You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Leon Oosterwijk <le...@daveramsey.com> on 2006/09/01 16:29:16 UTC

Chancing the svn:author in a subversion dumpfile

All, 
 
I am trying to migrate from CVS to SVN and have ran into a snag. I would
like to change some author names upon import. I tried to edit the dump
file with a script but this didn't seem to work very well. I understand
that the file is a binary format and therefore might not be easily
edit-able using a text-editor. I tried to use a Perl script but the file
still comes out malformed. 
 
Here are 2 scripts. one works, the other doesn't:
 
# this works. 
cat svndumpfile.dat | perl -e 'while (<STDIN>) {print $_}' >
svndumpfile.dat2
# this replaces the first occurance of leono with leon. (which happens
to be the first svn:author property in this particular case. 
cat svndumpfile.dat | perl -e '$i = 0 ; while (<STDIN>) {if (m/^leono$/
&& $i == 0 ){$i++; $_ =~ s/^leono/leon/gi; }print $_}' >
svndumpfile.dat2

Does anyone have any pointers on how i can change the svn:author
property? 
 
Thanks,
 
Leon
 

Re: Chancing the svn:author in a subversion dumpfile

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/1/06, Mark Phippard <ma...@softlanding.com> wrote:
> "Leon Oosterwijk" <le...@daveramsey.com> wrote on 09/01/2006 12:29:16 PM:
>
> > I am trying to migrate from CVS to SVN and have ran into a snag. I would
>
> > like to change some author names upon import. I tried to edit the dump
> file
> > with a script but this didn't seem to work very well. I understand that
> the
> > file is a binary format and therefore might not be easily edit-able
> using a
> > text-editor. I tried to use a Perl script but the file still comes out
> malformed.
> >
> > Here are 2 scripts. one works, the other doesn't:
> >
> > # this works.
> > cat svndumpfile.dat | perl -e 'while (<STDIN>) {print $_}' >
> svndumpfile.dat2
> > # this replaces the first occurance of leono with leon. (which happens
> to be
> > the first svn:author property in this particular case.
> > cat svndumpfile.dat | perl -e '$i = 0 ; while (<STDIN>) {if (m/^leono$/
> &&
> > $i == 0 ){$i++; $_ =~ s/^leono/leon/gi; }print $_}' > svndumpfile.dat2
> > Does anyone have any pointers on how i can change the svn:author
> property?
>
> Does the author field in the dump file perhaps have a length value stored
> somewhere?

Yes, it does.  It's stored as part of a serialized hash table, which
includes the length as part of the value.  Personally, when I need to
rename authors in a dumpfile I used a slightly hacked version of
svndumptool.py, it didn't take too much effort to teach it how to swap
authors.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Chancing the svn:author in a subversion dumpfile

Posted by Mark Phippard <ma...@softlanding.com>.
"Leon Oosterwijk" <le...@daveramsey.com> wrote on 09/01/2006 12:29:16 PM:

> I am trying to migrate from CVS to SVN and have ran into a snag. I would 

> like to change some author names upon import. I tried to edit the dump 
file 
> with a script but this didn't seem to work very well. I understand that 
the 
> file is a binary format and therefore might not be easily edit-able 
using a 
> text-editor. I tried to use a Perl script but the file still comes out 
malformed. 
> 
> Here are 2 scripts. one works, the other doesn't:
> 
> # this works. 
> cat svndumpfile.dat | perl -e 'while (<STDIN>) {print $_}' > 
svndumpfile.dat2
> # this replaces the first occurance of leono with leon. (which happens 
to be
> the first svn:author property in this particular case. 
> cat svndumpfile.dat | perl -e '$i = 0 ; while (<STDIN>) {if (m/^leono$/ 
&& 
> $i == 0 ){$i++; $_ =~ s/^leono/leon/gi; }print $_}' > svndumpfile.dat2
> Does anyone have any pointers on how i can change the svn:author 
property? 

Does the author field in the dump file perhaps have a length value stored 
somewhere?

Regardless, were you aware that you can change the author once the 
repository is loaded?

svn propset -R n svn:author leon url://server/repos

You could just load the repository and then write a script that runs this 
command for the revisions you want to change.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org