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

Re: Strategy for computing "diff history" of an element?

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: Wed, 29 Jul 2009 16:33:32 -0700

On Wed, Jul 29, 2009 at 3:39 PM, David M. Karr <dk068x_at_att.com> wrote:

> With other SCMs, I've written scripts which would take an element name
> and run "<tool> diff" multiple times. The first one would be the
> difference between HEAD and its predecessor. The second one between the
> pred of HEAD and its pred, and so on, until the element doesn't exist at
> some earlier revision. I'm trying to figure out how to write that sort
> of script with Subversion. To start, I don't see how to get a revision
> number associated with HEAD, or get the predecessor of that revision
> number.
>

svn log command will give you all the revision details. for eg., the
following command will give you a list of revisions associated with a
particular file -- the first in the list being the HEAD.

  svn log -q <file URL> | sed -n "s/^r\([0-9]*\) .*/\1/p"

Using this list, you can do a series of "svn diff -c <revision> <file URL>"
to get the diffs that you need.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2376768

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-07-30 01:40:26 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.