You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2010/05/06 19:13:00 UTC

svn commit: r941808 - /subversion/trunk/subversion/svndumpfilter/main.c

Author: pburba
Date: Thu May  6 17:13:00 2010
New Revision: 941808

URL: http://svn.apache.org/viewvc?rev=941808&view=rev
Log:
Make svndumpfilter --skip-missing-merge-sources filter mergeinfo referring
to the first revision in the dump stream, in addition to the revisions
that are older than that.

svnadmin load already does something analogous to this when it filters any
references to r1 from the load stream, see the issue #3020 fix
http://svn.apache.org/viewvc?view=revision&revision=941438

* subversion/svndumpfilter/main.c

  (adjust_mergeinfo): If --skip-missing_merge-sources is specified, then
   filter out all mergeinfo between r0 and the oldest rev in the dump stream.

Modified:
    subversion/trunk/subversion/svndumpfilter/main.c

Modified: subversion/trunk/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/main.c?rev=941808&r1=941807&r2=941808&view=diff
==============================================================================
--- subversion/trunk/subversion/svndumpfilter/main.c (original)
+++ subversion/trunk/subversion/svndumpfilter/main.c Thu May  6 17:13:00 2010
@@ -680,13 +680,21 @@ adjust_mergeinfo(svn_string_t **final_va
   SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool));
 
   /* Issue #3020: If we are skipping missing merge sources, then also
-     filter mergeinfo ranges older than the oldest revision in the dump
-     stream (since they are missing too).  If the oldest rev is r0 or r1,
-     then the filtering would be a no-op, so don't bother. */
-  if (rb->pb->skip_missing_merge_sources && rb->pb->oldest_original_rev > 1)
+     filter mergeinfo ranges as old or older than the oldest revision in the
+     dump stream.  Those older than the oldest obviously refer to history
+     outside of the dump stream.  The oldest rev itself is present in the
+     dump, but cannot be a valid merge source revision since it is the
+     start of all history.  E.g. if we dump -r100:400 then dumpfilter the
+     result with --skip-missing-merge-sources, any mergeinfo with revision
+     100 implies a change of -r99:100, but r99 is part of the history we
+     want filtered.  This is analogous to how r1 is always meaningless as
+     a merge source revision.
+
+     If the oldest rev is r0 then there is nothing to filter. */
+  if (rb->pb->skip_missing_merge_sources && rb->pb->oldest_original_rev > 0)
     SVN_ERR(svn_mergeinfo__filter_mergeinfo_by_ranges(
       &mergeinfo, mergeinfo,
-      rb->pb->oldest_original_rev - 1, 0,
+      rb->pb->oldest_original_rev, 0,
       FALSE, subpool, subpool));
 
   for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))