I can reproduce the corrupted WC reported by David Wallace with 1.6.17.
1.7.x does not show this bug.

I have attached a reproduction script that is roughly based on David's
typescript, but is only a fraction of the size.

The error occurs like this:

- use Subversion release 1.6.17
- update WC
- locally delete file 'foo'
- commit
- do *not* update.
- merge, so that file 'foo' is added (e.g. from another branch).
  status becomes: A    +  foo
- update
- A tree conflict "local edit, incoming delete" is flagged.

This is obviously wrong. The local 'foo' has been deleted (and committed).
Taking this situation further results in a truly corrupted WC:

- resolve the tree conflict
- commit

The committed result (svn cat <URL>) is different from the on-disk contents,
even though the file is claimed to be up-to-date.

Trunk doesn't show this behavior (thumbs up for wc-ng), but we should try to
find a fix for 1.6.x.

stsp, you wanna hunt this down?

Thank you very much, Dave! Seriously bad mojo, as you said. Good work!!
...even though it took ages to deflate your darn typescript ;)

~Neels
#!/usr/bin/env bash

## TO MAKE THIS RUN YOUR CUSTOM COMPILED SVN, two simple options:
## 1. Adjust your PATH to point at your custom installed location:
##      export PATH="$HOME/prefix/svn_trunk/bin:$PATH"
## OR
## 2. Uncomment the four lines below to use aliases into your
##    built source tree. The next line is the only line you should
##    need to adjust.
# SVNDIR=/path/to/built_subversion_source_tree
# function svn() { "$SVNDIR/subversion/svn/svn" "$@"; }
# function svnserve() { "$SVNDIR/subversion/svnserve/svnserve" "$@"; }
# function svnadmin() { "$SVNDIR/subversion/svnadmin/svnadmin" "$@"; }

set -e

svn --version
BASE="$(mktemp -d "/tmp/$(basename "$0").XXX")"
echo "BASE = $BASE"
REPOS="$BASE/repos"
WC="$BASE/wc"
URL="file://$REPOS"
svnadmin create "$REPOS"

# enable all revprop changes
cat > "$REPOS/hooks/pre-revprop-change" <<EOF
#!/usr/bin/env sh
exit 0
EOF
chmod a+x "$REPOS/hooks/pre-revprop-change"

svn co -q "$URL" "$WC"

set +e
set -x
cd "$WC"

## ACTUAL TEST

svn mkdir -m1 ^/a
svn cp -m2 ^/a ^/b
svn up

echo a > a/foo
svn add a/foo
svn ci -m3

echo b > b/foo
svn add b/foo
svn ci -m4

cd b
# Intending to merge from ^/a, knowing that ^/a/foo has been added,
# wanting to replace ./foo with ^/a/foo. Choosing to delete ./foo.
svn up
svn delete foo
svn ci -m5

# !!! forgetting to update !!!

# doing the intended merge to bring in ^/a/foo
svn merge ^/a
# commit complains about out-of-dateness, nothing an update can't fix:
svn up
# what, a tree conflict?
# local edit, incoming add? But it was deleted here!
# This is where the shirt starts hitting the farn. Just to illustrate...

svn resolved foo
cat foo
svn ci -m6

cat foo
svn cat ^/b/foo
set +x
echo "
NOTE:         cat foo shows 'a'
      svn cat ^/b/foo shows 'b'
  They differ though status and info indicate up-to-date-ness:
"
set -x
svn st -v
svn info ./foo
svn info ^/b/foo


## END
set +x
echo "BASE = $BASE"
svn, version 1.6.17 (r1128011)
   compiled Aug 23 2011, 03:00:21

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.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.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

BASE = /tmp/wallace.9S9
+ cd /tmp/wallace.9S9/wc
+ svn mkdir -m1 '^/a'

Committed revision 1.
+ svn cp -m2 '^/a' '^/b'

Committed revision 2.
+ svn up
A    a
A    b
Updated to revision 2.
+ echo a
+ svn add a/foo
A         a/foo
+ svn ci -m3
Adding         a/foo
Transmitting file data .
Committed revision 3.
+ echo b
+ svn add b/foo
A         b/foo
+ svn ci -m4
Adding         b/foo
Transmitting file data .
Committed revision 4.
+ cd b
+ svn up
At revision 4.
+ svn delete foo
D         foo
+ svn ci -m5
Deleting       b/foo

Committed revision 5.
+ svn merge '^/a'
--- Merging r2 through r5 into '.':
A    foo
+ svn up
   C foo
At revision 5.
Summary of conflicts:
  Tree conflicts: 1
+ svn resolved foo
Resolved conflicted state of 'foo'
+ cat foo
a
+ svn ci -m6
Sending        b
Adding         b/foo

Committed revision 6.
+ cat foo
a
+ svn cat '^/b/foo'
b
+ set +x

NOTE:         cat foo shows 'a'
      svn cat ^/b/foo shows 'b'
  They differ though status and info indicate up-to-date-ness:

+ svn st -v
                 6        6 neels        .
                 6        6 neels        foo
+ svn info ./foo
Path: foo
Name: foo
URL: file:///tmp/wallace.9S9/repos/b/foo
Repository Root: file:///tmp/wallace.9S9/repos
Repository UUID: 93b5ffea-cd35-11e0-a951-01932a052799
Revision: 6
Node Kind: file
Schedule: normal
Last Changed Author: neels
Last Changed Rev: 6
Last Changed Date: 2011-08-23 05:11:23 +0200 (Tue, 23 Aug 2011)
Text Last Updated: 2011-08-23 05:11:22 +0200 (Tue, 23 Aug 2011)
Checksum: 60b725f10c9c85c70d97880dfe8191b3

+ svn info '^/b/foo'
Path: foo
Name: foo
URL: file:///tmp/wallace.9S9/repos/b/foo
Repository Root: file:///tmp/wallace.9S9/repos
Repository UUID: 93b5ffea-cd35-11e0-a951-01932a052799
Revision: 6
Node Kind: file
Last Changed Author: neels
Last Changed Rev: 6
Last Changed Date: 2011-08-23 05:11:23 +0200 (Tue, 23 Aug 2011)

+ set +x
BASE = /tmp/wallace.9S9

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to