Skip to content
Browse files

New example script: svndump_replace_author.pl

  • Loading branch information...
1 parent c06a8ee commit d0bb8246a2b0b2f8ecd17e3b0ee6fe6946ed3798 @book book committed Nov 1, 2006
Showing with 21 additions and 0 deletions.
  1. +21 −0 eg/svndump_replace_author.pl
View
21 eg/svndump_replace_author.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use SVN::Dump;
+
+die "svndump_replace_author.pl <from> <to> [file]" if @ARGV < 2;
+
+my ( $from, $to ) = splice( @ARGV, 0, 2 );
+
+my $dump = SVN::Dump->new( { file => @ARGV ? $ARGV[0] : '-' } );
+
+while ( my $rec = $dump->next_record() ) {
+ if ( $rec->type() eq 'revision'
+ && $rec->get_header( 'Revision-number' ) != 0
+ && $rec->get_property('svn:author') eq $from )
+ {
+ $rec->set_property( 'svn:author' => $to );
+ }
+ print $rec->as_string();
+}
+

0 comments on commit d0bb824

Please sign in to comment.
Something went wrong with that request. Please try again.