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

WC corruption after "svn cp -r"

From: Eelco Dolstra <eelco_at_cs.uu.nl>
Date: 2006-07-12 15:54:52 CEST

Hi,

I ran into a bug in Subversion when I tried to revive an old revision of
a directory in a working copy under a new name, i.e., "svn cp dir -r REV
dir-old". If I then do "svn up" and commit, the contents of certain
files in the working copy can mismatch with what ends up being committed
in the repository. Subsequent operations on the working copy (such as a
new commit) then produce a "Base checksum mismatch" error.

This occurs with both Subversion 1.3.2 and 1.4.0rc1.

Recipe to reproduce the bug:

$ svn --version
svn, version 1.4.0 (Release Candidate 1)
    compiled Jul 12 2006, 12:02:24
...

$ uname -a
Linux tyros 2.6.13-15.10-default #1 Fri May 12 16:27:12 UTC 2006 i686
i686 i386 GNU/Linux

$ svnadmin create repo

$ repo=$(pwd)/repo

$ svn co file:///$repo wc
Checked out revision 0.

$ cd wc

$ svn mkdir dir

$ echo "test 123" > dir/foo

$ svn add dir/foo
A dir

$ svn -m "" ci
Adding dir
Adding dir/foo
Transmitting file data .
Committed revision 1.

$ echo "test 456" > dir/foo

$ svn -m "" ci
Sending dir/foo
Transmitting file data .svn
Committed revision 2.

$ svn cp dir -r 1 dir-old
A dir-old/foo
Updated to revision 1.
A dir-old

$ svn up <-- critical step, without this it works fine
At revision 3.

$ svn -m "" ci
Adding dir-old
Adding dir-old/foo
   <-- odd empty line here
Committed revision 3.

$ cat dir-old/foo
test 123

$ svn cat file://$repo/dir-old/foo
test 456 <-- note mismatch with working copy

$ echo "test 789" > dir-old/foo

$ svn -m "" ci
Sending dir-old/foo
Transmitting file data .svn: Commit failed (details follow):
svn: Base checksum mismatch on '/dir-old/foo':
    expected: 655dc4b8b68d6db8c2fd6d9b3852136b
      actual: 835a9514a38f56824a2d3d6e4c629567

Note: the only effect of "svn up" is that it changes
dir-old/.svn/entries as follows:

*** dir-old-orig/.svn/entries 2006-06-22 16:02:30.000000000 +0200
--- dir-old/.svn/entries 2006-06-22 16:02:45.000000000 +0200
***************
*** 24,28 ****
      copied="true"
      last-author="eelco"
      kind="file"
! prop-time="2006-06-22T14:02:29.000000Z"/>
   </wc-entries>
--- 24,29 ----
      copied="true"
      last-author="eelco"
      kind="file"
! prop-time="2006-06-22T14:02:29.000000Z"
! revision="2"/>
   </wc-entries>

-- 
Eelco Dolstra | http://www.cs.uu.nl/~eelco
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 12 15:55:51 2006

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