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

Textual mods applied to obstructed items

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 28 Jan 2009 22:26:10 +0200 (IST)

[ I'm not sure if it's a known issue or not, but I *think* it isn't. ]

It seems that 'svn up' doesn't check whether an item is obstructed before
applying textual changes to it.

For example, the attached script causes one obstructed item to get a
textual conflict, and another to be silently become non-obstructed
(destroying local changes). I haven't found a way to cause it to modify
an unversioned file :-).

I ran across this when I symlinked one wc's svnadmin_tests.py into the
other wc (i.e., 'cd wc1; ln -sf ../wc2/svnadmin_tests.py svnadmin_tests.py')
and ran 'svn up'.

Daniel

Script:
[[[
#!/bin/sh

SVNDIR=${HOME}/src/svn/trunk

if true; then
        svn=${SVNDIR}/subversion/svn/svn
        svnserve=${SVNDIR}/subversion/svnserve/svnserve
        svnadmin=${SVNDIR}/subversion/svnadmin/svnadmin
else
        svn=svn
        svnadmin=svnadmin
        svnserve=svnserve
fi

rm -rf repos wc1 wc2

$svnadmin create repos
ln -s /bin/true repos/hooks/pre-revprop-change
URL=file://`pwd`/repos

$svn co -q $URL wc1

# r1
for i in iota iota2; do
        touch wc1/$i
        $svn add -q wc1/$i
done
$svn ci wc1 -q -m "Add iota and iota2"

# r2
echo line1 > wc1/iota
echo line1 > wc1/iota2
$svn ci wc1 -q -m "Change iota and iota2"

# get wc2
$svn co -q $URL wc2

# create an obstruction
echo line1 > wc2/unversioned-file
echo "Conflicting line" > wc2/target
ln -sf target wc2/iota
ln -sf unversioned-file wc2/iota2
echo "=== wc2/iota* are obstructed:"
file wc2/iota*
$svn st wc2/iota*
echo "=== Updating wc2 to r1:"
$svn up --accept=postpone -r 1 wc2
echo "=== Result: textual conflict on an obstructed object:"
$svn st wc2/iota
echo "=== Result: the new symlink at iota2 has been broken:"
file wc2/iota2
echo "=== Result: unversioned-file has not been changed (good):"
cat wc2/unversioned-file
]]]

Output:
[[[
=== wc2/iota* are obstructed:
wc2/iota: symbolic link to `target'
wc2/iota2: symbolic link to `unversioned-file'
~ wc2/iota
~ wc2/iota2
=== Updating wc2 to r1:
C wc2/iota
U wc2/iota2
Updated to revision 1.
Summary of conflicts:
  Text conflicts: 1
=== Result: textual conflict on an obstructed object:
C wc2/iota
=== Result: the new symlink at iota2 has been broken:
wc2/iota2: empty
=== Result: unversioned-file has not been changed (good):
line1
]]]

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1064310
Received on 2009-01-28 21:38:11 CET

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