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

Re: list all tags/branches a for an arbitrary file(s)/dir(s)

From: Baz <brian.ewins_at_gmail.com>
Date: 2006-05-03 13:37:09 CEST

On 5/3/06, Philip M. Gollucci <pgollucci@p6m7g8.com> wrote:
> What I need now is to spot check a random set of files to see if the
> tagging/branching/history got created correctly.
>
> The functionality I'm missing is equivalent to
> cvs log path/to/file
> or
> cvs status -v path/to/file

You can try something like this:
svn log -qv $REPO|perl -ne 'if (/^(r\d+)/) {$r=$1}; next unless
/^(\s|-)+/; if (/^\s*A.*\(from/) { $b=$_; $c++; } elsif (/^---/) {
print "$r $b" if $c == 1; $c = 0; } else {$c+=2}' |less

which prints branch points like:
r9582 A /blah/branches/hoopity (from /blah/trunk:9581)

What I did there was parse the log for changes, looking for commits
where an 'A xxx (from yyy:rrr)' line that are the only change in a
revision (so they can't be a move)

It'll fail if theres something in a branch commit other than a single
copy. You can get more accurate results if you have xmlstarlet
installed:

svn log -qv --xml $REPO | xml sel -t -c
"/log/logentry[paths/path[@action='A'][@copyfrom-rev][not(@copyfrom-path=../path[@action='D'])]]"

(warning: this will take some time! You might want to try it with
--limit xxx on svn log first, or dump the log to a file first) This
prints out all log entries where a copy (ie branch, tag) occurred. You
can obviously do this with xsl too, the xpath above should help.

-Baz

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 3 13:38:16 2006

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.