You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Becroft <Da...@supercorp.com.au> on 2008/01/15 01:38:40 UTC

Calculating result (merge) of multiple revisions

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. 
 
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.
 
Cheers,
Daniel B.

RE: Calculating result (merge) of multiple revisions

Posted by Daniel Becroft <Da...@supercorp.com.au>.
> -----Original Message-----
> From: John Peacock [mailto:john.peacock@havurah-software.org]

> Daniel Becroft wrote:
> > 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.
> 
> It's not a lot of work if you install Trac (or some other 
> equivalent tool) and
> use a pre-commit hook to check for a ticket number.  Then you 
> helpfully have a
> single ticket with all of the associated changesets listed, 
> for easy(?) merging
> later.

Thanks, John.

I've already integrated our change management system to the SVN
repository via the pre- and post-commit hooks, so we already have
the 'ticket' and the associated changesets. I was after the 'merging later' 
portion of your solution.
 
> 1.5 (whenever *that* comes out) will automate the merging 
> aspect, and you can
> get most of that functionality now with svnmerge.py today.  

I'm sorry, but maybe I misworded my question. I am recording each
revision that has been committed against the devel branch for version X against
the appropriate 'ticket' (as above). However, in addition to displaying these
revisions (and the changesets for each), we also want to display a single list of
the overall changes that have been made, ie the net result of the changeset set. 

I don't actually want to be merging and then committing back to the repository.

> But if you have
> multiple tracks of development (trunk, more than one branch 
> you release from),
> you really want to have a tool that helps manage that 
> information.  Subversion
> isn't that tool; something like trac might be...

All the revisions that I care about will be made on the same branch, so I'm not sure 
if that makes it easier or not.

Cheers,
Daniel B.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Calculating result (merge) of multiple revisions

Posted by John Peacock <jo...@havurah-software.org>.
Daniel Becroft wrote:
> 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.

It's not a lot of work if you install Trac (or some other equivalent tool) and
use a pre-commit hook to check for a ticket number.  Then you helpfully have a
single ticket with all of the associated changesets listed, for easy(?) merging
later.

1.5 (whenever *that* comes out) will automate the merging aspect, and you can
get most of that functionality now with svnmerge.py today.  But if you have
multiple tracks of development (trunk, more than one branch you release from),
you really want to have a tool that helps manage that information.  Subversion
isn't that tool; something like trac might be...

HTH

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Calculating result (merge) of multiple revisions

Posted by Hari Kodungallur <hk...@gmail.com>.
On Jan 14, 2008 5:38 PM, Daniel Becroft <Da...@supercorp.com.au>
wrote:

>  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.

Thanks,
-Hari