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

Re: Chancing the svn:author in a subversion dumpfile

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-09-01 19:30:30 CEST

On 9/1/06, Mark Phippard <markp@softlanding.com> wrote:
> "Leon Oosterwijk" <leono@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
Received on Fri Sep 1 19:32:13 2006

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