[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: Dave Lawrence <dlawrence_at_ad-holdings.co.uk>
Date: Tue, 13 May 2008 12:47:22 +0100

Karl Fogel wrote:
> 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

OK. To get 1.4.5 server and 1.5.0-dev client on the same PC I used the
Cygwin installation I already had for the server.
Then from Cygwin:
$ ./server_setup.sh 1> setup_out.txt 2> setup_err.txt
 From CMD
> client_test 1> test_out.txt 2> test_err.txt

All files attached, except setup_err.txt which was empty. The error in
test_out.txt comes from the final svn command

This isn't to do with Cygwin by the way, it happens on with a Linux
server aswell (although that was 1.3.1). I suspect my observation that
it doesn't happen with file:// is related to your observation that it
doesn't happen with a 1.5.0-dev server.

C:\SVN\tests>echo off
svn, version 1.5.0 (dev build)
   compiled May 9 2008, 00:11:53

Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

Checked out revision 0.
A test.txt
Adding test.txt
Transmitting file data .
Committed revision 1.
Sending test.txt
Transmitting file data .
Committed revision 2.
"test.txt contents:"
"Text added at rev 1"
"Text added at rev 2"
Path: test.txt
Name: test.txt
URL: svn://localhost/bug_demo_repos/test.txt
Repository Root: svn://localhost/bug_demo_repos
Repository UUID: e83a2bf4-20e0-11dd-8576-f766ed43d4b4
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Rev: 2
Last Changed Date: 2008-05-13 12:37:36 +0100 (Tue, 13 May 2008)
Text Last Updated: 2008-05-13 12:37:36 +0100 (Tue, 13 May 2008)
Checksum: 2647bfbceb4cd54748ea92711d463507

U test.txt
Updated to revision 1.
"test.txt contesnts:"
"Text added at rev 1"
Path: test.txt
Name: test.txt
URL: svn://localhost/bug_demo_repos/test.txt
Repository Root: svn://localhost/bug_demo_repos
Repository UUID: e83a2bf4-20e0-11dd-8576-f766ed43d4b4
Revision: 1
Node Kind: file
Schedule: normal
Last Changed Rev: 1
Last Changed Date: 2008-05-13 12:37:35 +0100 (Tue, 13 May 2008)
Text Last Updated: 2008-05-13 12:37:37 +0100 (Tue, 13 May 2008)
Checksum: 914e47386c90ac2aa2efa5614d0c11e4

"Now update with --depth empty"
At revision 2.
"test.txt contents:"
"Text added at rev 1"
Path: test.txt
Name: test.txt
URL: svn://localhost/bug_demo_repos/test.txt
Repository Root: svn://localhost/bug_demo_repos
Repository UUID: e83a2bf4-20e0-11dd-8576-f766ed43d4b4
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Rev: 1
Last Changed Date: 2008-05-13 12:37:35 +0100 (Tue, 13 May 2008)
Text Last Updated: 2008-05-13 12:37:37 +0100 (Tue, 13 May 2008)
Checksum: 914e47386c90ac2aa2efa5614d0c11e4

"Update without depth parameter"
At revision 2.
"test.txt contents"
"Text added at rev 1"
Path: test.txt
Name: test.txt
URL: svn://localhost/bug_demo_repos/test.txt
Repository Root: svn://localhost/bug_demo_repos
Repository UUID: e83a2bf4-20e0-11dd-8576-f766ed43d4b4
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Rev: 1
Last Changed Date: 2008-05-13 12:37:35 +0100 (Tue, 13 May 2008)
Text Last Updated: 2008-05-13 12:37:37 +0100 (Tue, 13 May 2008)
Checksum: 914e47386c90ac2aa2efa5614d0c11e4

echo off
rd bug_demo /s /q
svn --version
svn co svn://localhost/bug_demo_repos bug_demo
cd bug_demo
echo "Text added at rev 1" > test.txt
svn add test.txt
svn ci test.txt -m=""
echo "Text added at rev 2" >> test.txt
svn ci test.txt -m=""
echo "test.txt contents:"
type test.txt
svn info test.txt
svn up test.txt -r1
echo "test.txt contesnts:"
type test.txt
svn info test.txt
echo "Now update with --depth empty"
svn up test.txt --depth empty
echo "test.txt contents:"
type test.txt
svn info test.txt
echo "Update without depth parameter"
svn up test.txt
echo "test.txt contents"
type test.txt
svn info test.txt
svn up test.txt -r1
cd ..

#!/bin/sh

svnserve --version

REPOS=bug_demo_repos
# Delete the previous experiment
rm -rf bug_demo_repos
svnadmin create bug_demo_repos
echo "[general]" > $REPOS/conf/svnserve.conf
echo "anon-access = write" >> $REPOS/conf/svnserve.conf
echo "auth-access = write" >> $REPOS/conf/svnserve.conf

svnserve -d --root .

svnserve, version 1.4.5 (r25188)
   compiled Sep 19 2007, 23:10:31

Copyright (C) 2000-2006 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.

svn: Checksum mismatch for '.svn\text-base\test.txt.svn-base'; expected: '2647bfbceb4cd54748ea92711d463507', actual: '914e47386c90ac2aa2efa5614d0c11e4'

---------------------------------------------------------------------
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-13 13:48:02 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.