You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Michael Quigley <mi...@michael9.com> on 2004/01/07 04:51:57 UTC
Changing Dump Paths.
I have a single repository that contains a couple of different projects I'd
like to split into separate repositories, like such:
http://svn:6666/repository/project-a/
http://svn:6666/repository/project-b/
I'd like two have two repositories named:
http://svn:6666/project-a/
http://svn:6666/project-b/
I can dump my repository and use svndumpfilter to separate the contents into
two separate dump files. That's simple. I end up with the following when I
load the separated dumps into their new repositories:
http://svn:6666/project-a/project-a/
http://svn:6666/project-b/project-b/
Does anyone have a simple recipe for removing the first path element from the
paths in a dump file, so that I can separate these two projects into two
repositories without the extra directory? I'm looking for something like the
'patch -p<n>' option for svndumpfilter. ;)
Any advice would be appreciated.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Jan Hendrik <ja...@bigfoot.com>.
Concerning Re: Changing Dump Paths.
Michael Quigley wrote on 7 Jan 2004, 11:26, at least in part:
> That's not the problem. Again, I have a repository:
>
> http://svn:6666/repository/
>
> It contains two directories, 'project-a' and 'project-b':
>
> http://svn:6666/repository/project-a/
> http://svn:6666/repository/project-b/
>
> I dump the repository:
>
> $ svnadmin dump http://svn:6666/repository > dumpfile
>
> I separate the projects:
>
> $ cat dumpfile | svndumpfilter include project-a > project-a-dumpfile
> $ cat dumpfile | svndumpfilter include project-b > project-b-dumpfile
>
> I create two new repositories:
>
> $ svnadmin create /raid/subversion/project-a
> $ svnadmin create /raid/subversion/project-b
>
> I load my dumps:
>
> $ svnadmin load /raid/subversion/project-a < project-a-dumpfile
> $ svnadmin load /raid/subversion/project-b < project-b-dumpfile
>
> I end up with:
>
> $ svn co file:///raid/subversion/project-a
> $ find project-a
> project-a/
> project-a/project-a/
> project-a/project-a/1
> project-a/project-a/2
> ...
That's logical: you just dumpfiltered one part of your repository, but
that does not change anything else. Before "repository" was the
root of your repos, project-a and project-b just the first branches of
your folder tree. Now "subversion/project-a" and "subversion/project-
b" resp. are roots of your new now two repositories. And the old
folder trees (or what you left of them in each case) start there.
Once I dumpfiltered all *.JPG files from a repository; this just
removed the files, but did not change anything to the folder
structure.
However, I would think that you can simply move the contents of
project-a/project-a up one level and are done (delete the then
empty second project-a folder).
Best regards
Jan Hendrik
---------------------------------------
Freedom quote:
Capitalism is not an 'ism.'
It is closer to being the opposite of an 'ism,'
because it is simply the freedom of ordinary people
to make whatever economic transactions they can mutually agree to.
-- Thomas Sowell
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Michael Quigley <mi...@michael9.com>.
Folker Schamel said:
> Michael Quigley wrote:
>
>> I load my dumps:
>>
>> $ svnadmin load /raid/subversion/project-a < project-a-dumpfile
>> $ svnadmin load /raid/subversion/project-b < project-b-dumpfile
>
> I didn't try this out, but what about the following:
>
> $ svnadmin load /raid/subversion < project-a-dumpfile
> $ svnadmin load /raid/subversion < project-b-dumpfile
/raid/subversion is just a regular directory, not a repository.
It seems to me that svndumpfilter just needs an extra function from stripping
path components from the front of paths.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Folker Schamel <sc...@spinor.com>.
Michael Quigley wrote:
> I load my dumps:
>
> $ svnadmin load /raid/subversion/project-a < project-a-dumpfile
> $ svnadmin load /raid/subversion/project-b < project-b-dumpfile
I didn't try this out, but what about the following:
$ svnadmin load /raid/subversion < project-a-dumpfile
$ svnadmin load /raid/subversion < project-b-dumpfile
Cheers,
Folker
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by Jan Hendrik <ja...@bigfoot.com>.
Concerning Re: Changing Dump Paths
mark benedetto king wrote on 9 Jan 2004, 9:47, at least in part:
> The dumpfile is a binary format, even though it looks human-friendly.
> You need to use an 8-bit-clean editor in order to make changes to it
> safely. Perhaps emacs or gvim?
Thanks, Ben, John, Michael, and Tim!
Since doing webfiles in a Windows environment I have exactly that
dump with mixed line endings. Don't want to join the ideological
war between emacs and vi users, but I think SciTE has an option
buried somewhere to leave EOLs untouched, too. Or good old hex
editor should help, too.
However, the general idea behind my quick test with dump editing
was to do, say, cosmetical changes in the dump rather than the
regular way from working copy through commit and update. Like
changing an email address or adding a target attribute to all links,
something like that one wants to be done and then forgotten, but
does not need to propagate to all working copies at once or to
upload all 5000+ files just for this change (rsync definitely not
supported by our hoster) as it could wait till a file is changed
anywhere else. But with checksums this would not work at all of
course, no matter if the editor is clean or dirt ... <g>
Best regards
Jan Hendrik
---------------------------------------
Freedom quote:
... the question becomes,
are you going to have everyone play by the same rules,
or are you going to try to rectify the shortcomings,
errors and failures of the entire cosmos?
Because those things are wholly incompatible.
If you're going to have people play by the same rules,
that can be enforced with a minimum amount
of interference with people's freedom.
But if you're going to try to make the entire cosmos right and just,
somebody has got to have an awful lot of power
to impose what they think is right on an awful lot of other people.
What we've seen, particularly in the 20th century,
is that putting that much power in anyone's hands is enormously dangerous.
-- Thomas Sowell, 1999
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by mark benedetto king <mb...@lowlatency.com>.
On Fri, Jan 09, 2004 at 11:19:11AM +0100, Jan Hendrik wrote:
>
> At least under Win2000 it seems not to be possible to edit the
> dumpfile successfully. When I do so in either SciTE or EditPad and
> then load it into a new repository I get the message "Found
> malformed header block in dumpfiles stream". Comparing filesize
> before and after editing shows the file grew somewhat even if I just
> replaced one character by another. When saving with *nix style line
> endings the load process starts, but then stops for a mismatch of
> checksum. Am I missing something here or is this something I
> have to buy a Linux box for (and learn that OS first)? Not that I
> needed dumpfile editing currently, just was curious, also in regard
> of other possibilities this would offer.
The dumpfile is a binary format, even though it looks human-friendly.
You need to use an 8-bit-clean editor in order to make changes to it
safely. Perhaps emacs or gvim?
--ben
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by kf...@collab.net.
"C. Michael Pilato" <cm...@collab.net> writes:
> [moving to dev@]
>
> John Peacock <jp...@rowman.com> writes:
>
> > In this case, I echo the desire for an option to svndumpfilter
>
> [...]
>
> Oh, and speaking of svndumpfilter, can we heavily document that this
> program is incomplete, theoretically limited, and likely to die? I do
> *not* want to support that code post-1.0.
Sounds fine to me.
Mike and Ben just elaborated on this in conversation, saying:
We don't have anything better for 1.0, so we should still ship this;
but we can document that the long-term plan is to put this
functionality in svnadmin or some other tool with random access to the
repository.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by "C. Michael Pilato" <cm...@collab.net>.
[moving to dev@]
John Peacock <jp...@rowman.com> writes:
> In this case, I echo the desire for an option to svndumpfilter
[...]
Oh, and speaking of svndumpfilter, can we heavily document that this
program is incomplete, theoretically limited, and likely to die? I do
*not* want to support that code post-1.0.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by John Peacock <jp...@rowman.com>.
C. Michael Pilato wrote:
> The Subversion dumpfile format is a binary one that just happens to be
> (mostly) human readable. If you have versioned files with CRLF line
> endings, and you dump that repository, you'll wind up with a dumpfile
> that uses LF line endings for the dump meta-data, but CRLFs will
> appear in the textual content of those files that have such endings.
> This file is likely to break in any text editor, irrespective of OS.
I'm sorry if I have been spreading misleading information then. I have not had
problems editing the dumpfile (which I have done a couple of times), but then
the ones I was editing did not have mixed line endings. I do have an 8-bit
clean editor under Windows (MultiEdit), so if I have to do it there, I can make
extra sure I don't confuse things.
In this case, I echo the desire for an option to svndumpfilter to delete
arbitrary portions of the 'Node-path:' (along the lines of 'patch -p1').
Although it is possible to post hoc move the files around in the repository, it
does cause some history confusion with certain tools (e.g. viewcvs).
Mea culpa
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by "C. Michael Pilato" <cm...@collab.net>.
"Jan Hendrik" <ja...@bigfoot.com> writes:
> Concerning Re: Changing Dump Paths.
> > > > I'd do a simple search and replace to change the paths in the
> > > > project-a-dumpfile and project-b-dumpfile, but that would leave
> > > > empty 'Node-path:' entries lying around and probably cause
> > > > problems (I haven't actually tried it).
>
> At least under Win2000 it seems not to be possible to edit the
> dumpfile successfully. When I do so in either SciTE or EditPad and
> then load it into a new repository I get the message "Found
> malformed header block in dumpfiles stream". Comparing filesize
> before and after editing shows the file grew somewhat even if I just
> replaced one character by another. When saving with *nix style line
> endings the load process starts, but then stops for a mismatch of
> checksum. Am I missing something here or is this something I
> have to buy a Linux box for (and learn that OS first)?
All that you are missing is good council.
The Subversion dumpfile format is a binary one that just happens to be
(mostly) human readable. If you have versioned files with CRLF line
endings, and you dump that repository, you'll wind up with a dumpfile
that uses LF line endings for the dump meta-data, but CRLFs will
appear in the textual content of those files that have such endings.
This file is likely to break in any text editor, irrespective of OS.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths
Posted by Jan Hendrik <ja...@bigfoot.com>.
Concerning Re: Changing Dump Paths.
> > > I'd do a simple search and replace to change the paths in the
> > > project-a-dumpfile and project-b-dumpfile, but that would leave
> > > empty 'Node-path:' entries lying around and probably cause
> > > problems (I haven't actually tried it).
At least under Win2000 it seems not to be possible to edit the
dumpfile successfully. When I do so in either SciTE or EditPad and
then load it into a new repository I get the message "Found
malformed header block in dumpfiles stream". Comparing filesize
before and after editing shows the file grew somewhat even if I just
replaced one character by another. When saving with *nix style line
endings the load process starts, but then stops for a mismatch of
checksum. Am I missing something here or is this something I
have to buy a Linux box for (and learn that OS first)? Not that I
needed dumpfile editing currently, just was curious, also in regard
of other possibilities this would offer.
TIA - Jan Hendrik
---------------------------------------
Freedom quote:
Intellect annuls Fate. So far as a man thinks, he is free ...
The revelation of Thought takes man out of servitude into freedom.
-- Ralph Waldo Emerson, Fate
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Sander Striker <st...@apache.org>.
On Wed, 2004-01-07 at 18:42, John Peacock wrote:
> Michael Quigley wrote:
>
> > $ svnadmin create /raid/subversion/project-a
> > $ svnadmin create /raid/subversion/project-b
>
> Ah, I see now. You named your new repository with the name of your former
> directory.
>
> > I'd do a simple search and replace to change the paths in the
> > project-a-dumpfile and project-b-dumpfile, but that would leave empty
> > 'Node-path:' entries lying around and probably cause problems (I haven't
> > actually tried it).
>
> The 'Node-path' is a combination of the path and a filename. If you delete the
> string 'project-a/' from every Node-path, none should be blank (and the Node
> that creates the 'project-a' directory, you can safely delete) and all files
> will be moved up a single level in the repository.
>
> I just tested this and it works fine.
Don't forget about Node-copyfrom-path:.
Sander
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Michael Quigley <mi...@michael9.com>.
John Peacock said:
> Ah, I see now. You named your new repository with the name of your former
> directory.
Exactly!
> The 'Node-path' is a combination of the path and a filename. If you delete
> the string 'project-a/' from every Node-path, none should be blank (and the
> Node that creates the 'project-a' directory, you can safely delete) and all
> file will be moved up a single level in the repository.
>
> I just tested this and it works fine.
Excellent. That's what I'll do. But again it would be nice if either 'svnadmin
load' or svndumpfilter supported this. 'svnadmin load' supports rooting the
dump deeper in the repository, but not making the dump shallower.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by John Peacock <jp...@rowman.com>.
Michael Quigley wrote:
> $ svnadmin create /raid/subversion/project-a
> $ svnadmin create /raid/subversion/project-b
Ah, I see now. You named your new repository with the name of your former
directory.
> I'd do a simple search and replace to change the paths in the
> project-a-dumpfile and project-b-dumpfile, but that would leave empty
> 'Node-path:' entries lying around and probably cause problems (I haven't
> actually tried it).
The 'Node-path' is a combination of the path and a filename. If you delete the
string 'project-a/' from every Node-path, none should be blank (and the Node
that creates the 'project-a' directory, you can safely delete) and all files
will be moved up a single level in the repository.
I just tested this and it works fine.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Michael Quigley <mi...@michael9.com>.
John Peacock said:
> No, then you should't need to edit it at all. What was your exact command to
> load the dumpfile? It should have been:
>
> svnadmin load /path/to/repository < dumpfile
>
> i.e. you do not want (or need) the '--parent-dir arg' option.
That's not the problem. Again, I have a repository:
http://svn:6666/repository/
It contains two directories, 'project-a' and 'project-b':
http://svn:6666/repository/project-a/
http://svn:6666/repository/project-b/
I dump the repository:
$ svnadmin dump http://svn:6666/repository > dumpfile
I separate the projects:
$ cat dumpfile | svndumpfilter include project-a > project-a-dumpfile
$ cat dumpfile | svndumpfilter include project-b > project-b-dumpfile
I create two new repositories:
$ svnadmin create /raid/subversion/project-a
$ svnadmin create /raid/subversion/project-b
I load my dumps:
$ svnadmin load /raid/subversion/project-a < project-a-dumpfile
$ svnadmin load /raid/subversion/project-b < project-b-dumpfile
I end up with:
$ svn co file:///raid/subversion/project-a
$ find project-a
project-a/
project-a/project-a/
project-a/project-a/1
project-a/project-a/2
...
When what I really want is:
$ find project-a
project-a/
project-a/1
project-a/2
...
The original 'project-a' and 'project-b' directories from the original
repository are no longer necessary, as the new repositories 'project-a' and
'project-b' take the place of these directories.
I'd do a simple search and replace to change the paths in the
project-a-dumpfile and project-b-dumpfile, but that would leave empty
'Node-path:' entries lying around and probably cause problems (I haven't
actually tried it).
Anyone have any advice?
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by John Peacock <jp...@rowman.com>.
Michael Quigley wrote:
> There is no 'project-a/project-a/' in the dumpfile. There is only
> 'project-a/'. I'd do a simple search and replace on the 'Node-path:' entries,
> but that'll end up creating a few empty 'Node-path:' lines. The lines that
> looked like:
No, then you should't need to edit it at all. What was your exact command to
load the dumpfile? It should have been:
svnadmin load /path/to/repository < dumpfile
i.e. you do not want (or need) the '--parent-dir arg' option.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by Michael Quigley <mi...@michael9.com>.
John Peacock said:
> Open the dumpfile in your favorite editor and replace 'project-a/project-a/'
> with 'project-a/'. It's one of the advantages that the dumpfile is [mostly]
> just text.
There is no 'project-a/project-a/' in the dumpfile. There is only
'project-a/'. I'd do a simple search and replace on the 'Node-path:' entries,
but that'll end up creating a few empty 'Node-path:' lines. The lines that
looked like:
Node-path: project-a
...will end up as:
Node-path:
Is this a problem?
I guess the other alternative could be to simple do the import into the new
repository and then:
$ svn co http://svn:6666/project-a/
$ cd project-a
$ svn mv * ..
$ svn ci
Anyone have any other ideas? Is the empty 'Node-path:' line a problem? Maybe
I'll look at the svndumpfilter and see about adding this functionality
directly.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Changing Dump Paths.
Posted by John Peacock <jp...@rowman.com>.
Michael Quigley wrote:
> Does anyone have a simple recipe for removing the first path element from the
> paths in a dump file, so that I can separate these two projects into two
> repositories without the extra directory? I'm looking for something like the
> 'patch -p<n>' option for svndumpfilter. ;)
Open the dumpfile in your favorite editor and replace 'project-a/project-a/'
with 'project-a/'. It's one of the advantages that the dumpfile is [mostly]
just text.
HTH
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org