Reproduction recipe:
#!/bin/sh -x
# Create the repo and set an environment variable to refer to it.
svnadmin create repo
R=file://`pwd`/repo
# Checkout the working copy and cd to it.
svn co $R wc
cd wc
# Create two directories that act as lines of development/branches
svn mkdir devel branch
svn commit --message 'setup'
# In devel create a directory and commit
cd devel
svn mkdir foo
svn commit --message 'add foo'
# In the branch merge the foo dir and commit.
cd ../branch
svn merge -r 1:2 $R/devel
svn commit --message 'Merge r2'
# In devel delete foo and commit
cd ../devel
svn rm foo
svn commit --message 'delete foo'
# Now put foo back.
svn mkdir foo
svn commit --message 'readd foo'
# On branch merge the delete and readd of the dir.
# This will fail saying the revisions don't match.
cd ../branch
svn merge -r 2:5 $R/devel
# Cleanup the failed merge
svn revert -R .
# We can also get another error saying that the URLs
# don't match if the BASE of the directory that will
# be deleted and readded in the working copy is the same
# as the end of our merge.
svn up -r 5
svn merge -r 2:5 $R/devel
The first merge will produce:
subversion/libsvn_wc/adm_files.c:902: (apr_err=155000)
svn: Revision 5 doesn't match existing revision 3 in 'foo'
and the second will produce:
subversion/libsvn_wc/adm_files.c:911: (apr_err=155000)
svn: URL 'file:///home/breser/ts/case1/repo/devel/foo' doesn't match existing
URL 'file:///home/breser/ts/case1/repo/branch/foo' in 'foo'
The problem is that check_adm_exists() which is called by svn_wc_ensure_adm()
which is called by svn_wc_add() is being given the URL the merge is coming from
and the revision of the end revision of the merge. However, the dir being
deleted and then being readded will be scheduled deleted at this point, so it's
URL and rev will not match what the readd will create.
I believe that check_adm_exists() should ignore the URL and rev tests entirely
in the case of the working copy being scheduled for deletion. A patch making
this change and adding test suite coverage will be forthcoming.
Note: My work on diagnosing this issue was funded by Transplace, LLC. I thank
them for their funding and assistance in working on this.