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

tree conflict permanently corrupts working copy

From: Mycroft Holmes <psion.s5_at_gmail.com>
Date: Mon, 20 Apr 2009 14:33:33 +0200

Hi to all,

here's a possible bug in svn 1.6.1 and a detailed testcase.
basically the idea is:
1) get a working copy of DIR2
2) merge a commit from DIR1 that adds a file (this results in a "file
added
with history").
3) copy w.c. to repo DIR3
4) switch w.c. from DIR2 to DIR3

this should do nothing, because DIR3 is a copy of current DIR2, with
all its
local modifications.
instead we get a tree conflict (it is debatable this is the desired
behaviour, but this is not yet the bug!)

5) run 'svn resolve' and accept everything (remember we already know
this is
harmless)

>>> problem 1: you must use 'resolve -R'
>>> problem 2: the conflict is resolved, but there's still a local
modification

6) run 'svn revert . -R'

the new file is reverted (i.e. not under version control any more),
but not
deleted.
don't worry, delete it

HERE'S THE BUG: from this point on, there's no way to see the file
again (revert,
update...).
the only way is to wipe the w.c. entirely and perform a fresh checkout.
note that w.c. does point to DIR3, the new file is present in the
repository,
but the w.c. still
believes this file is unnecessary.

note that in the same situation svn 1.5 would fail during the switch.
here are al the detailed steps (grabbed from a windows command shell):

[C:\svn_repository]svnadmin create test

[C:\svn_repository]md \test

[C:\svn_repository]cd \test\

[C:\test]svn mkdir svn://localhost/test/dir1 -m ""

Committed revision 1.

[C:\test]svn co svn://localhost/test/dir1 .\dir1
Checked out revision 1.

[C:\test]cd dir1

[C:\test\dir1]dir

Volume in drive C is unlabeled Serial number is 5073:9202
Directory of C:\test\dir1\*

20/04/2009 13:39 <DIR> .
20/04/2009 13:39 <DIR> ..
              0 bytes in 0 files and 2 dirs
97,560,604,672 bytes free

[C:\test\dir1]dir > f1.txt

[C:\test\dir1]dir > f2.txt

[C:\test\dir1]dir > f3.txt

[C:\test\dir1]svn add *
svn: Skipping argument: '.svn' ends in a reserved name
A f1.txt
A f2.txt
A f3.txt

[C:\test\dir1]svn ci -m ""
Adding f1.txt
Adding f2.txt
Adding f3.txt
Transmitting file data ...
Committed revision 2.

[C:\test\dir1]svn info
Path: .
URL: svn://localhost/test/dir1
Repository Root: svn://localhost/test
Repository UUID: 780b9876-ce1c-b244-a368-4a41f086a785
Revision: 1
Node Kind: directory
Schedule: normal
Last Changed Rev: 1
Last Changed Date: 2009-04-20 13:38:55 +0200 (Mon, 20 Apr 2009)

[C:\test\dir1]svn st

[C:\test\dir1]svn st -v
                 1 1 ? .
                 2 2 ? f1.txt
                 2 2 ? f2.txt
                 2 2 ? f3.txt

[C:\test\dir1]svn cp . svn://localhost/test/dir2 -m ""

Committed revision 3.

[C:\test\dir1]dir > fnew.txt

[C:\test\dir1]svn add fnew.txt
A fnew.txt

[C:\test\dir1]svn ci -m ""
Adding fnew.txt
Transmitting file data .
Committed revision 4.

[C:\test\dir1]cd ..

[C:\test]svn co svn://localhost/test/dir2 .\dir2
A dir2\f1.txt
A dir2\f2.txt
A dir2\f3.txt
Checked out revision 4.

[C:\test]cd dir2

[C:\test\dir2]svn log svn://localhost/test -v
------------------------------------------------------------------------
r4 | (no author) | 2009-04-20 13:42:00 +0200 (Mon, 20 Apr 2009) | 1 line
Changed paths:
   A /dir1/fnew.txt

------------------------------------------------------------------------
r3 | (no author) | 2009-04-20 13:41:36 +0200 (Mon, 20 Apr 2009) | 1 line
Changed paths:
   A /dir2 (from /dir1:1)
   A /dir2/f1.txt (from /dir1/f1.txt:2)
   A /dir2/f2.txt (from /dir1/f2.txt:2)
   A /dir2/f3.txt (from /dir1/f3.txt:2)

------------------------------------------------------------------------
r2 | (no author) | 2009-04-20 13:39:40 +0200 (Mon, 20 Apr 2009) | 1 line
Changed paths:
   A /dir1/f1.txt
   A /dir1/f2.txt
   A /dir1/f3.txt

------------------------------------------------------------------------
r1 | (no author) | 2009-04-20 13:38:55 +0200 (Mon, 20 Apr 2009) | 1 line
Changed paths:
   A /dir1

------------------------------------------------------------------------

[C:\test\dir2]svn merge -c 4 svn://localhost/test/dir1 .
--- Merging r4 into '.':
A fnew.txt

[C:\test\dir2]svn info
Path: .
URL: svn://localhost/test/dir2
Repository Root: svn://localhost/test
Repository UUID: 780b9876-ce1c-b244-a368-4a41f086a785
Revision: 4
Node Kind: directory
Schedule: normal
Last Changed Rev: 3
Last Changed Date: 2009-04-20 13:41:36 +0200 (Mon, 20 Apr 2009)

[C:\test\dir2]svn st
M .
A + fnew.txt

[C:\test\dir2]svn sw svn://localhost/test/dir3 .
   C fnew.txt
G .
Updated to revision 5.
Summary of conflicts:
  Tree conflicts: 1

[C:\test\dir2]svn st
A +S C fnew.txt
> local add, incoming add upon switch

[C:\test\dir2]svn resolve --accept theirs-full .

>>>>>>>>>> nothing happened???

[C:\test\dir2]svn st
A +S C fnew.txt
> local add, incoming add upon switch

[C:\test\dir2]svn resolve --accept theirs-full . -R
Resolved conflicted state of 'fnew.txt'

>>>>>>>>>> works, but still a local modification here

[C:\test\dir2]svn st
A +S fnew.txt

[C:\test\dir2]svn revert .

[C:\test\dir2]svn st
A +S fnew.txt

[C:\test\dir2]svn revert . -R
Reverted 'fnew.txt'

[C:\test\dir2]svn st
? fnew.txt

[C:\test\dir2]svn info
Path: .
URL: svn://localhost/test/dir3
Repository Root: svn://localhost/test
Repository UUID: 780b9876-ce1c-b244-a368-4a41f086a785
Revision: 5
Node Kind: directory
Schedule: normal
Last Changed Rev: 5
Last Changed Date: 2009-04-20 13:49:47 +0200 (Mon, 20 Apr 2009)

[C:\test\dir2]svn st
? fnew.txt

[C:\test\dir2]del fnew.txt
Deleting C:\test\dir2\fnew.txt
     1 file deleted

[C:\test\dir2]svn up
At revision 5.

[C:\test\dir2]svn revert . -R

[C:\test\dir2]svn st

>>>>>>>>>> no way to see the file again
>>>>>>>>>> even if present in the repository

[C:\test\dir2]dir

Volume in drive C is unlabeled Serial number is 5073:9202
Directory of C:\test\dir2\*

20/04/2009 14:00 <DIR> .
20/04/2009 14:00 <DIR> ..
20/04/2009 13:43 314 f1.txt
20/04/2009 13:43 362 f2.txt
20/04/2009 13:43 405 f3.txt
          1,081 bytes in 3 files and 2 dirs 12,288 bytes allocated
97,559,916,544 bytes free

[C:\test\dir2]svn ls svn://localhost/test/dir3
f1.txt
f2.txt
f3.txt
fnew.txt

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].

  • application/pkcs7-signature attachment: smime.p7s
Received on 2009-04-20 14:34:45 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.