subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1148773 [2/3] - in /subversion/branches/revprop-packing: ./ build/ac-macros/ build/generator/ notes/ subversion/bindings/swig/perl/native/ subversion/bindings/swig/perl/native/scripts/ subversion/bindings/swig/perl/native/t/ subversion/inc...
Date Wed, 20 Jul 2011 13:52:14 GMT
Propchange: subversion/branches/revprop-packing/subversion/include/private/svn_adler32.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -43,4 +43,4 @@
 /subversion/branches/tc_url_rev/subversion/libsvn_diff/diff.h:874351-874483
 /subversion/branches/tree-conflicts/subversion/libsvn_diff/diff.h:868291-873154
 /subversion/branches/tree-conflicts-notify/subversion/libsvn_diff/diff.h:873926-874008
-/subversion/trunk/subversion/include/private/svn_adler32.h:1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/include/private/svn_adler32.h:1143817-1148765

Propchange: subversion/branches/revprop-packing/subversion/include/private/svn_string_private.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -52,4 +52,4 @@
 /subversion/branches/tree-conflicts/subversion/include/svn_string.h:868291-873154
 /subversion/branches/tree-conflicts-notify/subversion/include/svn_string.h:873926-874008
 /subversion/branches/uris-as-urls/subversion/include/svn_string.h:1060426-1064427
-/subversion/trunk/subversion/include/private/svn_string_private.h:1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/include/private/svn_string_private.h:1143817-1148765

Propchange: subversion/branches/revprop-packing/subversion/include/private/svn_temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/include/private/svn_temp_serializer.h:1067687-1072301,1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/include/private/svn_temp_serializer.h:1067687-1072301,1143817-1148765

Modified: subversion/branches/revprop-packing/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_client.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_client.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_client.h Wed Jul 20 13:52:06 2011
@@ -477,6 +477,7 @@ typedef struct svn_client_commit_item3_t
   /**
    * When processing the commit this contains the relative path for
    * the commit session. #NULL until the commit item is preprocessed.
+   * @since New in 1.7.
    */
   const char *session_relpath;
 } svn_client_commit_item3_t;
@@ -5388,10 +5389,10 @@ typedef struct svn_client_info2_t
   const char *last_changed_author;
 
   /** An exclusive lock, if present.  Could be either local or remote. */
-  svn_lock_t *lock;
+  const svn_lock_t *lock;
 
-  /* Possible information about the working copy, NULL if not valid. */
-  struct svn_wc_info_t *wc_info;
+  /** Possible information about the working copy, NULL if not valid. */
+  const svn_wc_info_t *wc_info;
 
 } svn_client_info2_t;
 

Modified: subversion/branches/revprop-packing/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_fs.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_fs.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_fs.h Wed Jul 20 13:52:06 2011
@@ -253,6 +253,23 @@ svn_fs_upgrade(const char *path,
                apr_pool_t *pool);
 
 /**
+ * Perform backend-specific data consistency and correctness validations
+ * to the Subversion filesystem located in the directory @a path.
+ * Use @a pool for necessary allocations.
+ *
+ * @note You probably don't want to use this directly.  Take a look at
+ * svn_repos_verify_fs2() instead, which does non-backend-specific
+ * verifications as well.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_fs_verify(const char *path,
+              svn_cancel_func_t cancel_func,
+              void *cancel_baton,
+              apr_pool_t *pool);
+
+/**
  * Return, in @a *fs_type, a string identifying the back-end type of
  * the Subversion filesystem located in @a path.  Allocate @a *fs_type
  * in @a pool.

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/client.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/client.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/client.h Wed Jul 20 13:52:06 2011
@@ -223,7 +223,21 @@ svn_client__ra_session_from_path(svn_ra_
    NULL.
 
    If SESSION_URL is NULL, treat this as a magic value meaning "point
-   the RA session to the root of the repository".  */
+   the RA session to the root of the repository".
+
+   NOTE: The typical usage pattern for this functions is:
+
+       const char *old_session_url;
+       SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url,
+                                                 ra_session,
+                                                 new_session_url,
+                                                 pool);
+
+       [...]
+
+       if (old_session_url)
+         SVN_ERR(svn_ra_reparent(ra_session, old_session_url, pool));
+*/
 svn_error_t *
 svn_client__ensure_ra_session_url(const char **old_session_url,
                                   svn_ra_session_t *ra_session,

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/deprecated.c Wed Jul 20 13:52:06 2011
@@ -2177,7 +2177,9 @@ info_from_info2(svn_info_t **new_info,
   info->last_changed_rev    = info2->last_changed_rev;
   info->last_changed_date   = info2->last_changed_date;
   info->last_changed_author = info2->last_changed_author;
-  info->lock                = info2->lock;
+
+  /* Stupid old structure has a non-const LOCK member. Sigh.  */
+  info->lock                = (svn_lock_t *)info2->lock;
 
   info->size64              = info2->size;
   if (info2->size == SVN_INVALID_FILESIZE)

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/merge.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/merge.c Wed Jul 20 13:52:06 2011
@@ -2903,21 +2903,34 @@ adjust_deleted_subtree_ranges(svn_client
                                                 scratch_pool));
                 }
 
-              /* Create a rangelist describing the range PRIMARY_URL@older_rev
-                 exists and find the intersection of that and
-                 CHILD->REMAINING_RANGES. */
-              exists_rangelist =
-                svn_rangelist__initialize(older_rev,
-                                          revision_primary_url_deleted - 1,
-                                          TRUE, scratch_pool);
-              SVN_ERR(svn_rangelist_intersect(&(child->remaining_ranges),
-                                              exists_rangelist,
-                                              child->remaining_ranges,
-                                              FALSE, scratch_pool));
+              /* Find the intersection of CHILD->REMAINING_RANGES with the
+                 range over which PRIMARY_URL@older_rev exists (ending at
+                 the youngest revision at which it still exists). */
+              if (revision_primary_url_deleted - 1 > older_rev)
+                {
+                  /* It was not deleted immediately after OLDER_REV, so
+                     it has some relevant changes. */
+                  exists_rangelist =
+                    svn_rangelist__initialize(older_rev,
+                                              revision_primary_url_deleted - 1,
+                                              TRUE, scratch_pool);
+                  SVN_ERR(svn_rangelist_intersect(&(child->remaining_ranges),
+                                                  exists_rangelist,
+                                                  child->remaining_ranges,
+                                                  FALSE, scratch_pool));
+                }
+              else
+                {
+                  /* It was deleted immediately after the OLDER rev, so
+                     it has no relevant changes. */
+                  child->remaining_ranges
+                    = apr_array_make(scratch_pool, 0,
+                                     sizeof(svn_merge_range_t *));
+                }
 
-              /* Create a second rangelist describing the range beginning when
-                 PRIMARY_URL@older_rev was deleted until younger_rev.  Then
-                 find the intersection of that and PARENT->REMAINING_RANGES.
+              /* Find the intersection of PARENT->REMAINING_RANGES with the
+                 range beginning when PRIMARY_URL@older_rev was deleted
+                 until younger_rev.
                  Finally merge this rangelist with the rangelist above and
                  store the result in CHILD->REMANING_RANGES. */
               deleted_rangelist =
@@ -3161,48 +3174,45 @@ fix_deleted_subtree_ranges(const char *u
 /*** Determining What Remains To Be Merged ***/
 
 
-/* Contact the repository to get the portion of a working copy path's
-   inherited mergeinfo (if any) which contains non-existent mergeinfo
-   sources -- see http://subversion.tigris.org/issues/show_bug.cgi?id=3669
+/* Given the inherited mergeinfo INHERITED_MERGEINFO on TARGET_ABSPATH,
+   set *CORRECTED_MERGEINFO equal to INHERITED_MERGEINFO less any
+   mergeinfo TARGET_ABSPATH, at its base revision, inherits from the
+   repository.  If TARGET_ABSPATH doesn't exist in the repository, or if
+   no mergeinfo or only empty mergeinfo is inherited from the repository,
+   then set *CORRECTED_MERGEINFO equal to INHERITED_MERGEINFO.
 
-   Note: This function should only be called if the server supports the
-   SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability.
+   RA_SESSION is an open session that may be temporarily reparented as
+   needed by this function.
 
-   Query the repository for the mergeinfo TARGET_ABSPATH inherits at its
-   base revision.
+   RESULT_POOL is used to allocate *CORRECTED_MERGEINFO if necessary.
+   SCRATCH_POOL is used for temporary allocations.
 
-   If no mergeinfo is inherited set *INVALID_INHERITED_MERGEINFO to NULL.
+   Note: This function should only be called if the server supports the
+   SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability.  If the server
+   does not have that capability then this function is a no-op.
 
-   If only empty mergeinfo is inherited set *INVALID_INHERITED_MERGEINFO to
-   an empty hash.
-
-   If non-empty mergeinfo is inherited then, if the server supports the
-   SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability, remove all
-   existing path-revisions from the inherited mergeinfo, and set
-   *INVALID_INHERITED_MERGEINFO to the remainder.  If all of the inherited
-   inherited mergeinfo describes non-existent paths, then set
-   *INVALID_INHERITED_MERGEINFO to an empty hash.
-
-   RA_SESSION is an open session that points to TARGET_ABSPATH's repository
-   location or to the location of one of TARGET_ABSPATH's parents.  It may
-   be temporarily reparented.
-
-   RESULT_POOL is used to allocate *INVALID_INHERITED_MERGEINFO, SCRATCH_POOL
-   is used for any temporary allocations. */
-static svn_error_t *
-get_invalid_inherited_mergeinfo(svn_mergeinfo_t *invalid_inherited_mergeinfo,
-                                svn_ra_session_t *ra_session,
-                                const char *target_abspath,
-                                svn_client_ctx_t *ctx,
-                                apr_pool_t *result_pool,
-                                apr_pool_t *scratch_pool)
+   ### While this function addresses issue #3669 'inheritance can result
+   ### in mergeinfo describing nonexistent sources', it is worth noting
+   ### that issue #3756 'subtree merge can inherit invalid working
+   ### mergeinfo' is still a problem here, i.e. if TARGET_ABSPATH inherits
+   ### working mergeinfo from a working copy parent, some of the merge
+   ### sources in that mergeinfo may describe non-existent path-revs.
+   ###
+   ### See http://subversion.tigris.org/issues/show_bug.cgi?id=3669
+   ### and http://subversion.tigris.org/issues/show_bug.cgi?id=3756 */
+static svn_error_t *
+remove_non_existent_inherited_mergeinfo(svn_mergeinfo_t *corrected_mergeinfo,
+                                        svn_mergeinfo_t inherited_mergeinfo,
+                                        svn_ra_session_t *ra_session,
+                                        const char *target_abspath,
+                                        svn_client_ctx_t *ctx,
+                                        apr_pool_t *result_pool,
+                                        apr_pool_t *scratch_pool)
 {
-  svn_mergeinfo_t repos_raw_inherited;
-  svn_mergeinfo_t repos_validated_inherited;
   svn_revnum_t base_revision;
 
-  /* Our starting assumptions. */
-  *invalid_inherited_mergeinfo = NULL;
+  /* Our starting assumption. */
+  *corrected_mergeinfo = inherited_mergeinfo;
 
   SVN_ERR(svn_wc__node_get_base_rev(&base_revision, ctx->wc_ctx,
                                     target_abspath, scratch_pool));
@@ -3211,6 +3221,8 @@ get_invalid_inherited_mergeinfo(svn_merg
      in the repository yet, so we're done. */
   if (SVN_IS_VALID_REVNUM(base_revision))
     {
+      svn_mergeinfo_t repos_raw_inherited;
+      svn_mergeinfo_t nonexistent_inherited_mergeinfo;
       const char *target_url;
       const char *session_url;
 
@@ -3220,35 +3232,66 @@ get_invalid_inherited_mergeinfo(svn_merg
       SVN_ERR(svn_client__ensure_ra_session_url(&session_url, ra_session,
                                                 target_url, scratch_pool));
 
-      /* Contact the repository to derive the portion of
-         TARGET_ABSPATH's inherited mergeinfo which is non-existent
-         and remove it from */
-      SVN_ERR(svn_client__get_repos_mergeinfo(
-        ra_session, &repos_raw_inherited, "", base_revision,
-        svn_mergeinfo_inherited, TRUE,
-        FALSE, scratch_pool));
+      /* Get TARGET_ABSPATH's inherited mergeinfo from the repository with
+         that most unusual of requests: We don't want the server to check
+         that the inherited merge sources actually exist. */
+      SVN_ERR(svn_client__get_repos_mergeinfo(ra_session,
+                                              &repos_raw_inherited, "",
+                                              base_revision,
+                                              svn_mergeinfo_inherited,
+                                              TRUE,
+                                              FALSE, /* No validation */
+                                              scratch_pool));
 
-      if (repos_raw_inherited == NULL)
-        {
-          *invalid_inherited_mergeinfo = NULL;
-        }
-      else if (apr_hash_count(repos_raw_inherited) == 0)
+      if (repos_raw_inherited == NULL
+          || apr_hash_count(repos_raw_inherited) == 0)
         {
-          *invalid_inherited_mergeinfo = apr_hash_make(result_pool);
+          /* No mergeinfo or only empty mergeinfo was inherited. */
+          nonexistent_inherited_mergeinfo = NULL;
         }
       else
         {
-          SVN_ERR(svn_client__get_repos_mergeinfo(
-            ra_session, &repos_validated_inherited, "", base_revision,
-            svn_mergeinfo_inherited, TRUE,
-            TRUE, scratch_pool));
-          SVN_ERR(svn_mergeinfo_remove2(invalid_inherited_mergeinfo,
-                                        repos_validated_inherited,
-                                        repos_raw_inherited, FALSE,
-                                        result_pool, scratch_pool));
+          /* Now ask the server for TARGET_ABSPATH's inherited mergeinfo
+             but this time request that the inherited mergeinfo be valiated
+             so it contains only existing merge sources. */
+          svn_mergeinfo_t repos_validated_inherited;
+
+          SVN_ERR(svn_client__get_repos_mergeinfo(ra_session,
+                                                  &repos_validated_inherited,
+                                                  "", base_revision,
+                                                  svn_mergeinfo_inherited,
+                                                  TRUE,
+                                                  TRUE, /* Validated */
+                                                  scratch_pool));
+          if (repos_validated_inherited == NULL
+              || apr_hash_count(repos_validated_inherited) == 0)
+            {
+              /* All of the inherited mergeinfo describes non-existent
+                 merge sources. */
+              nonexistent_inherited_mergeinfo = repos_raw_inherited;
+            }
+          else
+            {
+              SVN_ERR(svn_mergeinfo_remove2(&nonexistent_inherited_mergeinfo,
+                                            repos_validated_inherited,
+                                            repos_raw_inherited, FALSE,
+                                            scratch_pool, scratch_pool));
+            }
         }
-      SVN_ERR(svn_client__ensure_ra_session_url(&session_url, ra_session,
-                                                session_url, scratch_pool));
+
+      /* If we needed to temporarily reparent RA_SESSION, then point it
+         back to its original URL. */
+      if (session_url)
+        SVN_ERR(svn_ra_reparent(ra_session, session_url, scratch_pool));
+
+      /* Remove any non-existent inherited merge sources from
+         INHERITED_MERGEINFO. */
+      if (nonexistent_inherited_mergeinfo
+          && apr_hash_count(nonexistent_inherited_mergeinfo))
+        SVN_ERR(svn_mergeinfo_remove2(corrected_mergeinfo,
+                                      nonexistent_inherited_mergeinfo,
+                                      inherited_mergeinfo, FALSE,
+                                      result_pool, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -3327,27 +3370,19 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
 
          If we already contacted the repository for inherited mergeinfo then
          we've done all we can since svn_client__get_wc_or_repos_mergeinfo
-         will request validation by default when asking the repository.
-
-         ### [PTB] Issue #3756 is still a problem here, i.e. TARGET_ABSPATH
-         ### inherits working mergeinfo from a working copy parent. */
+         will request validation by default when asking the repository. */
       if (inherited_mergeinfo
           && validate_inherited
           && !inherited_from_repos)
         {
-          svn_mergeinfo_t invalid_inherited_mergeinfo;
+          SVN_ERR(remove_non_existent_inherited_mergeinfo(recorded_mergeinfo,
+                                                          *recorded_mergeinfo,
+                                                          ra_session,
+                                                          target_abspath,
+                                                          ctx,
+                                                          scratch_pool,
+                                                          scratch_pool));
 
-          SVN_ERR(get_invalid_inherited_mergeinfo(
-            &invalid_inherited_mergeinfo,
-            ra_session, target_abspath, ctx,
-            scratch_pool, scratch_pool));
-
-          if (invalid_inherited_mergeinfo
-              && apr_hash_count(invalid_inherited_mergeinfo))
-            SVN_ERR(svn_mergeinfo_remove2(recorded_mergeinfo,
-                                          invalid_inherited_mergeinfo,
-                                          *recorded_mergeinfo, FALSE,
-                                          scratch_pool, scratch_pool));
         }
     }
 
@@ -3418,9 +3453,7 @@ get_full_mergeinfo(svn_mergeinfo_t *reco
                                                        result_pool));
 
           /* Return RA_SESSION back to where it was when we were called. */
-         SVN_ERR(svn_client__ensure_ra_session_url(&session_url,
-                                                   ra_session, session_url,
-                                                   scratch_pool));
+          SVN_ERR(svn_ra_reparent(ra_session, session_url, scratch_pool));
         }
     } /*if (implicit_mergeinfo) */
 
@@ -7856,6 +7889,18 @@ log_noop_revs(void *baton,
   apr_hash_index_t *hi;
   svn_revnum_t revision;
   svn_boolean_t log_entry_rev_required = FALSE;
+  apr_array_header_t *rl1;
+  apr_array_header_t *rl2;
+
+  /* The baton's pool is essentially an iterpool so we must clear it
+   * for each invocation of this function. */
+  rl1 = svn_rangelist_dup(log_gap_baton->operative_ranges, pool);
+  rl2 = svn_rangelist_dup(log_gap_baton->merged_ranges, pool);
+  svn_pool_clear(log_gap_baton->pool);
+  log_gap_baton->operative_ranges = svn_rangelist_dup(rl1,
+                                                      log_gap_baton->pool);
+  log_gap_baton->merged_ranges = svn_rangelist_dup(rl2,
+                                                   log_gap_baton->pool);
 
   revision = log_entry->revision;
 
@@ -8083,7 +8128,7 @@ remove_noop_subtree_ranges(const char *u
                     result_pool, scratch_pool));
   log_gap_baton.merged_ranges = merged_ranges;
   log_gap_baton.operative_ranges = operative_ranges;
-  log_gap_baton.pool = scratch_pool;
+  log_gap_baton.pool = svn_pool_create(scratch_pool);
 
   APR_ARRAY_PUSH(log_targets, const char *) = "";
 
@@ -10022,7 +10067,8 @@ find_unmerged_mergeinfo(svn_mergeinfo_ca
                                         FALSE, FALSE,
                                         iterpool));
           if (subtree_catalog)
-            source_mergeinfo = apr_hash_get(subtree_catalog, source_path,
+            source_mergeinfo = apr_hash_get(subtree_catalog,
+                                            source_path_rel_to_session,
                                             APR_HASH_KEY_STRING);
 
           /* A path might not have any inherited mergeinfo either. */

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.c Wed Jul 20 13:52:06 2011
@@ -1812,7 +1812,7 @@ svn_client_mergeinfo_log(svn_boolean_t f
           SVN_ERR(svn_mergeinfo_intersect2(&merged_via_history,
                                            subtree_history,
                                            subtree_source_history, TRUE,
-                                           scratch_pool, scratch_pool));
+                                           scratch_pool, iterpool));
           SVN_ERR(svn_mergeinfo_merge(subtree_mergeinfo,
                                       merged_via_history,
                                       scratch_pool));

Modified: subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_client/mergeinfo.h Wed Jul 20 13:52:06 2011
@@ -49,7 +49,7 @@ typedef struct svn_client__merge_path_t
                                         probably due to authz
                                         restrictions. */
 
-  svn_boolean_t child_of_noninheritable; /* ABSPATH has no explict mergeinfo
+  svn_boolean_t child_of_noninheritable; /* ABSPATH has no explicit mergeinfo
                                             itself but is the child of a
                                             path with noniheritable
                                             mergeinfo. */
@@ -316,7 +316,7 @@ svn_client__parse_mergeinfo(svn_mergeinf
 /* Write MERGEINFO into the WC for LOCAL_ABSPATH.  If MERGEINFO is NULL,
    remove any SVN_PROP_MERGEINFO for LOCAL_ABSPATH.  If MERGEINFO is empty,
    record an empty property value (e.g. "").  If CTX->NOTIFY_FUNC2 is
-   not null call it with notification type svn_wc_notify_update_update
+   not null call it with notification type svn_wc_notify_merge_record_info
    if DO_NOTIFICATION is true.
 
    Use WC_CTX to access the working copy, and SCRATCH_POOL for any temporary

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.c Wed Jul 20 13:52:06 2011
@@ -459,6 +459,31 @@ svn_fs_upgrade(const char *path, apr_poo
   return svn_error_trace(err2);
 }
 
+svn_error_t *
+svn_fs_verify(const char *path,
+              svn_cancel_func_t cancel_func,
+              void *cancel_baton,
+              apr_pool_t *pool) 
+{
+  svn_error_t *err;
+  svn_error_t *err2;
+  fs_library_vtable_t *vtable;
+  svn_fs_t *fs;
+
+  SVN_ERR(fs_library_vtable(&vtable, path, pool));
+  fs = fs_new(NULL, pool);
+  SVN_ERR(acquire_fs_mutex());
+  err = vtable->verify_fs(fs, path, cancel_func, cancel_baton,
+                          pool, common_pool);
+  err2 = release_fs_mutex();
+  if (err)
+    {
+      svn_error_clear(err2);
+      return svn_error_trace(err);
+    }
+  return svn_error_trace(err2);
+}
+
 const char *
 svn_fs_path(svn_fs_t *fs, apr_pool_t *pool)
 {

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs/fs-loader.h Wed Jul 20 13:52:06 2011
@@ -86,6 +86,11 @@ typedef struct fs_library_vtable_t
                                        apr_pool_t *common_pool);
   svn_error_t *(*upgrade_fs)(svn_fs_t *fs, const char *path, apr_pool_t *pool,
                              apr_pool_t *common_pool);
+  svn_error_t *(*verify_fs)(svn_fs_t *fs, const char *path,
+                            /* ### notification? */
+                            svn_cancel_func_t cancel_func, void *cancel_baton,
+                            apr_pool_t *pool,
+                            apr_pool_t *common_pool);
   svn_error_t *(*delete_fs)(const char *path, apr_pool_t *pool);
   svn_error_t *(*hotcopy)(const char *src_path, const char *dest_path,
                           svn_boolean_t clean, apr_pool_t *pool);

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_base/fs.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_base/fs.c Wed Jul 20 13:52:06 2011
@@ -881,6 +881,18 @@ base_upgrade(svn_fs_t *fs, const char *p
 }
 
 static svn_error_t *
+base_verify(svn_fs_t *fs, const char *path,
+            svn_cancel_func_t cancel_func,
+            void *cancel_baton,
+            apr_pool_t *pool,
+            apr_pool_t *common_pool)
+{
+  /* ### Any boilerplate needed here? */
+  /* Verifying is currently a no op for BDB. */
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
 base_bdb_recover(svn_fs_t *fs,
                  svn_cancel_func_t cancel_func, void *cancel_baton,
                  apr_pool_t *pool)
@@ -1349,6 +1361,7 @@ static fs_library_vtable_t library_vtabl
   base_open,
   base_open_for_recovery,
   base_upgrade,
+  base_verify,
   base_delete_fs,
   base_hotcopy,
   base_get_description,

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/caching.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/caching.c Wed Jul 20 13:52:06 2011
@@ -289,7 +289,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        svn_fs_fs__dag_serialize,
                        svn_fs_fs__dag_deserialize,
                        APR_HASH_KEY_STRING,
-                       apr_pstrcat(pool, prefix, "DAG", NULL),
+                       apr_pstrcat(pool, prefix, "DAG", (char *)NULL),
                        fs->pool));
 
   SVN_ERR(init_callbacks(ffd->rev_node_cache, fs, no_handler, pool));

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs.c Wed Jul 20 13:52:06 2011
@@ -256,6 +256,21 @@ fs_upgrade(svn_fs_t *fs, const char *pat
 }
 
 static svn_error_t *
+fs_verify(svn_fs_t *fs, const char *path,
+          svn_cancel_func_t cancel_func,
+          void *cancel_baton,
+          apr_pool_t *pool,
+          apr_pool_t *common_pool)
+{
+  SVN_ERR(svn_fs__check_fs(fs, FALSE));
+  SVN_ERR(initialize_fs_struct(fs));
+  SVN_ERR(svn_fs_fs__open(fs, path, pool));
+  SVN_ERR(svn_fs_fs__initialize_caches(fs, pool));
+  SVN_ERR(fs_serialized_init(fs, common_pool, pool));
+  return svn_fs_fs__verify(fs, cancel_func, cancel_baton, pool);
+}
+
+static svn_error_t *
 fs_pack(svn_fs_t *fs,
         const char *path,
         svn_fs_pack_notify_t notify_func,
@@ -342,6 +357,7 @@ static fs_library_vtable_t library_vtabl
   fs_open,
   fs_open_for_recovery,
   fs_upgrade,
+  fs_verify,
   fs_delete_fs,
   fs_hotcopy,
   fs_get_description,

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c Wed Jul 20 13:52:06 2011
@@ -1168,6 +1168,7 @@ write_config(svn_fs_t *fs,
 "### The following parameter enables rep-sharing in the repository.  It can" NL
 "### be switched on and off at will, but for best space-saving results"      NL
 "### should be enabled consistently over the life of the repository."        NL
+"### 'svnadmin verify' will check the rep-cache regardless of this setting." NL
 "### rep-sharing is enabled by default."                                     NL
 "# " CONFIG_OPTION_ENABLE_REP_SHARING " = true"                              NL
 
@@ -3435,8 +3436,10 @@ create_rep_state(struct rep_state **rep_
          ### going to jump straight to this comment anyway! */
       return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
                                "Corrupt representation '%s'",
-                               representation_string(rep, ffd->format, TRUE,
-                                                     pool));
+                               rep 
+                               ? representation_string(rep, ffd->format, TRUE,
+                                                       pool)
+                               : "(null)");
     }
   /* ### Call representation_string() ? */
   return svn_error_trace(err);
@@ -8281,3 +8284,42 @@ svn_fs_fs__pack(svn_fs_t *fs,
   pb.cancel_baton = cancel_baton;
   return svn_fs_fs__with_write_lock(fs, pack_body, &pb, pool);
 }
+
+
+/** Verifying. **/
+
+/* Body of svn_fs_fs__verify().
+   Implements svn_fs_fs__walk_rep_reference().walker.  */
+static svn_error_t *
+verify_walker(representation_t *rep,
+              void *baton,
+              svn_fs_t *fs,
+              apr_pool_t *scratch_pool)
+{
+  struct rep_state *rs;
+  struct rep_args *rep_args;
+
+  /* ### Should this be using read_rep_line() directly? */
+  SVN_ERR(create_rep_state(&rs, &rep_args, rep, fs, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_fs_fs__verify(svn_fs_t *fs,
+                  svn_cancel_func_t cancel_func,
+                  void *cancel_baton,
+                  apr_pool_t *pool)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+
+  if (ffd->format < SVN_FS_FS__MIN_REP_SHARING_FORMAT)
+    return SVN_NO_ERROR;
+
+  /* Don't take any lock. */
+  SVN_ERR(svn_fs_fs__walk_rep_reference(fs, verify_walker, NULL,
+                                        cancel_func, cancel_baton,
+                                        pool));
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.h Wed Jul 20 13:52:06 2011
@@ -38,6 +38,12 @@ svn_error_t *svn_fs_fs__open(svn_fs_t *f
 svn_error_t *svn_fs_fs__upgrade(svn_fs_t *fs,
                                 apr_pool_t *pool);
 
+/* Verify the fsfs filesystem FS.  Use POOL for temporary allocations. */
+svn_error_t *svn_fs_fs__verify(svn_fs_t *fs,
+                               svn_cancel_func_t cancel_func,
+                               void *cancel_baton,
+                               apr_pool_t *pool);
+
 /* Copy the fsfs filesystem at SRC_PATH into a new copy at DST_PATH.
    Use POOL for temporary allocations. */
 svn_error_t *svn_fs_fs__hotcopy(const char *src_path,

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache-db.sql
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache-db.sql?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache-db.sql (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache-db.sql Wed Jul 20 13:52:06 2011
@@ -45,3 +45,10 @@ WHERE hash = ?1
 -- STMT_SET_REP
 INSERT OR FAIL INTO rep_cache (hash, revision, offset, size, expanded_size)
 VALUES (?1, ?2, ?3, ?4, ?5)
+
+
+-- STMT_GET_ALL_REPS
+SELECT hash, revision, offset, size, expanded_size
+FROM rep_cache
+
+

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.c Wed Jul 20 13:52:06 2011
@@ -20,6 +20,8 @@
  * ====================================================================
  */
 
+#include "svn_pools.h"
+
 #include "svn_private_config.h"
 
 #include "fs_fs.h"
@@ -39,6 +41,42 @@
 REP_CACHE_DB_SQL_DECLARE_STATEMENTS(statements);
 
 
+
+/** Helper functions. **/
+
+
+/* Check that REP refers to a revision that exists in FS. */
+static svn_error_t *
+rep_has_been_born(representation_t *rep,
+                  svn_fs_t *fs,
+                  apr_pool_t *pool)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+  svn_revnum_t youngest;
+
+  SVN_ERR_ASSERT(rep);
+
+  youngest = ffd->youngest_rev_cache;
+  if (youngest < rep->revision)
+  {
+    /* Stale cache. */
+    SVN_ERR(svn_fs_fs__youngest_rev(&youngest, fs, pool));
+
+    /* Fresh cache. */
+    if (youngest < rep->revision)
+      return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+                               _("Youngest revision is r%ld, but "
+                                 "rep-cache contains r%ld"),
+                               youngest, rep->revision);
+  }
+
+  return SVN_NO_ERROR;
+}
+
+
+
+/** Library-private API's. **/
+
 /* Body of svn_fs_fs__open_rep_cache().
    Implements svn_atomic__init_once().init_func.
  */
@@ -81,6 +119,77 @@ svn_fs_fs__open_rep_cache(svn_fs_t *fs,
   return svn_error_quick_wrap(err, _("Couldn't open rep-cache database"));
 }
 
+svn_error_t *
+svn_fs_fs__walk_rep_reference(svn_fs_t *fs,
+                              svn_error_t *(*walker)(representation_t *,
+                                                     void *,
+                                                     svn_fs_t *, 
+                                                     apr_pool_t *),
+                              void *walker_baton,
+                              svn_cancel_func_t cancel_func,
+                              void *cancel_baton,
+                              apr_pool_t *pool)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+  svn_sqlite__stmt_t *stmt;
+  svn_boolean_t have_row;
+  int iterations = 0;
+
+  apr_pool_t *iterpool = svn_pool_create(pool);
+
+  /* Don't check ffd->rep_sharing_allowed. */
+  SVN_ERR_ASSERT(ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT);
+
+  if (! ffd->rep_cache_db)
+    SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
+
+  /* Get the statement. (There are no arguments to bind.) */
+  SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->rep_cache_db,
+                                    STMT_GET_ALL_REPS));
+
+  /* Walk the cache entries. */
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+  while (have_row)
+    {
+      representation_t *rep;
+      const char *sha1_digest;
+      
+      /* Clear ITERPOOL occasionally. */
+      if (iterations++ % 16 == 0)
+        svn_pool_clear(iterpool);
+
+      /* Check for cancellation. */
+      if (cancel_func)
+        SVN_ERR(cancel_func(cancel_baton));
+
+      /* Construct a representation_t. */
+      rep = apr_pcalloc(iterpool, sizeof(*rep));
+      sha1_digest = svn_sqlite__column_text(stmt, 0, iterpool);
+      SVN_ERR(svn_checksum_parse_hex(&rep->sha1_checksum,
+                                     svn_checksum_sha1, sha1_digest,
+                                     iterpool));
+      rep->revision = svn_sqlite__column_revnum(stmt, 1);
+      rep->offset = svn_sqlite__column_int64(stmt, 2);
+      rep->size = svn_sqlite__column_int64(stmt, 3);
+      rep->expanded_size = svn_sqlite__column_int64(stmt, 4);
+
+      /* Sanity check. */
+      if (rep)
+        SVN_ERR(rep_has_been_born(rep, fs, iterpool));
+
+      /* Walk. */
+      SVN_ERR(walker(rep, walker_baton, fs, iterpool));
+
+      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+    }
+
+  SVN_ERR(svn_sqlite__reset(stmt));
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
+
 /* This function's caller ignores most errors it returns.
    If you extend this function, check the callsite to see if you have
    to make it not-ignore additional error codes.  */
@@ -121,25 +230,8 @@ svn_fs_fs__get_rep_reference(representat
   else
     *rep = NULL;
 
-  /* Sanity check. */
   if (*rep)
-    {
-      svn_revnum_t youngest;
-
-      youngest = ffd->youngest_rev_cache;
-      if (youngest < (*rep)->revision)
-      {
-        /* Stale cache. */
-        SVN_ERR(svn_fs_fs__youngest_rev(&youngest, fs, pool));
-
-        /* Fresh cache. */
-        if (youngest < (*rep)->revision)
-          return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
-                                   _("Youngest revision is r%ld, but "
-                                     "rep-cache contains r%ld"),
-                                   youngest, (*rep)->revision);
-      }
-    }
+    SVN_ERR(rep_has_been_born(*rep, fs, pool));
 
   return svn_sqlite__reset(stmt);
 }

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/rep-cache.h Wed Jul 20 13:52:06 2011
@@ -40,6 +40,18 @@ svn_error_t *
 svn_fs_fs__open_rep_cache(svn_fs_t *fs,
                           apr_pool_t *pool);
 
+/* Iterate all representations currently in FS's cache. */
+svn_error_t *
+svn_fs_fs__walk_rep_reference(svn_fs_t *fs,
+                              svn_error_t *(*walker)(representation_t *rep,
+                                                     void *walker_baton,
+                                                     svn_fs_t *fs, 
+                                                     apr_pool_t *scratch_pool),
+                              void *walker_baton,
+                              svn_cancel_func_t cancel_func,
+                              void *cancel_baton,
+                              apr_pool_t *pool);
+
 /* Return the representation REP in FS which has fulltext CHECKSUM.
    REP is allocated in POOL.  If the rep cache database has not been
    opened, just set *REP to NULL. */

Propchange: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:1067687-1072301,1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:1067687-1072301,1143817-1148765

Propchange: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:1067687-1072301,1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:1067687-1072301,1143817-1148765

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra/ra_loader.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra/ra_loader.c Wed Jul 20 13:52:06 2011
@@ -201,14 +201,13 @@ load_ra_module(svn_ra__init_func_t *func
   return SVN_NO_ERROR;
 }
 
-/* If DEFN may support URL, return the scheme.  Else, return NULL. */
+/* If SCHEMES contains URL, return the scheme.  Else, return NULL. */
 static const char *
-has_scheme_of(const struct ra_lib_defn *defn, const char *url)
+has_scheme_of(const char * const *schemes, const char *url)
 {
-  const char * const *schemes;
   apr_size_t len;
 
-  for (schemes = defn->schemes; *schemes != NULL; ++schemes)
+  for ( ; *schemes != NULL; ++schemes)
     {
       const char *scheme = *schemes;
       len = strlen(scheme);
@@ -454,7 +453,7 @@ svn_error_t *svn_ra_open4(svn_ra_session
     {
       const char *scheme;
 
-      if ((scheme = has_scheme_of(defn, repos_URL)))
+      if ((scheme = has_scheme_of(defn->schemes, repos_URL)))
         {
           svn_ra__init_func_t initfunc = defn->initfunc;
 
@@ -475,6 +474,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
 
           SVN_ERR(check_ra_version(vtable->get_version(), scheme));
 
+          if (! has_scheme_of(vtable->get_schemes(sesspool), repos_URL))
+            /* Library doesn't support the scheme at runtime. */
+            continue;
+
+
           break;
         }
     }
@@ -1332,7 +1336,7 @@ svn_ra_get_ra_library(svn_ra_plugin_t **
   for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
     {
       const char *scheme;
-      if ((scheme = has_scheme_of(defn, url)))
+      if ((scheme = has_scheme_of(defn->schemes, url)))
         {
           svn_ra_init_func_t compat_initfunc = defn->compat_initfunc;
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_local/ra_plugin.c Wed Jul 20 13:52:06 2011
@@ -238,6 +238,15 @@ static const svn_ra_reporter3_t ra_local
 };
 
 
+/* ...
+ *
+ * Wrap a cancellation editor using SESSION's cancellation function around
+ * the supplied EDITOR.  ### Some callers (via svn_ra_do_update2() etc.)
+ * don't appear to know that we do this, and are supplying an editor that
+ * they have already wrapped with the same cancellation editor, so it ends
+ * up double-wrapped.
+ *
+ * ... */
 static svn_error_t *
 make_reporter(svn_ra_session_t *session,
               const svn_ra_reporter3_t **reporter,

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/log.c Wed Jul 20 13:52:06 2011
@@ -121,11 +121,12 @@ push_state(svn_ra_serf__xml_parser_t *pa
   if (state == ITEM)
     {
       log_info_t *info;
+      apr_pool_t *info_pool = svn_pool_create(parser->state->pool);
 
-      info = apr_pcalloc(parser->state->pool, sizeof(*info));
-      info->log_entry = svn_log_entry_create(parser->state->pool);
+      info = apr_pcalloc(info_pool, sizeof(*info));
+      info->pool = info_pool;
+      info->log_entry = svn_log_entry_create(info_pool);
 
-      info->pool = parser->state->pool;
       info->log_entry->revision = SVN_INVALID_REVNUM;
 
       parser->state->private = info;
@@ -220,11 +221,14 @@ start_log(svn_ra_serf__xml_parser_t *par
         }
       else if (strcmp(name.name, "revprop") == 0)
         {
+          const char *revprop_name;
           info = push_state(parser, log_ctx, REVPROP);
-          info->revprop_name = svn_xml_get_attr_value("name", attrs);
-          if (info->revprop_name == NULL)
+          revprop_name = svn_xml_get_attr_value("name", attrs);
+          if (revprop_name == NULL)
             return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
                                      _("Missing name attr in revprop element"));
+
+          info->revprop_name = apr_pstrdup(info->pool, revprop_name);
         }
       else if (strcmp(name.name, "has-children") == 0)
         {
@@ -342,6 +346,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
           log_ctx->nest_level--;
         }
 
+      svn_pool_destroy(info->pool);
       svn_ra_serf__xml_pop_state(parser);
     }
   else if (state == VERSION &&

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/ra_serf.h Wed Jul 20 13:52:06 2011
@@ -535,6 +535,10 @@ struct svn_ra_serf__xml_parser_t {
   /* Temporary allocations should be made in this pool. */
   apr_pool_t *pool;
 
+  /* What kind of response are we parsing? If set, this should typically
+     define the report name.  */
+  const char *response_type;
+
   /* Caller-specific data passed to the start, end, cdata callbacks.  */
   void *user_data;
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/serf.c Wed Jul 20 13:52:06 2011
@@ -1087,6 +1087,9 @@ svn_ra_serf__init(const svn_version_t *l
       { "svn_delta", svn_delta_version },
       { NULL, NULL }
     };
+  int serf_major;
+  int serf_minor;
+  int serf_patch;
 
   SVN_ERR(svn_ver_check_list(ra_serf_version(), checklist));
 
@@ -1094,12 +1097,27 @@ svn_ra_serf__init(const svn_version_t *l
      VTABLE parameter. The RA loader does a more exhaustive check. */
   if (loader_version->major != SVN_VER_MAJOR)
     {
-      return svn_error_createf
-        (SVN_ERR_VERSION_MISMATCH, NULL,
+      return svn_error_createf(
+         SVN_ERR_VERSION_MISMATCH, NULL,
          _("Unsupported RA loader version (%d) for ra_serf"),
          loader_version->major);
     }
 
+  /* Make sure that we have loaded a compatible library: the MAJOR must
+     match, and the minor must be at *least* what we compiled against.
+     The patch level is simply ignored.  */
+  serf_lib_version(&serf_major, &serf_minor, &serf_patch);
+  if (serf_major != SERF_MAJOR_VERSION
+      || serf_minor < SERF_MINOR_VERSION)
+    {
+      return svn_error_createf(
+         SVN_ERR_VERSION_MISMATCH, NULL,
+         _("ra_serf was compiled for serf %d.%d.%d but loaded "
+           "an incompatible %d.%d.%d library"),
+         SERF_MAJOR_VERSION, SERF_MINOR_VERSION, SERF_PATCH_VERSION,
+         serf_major, serf_minor, serf_patch);
+    }
+
   *vtable = &serf_vtable;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/update.c Wed Jul 20 13:52:06 2011
@@ -2324,6 +2324,7 @@ finish_report(void *report_baton,
   parser_ctx = apr_pcalloc(pool, sizeof(*parser_ctx));
 
   parser_ctx->pool = pool;
+  parser_ctx->response_type = "update-report";
   parser_ctx->user_data = report;
   parser_ctx->start = start_report;
   parser_ctx->end = end_report;

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_serf/util.c Wed Jul 20 13:52:06 2011
@@ -103,7 +103,65 @@ struct svn_ra_serf__pending_t {
 #define SPILL_SIZE 1000000
 
 /* See notes/ra-serf-testing.txt for some information on testing this
-   new "paused" feature.  */
+   new "paused" feature (aka network pushback).
+
+   Define PBTEST_ACTIVE, if you would like to run the pushback tests.  */
+#undef PBTEST_ACTIVE
+#ifdef PBTEST_ACTIVE
+
+static int pbtest_step = 0;
+
+/* Note: this cannot resolve states 5 and 7.  */
+#define PBTEST_STATE(p) \
+  ((p) == NULL ? 1                                                 \
+               : ((p)->spill == NULL ? ((p)->head == NULL ? 2 : 3) \
+                                     : ((p)->head == NULL ? 6 : 4)))
+
+typedef struct {
+  svn_boolean_t paused;   /* pause the parser on this step?  */
+  svn_boolean_t inject;   /* inject pending content on this step?  */
+  int when_next;          /* when to move to the next step?  */
+  const char *completed;  /* what test was completed?  */
+} pbtest_desc_t;
+
+static const pbtest_desc_t pbtest_description[] = {
+  { 0 }, /* unused */
+  { TRUE,  FALSE, 3, "1.1" },
+  { TRUE,  FALSE, 3, "1.3" },
+  { FALSE, FALSE, 3, "2.3" },
+  { FALSE, TRUE,  2, "3.3" },  /* WHEN_NEXT is ignored due to INJECT  */
+  { TRUE,  FALSE, 3, "1.2" },
+  { TRUE,  FALSE, 4, NULL  },
+  { TRUE,  FALSE, 4, "1.4" },
+  { FALSE, FALSE, 4, "2.4" },
+  { FALSE, TRUE,  6, "3.4" },  /* WHEN_NEXT is ignored due to INJECT  */
+  { TRUE,  FALSE, 6, "1.6" },
+  { FALSE, FALSE, 6, "2.6" },
+  { FALSE, TRUE,  7, "3.6" },  /* WHEN_NEXT is ignored due to INJECT  */
+  { TRUE,  FALSE, 6, "1.7" },
+  { 0 } /* unused */
+};
+
+#define PBTEST_SET_PAUSED(ctx) \
+  (pbtest_step < 14                                          \
+   ? (ctx)->paused = pbtest_description[pbtest_step].paused  \
+   : FALSE)
+
+#define PBTEST_MAYBE_STEP(ctx) maybe_next_step(ctx)
+
+#define PBTEST_FORCE_SPILL() (pbtest_step == 6)
+
+#else /* PBTEST_ACTIVE  */
+
+/* Be wary with the definition of these macros so that we don't
+   end up with "statement with no effect" warnings. Obviously, this
+   depends upon particular usage, which is easy to verify.  */
+#define PBTEST_SET_PAUSED(ctx)  /* empty */
+#define PBTEST_MAYBE_STEP(ctx)  /* empty */
+
+#define PBTEST_FORCE_SPILL() FALSE
+
+#endif /* PBTEST_ACTIVE  */
 
 
 
@@ -1250,6 +1308,48 @@ add_done_item(svn_ra_serf__xml_parser_t 
 }
 
 
+#ifdef PBTEST_ACTIVE
+
+/* Determine whether we should move to the next step. Print out the
+   transition for debugging purposes.  */
+static void
+maybe_next_step(svn_ra_serf__xml_parser_t *parser)
+{
+  const pbtest_desc_t *desc;
+  int state;
+
+  /* This would fail the state transition, but for clarity... just return
+     when the testing has completed.  */
+  if (pbtest_step == 14)
+    return;
+
+  desc = &pbtest_description[pbtest_step];
+  state = PBTEST_STATE(parser->pending);
+
+  if (desc->inject || state == desc->when_next || pbtest_step == 0)
+    {
+      ++pbtest_step;
+
+      if (desc->completed != NULL)
+        SVN_DBG(("PBTEST: completed TEST %s\n", desc->completed));
+
+      /* Pause the parser based on the new step's config.  */
+      ++desc;
+      parser->paused = desc->paused;
+
+      SVN_DBG(("PBTEST: advanced: step=%d  paused=%d  inject=%d\n",
+               pbtest_step, desc->paused, desc->inject));
+    }
+  else
+    {
+      SVN_DBG(("PBTEST: step[%d]: state=%d  waiting_for=%d\n",
+               pbtest_step, state, desc->when_next));
+    }
+}
+
+#endif /* PBTEST_ACTIVE  */
+
+
 /* Get a buffer from the parsing context. It will come from the free list,
    or allocated as necessary.  */
 static struct pending_buffer_t *
@@ -1293,10 +1393,18 @@ write_to_pending(svn_ra_serf__xml_parser
 
   /* We do not (yet) have a spill file, but the amount stored in memory
      has grown too large. Create the file and place the pending data into
-     the temporary file.  */
-  if (ctx->pending->spill == NULL
-      && ctx->pending->memory_size > SPILL_SIZE)
-    {
+     the temporary file.
+
+     For testing purposes, there are points when we may want to
+     create the spill file, regardless.  */
+  if (PBTEST_FORCE_SPILL()
+      || (ctx->pending->spill == NULL
+          && ctx->pending->memory_size > SPILL_SIZE))
+    {
+#ifdef PBTEST_ACTIVE
+      /* Only allow a spill file for steps 6 or later.  */
+      if (pbtest_step >= 6)
+#endif
       SVN_ERR(svn_io_open_unique_file3(&ctx->pending->spill,
                                        NULL /* temp_path */,
                                        NULL /* dirpath */,
@@ -1371,6 +1479,10 @@ inject_to_parser(svn_ra_serf__xml_parser
   if (ctx->error && !ctx->ignore_errors)
     return svn_error_trace(ctx->error);
 
+  /* We may want to ignore the callbacks choice for the PAUSED flag.
+     Set this value, as appropriate.  */
+  PBTEST_SET_PAUSED(ctx);
+
   return SVN_NO_ERROR;
 }
 
@@ -1383,6 +1495,18 @@ svn_ra_serf__process_pending(svn_ra_serf
   svn_error_t *err;
   apr_off_t output_unused;
 
+  /* We may need to repair the PAUSED state when testing.  */
+  PBTEST_SET_PAUSED(parser);
+
+#ifdef PBTEST_ACTIVE
+  /* If this step should not inject content, then fast-path exit.  */
+  if (pbtest_step < 14 && !pbtest_description[pbtest_step].inject)
+    {
+      SVN_DBG(("PBTEST: process: injection disabled\n"));
+      return SVN_NO_ERROR;
+    }
+#endif
+
   /* Fast path exit: already paused, or nothing to do.  */
   if (parser->paused || parser->pending == NULL)
     return SVN_NO_ERROR;
@@ -1420,6 +1544,17 @@ svn_ra_serf__process_pending(svn_ra_serf
         return SVN_NO_ERROR;
     }
 
+#ifdef PBTEST_ACTIVE
+  /* For steps 4 and 9, we wait until all of the memory content has been
+     injected. At that point, we can take another step which will pause
+     the parser, and we'll need to exit.  */
+  if (pbtest_step == 4 || pbtest_step == 9)
+    {
+      PBTEST_MAYBE_STEP(parser);
+      return SVN_NO_ERROR;
+    }
+#endif
+
   /* If we don't have a spill file, then we've exhausted all
      pending content.  */
   if (parser->pending->spill == NULL)
@@ -1481,6 +1616,11 @@ svn_ra_serf__process_pending(svn_ra_serf
       XML_ParserFree(parser->xmlp);
       add_done_item(parser);
     }
+
+  /* For testing step 12, we have written all of the disk content. This
+     will advance to step 13 and pause the parser again.  */
+  PBTEST_MAYBE_STEP(parser);
+
   return SVN_NO_ERROR;
 }
 
@@ -1538,6 +1678,14 @@ svn_ra_serf__handle_xml_parser(serf_requ
         {
           XML_SetCharacterDataHandler(ctx->xmlp, cdata_xml);
         }
+
+      /* This is the first invocation. If we're looking at an update
+         report, then move to step 1 of the testing sequence.  */
+#ifdef PBTEST_ACTIVE
+      if (ctx->response_type != NULL
+          && strcmp(ctx->response_type, "update-report") == 0)
+        PBTEST_MAYBE_STEP(ctx);
+#endif
     }
 
   /* If we are storing content into a spill file, then move to the end of
@@ -1564,6 +1712,16 @@ svn_ra_serf__handle_xml_parser(serf_requ
           return svn_error_wrap_apr(status, NULL);
         }
 
+      /* Ensure that the parser's PAUSED state is correct before we test
+         the flag.  */
+      PBTEST_SET_PAUSED(ctx);
+
+#ifdef PBTEST_ACTIVE
+      SVN_DBG(("response: len=%d  paused=%d  status=%08x\n",
+               (int)len, ctx->paused, status));
+      SVN_DBG(("content=%s\n", data));
+#endif
+
       /* Note: once the callbacks invoked by inject_to_parser() sets the
          PAUSED flag, then it will not be cleared. write_to_pending() will
          only save the content. Logic outside of serf_context_run() will
@@ -1573,10 +1731,17 @@ svn_ra_serf__handle_xml_parser(serf_requ
          We want to save arriving content into the PENDING structures if
          the parser has been paused, or we already have data in there (so
          the arriving data is appended, rather than injected out of order)  */
-#ifdef DISABLE_THIS_FOR_NOW
+#ifdef PBTEST_ACTIVE
       if (ctx->paused || HAS_PENDING_DATA(ctx->pending))
         {
           err = write_to_pending(ctx, data, len, pool);
+
+          /* We may have a transition to a next step.
+
+             Note: this only happens on writing to PENDING. If the
+             parser is unpaused, then we will never change state within
+             this network-reading loop.  */
+          PBTEST_MAYBE_STEP(ctx);
         }
       else
 #endif

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_svn/editorp.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_svn/editorp.c Wed Jul 20 13:52:06 2011
@@ -914,6 +914,17 @@ svn_error_t *svn_ra_svn_drive_editor2(sv
         }
       if (ra_svn_edit_cmds[i].cmd)
         err = (*ra_svn_edit_cmds[i].handler)(conn, subpool, params, &state);
+      else if (strcmp(cmd, "failure") == 0)
+        {
+          /* While not really an editor command this can occur when
+             reporter->finish_report() fails before the first editor command */
+          if (aborted)
+            *aborted = TRUE;
+          err = svn_ra_svn__handle_failure_status(params, pool);
+          return svn_error_compose_create(
+                            err,
+                            editor->abort_edit(edit_baton, subpool));
+        }
       else
         {
           err = svn_error_createf(SVN_ERR_RA_SVN_UNKNOWN_CMD, NULL,

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_svn/marshal.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_svn/marshal.c Wed Jul 20 13:52:06 2011
@@ -44,6 +44,7 @@
 
 #include "private/svn_string_private.h"
 #include "private/svn_dep_compat.h"
+#include "private/svn_error_private.h"
 
 #define svn_iswhitespace(c) ((c) == ' ' || (c) == '\n')
 
@@ -1096,7 +1097,14 @@ svn_error_t *svn_ra_svn_write_cmd_failur
   SVN_ERR(svn_ra_svn_start_list(conn, pool));
   for (; err; err = err->child)
     {
-      const char *msg = svn_err_best_message(err, buffer, sizeof(buffer));
+      const char *msg;
+
+#ifdef SVN_ERR__TRACING
+      if (svn_error__is_tracing_link(err))
+        msg = err->message;
+      else
+#endif
+        msg = svn_err_best_message(err, buffer, sizeof(buffer));
 
       /* The message string should have been optional, but we can't
          easily change that, so marshal nonexistent messages as "". */

Modified: subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c Wed Jul 20 13:52:06 2011
@@ -1282,6 +1282,11 @@ svn_repos_verify_fs2(svn_repos_t *repos,
                                "(youngest revision is %ld)"),
                              end_rev, youngest);
 
+  /* Verify global/auxiliary data before verifying revisions. */
+  if (start_rev == 0)
+    SVN_ERR(svn_fs_verify(svn_fs_path(fs, pool), cancel_func, cancel_baton,
+                          pool));
+
   /* Create a notify object that we can reuse within the loop. */
   if (notify_func)
     notify = svn_repos_notify_create(svn_repos_notify_verify_rev_end,
@@ -1329,10 +1334,11 @@ svn_repos_verify_fs2(svn_repos_t *repos,
   /* We're done. */
   if (notify_func)
     {
-      notify = svn_repos_notify_create(svn_repos_notify_dump_end, iterpool);
+      notify = svn_repos_notify_create(svn_repos_notify_verify_end, iterpool);
       notify_func(notify_baton, notify, iterpool);
     }
 
+  /* Per-backend verification. */
   svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;

Modified: subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_repos/hooks.c Wed Jul 20 13:52:06 2011
@@ -616,8 +616,20 @@ svn_repos__hooks_pre_lock(svn_repos_t *r
 
       SVN_ERR(run_hook_cmd(&buf, SVN_REPOS__HOOK_PRE_LOCK, hook, args, NULL,
                            pool));
+
       if (token)
-        *token = buf->data;
+        {
+          svn_error_t *err;
+          /* Convert hook output from native encoding to UTF-8. */
+          err = svn_utf_cstring_to_utf8(token, buf->data, pool);
+          if (err)
+            {
+              return svn_error_create(SVN_ERR_REPOS_HOOK_FAILURE, err,
+                                      _("Output of pre-lock hook could not be "
+                                        "translated from the native locale to "
+                                        "UTF-8."));
+            }
+        }
     }
   else if (token)
     *token = "";

Propchange: subversion/branches/revprop-packing/subversion/libsvn_subr/adler32.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -1,4 +1,4 @@
 /subversion/branches/diff-optimizations/subversion/libsvn_subr/adler32.c:1031270-1037352
 /subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c:1037353-1067789
 /subversion/branches/performance/subversion/libsvn_subr/adler32.c:1067697-1078365
-/subversion/trunk/subversion/libsvn_subr/adler32.c:1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/libsvn_subr/adler32.c:1143817-1148765

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/dso.c Wed Jul 20 13:52:06 2011
@@ -105,7 +105,7 @@ svn_dso_load(apr_dso_handle_t **dso, con
       status = apr_dso_load(dso, fname, dso_pool);
       if (status)
         {
-#ifdef SVN_DEBUG
+#if 0
           char buf[1024];
           fprintf(stderr, "%s\n", apr_dso_error(*dso, buf, 1024));
 #endif

Propchange: subversion/branches/revprop-packing/subversion/libsvn_subr/hash.c
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: subversion/branches/revprop-packing/subversion/libsvn_subr/svn_temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:52:06 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_subr/svn_temp_serializer.c:1067687-1072301,1143817-1144579,1145515,1145519,1145670
+/subversion/trunk/subversion/libsvn_subr/svn_temp_serializer.c:1067687-1072301,1143817-1148765

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/info.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/info.c Wed Jul 20 13:52:06 2011
@@ -301,18 +301,24 @@ build_info_for_unversioned(svn_wc__info2
                            apr_pool_t *pool)
 {
   svn_wc__info2_t *tmpinfo = apr_pcalloc(pool, sizeof(*tmpinfo));
-  tmpinfo->wc_info = apr_pcalloc(pool, sizeof (*tmpinfo->wc_info));
+  svn_wc_info_t *wc_info = apr_pcalloc(pool, sizeof (*wc_info));
 
   tmpinfo->URL                  = NULL;
-  tmpinfo->rev                  = SVN_INVALID_REVNUM;
-  tmpinfo->kind                 = svn_node_none;
   tmpinfo->repos_UUID           = NULL;
   tmpinfo->repos_root_URL       = NULL;
+  tmpinfo->rev                  = SVN_INVALID_REVNUM;
+  tmpinfo->kind                 = svn_node_none;
+  tmpinfo->size                 = SVN_INVALID_FILESIZE;
   tmpinfo->last_changed_rev     = SVN_INVALID_REVNUM;
   tmpinfo->last_changed_date    = 0;
   tmpinfo->last_changed_author  = NULL;
   tmpinfo->lock                 = NULL;
-  tmpinfo->size                 = SVN_INVALID_FILESIZE;
+
+  tmpinfo->wc_info = wc_info;
+
+  wc_info->copyfrom_rev = SVN_INVALID_REVNUM;
+  wc_info->depth = svn_depth_unknown;
+  wc_info->recorded_size = SVN_INVALID_FILESIZE;
 
   *info = tmpinfo;
   return SVN_NO_ERROR;

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/upgrade.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/upgrade.c Wed Jul 20 13:52:06 2011
@@ -1754,6 +1754,8 @@ is_old_wcroot(const char *local_abspath,
         _("Can't upgrade '%s' as it is not a pre-1.7 working copy directory"),
         svn_dirent_local_style(local_abspath, scratch_pool));
     }
+  else if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
+    return SVN_NO_ERROR;
 
   svn_dirent_split(&parent_abspath, &name, local_abspath, scratch_pool);
 
@@ -1768,14 +1770,15 @@ is_old_wcroot(const char *local_abspath,
   entry = apr_hash_get(entries, name, APR_HASH_KEY_STRING);
   if (!entry
       || entry->absent
-      || (entry->deleted && entry->schedule != svn_wc_schedule_add))
+      || (entry->deleted && entry->schedule != svn_wc_schedule_add)
+      || entry->depth == svn_depth_exclude)
     {
       return SVN_NO_ERROR;
     }
 
-  svn_dirent_split(&parent_abspath, &name, parent_abspath, scratch_pool);
   while (!svn_dirent_is_root(parent_abspath, strlen(parent_abspath)))
     {
+      svn_dirent_split(&parent_abspath, &name, parent_abspath, scratch_pool);
       err = svn_wc__read_entries_old(&entries, parent_abspath,
                                      scratch_pool, scratch_pool);
       if (err)
@@ -1787,12 +1790,12 @@ is_old_wcroot(const char *local_abspath,
       entry = apr_hash_get(entries, name, APR_HASH_KEY_STRING);
       if (!entry
           || entry->absent
-          || (entry->deleted && entry->schedule != svn_wc_schedule_add))
+          || (entry->deleted && entry->schedule != svn_wc_schedule_add)
+          || entry->depth == svn_depth_exclude)
         {
           parent_abspath = svn_dirent_join(parent_abspath, name, scratch_pool);
           break;
         }
-      svn_dirent_split(&parent_abspath, &name, parent_abspath, scratch_pool);
     }
 
   return svn_error_createf(

Modified: subversion/branches/revprop-packing/subversion/svn/copy-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/svn/copy-cmd.c?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/svn/copy-cmd.c (original)
+++ subversion/branches/revprop-packing/subversion/svn/copy-cmd.c Wed Jul 20 13:52:06 2011
@@ -95,12 +95,14 @@ svn_cl__copy(apr_getopt_t *os,
   else if ((! srcs_are_urls) && (dst_is_url))
     {
       /* WC->URL : Use notification. */
+      if (! opt_state->quiet)
         SVN_ERR(svn_cl__notifier_mark_wc_to_repos_copy(ctx->notify_baton2));
     }
   else if ((srcs_are_urls) && (! dst_is_url))
     {
-      /* URL->WC : Use checkout-style notification. */
-      SVN_ERR(svn_cl__notifier_mark_checkout(ctx->notify_baton2));
+     /* URL->WC : Use checkout-style notification. */
+     if (! opt_state->quiet)
+       SVN_ERR(svn_cl__notifier_mark_checkout(ctx->notify_baton2));
     }
   else
     {

Modified: subversion/branches/revprop-packing/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1148773&r1=1148772&r2=1148773&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/revprop-packing/subversion/tests/cmdline/merge_reintegrate_tests.py Wed Jul 20 13:52:06 2011
@@ -2340,6 +2340,268 @@ def reintegrate_creates_bogus_mergeinfo(
                                        None, None, None, None, None,
                                        1, 1, "--reintegrate", A_path)
 
+
+#----------------------------------------------------------------------
+# Test for regression on 1.6.x branch, merge fails when source without
+# subtree mergeinfo is reintegrated into a target with subtree
+# mergeinfo.  Deliberately written in a style that works with the 1.6
+# testsuite.
+@Issue(3957)
+def no_source_subtree_mergeinfo(sbox):
+  "source without subtree mergeinfo"
+
+  sbox.build()
+  wc_dir=sbox.wc_dir
+
+  svntest.main.file_write(os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
+                          'AAA\n' +
+                          'BBB\n' +
+                          'CCC\n')
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Create branch-1
+  svntest.main.run_svn(None, 'copy',
+                       os.path.join(wc_dir, 'A', 'B'),
+                       os.path.join(wc_dir, 'A', 'B1'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+
+  # Create branch-1
+  svntest.main.run_svn(None, 'copy',
+                       os.path.join(wc_dir, 'A', 'B'),
+                       os.path.join(wc_dir, 'A', 'B2'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+
+  # Change on trunk
+  svntest.main.file_write(os.path.join(wc_dir, 'A', 'B', 'E', 'alpha'),
+                          'AAAxx\n' +
+                          'BBB\n' +
+                          'CCC\n')
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+
+  # Change on branch-1
+  svntest.main.file_write(os.path.join(wc_dir, 'A', 'B1', 'E', 'alpha'),
+                          'AAA\n' +
+                          'BBBxx\n' +
+                          'CCC\n')
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+
+  # Change on branch-2
+  svntest.main.file_write(os.path.join(wc_dir, 'A', 'B2', 'E', 'alpha'),
+                          'AAA\n' +
+                          'BBB\n' +
+                          'CCCxx\n')
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Merge trunk to branch-1
+  svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B1'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Reintegrate branch-1 subtree to trunk subtree
+  svntest.main.run_svn(None, 'merge', '--reintegrate',
+                       '^/A/B1/E', os.path.join(wc_dir, 'A', 'B', 'E'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Merge trunk to branch-2
+  svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B2'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Reverse merge branch-1 subtree to branch-2 subtree, this removes
+  # the subtree mergeinfo from branch 2
+  svntest.main.run_svn(None, 'merge', '-r8:2',
+                       '^/A/B1/E', os.path.join(wc_dir, 'A', 'B2', 'E'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Verify that merge results in no subtree mergeinfo
+  svntest.actions.run_and_verify_svn(None, [], [], 'propget', 'svn:mergeinfo',
+                                     sbox.repo_url + '/A/B2/E')
+
+  # Merge trunk to branch-2
+  svntest.main.run_svn(None, 'merge', '^/A/B', os.path.join(wc_dir, 'A', 'B2'))
+  svntest.main.run_svn(None, 'commit', '-m', 'log message', wc_dir)
+  svntest.main.run_svn(None, 'update', wc_dir)
+
+  # Verify that there is still no subtree mergeinfo
+  svntest.actions.run_and_verify_svn(None, [], [], 'propget', 'svn:mergeinfo',
+                                     sbox.repo_url + '/A/B2/E')
+
+  # Reintegrate branch-2 to trunk, this fails in 1.6.x from 1.6.13.
+  # The error message states revisions /A/B/E:3-11 are missing from
+  # /A/B2/E and yet the mergeinfo on /A/B2 is /A/B:3-11 and /A/B2/E
+  # has no mergeinfo.
+  expected_output = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+      'E'       : Item(status=' U'),
+      'E/alpha' : Item(status='U '),
+      })
+  expected_mergeinfo = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+      '' : Item(status=' U'),
+      })
+  expected_elision = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+      })
+  expected_disk = wc.State('', {
+      ''        : Item(props={SVN_PROP_MERGEINFO : '/A/B2:3-12'}),
+      'E'       : Item(),
+      'E/alpha' : Item("AAA\n" +
+                       "BBB\n" +
+                       "CCCxx\n"),
+      'E/beta'  : Item("This is the file 'beta'.\n"),
+      'F'       : Item(),
+      'lambda'  : Item("This is the file 'lambda'.\n"),
+      })
+  expected_skip = wc.State(os.path.join(wc_dir, 'A', 'B'), {
+      })
+  svntest.actions.run_and_verify_merge(os.path.join(wc_dir, 'A', 'B'),
+                                       None, None, '^/A/B2', None,
+                                       expected_output, expected_mergeinfo,
+                                       expected_elision, expected_disk,
+                                       None, expected_skip,
+                                       None, None, None, None, None,
+                                       1, 1, '--reintegrate',
+                                       os.path.join(wc_dir, 'A', 'B'))
+  # For 1.6 testsuite use:
+  # svntest.actions.run_and_verify_merge(os.path.join(wc_dir, 'A', 'B'),
+  #                                      None, None, '^/A/B2',
+  #                                      expected_output,
+  #                                      expected_disk,
+  #                                      None, expected_skip,
+  #                                      None, None, None, None, None,
+  #                                      1, 1, '--reintegrate')
+
+#----------------------------------------------------------------------
+@SkipUnless(server_has_mergeinfo)
+@Issue(3961)
+@XFail()
+def reintegrate_replaced_source(sbox):
+  "reintegrate a replaced source branch"
+
+  # Make A_COPY branch in r2, and do a few more commits to A in r3-6.
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  expected_disk, expected_status = set_up_branch(sbox)
+
+  A_path         = os.path.join(sbox.wc_dir, "A")
+  A_COPY_path    = os.path.join(sbox.wc_dir, "A_COPY")
+  beta_COPY_path = os.path.join(sbox.wc_dir, "A_COPY", "B", "E", "beta")
+  mu_COPY_path   = os.path.join(sbox.wc_dir, "A_COPY", "mu")  
+
+  # Using cherrypick merges, simulate a series of sync merges from A to
+  # A_COPY with a replace of A_COPY along the way.
+  #
+  # r6 - Merge r3 from A to A_COPY
+  svntest.main.run_svn(None, 'up', wc_dir)
+  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
+                       '-c3')
+  svntest.main.run_svn(None, 'ci', '-m', 'Merge r3 from A to A_COPY', wc_dir)
+
+  # r8 - Merge r4 from A to A_COPY
+  svntest.main.run_svn(None, 'up', wc_dir)
+  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
+                       '-c4')
+  svntest.main.run_svn(None, 'ci', '-m', 'Merge r4 from A to A_COPY', wc_dir)
+
+  # r9 - Merge r5 from A to A_COPY. Make an additional edit to
+  # A_COPY/B/E/beta.
+  svntest.main.run_svn(None, 'up', wc_dir)
+  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
+                       '-c5')
+  svntest.main.file_write(beta_COPY_path, "Branch edit mistake.\n")
+  svntest.main.run_svn(None, 'ci', '-m', 'Merge r5 from A to A_COPY', wc_dir)
+
+  # r10 - Delete A_COPY and replace it with A_COPY@8. This removes the edit
+  # we made above in r9 to A_COPY/B/E/beta.
+  svntest.main.run_svn(None, 'up', wc_dir)
+  svntest.main.run_svn(None, 'delete', A_COPY_path)
+  svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A_COPY@8',
+                       A_COPY_path)
+  svntest.main.run_svn(None, 'ci', '-m', 'Replace A_COPY with A_COPY@8',
+                       wc_dir)
+
+  # r11 - Make an edit on A_COPY/mu.
+  svntest.main.file_write(mu_COPY_path, "Branch edit.\n")
+  svntest.main.run_svn(None, 'ci', '-m', 'Branch edit',
+                       wc_dir)
+
+  # r12 - Do a final sync merge of A to A_COPY in preparation for
+  # reintegration.  
+  svntest.main.run_svn(None, 'up', wc_dir)
+  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
+  svntest.main.run_svn(None, 'ci', '-m', 'Sycn A_COPY with A', wc_dir)
+
+  # Reintegrate A_COPY to A.  The resulting mergeinfo should be
+  # '/A_COPY:2-8,10-12' because of the replacement which removed /A_COPY:9
+  # from the reintegrate source's history.
+  svntest.main.run_svn(None, 'up', wc_dir)
+  expected_output = wc.State(A_path, {
+    'mu' : Item(status='U '),
+    })
+  expected_mergeinfo_output = wc.State(A_path, {
+    ''   : Item(status=' U'),
+    })
+  expected_elision_output = wc.State(A_path, {
+    })
+  expected_status = wc.State(A_path, {
+    ''          : Item(status=' M'),
+    'B'         : Item(status='  '),
+    'mu'        : Item(status='M '),
+    'B/E'       : Item(status='  '),
+    'B/E/alpha' : Item(status='  '),
+    'B/E/beta'  : Item(status='  '),
+    'B/lambda'  : Item(status='  '),
+    'B/F'       : Item(status='  '),
+    'C'         : Item(status='  '),
+    'D'         : Item(status='  '),
+    'D/G'       : Item(status='  '),
+    'D/G/pi'    : Item(status='  '),
+    'D/G/rho'   : Item(status='  '),
+    'D/G/tau'   : Item(status='  '),
+    'D/gamma'   : Item(status='  '),
+    'D/H'       : Item(status='  '),
+    'D/H/chi'   : Item(status='  '),
+    'D/H/psi'   : Item(status='  '),
+    'D/H/omega' : Item(status='  '),
+    })
+  expected_status.tweak(wc_rev=12)
+  expected_disk = wc.State('', {
+    # This test currently fails because the resulting mergeinfo is
+    # /A_COPY:2-12, even though the changes in A_COPY:9 are *not*
+    # present on A.
+    ''          : Item(props={SVN_PROP_MERGEINFO : '/A_COPY:2-8,10-12'}),
+    'B'         : Item(),
+    'mu'        : Item("Branch edit.\n"),
+    'B/E'       : Item(),
+    'B/E/alpha' : Item("This is the file 'alpha'.\n"),
+    'B/E/beta'  : Item("New content"),
+    'B/lambda'  : Item("This is the file 'lambda'.\n"),
+    'B/F'       : Item(),
+    'C'         : Item(),
+    'D'         : Item(),
+    'D/G'       : Item(),
+    'D/G/pi'    : Item("This is the file 'pi'.\n"),
+    'D/G/rho'   : Item("New content"),
+    'D/G/tau'   : Item("This is the file 'tau'.\n"),
+    'D/gamma'   : Item("This is the file 'gamma'.\n"),
+    'D/H'       : Item(),
+    'D/H/chi'   : Item("This is the file 'chi'.\n"),
+    'D/H/psi'   : Item("New content"),
+    'D/H/omega' : Item("New content"),
+    })
+  expected_skip = wc.State(A_path, { })
+  svntest.actions.run_and_verify_merge(A_path, None, None,
+                                       sbox.repo_url + '/A_COPY', None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       [], None, None, None, None, True, True,
+                                       '--reintegrate', A_path)
+  
 ########################################################################
 # Run the tests
 
@@ -2361,6 +2623,8 @@ test_list = [ None,
               added_subtrees_with_mergeinfo_break_reintegrate,
               two_URL_merge_removes_valid_mergeinfo_from_target,
               reintegrate_creates_bogus_mergeinfo,
+              no_source_subtree_mergeinfo,
+              reintegrate_replaced_source,
              ]
 
 if __name__ == '__main__':



Mime
View raw message