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

Re: digging whole history of the file

From: Ryan Schmidt <subversion-2008b_at_ryandesign.com>
Date: Tue, 3 Jun 2008 03:19:01 -0500

On Jun 3, 2008, at 01:57, Victoria Muntean wrote:

> How can I do (script or svn command) two following things:
> 1) for given file x, print series of diffs -rN-1:N for *all*
> revisions
> of the file (fopr every revision that 'svn log x' reports, that is)

> For (1), I wonder if there is faster way than parsing svn log x +
> bunch of 'svn diff'. This can be really slow.

I'd do it just like that.

You can get the list of revisions with:

svn log -q $REPO/path/to/x \
| sed -n 's%^r%%p' \
| awk '{print $1}'

For each revision, run:

svn diff -c $REV $REPO/path/to/x

> 2) for given file x and range of lines M:N in this file, print all
> revisions that touched on this region of lines (and optionally,
> diffs for that revision for that region only)

Not sure how to do this. You can start with:

svn blame $REPO/path/to/x \
| sed -n $M,$Np \
| awk '{print $1}'

This will print the most recent revisions to touch each of the lines
in the range $M to $N. However, where you go from here is unclear.
Any of those revisions, or preceding revisions, might have added or
removed lines. How do you programmatically know where your range of
lines is in the earlier revision?

To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-03 10:19:44 CEST

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.