[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] fix for svndumpfilter not filtering out revisions that were initially empty

From: Igor Sereda <sereda_at_gmail.com>
Date: Sun, 4 Jul 2010 20:08:28 +0400

[[[
Fix for svndumpfilter.

  * subversion/svndumpfilter/main.c

Problem Reproduction Sequence:

  1. Get a dump of a repository with empty revisions (for example, by
pulling a subdirectory of a remote repo with svnsync).
  2. Run svndumpfilter --drop-empty-revs to filter the dump.

Expected:

  Revisions that were initially empty are dropped. (As well as those
filtered out.)

Observed:

  Only revisions that were filtered out are dropped. Revisions that
were initially empty - remain.

This also contradicts a comment in the related code.

The following patch fixes that.
]]]
Index: subversion/svndumpfilter/main.c
===================================================================
--- subversion/svndumpfilter/main.c (revision 960348)
+++ subversion/svndumpfilter/main.c (working copy)
@@ -383,12 +383,12 @@
   /* Revision is written out in the following cases:
      1. No --drop-empty-revs has been supplied.
      2. --drop-empty-revs has been supplied,
- but revision has not all nodes dropped
- 3. Revision had no nodes to begin with.
+ but revision has nodes (possibly after some were dropped)
+ 3. It is revision 0, which should be preserved
   */
   if (rb->has_nodes
       || (! rb->pb->drop_empty_revs)
- || (! rb->had_dropped_nodes))
+ || rb->rev_orig == 0)
     {
       /* This revision is a keeper. */
       SVN_ERR(svn_stream_write(rb->pb->out_stream,

Received on 2010-07-04 18:25:53 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.