Difference between revisions of "Subversion"

From RobolaboWiki
Jump to: navigation, search
(Created page with "<!--__NOTOC__--> <h1> Subversion Manager </h1> <h2> Dump </h2> To create a file with all the repo <pre> svnadmin dump <SVN_REPO_NAME> > <SVN_DUMPFILE_NAME> </pre> <h2> Lo...")
 
Line 24: Line 24:
 
<pre>
 
<pre>
 
svndumpfilter include <PATH_TO_DESIRED_DIR> --drop-empty-revs --renumber-revs --preserve-revprops < <SVN_DUMPFILE_NAME> > <SVN_DESIRED_DIR_DUMPFILE_NAME>
 
svndumpfilter include <PATH_TO_DESIRED_DIR> --drop-empty-revs --renumber-revs --preserve-revprops < <SVN_DUMPFILE_NAME> > <SVN_DESIRED_DIR_DUMPFILE_NAME>
 +
</pre>
 +
 +
However, the <SVN_DESIRED_DIR_DUMPFILE_NAME> keeps the directory structure of the old repo.
 +
If you want to delete it:
 +
 +
 +
1) Edit <SVN_DESIRED_DIR_DUMPFILE_NAME>
 +
2) Remove the top directory (e.g.):
 +
<pre>
 +
Node-path: 2007-2008
 +
Node-action: add
 +
Node-kind: dir
 +
Prop-content-length: 10
 +
Content-length: 10
 +
 +
PROPS-END
 +
</pre>
 +
 +
3) Remove all  the references to the top directory (e.g. in vim)
 +
<pre>
 +
%s/2006-2007//g
 
</pre>
 
</pre>

Revision as of 11:12, 8 January 2013


Subversion Manager

Dump

To create a file with all the repo

svnadmin dump <SVN_REPO_NAME> > <SVN_DUMPFILE_NAME>

Load

To create a repo from a dump file

svnadmin create <SVN_REPO_NAME>
svnadmin load <SVN_DUMPFILE_NAME> < <SVN_REPO_NAME>

Filter

To create a repo file with a specific directory within the dump file

svndumpfilter include <PATH_TO_DESIRED_DIR> --drop-empty-revs --renumber-revs --preserve-revprops < <SVN_DUMPFILE_NAME> > <SVN_DESIRED_DIR_DUMPFILE_NAME>

However, the <SVN_DESIRED_DIR_DUMPFILE_NAME> keeps the directory structure of the old repo. If you want to delete it:


1) Edit <SVN_DESIRED_DIR_DUMPFILE_NAME> 2) Remove the top directory (e.g.):

Node-path: 2007-2008
Node-action: add
Node-kind: dir
Prop-content-length: 10
Content-length: 10

PROPS-END

3) Remove all the references to the top directory (e.g. in vim)

%s/2006-2007//g