You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/08/07 15:24:05 UTC

svn commit: r983225 - in /subversion/branches/atomic-revprop/subversion/libsvn_ra_serf: commit.c property.c ra_serf.h replay.c serf.c update.c

Author: danielsh
Date: Sat Aug  7 13:24:04 2010
New Revision: 983225

URL: http://svn.apache.org/viewvc?rev=983225&view=rev
Log:
On the 'atomic-revprop' branch:

Revv an ra_serf-internal API.  This commit only upgrades the declaration and
calls to the functions; the new code (which implements support for the new
parameters) will be in the next commit.

This commit revvs the following APIs:

    svn_ra_serf__set_ver_prop(),
    svn_ra_serf__walker_visitor_t(),
    svn_ra_serf__walk_all_props(),
    svn_ra_serf__set_prop().

* subversion/libsvn_ra_serf/ra_serf.h,
  subversion/libsvn_ra_serf/property.c:
  (svn_ra_serf__set_ver_prop, svn_ra_serf__set_prop):
    Add OLD_VALUE_P parameter.
  (svn_ra_serf__walker_visitor_t):
    Add OLD_VAL_P parameter.
  (svn_ra_serf__walk_all_props):
    Add VALUES_ARE_PROPPAIRS parameter.

* subversion/libsvn_ra_serf/serf.c,
  subversion/libsvn_ra_serf/update.c,
  subversion/libsvn_ra_serf/property.c,
  subversion/libsvn_ra_serf/commit.c,
  subversion/libsvn_ra_serf/replay.c:
  (everywhere):
    Upgrade calls and callbacks to have the new parameters,
    passing NULL or FALSE respectively.

Modified:
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/replay.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/serf.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c?rev=983225&r1=983224&r2=983225&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/commit.c Sat Aug  7 13:24:04 2010
@@ -680,6 +680,7 @@ static svn_error_t *
 proppatch_walker(void *baton,
                  const char *ns, apr_ssize_t ns_len,
                  const char *name, apr_ssize_t name_len,
+                 const svn_string_t *const *old_val_p, /* ### */
                  const svn_string_t *val,
                  apr_pool_t *pool)
 {
@@ -771,7 +772,7 @@ create_proppatch_body(serf_bucket_t **bk
       svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
 
       SVN_ERR(svn_ra_serf__walk_all_props(ctx->changed_props, ctx->path,
-                                          SVN_INVALID_REVNUM,
+                                          SVN_INVALID_REVNUM, FALSE,
                                           proppatch_walker, body_bkt, pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
@@ -784,7 +785,7 @@ create_proppatch_body(serf_bucket_t **bk
       svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", NULL);
 
       SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
-                                          SVN_INVALID_REVNUM,
+                                          SVN_INVALID_REVNUM, FALSE,
                                           proppatch_walker, body_bkt, pool));
 
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
@@ -1307,7 +1308,7 @@ open_root(void *edit_baton,
         }
 
       svn_ra_serf__set_prop(proppatch_ctx->changed_props, proppatch_ctx->path,
-                            ns, name, value, proppatch_ctx->pool);
+                            ns, name, NULL, value, proppatch_ctx->pool);
     }
 
   SVN_ERR(proppatch_resource(proppatch_ctx, dir->commit, ctx->pool));
@@ -1600,13 +1601,13 @@ change_dir_prop(void *dir_baton,
     {
       value = svn_string_dup(value, dir->pool);
       svn_ra_serf__set_prop(dir->changed_props, proppatch_target,
-                            ns, name, value, dir->pool);
+                            ns, name, NULL, value, dir->pool);
     }
   else
     {
       value = svn_string_create("", dir->pool);
       svn_ra_serf__set_prop(dir->removed_props, proppatch_target,
-                            ns, name, value, dir->pool);
+                            ns, name, NULL, value, dir->pool);
     }
 
   return SVN_NO_ERROR;
@@ -1852,14 +1853,14 @@ change_file_prop(void *file_baton,
     {
       value = svn_string_dup(value, file->pool);
       svn_ra_serf__set_prop(file->changed_props, file->url,
-                            ns, name, value, file->pool);
+                            ns, name, NULL, value, file->pool);
     }
   else
     {
       value = svn_string_create("", file->pool);
 
       svn_ra_serf__set_prop(file->removed_props, file->url,
-                            ns, name, value, file->pool);
+                            ns, name, NULL, value, file->pool);
     }
 
   return SVN_NO_ERROR;
@@ -2271,14 +2272,14 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
   if (value)
     {
       svn_ra_serf__set_prop(proppatch_ctx->changed_props, proppatch_ctx->path,
-                            ns, name, value, proppatch_ctx->pool);
+                            ns, name, NULL, value, proppatch_ctx->pool);
     }
   else
     {
       value = svn_string_create("", proppatch_ctx->pool);
 
       svn_ra_serf__set_prop(proppatch_ctx->removed_props, proppatch_ctx->path,
-                            ns, name, value, proppatch_ctx->pool);
+                            ns, name, NULL, value, proppatch_ctx->pool);
     }
 
   err = proppatch_resource(proppatch_ctx, commit, proppatch_ctx->pool);

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c?rev=983225&r1=983224&r2=983225&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c Sat Aug  7 13:24:04 2010
@@ -175,6 +175,7 @@ void
 svn_ra_serf__set_ver_prop(apr_hash_t *props,
                           const char *path, svn_revnum_t rev,
                           const char *ns, const char *name,
+                          const svn_string_t *const *old_value_p,
                           const svn_string_t *val, apr_pool_t *pool)
 {
   apr_hash_t *ver_props, *path_props, *ns_props;
@@ -215,10 +216,11 @@ void
 svn_ra_serf__set_prop(apr_hash_t *props,
                       const char *path,
                       const char *ns, const char *name,
+                      const svn_string_t *const *old_value_p,
                       const svn_string_t *val, apr_pool_t *pool)
 {
   svn_ra_serf__set_ver_prop(props, path, SVN_INVALID_REVNUM, ns, name,
-                            val, pool);
+                            old_value_p, val, pool);
 }
 
 static prop_info_t *
@@ -370,7 +372,7 @@ end_propfind(svn_ra_serf__xml_parser_t *
       /* set the return props and update our cache too. */
       svn_ra_serf__set_ver_prop(ctx->ret_props,
                                 ctx->current_path, ctx->rev,
-                                ns, pname, val_str,
+                                ns, pname, NULL, val_str,
                                 ctx->pool);
       if (ctx->cache_props)
         {
@@ -381,7 +383,7 @@ end_propfind(svn_ra_serf__xml_parser_t *
 
           svn_ra_serf__set_ver_prop(ctx->sess->cached_props,
                                     ctx->current_path, ctx->rev,
-                                    ns, pname, val_str,
+                                    ns, pname, NULL, val_str,
                                     ctx->sess->pool);
         }
 
@@ -542,7 +544,8 @@ check_cache(apr_hash_t *ret_props,
       if (val)
         {
           svn_ra_serf__set_ver_prop(ret_props, path, rev,
-                                    prop->namespace, prop->name, val, pool);
+                                    prop->namespace, prop->name, NULL,
+                                    val, pool);
         }
       else
         {
@@ -742,6 +745,7 @@ svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
                             const char *name,
                             svn_revnum_t rev,
+                            svn_boolean_t values_are_proppairs,
                             svn_ra_serf__walker_visitor_t walker,
                             void *baton,
                             apr_pool_t *pool)
@@ -781,7 +785,7 @@ svn_ra_serf__walk_all_props(apr_hash_t *
           apr_hash_this(name_hi, &prop_name, &prop_len, &prop_val);
           /* use a subpool? */
           SVN_ERR(walker(baton, ns_name, ns_len, prop_name, prop_len,
-                         prop_val, pool));
+                         NULL /* ### */, prop_val, pool));
         }
     }
 
@@ -926,6 +930,7 @@ svn_error_t *
 svn_ra_serf__set_flat_props(void *baton,
                             const char *ns, apr_ssize_t ns_len,
                             const char *name, apr_ssize_t name_len,
+                            const svn_string_t *const *ignored,
                             const svn_string_t *val,
                             apr_pool_t *pool)
 {
@@ -937,6 +942,7 @@ svn_error_t *
 svn_ra_serf__set_bare_props(void *baton,
                             const char *ns, apr_ssize_t ns_len,
                             const char *name, apr_ssize_t name_len,
+                            const svn_string_t *const *ignored,
                             const svn_string_t *val,
                             apr_pool_t *pool)
 {

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h?rev=983225&r1=983224&r2=983225&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h Sat Aug  7 13:24:04 2010
@@ -960,6 +960,9 @@ svn_ra_serf__retrieve_props(apr_hash_t *
                             apr_pool_t *pool);
 
 /* Set PROPS for PATH at REV revision with a NS:NAME VAL.
+ * 
+ * ### If OLD_VALUE_P is not NULL, it must equal the current value of the
+ * ### revprop.
  *
  * The POOL governs allocation.
  */
@@ -967,6 +970,7 @@ void
 svn_ra_serf__set_ver_prop(apr_hash_t *props,
                           const char *path, svn_revnum_t rev,
                           const char *ns, const char *name,
+                          const svn_string_t *const *old_value_p,
                           const svn_string_t *val, apr_pool_t *pool);
 #define svn_ra_serf__set_rev_prop svn_ra_serf__set_ver_prop
 
@@ -976,13 +980,16 @@ typedef svn_error_t *
 (*svn_ra_serf__walker_visitor_t)(void *baton,
                                  const char *ns, apr_ssize_t ns_len,
                                  const char *name, apr_ssize_t name_len,
+                                 const svn_string_t *const *old_val_p,
                                  const svn_string_t *val,
                                  apr_pool_t *pool);
 
+/* ### VALUES_ARE_PROPPAIRS is not implemented */
 svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
                             const char *name,
                             svn_revnum_t rev,
+                            svn_boolean_t values_are_proppairs,
                             svn_ra_serf__walker_visitor_t walker,
                             void *baton,
                             apr_pool_t *pool);
@@ -1018,6 +1025,7 @@ svn_error_t *
 svn_ra_serf__set_flat_props(void *baton,
                             const char *ns, apr_ssize_t ns_len,
                             const char *name, apr_ssize_t name_len,
+                            const svn_string_t *const *ignored,
                             const svn_string_t *val,
                             apr_pool_t *pool);
 
@@ -1025,6 +1033,7 @@ svn_error_t *
 svn_ra_serf__set_bare_props(void *baton,
                             const char *ns, apr_ssize_t ns_len,
                             const char *name, apr_ssize_t name_len,
+                            const svn_string_t *const *ignored,
                             const svn_string_t *val,
                             apr_pool_t *pool);
 
@@ -1049,6 +1058,7 @@ svn_ra_serf__get_prop(apr_hash_t *props,
 void
 svn_ra_serf__set_prop(apr_hash_t *props, const char *path,
                       const char *ns, const char *name,
+                      const svn_string_t *const *old_value_p,
                       const svn_string_t *val, apr_pool_t *pool);
 
 /** MERGE-related functions **/

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/replay.c?rev=983225&r1=983224&r2=983225&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/replay.c Sat Aug  7 13:24:04 2010
@@ -184,7 +184,7 @@ start_replay(svn_ra_serf__xml_parser_t *
       ctx->dst_rev_pool = svn_pool_create(ctx->src_rev_pool);
       ctx->props = apr_hash_make(ctx->dst_rev_pool);
       SVN_ERR(svn_ra_serf__walk_all_props(ctx->revs_props, ctx->report_target,
-                                          ctx->revision,
+                                          ctx->revision, FALSE,
                                           svn_ra_serf__set_bare_props,
                                           ctx->props, ctx->dst_rev_pool));
       if (ctx->revstart_func)

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/serf.c?rev=983225&r1=983224&r2=983225&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/serf.c Sat Aug  7 13:24:04 2010
@@ -541,7 +541,7 @@ svn_ra_serf__rev_proplist(svn_ra_session
                                       propfind_path, rev, "0", all_props,
                                       pool));
 
-  SVN_ERR(svn_ra_serf__walk_all_props(props, propfind_path, rev,
+  SVN_ERR(svn_ra_serf__walk_all_props(props, propfind_path, rev, FALSE,
                                       svn_ra_serf__set_bare_props, *ret_props,
                                       pool));
 
@@ -688,6 +688,7 @@ static svn_error_t *
 dirent_walker(void *baton,
               const char *ns, apr_ssize_t ns_len,
               const char *name, apr_ssize_t name_len,
+              const svn_string_t *const *ignored,
               const svn_string_t *val,
               apr_pool_t *pool)
 {
@@ -773,7 +774,7 @@ path_dirent_walker(void *baton,
       apr_hash_set(dirents->base_paths, base_name, APR_HASH_KEY_STRING, entry);
     }
 
-  return dirent_walker(entry, ns, ns_len, name, name_len, val, pool);
+  return dirent_walker(entry, ns, ns_len, name, name_len, NULL, val, pool);
 }
 
 static svn_error_t *
@@ -807,8 +808,8 @@ svn_ra_serf__stat(svn_ra_session_t *ra_s
 
   entry = apr_pcalloc(pool, sizeof(*entry));
 
-  SVN_ERR(svn_ra_serf__walk_all_props(props, path, fetched_rev, dirent_walker,
-                                      entry, pool));
+  SVN_ERR(svn_ra_serf__walk_all_props(props, path, fetched_rev, FALSE,
+                                      dirent_walker, entry, pool));
 
   *dirent = entry;
 
@@ -921,7 +922,7 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
       /* Check if the path is really a directory. */
       SVN_ERR(resource_is_directory (props, path, revision));
 
-      SVN_ERR(svn_ra_serf__walk_all_props(props, path, revision,
+      SVN_ERR(svn_ra_serf__walk_all_props(props, path, revision, FALSE,
                                           svn_ra_serf__set_flat_props,
                                           *ret_props, pool));
     }

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c?rev=983225&r1=983224&r2=983225&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/update.c Sat Aug  7 13:24:04 2010
@@ -442,6 +442,7 @@ static svn_error_t *
 set_file_props(void *baton,
                const char *ns, apr_ssize_t ns_len,
                const char *name, apr_ssize_t name_len,
+               const svn_string_t *const *ignored,
                const svn_string_t *val,
                apr_pool_t *pool)
 {
@@ -463,6 +464,7 @@ static svn_error_t *
 set_dir_props(void *baton,
               const char *ns, apr_ssize_t ns_len,
               const char *name, apr_ssize_t name_len,
+              const svn_string_t *const *ignored,
               const svn_string_t *val,
               apr_pool_t *pool)
 {
@@ -476,6 +478,7 @@ static svn_error_t *
 remove_file_props(void *baton,
                   const char *ns, apr_ssize_t ns_len,
                   const char *name, apr_ssize_t name_len,
+                  const svn_string_t *const *ignored,
                   const svn_string_t *val,
                   apr_pool_t *pool)
 {
@@ -491,6 +494,7 @@ static svn_error_t *
 remove_dir_props(void *baton,
                  const char *ns, apr_ssize_t ns_len,
                  const char *name, apr_ssize_t name_len,
+                 const svn_string_t *const *ignored,
                  const svn_string_t *val,
                  apr_pool_t *pool)
 {
@@ -564,18 +568,18 @@ close_dir(report_dir_t *dir)
   SVN_ERR_ASSERT(! dir->ref_count);
 
   SVN_ERR(svn_ra_serf__walk_all_props(dir->props, dir->base_name,
-                                      dir->base_rev,
+                                      dir->base_rev, FALSE,
                                       set_dir_props, dir,
                                       dir->dir_baton_pool));
 
-  SVN_ERR(svn_ra_serf__walk_all_props(dir->removed_props, dir->base_name,
+  SVN_ERR(svn_ra_serf__walk_all_props(dir->removed_props, dir->base_name, FALSE,
                                       dir->base_rev, remove_dir_props, dir,
                                       dir->dir_baton_pool));
 
   if (dir->fetch_props)
     {
       SVN_ERR(svn_ra_serf__walk_all_props(dir->props, dir->url,
-                                          dir->target_rev,
+                                          dir->target_rev, FALSE,
                                           set_dir_props, dir,
                                           dir->dir_baton_pool));
     }
@@ -664,7 +668,7 @@ check_lock(report_info_t *info)
 
       svn_ra_serf__set_ver_prop(info->dir->removed_props, info->base_name,
                                 info->base_rev, "DAV:", "lock-token",
-                                str, info->dir->pool);
+                                NULL, str, info->dir->pool);
     }
 }
 
@@ -944,6 +948,7 @@ handle_fetch(serf_request_t *request,
           err = svn_ra_serf__walk_all_props(info->props,
                                             info->base_name,
                                             info->base_rev,
+                                            FALSE,
                                             set_file_props,
                                             info, info->editor_pool);
 
@@ -951,6 +956,7 @@ handle_fetch(serf_request_t *request,
             err = svn_ra_serf__walk_all_props(info->dir->removed_props,
                                               info->base_name,
                                               info->base_rev,
+                                              FALSE,
                                               remove_file_props,
                                               info, info->editor_pool);
           if (!err && info->fetch_props)
@@ -958,6 +964,7 @@ handle_fetch(serf_request_t *request,
               err = svn_ra_serf__walk_all_props(info->props,
                                                 info->url,
                                                 info->target_rev,
+                                                FALSE,
                                                 set_file_props,
                                                 info, info->editor_pool);
             }
@@ -1131,17 +1138,18 @@ handle_propchange_only(report_info_t *in
   /* set all of the properties we received */
   SVN_ERR(svn_ra_serf__walk_all_props(info->props,
                                       info->base_name, info->base_rev,
-                                      set_file_props, info,
+                                      FALSE, set_file_props, info,
                                       info->editor_pool));
   SVN_ERR(svn_ra_serf__walk_all_props(info->dir->removed_props,
                                       info->base_name, info->base_rev,
-                                      remove_file_props, info,
+                                      FALSE, remove_file_props, info,
                                       info->editor_pool));
   if (info->fetch_props)
     {
       SVN_ERR(svn_ra_serf__walk_all_props(info->props, info->url,
-                                          info->target_rev, set_file_props,
-                                          info, info->editor_pool));
+                                          info->target_rev, FALSE,
+                                          set_file_props, info,
+                                          info->editor_pool));
     }
 
   SVN_ERR(info->dir->update_editor->close_file(info->file_baton,
@@ -1998,7 +2006,8 @@ end_report(svn_ra_serf__xml_parser_t *pa
       set_val_str = svn_string_ncreate(set_val, info->prop_val_len, pool);
 
       svn_ra_serf__set_ver_prop(props, info->base_name, info->base_rev,
-                                ns->namespace, ns->url, set_val_str, pool);
+                                ns->namespace, ns->url, NULL,
+                                set_val_str, pool);
       svn_ra_serf__xml_pop_state(parser);
     }
   else if (state == IGNORE_PROP_NAME || state == NEED_PROP_NAME)
@@ -2731,7 +2740,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
       SVN_ERR(svn_ra_serf__retrieve_props(fetch_props, session, conn, fetch_url,
                                           revision, "0", all_props, pool));
 
-      SVN_ERR(svn_ra_serf__walk_all_props(fetch_props, fetch_url, revision,
+      SVN_ERR(svn_ra_serf__walk_all_props(fetch_props, fetch_url, revision, FALSE,
                                           svn_ra_serf__set_flat_props, *props, pool));
     }