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

Re: Repository re-organisation / moving files

From: David Kramer <david_at_thekramers.net>
Date: 2004-11-22 21:59:07 CET

On Mon, 22 Nov 2004, Toby D. Watson wrote:
> In an earlier post that I dug up it was suggested - if I read it right!
> - that one solution was to dump the repository then recreate it after
> "hacking" the dumpfile. Having examined the dump files produced I am a
> little unclear about what this means.
>
> If anyone could put me right on this that would be very helpful.

I think I was the one to post that.

What I did was edit the dump files in emacs. For each directory and file,
there's a section of headers defining the properties. One of the lines
should say "Node-path:". What I did was do a global search and replace so
the files and directories were laid out the way I wanted. Then I set up
the empty repository and loaded the dumpfile into it. All the files were
laid out in the new arrangement, and I had the full history of each file
and directory intact.

Ferinstance, let's say I had
myproject/bar/branches
myproject/bar/trunk
myproject/bar/tags
myproject/baz/branches
myproject/baz/trunk
myproject/baz/tags
myproject/foo/branches
myproject/foo/trunk
myproject/foo/tags

and I wanted
mypoject/branches/bar
mypoject/branches/baz
mypoject/branches/foo
mypoject/trunk/bar
mypoject/trunk/baz
mypoject/trunk/foo
mypoject/tags/bar
mypoject/tags/baz
mypoject/tags/foo

I would search and replace
"Node-path: myproject/bar/branches"->"Node-path: myproject/branches/bar"
"Node-path: myproject/bar/trunk"->"Node-path: myproject/trunk/bar"
"Node-path: myproject/bar/tags"->"Node-path: myproject/tags/bar"

"Node-path: myproject/baz/branches"->"Node-path: myproject/branches/baz"
"Node-path: myproject/baz/trunk"->"Node-path: myproject/trunk/baz"
"Node-path: myproject/baz/tags"->"Node-path: myproject/tags/baz"

"Node-path: myproject/foo/branches"->"Node-path: myproject/branches/foo"
"Node-path: myproject/foo/trunk"->"Node-path: myproject/trunk/foo"
"Node-path: myproject/foo/tags"->"Node-path: myproject/tags/foo"

You could use sed, perl, an editor, or whatever you're comfortable with,
to do the search and replace.

Just don't forget to include the "Node-path: " part in your search and
replace to guarantee you don't change any text in your source files.

----------------------------------------------------------------------------
DDDD David Kramer david_at_thekramers.net http://thekramers.net
DK KD Some people have told me they don't think a fat penguin really
DKK D embodies the grace of Linux, which just tells me they have never seen
DK KD an angry penguin charging at them in excess of 100mph. They'd be a
DDDD lot more careful about what they say if they had. Linus Torvalds

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Nov 22 22:01:28 2004

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.