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

Re: svndumpfilter and empty revisions

From: David Newman <dnewman_at_unixmonkeys.com>
Date: Mon, 24 Sep 2012 09:58:53 -0400

 On Fri, Sep 14, 2012 at 6:49 PM, Daniel Shahaf <d.s_at_daniel.shahaf.name>
 wrote:

> Can you post the actual parts of the dumpfile for those empty revisions?
> (between successive "Revision-number: " lines)
>
>
Sure. Posted below are a couple of revisions. I actually worked around
this problem by writing a perl script that uses SVN::Dumpfile to read and
write each revision but ignoring revisions with the svn:log property of
"This is an empty revision for padding." The fail case here would be if a
developer commited a revision with that log message, but shame on them.

== Perl script ==
#!/usr/bin/perl
use SVN::Dumpfile;
use strict;

my $olddf = SVN::Dumpfile->open(file => "original.dmp");
my $newdf = $olddf->copy->create(file => "new.dump");

while ( my $node = $olddf->read_node ) {
  if ($node->property('svn:log') ne 'This is an empty revision for
padding.') {
    $newdf->write_node($node);
  }
}

== Dump File Sample ==

Revision-number: 66
Prop-content-length: 112
Content-length: 112

K 7
svn:log
V 38
This is an empty revision for padding.
K 8
svn:date
V 27
2009-06-18T13:13:48.000000Z
PROPS-END

Revision-number: 67
Prop-content-length: 112
Content-length: 112

K 7
svn:log
V 38
This is an empty revision for padding.
K 8
svn:date
V 27
2009-06-23T12:38:37.000000Z
PROPS-END
Received on 2012-09-24 15:59:28 CEST

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

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