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

Re: taking part of a repository: beyond svndumpfilter

From: Jay Berkenbilt <ejb_at_ql.org>
Date: 2005-10-15 05:54:08 CEST

Jay Berkenbilt <ejb@ql.org> wrote:

> I'd like to extract from my subversion repository the entire history
> of some files specified by their paths in the latest revision of the
> repository as they've moved around throughout various layouts,
> branches, and so forth. It seems to me that if I use svndumpfilter
> include /some/path, then any transaction to a file that was at or
> below /some/path *at the time of the transaction* will be included,
> whereas I want would be to include historical information only about
> files at a certain location in the HEAD revision even if they lived in
> other places at other times.

I have written code to do this, which I will describe briefly for the
benefit of someone who finds this in the archives.

There is a pair of programs. The first program parses the output of
svn log --xml -v over the entire repository along with a list of
"paths of interest". It traces back through the history to determine
an exact list of node paths in each revision whose presence
contributes to the history of any node equal to or below any specified
path of interest in the HEAD. It also indicates when a historical
path that was needed at one time is no longer needed. The second
program reads the output of the first program and filters the output
of svnadmin dump to include only the specific parts of the required
revisions. It also fabricates deletes for things it doesn't need
anymore, removes empty revisions, and renumbers revisions.

This code works well for my cases. My repository does some reasonably
complex things like replacing paths with other paths, doing major
rearrangements of high-level directories, and having files' histories
weave through various side branches. I can't swear that I've thought
of all possible cases (in fact, it's a virtual certainty that I
haven't), but it's probably very close.

Code available upon request. This is about 500 lines of perl code.
It doesn't use any apis or subversion commands. It manually parses
the easily parseable dump file and xml log file output. (xml log file
output is processed using XML::Parser.)

-- 
Jay Berkenbilt <ejb@ql.org>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Oct 15 05:56:44 2005

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.