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

Re: Bug: svn up file --depth empty

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Mon, 12 May 2008 15:29:59 -0400

Dave Lawrence <dlawrence_at_ad-holdings.co.uk> writes:
> To reproduce this problem:
> 1) Create a test repo
> 2) Set it up with a server (svnserve 1.4.5 in my case)
> 3) Add a file as <server url>/tests/test.txt
> 4) make a few revisions (3 will do) - make the text obviously indicate
> the revision number
> 5) svn co <server url>/tests/ .
> 6) svn up test.txt -r1
> 7) svn up test.txt --depth empty
>
> Now the working copy is broken. The file working copy and working
> base are still at revision 1, the checksum is incorrect (presumably
> the checksum is at the head revision). Errors such as "checksum
> incorrect" and "delta ended unexpectedly" will result if trying to do
> further updates.
>
> I originally saw this in TSVN - after I reported that Stefan changed a
> use of "svn_depth_empty" to "svn_depth_files" and that particular
> feature of TSVN now works OK (12885).
>
> I don't know whether it is at all valid to update a single file with
> depth set to empty, but it certainly shouldn't cause the working copy
> to be corrupted.
>
> Using svn.exe as built by the TortoiseSVN nightly build, from the head
> revision of 1.5.x (a few days ago).
>
> Windows XP SP2.
>
> b.t.w this doesn't seem to happen with file:// protocol. I've seen it
> with 2 different server configs:
> 1) Apache with svn 1.3.1 on Linux
> 2) svnserve 1.4.5 on Cygwin

I haven't been able to reproduce it using the script below, but that's
with server of 1.5.0-dev. Before I try with 1.4.5, could you write a
similar script that reproduces it against a 1.4.x server, so we know
that we're talking about the same basic recipe? Thanks.

-Karl

--------------------------------------------------------------------------
#!/bin/sh

# You probably need to adjust just the next line to run this script.
SVNDIR=/home/kfogel/src/subversion

SVN=${SVNDIR}/subversion/svn/svn
SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin

# Select an access method. If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
#
# URL=http://localhost/SOMETHING/repos
URL=svn://localhost/repos
# URL=file:///`pwd`/repos

rm -rf repos wc import-me

${SVNADMIN} create repos

# These are for svnserve only.
echo "[general]" > repos/conf/svnserve.conf
echo "anon-access = write" >> repos/conf/svnserve.conf
echo "auth-access = write" >> repos/conf/svnserve.conf

# The server will only be contacted if $URL is svn://foo, of course.
${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
# And put the kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k

echo "### Making a Greek Tree for import..."
mkdir import-me
mkdir import-me/tests
echo "### Done."
echo ""
echo "### Importing it..."
(cd import-me; ${SVN} import -q -m "Initial import." ${URL})
echo "### Done."
echo ""

${SVN} co -q ${URL}/tests wc

cd wc
echo "New file." >> test.txt
${SVN} add -q test.txt
${SVN} ci -q -m "Add test.txt."
${SVN} up -q
echo "Made this change in r2." >> test.txt
${SVN} ci -q -m "Change test.txt in r2."
echo "Made this change in r3." >> test.txt
${SVN} ci -q -m "Change test.txt in r3."
echo "Made this change in r4." >> test.txt
${SVN} ci -q -m "Change test.txt in r4."
echo "Made this change in r5." >> test.txt
${SVN} ci -q -m "Change test.txt in r5."
cd ..

rm -rf wc
${SVN} co -q ${URL}/tests wc

cd wc
${SVN} up test.txt -r1
${SVN} up test.txt --depth empty
echo ""
echo "### No corruption so far... Can we commit another change and update?"
echo ""
echo "Another change, in r6." >> test.txt
${SVN} ci -q -m "Change test.txt in r6."
${SVN} up
echo ""
echo "### Yup, apparently so."
echo ""
cd ..

# Put kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k
./k

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-05-12 21:30:25 CEST

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.