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

Re: replace conflict permutations

From: Neels Janosch Hofmeyr <neels_at_elego.de>
Date: Tue, 25 Aug 2009 15:08:41 +0200

Julian Foad wrote:
> Neels Janosch Hofmeyr wrote:
>> Hi TC folks,
>>
>> after being disappointed in svn's current awareness/handling of
>> tree-conflicts during incoming replace, I felt the desire to have a set of
>> tests that cover all the possible cases. But I find 1652 of them :o
>>
>> [[[
>> REPLACE CASES DURING MERGE:
>>
>> actions | reasons
>> -------------|------------------
>> fwf | - | - | d | -
>> dwd | m | h | m | c
>> fwd | p | | p |
>> dwf | mp | | mp |
>
> Hi Neels.
>
> When "action" is changing the node kind, it doesn't make sense to talk
> of whether it's also "modified". Similarly for "reason" when reason is a
> replacement. So:

Right, for dwf, I can't think of any content modifications.

But it might make a difference whether the added directory is empty or
whether it has more content inside (e.g. missing or stray 'Skipping...'
messages?).

And the property mods are still possible. I am thinking 'replaced and set a
property' vs. 'replaced and didn't set a property', to prove that
tree-conflicts and property additions don't interfere with each other.

In a particular case, when the incoming replace set a property with the same
name as a local property addition, it is treated as a separate conflict from
the tree-conflict, and that's bad. See attached script.

But you're right, should be ok to test that separately. It still gives me a
sense of uncertainty. To be sure, we should actually test every single
variant on its own. But we won't since it's not practical. Fine.

>
> | actions | ...
> |--------------| ...
> | fwf | - | -
> | dwd | m | h
> | | p |
> | | mp |
> |----------|
> | fwd |
> | dwf |
> |--------------
>
> Next, don't try to test all different kinds of modification in all these
> combinations. Just have "different" versus "identical" in this batch of
> tests. Have a separate set of tests just for testing that different
> actions are correctly detected:
>
> | actions | reasons
> |--------------|------------------
> | fwf | - | - | (just pick one reason)
> | dwd | m | h |
> | | p | |
> | | mp | |
>
> and another set for testing that all different reasons are correctly
> detected (just pick one action).
>
> Another thought. When "action" is replacing with a node of the same
> kind, we might assume that the replacement node should differ from the
> ancestor/base node. (If it is identical, we might want to treat it
> specially as it's close to a no-op, but I don't think we have discussed
> doing that.) It is more interesting to ask whether it is identical to or
> different from the target node that it clashes with on the receiving
> ("local") side.

Yes, good point.

>
>
>> 4*4*2*(4 + 2*2*4)*2 = 1652 permutations
>
> (I make that 1280 but who cares?)

Maybe it's a good number to impress raging users with... I didn't realize
myself that there are over a thousand variants in which replace conflicts
can manifest. I was thinking more like six. :P

BTW, in attached script, see how the reason is 'local add', even though it
was a local prop, and the action is 'incoming add', even though it was a
replace. (Probably a lot of such cases still hidden in the bushes.)

~Neels

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

#!/bin/bash

## CONFIGURE THIS:
## The next line is the only line you should need to adjust.
## (and uncomment all four lines)
#SVNDIR=/my/svn/trunk
#alias svn=${SVNDIR}/subversion/svn/svn
#alias svnserve=${SVNDIR}/subversion/svnserve/svnserve
#alias svnadmin=${SVNDIR}/subversion/svnadmin/svnadmin

svn --version
URL=file:///`pwd`/repos
rm -rf repos wc
svnadmin create repos
svn co -q ${URL} wc

set -x
cd wc

## ACTUAL TEST

mkdir -p trunk/dir
svn add trunk
svn ci -m r1

svn cp -m r2 ^/trunk ^/branch
svn up

# on the branch, replace the dir
svn rm branch/dir
svn ci -m r3
svn mkdir branch/dir
# also add a conflicting property.
svn ps propname otherval branch/dir
svn ci -m r4

# on trunk, set a prop on the dir, don't commit it.
svn ps propname propval trunk/dir

# merge the dir replacement onto trunk (that has the property set).
# When omitting the --accept option, this goes into interactive prop
# conflict resolution before mentioning tree-conflicts!
svn merge --accept=postpone ^/branch trunk
svn st
# There's a tree-conflict, but it says 'local add'.
svn info trunk/dir
svn pg propname trunk/dir
svn pg propname branch/dir

Received on 2009-08-26 23:49:51 CEST

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.