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

Re: Calculating result (merge) of multiple revisions

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: Mon, 14 Jan 2008 17:57:56 -0800

On Jan 14, 2008 5:38 PM, Daniel Becroft <Daniel.Becroft_at_supercorp.com.au>

> Hi all,
> Is there an SVN command, script or utility around that will calculate the
> new result of multiple, not necessarily consecutive revisions?
> That is, given a set of revisions {r10,r11,r14,r17,r19,r25}, calculate
> what files were modified OVERALL.

First of all, I don't think there is one command in svn that can merge a
given set of revisions (or cherry pick). Currently it works only on revision
ranges and not on a set of non-contiguous revisions (I mean, non-contiguous
within the scope of a revision tree).

> E.g.
> 1)
> User A adds a new file, Foo.java, in r10
> User A deletes the file, Foo.java in r17
> Result: Foo.java should not be reported in the list
> 2)
> User A modifies an existing file, Foo.java, in r11
> User B modifies the file, Foo.java in r12 (not in our revision set)
> User A backs out their changes for Foo.java in r19
> Result: Foo.java should not be reported in the list
> 3)
> User A modifies the file, Bar.java, in r11
> User B deletes the file, Bar.java in r15 (not in our revision set)
> Result: Bar.java should be reported in the list
> The reason I am after this sort of thing, is that there are multiple
> revisions for a given piece of work that we may need to do (including
> reworks due to bugs, etc), but we would like to see an overall changelist of
> the files involved to achieve the work.
> This seems like alot of work, so hence the reason I am asking if there is
> something already built into subversion, or if someone has already written
> something to do this.

Since svn works only revision range (or one revison), it means that even if
someone writes a script to get the changes made within each revision and
evaluate the affected files, it will be difficult to do the 2nd example that
you provided. When the later version undoes the change from an earlier
revision, you will have to do some fancy stuff to figure out whether the
change was an undo operation or not. Basically, I think scripting this will
be difficult.

If you can work within a revision range, you can use the --dry-run option to
the merge command. This option as the name suggests, will not do the merge,
but will just show you the files that will be affected by the merge.

The current dev version (1.5) of svn, has some merge tracking features.
Cherry picking is one of the listed TODOs for merge tracking. May be you can
check that out to see if the dev version has something that can help.

Received on 2008-01-15 02:58:18 CET

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.