Author: rhuijben
Date: Sun May  8 16:43:53 2011
New Revision: 1100769

URL: http://svn.apache.org/viewvc?rev=1100769&view=rev
Log:
Add initial stubs of (file)external management wc_db api. The initial
implementation will just use the current BASE api to provide access to
the current file externals storage, but I intend to switch this to a
separate table later this week, which will need a format bump.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_external_add_file,
   svn_wc__db_external_add_symlink,
   svn_wc__db_external_add_dir,
   svn_wc__db_external_remove,
   svn_wc__db_external_read,
   svn_wc__db_external_read_pristine_props,
   svn_wc__db_external_read_props): Add stubs.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_external_add_file,
   svn_wc__db_external_add_symlink,
   svn_wc__db_external_add_dir,
   svn_wc__db_external_remove
   svn_wc__db_external_read,
   svn_wc__db_external_read_pristine_props,
   svn_wc__db_external_read_props): Add stubs.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1100769&r1=1100768&r2=1100769&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun May  8 16:43:53 2011
@@ -2281,6 +2281,8 @@ svn_wc__db_base_clear_dav_cache_recursiv
   return SVN_NO_ERROR;
 }
 
+
+
 /* Like svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH instead of
    DB+LOCAL_ABSPATH and outputting REPOS_ID instead of URL+UUID. */
 static svn_error_t *
@@ -2432,6 +2434,186 @@ with_triggers(void *baton,
 }
 
 
+svn_error_t *
+svn_wc__db_external_add_file(svn_wc__db_t *db,
+                             const char *local_abspath,
+                             const char *wri_abspath,
+
+                             const char *repos_relpath,
+                             const char *repos_root_url,
+                             const char *repos_uuid,
+                             svn_revnum_t revision,
+
+                             const apr_hash_t *props,
+
+                             svn_revnum_t changed_rev,
+                             apr_time_t changed_date,
+                             const char *changed_author,
+
+                             const svn_checksum_t *checksum,
+
+                             const apr_hash_t *dav_cache,
+
+                             const char *recorded_repos_relpath,
+                             svn_revnum_t recorded_peg_revision,
+                             svn_revnum_t recorded_revision,
+
+                             svn_boolean_t update_actual_props,
+                             apr_hash_t *new_actual_props,
+
+                             svn_boolean_t keep_recorded_info,
+                             const svn_skel_t *work_items,
+                             apr_pool_t *scratch_pool)
+{
+  NOT_IMPLEMENTED();
+}
+
+/* Adds (or overwrites) a symlink external LOCAL_ABSPATH to the working copy
+   identified by WRI_ABSPATH.
+ */
+svn_error_t *
+svn_wc__db_external_add_symlink(svn_wc__db_t *db,
+                                const char *local_abspath,
+                                const char *wri_abspath,
+
+                                const char *repos_relpath,
+                                const char *repos_root_url,
+                                const char *repos_uuid,
+                                svn_revnum_t revision,
+
+                                const apr_hash_t *props,
+
+                                svn_revnum_t changed_rev,
+                                apr_time_t changed_date,
+                                const char *changed_author,
+
+                                const char *target,
+
+                                const apr_hash_t *dav_cache,
+
+                                const char *recorded_repos_relpath,
+                                svn_revnum_t recorded_peg_revision,
+                                svn_revnum_t recorded_revision,
+
+                                svn_boolean_t update_actual_props,
+                                apr_hash_t *new_actual_props,
+
+                                svn_boolean_t keep_recorded_info,
+                                const svn_skel_t *work_items,
+                                apr_pool_t *scratch_pool)
+{
+  NOT_IMPLEMENTED();
+}
+
+/* Adds (or overwrites) a directory external LOCAL_ABSPATH to the working copy
+   identified by WRI_ABSPATH.
+ 
+  Directory externals are stored in their own working copy, so one should use
+  the normal svn_wc__db functions to access the normal working copy
+  information.
+ */
+svn_error_t *
+svn_wc__db_external_add_dir(svn_wc__db_t *db,
+                            const char *local_abspath,
+                            const char *wri_abspath,
+
+                            const char *recorded_repos_relpath,
+                            svn_revnum_t recorded_peg_revision,
+                            svn_revnum_t recorded_revision,
+
+                            const svn_skel_t *work_items,
+                            apr_pool_t *scratch_pool)
+{
+  NOT_IMPLEMENTED();
+}
+
+/* Reads information on the external LOCAL_ABSPATH as stored in the working
+   copy identified with WRI_ABSPATH (If NULL the parent directory of
+   LOCAL_ABSPATH).
+
+   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
+   this working copy
+ */
+svn_error_t *
+svn_wc__db_external_read(svn_wc__db_kind_t *kind,
+                         svn_revnum_t *revision,
+                         const char **repos_relpath,
+                         const char **repos_root_url,
+                         const char **repos_uuid,
+                         svn_revnum_t *changed_rev,
+                         apr_time_t *changed_date,
+                         const char **changed_author,
+
+                         const svn_checksum_t **checksum, /* files only */
+                         const char **target, /* symlinks only */
+
+                         /* For files and symlinks */
+                         svn_wc__db_lock_t **lock,
+
+                         /* Recorded for files present in the working copy */
+                         svn_filesize_t *recorded_size,
+                         apr_time_t *recorded_mod_time,
+
+                         /* following fields are stored as copy from the
+                            property which defined the external.
+                            (Currently only for file externals) */
+                         const char **recorded_repos_relpath,
+                         svn_revnum_t *recorded_peg_revision,
+                         svn_revnum_t *recorded_revision,
+
+                         /* From ACTUAL */
+                         svn_boolean_t *conflicted,
+
+                         /* Derived (only for files) */
+                         svn_boolean_t had_props,
+                         svn_boolean_t *props_mod,
+
+                         svn_wc__db_t *db,
+                         const char *local_abspath,
+                         const char *wri_abspath,
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
+{
+  NOT_IMPLEMENTED();
+}
+
+/* For file and symlink externals reads the pristine properties of
+   LOCAL_ABSPATH as stored in the working copy identified by WRI_ABSPATH
+   (If NULL the parent directory of LOCAL_ABSPATH).
+
+   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
+   this working copy.
+ */
+svn_error_t *
+svn_wc__db_external_read_pristine_props(apr_hash_t **props,
+                                        svn_wc__db_t *db,
+                                        const char *local_abspath,
+                                        const char *wri_abspath,
+                                        apr_pool_t *result_pool,
+                                        apr_pool_t *scratch_pool)
+{
+  NOT_IMPLEMENTED();
+}
+
+/* For file and symlink externals reads the actual properties of
+   LOCAL_ABSPATH as stored in the working copy identified by WRI_ABSPATH
+   (If NULL the parent directory of LOCAL_ABSPATH).
+
+   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
+   this working copy.
+ */
+svn_error_t *
+svn_wc__db_external_read_props(apr_hash_t **props,
+                               svn_wc__db_t *db,
+                               const char *local_abspath,
+                               const char *wri_abspath,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
+{
+  NOT_IMPLEMENTED();
+}
+
+
 /* Helper for svn_wc__db_op_copy to handle copying from one db to
    another */
 static svn_error_t *

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1100769&r1=1100768&r2=1100769&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Sun May  8 16:43:53 2011
@@ -1015,9 +1015,187 @@ svn_wc__db_pristine_check(svn_boolean_t 
                           const svn_checksum_t *sha1_checksum,
                           apr_pool_t *scratch_pool);
 
+/* @defgroup svn_wc__db_external  External management
+   @{ */
 
-/* @} */
+/* Adds (or overwrites) a file external LOCAL_ABSPATH to the working copy
+   identified by WRI_ABSPATH.
+ */
+svn_error_t *
+svn_wc__db_external_add_file(svn_wc__db_t *db,
+                             const char *local_abspath,
+                             const char *wri_abspath,
+
+                             const char *repos_relpath,
+                             const char *repos_root_url,
+                             const char *repos_uuid,
+                             svn_revnum_t revision,
+
+                             const apr_hash_t *props,
+
+                             svn_revnum_t changed_rev,
+                             apr_time_t changed_date,
+                             const char *changed_author,
+
+                             const svn_checksum_t *checksum,
+
+                             const apr_hash_t *dav_cache,
+
+                             const char *recorded_repos_relpath,
+                             svn_revnum_t recorded_peg_revision,
+                             svn_revnum_t recorded_revision,
+
+                             svn_boolean_t update_actual_props,
+                             apr_hash_t *new_actual_props,
+
+                             svn_boolean_t keep_recorded_info,
+                             const svn_skel_t *work_items,
+                             apr_pool_t *scratch_pool);
+
+/* Adds (or overwrites) a symlink external LOCAL_ABSPATH to the working copy
+   identified by WRI_ABSPATH.
+ */
+svn_error_t *
+svn_wc__db_external_add_symlink(svn_wc__db_t *db,
+                                const char *local_abspath,
+                                const char *wri_abspath,
+
+                                const char *repos_relpath,
+                                const char *repos_root_url,
+                                const char *repos_uuid,
+                                svn_revnum_t revision,
+
+                                const apr_hash_t *props,
+
+                                svn_revnum_t changed_rev,
+                                apr_time_t changed_date,
+                                const char *changed_author,
+
+                                const char *target,
+
+                                const apr_hash_t *dav_cache,
+
+                                const char *recorded_repos_relpath,
+                                svn_revnum_t recorded_peg_revision,
+                                svn_revnum_t recorded_revision,
+
+                                svn_boolean_t update_actual_props,
+                                apr_hash_t *new_actual_props,
+
+                                svn_boolean_t keep_recorded_info,
+                                const svn_skel_t *work_items,
+                                apr_pool_t *scratch_pool);
+
+/* Adds (or overwrites) a directory external LOCAL_ABSPATH to the working copy
+   identified by WRI_ABSPATH.
+ 
+  Directory externals are stored in their own working copy, so one should use
+  the normal svn_wc__db functions to access the normal working copy
+  information.
+ */
+svn_error_t *
+svn_wc__db_external_add_dir(svn_wc__db_t *db,
+                            const char *local_abspath,
+                            const char *wri_abspath,
+
+                            const char *recorded_repos_relpath,
+                            svn_revnum_t recorded_peg_revision,
+                            svn_revnum_t recorded_revision,
+
+                            const svn_skel_t *work_items,
+                            apr_pool_t *scratch_pool);
+
+/* Remove a registered external LOCAL_ABSPATH from the working copy identified
+   by WRI_ABSPATH.
+ */
+svn_error_t *
+svn_wc__db_external_remove(svn_wc__db_t *db,
+                           const char *local_abspath,
+                           const char *wri_abspath,
+
+                           const svn_skel_t *work_items,
+                           apr_pool_t *scratch_pool);
+
+
+/* Reads information on the external LOCAL_ABSPATH as stored in the working
+   copy identified with WRI_ABSPATH (If NULL the parent directory of
+   LOCAL_ABSPATH).
+
+   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
+   this working copy
+ */
+svn_error_t *
+svn_wc__db_external_read(svn_wc__db_kind_t *kind,
+                         svn_revnum_t *revision,
+                         const char **repos_relpath,
+                         const char **repos_root_url,
+                         const char **repos_uuid,
+                         svn_revnum_t *changed_rev,
+                         apr_time_t *changed_date,
+                         const char **changed_author,
+
+                         const svn_checksum_t **checksum, /* files only */
+                         const char **target, /* symlinks only */
+
+                         /* For files and symlinks */
+                         svn_wc__db_lock_t **lock,
+
+                         /* Recorded for files present in the working copy */
+                         svn_filesize_t *recorded_size,
+                         apr_time_t *recorded_mod_time,
+
+                         /* following fields are stored as copy from the
+                            property which defined the external.
+                            (Currently only for file externals) */
+                         const char **recorded_repos_relpath,
+                         svn_revnum_t *recorded_peg_revision,
+                         svn_revnum_t *recorded_revision,
+
+                         /* From ACTUAL */
+                         svn_boolean_t *conflicted,
+
+                         /* Derived (only for files) */
+                         svn_boolean_t had_props,
+                         svn_boolean_t *props_mod,
+
+                         svn_wc__db_t *db,
+                         const char *local_abspath,
+                         const char *wri_abspath,
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool);
+
+/* For file and symlink externals reads the pristine properties of
+   LOCAL_ABSPATH as stored in the working copy identified by WRI_ABSPATH
+   (If NULL the parent directory of LOCAL_ABSPATH).
+
+   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
+   this working copy.
+ */
+svn_error_t *
+svn_wc__db_external_read_pristine_props(apr_hash_t **props,
+                                        svn_wc__db_t *db,
+                                        const char *local_abspath,
+                                        const char *wri_abspath,
+                                        apr_pool_t *result_pool,
+                                        apr_pool_t *scratch_pool);
 
+/* For file and symlink externals reads the actual properties of
+   LOCAL_ABSPATH as stored in the working copy identified by WRI_ABSPATH
+   (If NULL the parent directory of LOCAL_ABSPATH).
+
+   Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
+   this working copy.
+ */
+svn_error_t *
+svn_wc__db_external_read_props(apr_hash_t **props,
+                               svn_wc__db_t *db,
+                               const char *local_abspath,
+                               const char *wri_abspath,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool);
+
+
+/* @} */
 
 /* @defgroup svn_wc__db_op  Operations on WORKING tree
    @{
@@ -2709,7 +2887,7 @@ svn_wc__db_get_not_present_descendants(c
                                        apr_pool_t *scratch_pool);
 
 /* Gather revision status information about a working copy using DB.
- * 
+ *
  * Set *MIN_REVISION and *MAX_REVISION to the lowest and highest revision
  * numbers found within LOCAL_ABSPATH.
  * Only nodes with op_depth zero and presence 'normal' or 'incomplete'
@@ -2752,7 +2930,7 @@ svn_wc__db_revision_status(svn_revnum_t 
  * the result.  If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
  * to the lowest and highest comitted (i.e. "last changed") revision numbers,
  * respectively. Use SCRATCH_POOL for temporary allocations.
- * 
+ *
  * This function provides a subset of the functionality of
  * svn_wc__db_revision_status() and is more efficient if the caller
  * doesn't need all information returned by svn_wc__db_revision_status(). */
@@ -2767,7 +2945,7 @@ svn_wc__db_min_max_revisions(svn_revnum_
 /* Indicate in *IS_SPARSE_CHECKOUT whether any of the nodes within
  * LOCAL_ABSPATH is sparse, using DB.
  * Use SCRATCH_POOL for temporary allocations.
- * 
+ *
  * This function provides a subset of the functionality of
  * svn_wc__db_revision_status() and is more efficient if the caller
  * doesn't need all information returned by svn_wc__db_revision_status(). */
@@ -2785,7 +2963,7 @@ svn_wc__db_is_sparse_checkout(svn_boolea
  * expected URL, long enough to include any parts that the caller considers
  * might be changed by a switch.  If it does not match the end of WC_PATH's
  * actual URL, then report a "switched" status.
- * 
+ *
  * This function provides a subset of the functionality of
  * svn_wc__db_revision_status() and is more efficient if the caller
  * doesn't need all information returned by svn_wc__db_revision_status(). */
@@ -2811,7 +2989,7 @@ svn_wc__db_get_absent_subtrees(apr_hash_
 
 /* Indicate in *IS_MODIFIED whether the working copy has local modifications,
  * using DB. Use SCRATCH_POOL for temporary allocations.
- * 
+ *
  * This function provides a subset of the functionality of
  * svn_wc__db_revision_status() and is more efficient if the caller
  * doesn't need all information returned by svn_wc__db_revision_status(). */


Reply via email to