You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Newman <dn...@unixmonkeys.com> on 2012/09/12 18:02:29 UTC

svndumpfilter and empty revisions

Hi there,
I have received a subversion dump file that contains about 12000 empty
revisions.  There's only one subdirectory in the dump filter so I figured I
could run it through svndumpfilter include subdir --drop-empty-revs
--renumber-revs < src.dmp > filtered.dmp and because the empty revs don't
contain any nodes they'd get filtered.  However, the empty revisions pass
through and end up in the filtered dump file.  The empty revisions contain
only two things, a svn:log property and a svn:date property.

Is this a bug?

-Dave

Re: svndumpfilter and empty revisions

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Nice.  I don't see why svndumpfilter included r66, it might be a bug
(have you tried 1.7.6?).  We could also make the "This is an empty
revision for padding" information available as a revprop --- patches
welcome... (to svndumpfilter/main.c)

David Newman wrote on Mon, Sep 24, 2012 at 09:58:53 -0400:
>  On Fri, Sep 14, 2012 at 6:49 PM, Daniel Shahaf <d....@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

Re: svndumpfilter and empty revisions

Posted by David Newman <dn...@unixmonkeys.com>.
 On Fri, Sep 14, 2012 at 6:49 PM, Daniel Shahaf <d....@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

Re: svndumpfilter and empty revisions

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Can you post the actual parts of the dumpfile for those empty revisions?
(between successive "Revision-number: " lines)

David Newman wrote on Wed, Sep 12, 2012 at 12:02:29 -0400:
> Hi there,
> I have received a subversion dump file that contains about 12000 empty
> revisions.  There's only one subdirectory in the dump filter so I figured I
> could run it through svndumpfilter include subdir --drop-empty-revs
> --renumber-revs < src.dmp > filtered.dmp and because the empty revs don't
> contain any nodes they'd get filtered.  However, the empty revisions pass
> through and end up in the filtered dump file.  The empty revisions contain
> only two things, a svn:log property and a svn:date property.
> 
> Is this a bug?
> 
> -Dave