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

svn:mergeinfo and revert

From: Paul Burba <pburba_at_collab.net>
Date: 2007-07-06 23:13:22 CEST

Today in IRC the question came up of how the revert of a portion of a
merge should effect mergeinfo.

Currently on trunk, if you merge -rX:Y URL PATH, then you revert a child
of PATH, but not PATH itself, the mergeinfo set on PATH by the intial
merge stays the same. For example, given:

A vanilla greek tree
r2: 'A' copied to 'A_COPY'
r3: text changes to 'A/D/H/psi'
r4: text change to 'A/D/G/rho'

>svn pl -vR
Properties on 'A_COPY':
  svn:mergeinfo : /A:1

>svn merge -r2:4 %URL%/A A_COPY
--- Merging r3 through r4:
U A_COPY\D\G\rho
U A_COPY\D\H\psi

>svn pl -vR
Properties on 'A_COPY':
  svn:mergeinfo : /A:1,3-4

# Revert one part of the merge
>svn revert A_COPY\D\H\psi
Reverted 'A_COPY\D\H\psi'

# Revert the rest of it
>svn revert A_COPY\D\G\rho
Reverted 'A_COPY\D\G\rho'

# The only local mod now
# is the mergeinfo itself!
>svn st
 M A_COPY

>svn pl -vR
Properties on 'A_COPY':
  svn:mergeinfo : /A:1,3-4

This is a contrived example yes, but it shows the potential problem.
Now if you want to revert part of a merge you can reverse merge those
portions away, rather than reverting them. Say you didn't want the
change to psi, reverse merge it and it get's overriding mergeinfo:

>svn merge -r2:4 %URL%/A A_COPY
--- Merging r3 through r4:
U A_COPY\D\G\rho
U A_COPY\D\H\psi

>svn merge -r4:2 %URL%/A/D/H/psi A_COPY/D/H/psi
--- Merging r4 through r3:
G A_COPY\D\H\psi

>svn pl -vR
Properties on 'A_COPY':
  svn:mergeinfo : /A:1,3-4
Properties on 'A_COPY\D\H\psi':
  svn:mergeinfo : /A/D/H/psi:1

So, FWIW, there is a work-around.

Should revert update the mergeinfo on the reverted path to reflect the
fact that no changes were merged into it?

>svn merge -r2:4 %URL%/A A_COPY
--- Merging r3 through r4:
U A_COPY\D\G\rho
U A_COPY\D\H\psi

>svn revert A_COPY\D\H\psi
Reverted 'A_COPY\D\H\psi'

>svn pl -vR
Properties on 'A_COPY':
  svn:mergeinfo : /A:1,3-4
Properties on 'A_COPY\D\H\psi':
  svn:mergeinfo : /A/D/H/psi:1

>svn st
 M A_COPY
M A_COPY\D\G\rho
 M A_COPY\D\H\psi

The thing I really don't like about this is that revert actually leaves
the reverted path with a local change (the overriding mergeinfo), bleh!
Plus, would a second revert "really" revert all local changes, including
the overriding mergeinfo. As I write this I think this solution is
bogus. But if we want revert to be "merge sensitive" what else could we
do?

~~~~~

One thing I'd really like to know is how often do people revert a
portion of a merge? Is this a common use case? If this is something
you do, what is your expectation re mergeinfo? Are there cases where
you *wouldn't* want the mergeinfo on the reverted path to be overridden?

Any thoughts on this appreciated.

Thanks,

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 7 00:45:43 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.