[Svnmerge] Merge, revert, merge may not commit added files

Blair Zajac blair at orcaware.com
Wed Jun 7 12:37:49 PDT 2006


I ended up with a bad merge, that is, the merge committed but it did not contain 
the entire commit that was the source of the merge.

This happens when you do:

1) Add a file on a trunk.
2) Commit the file.
3) Run svnmerge.py on the branch.
4) Do a recursive revert: svn revert -R .
5) DO NOT delete the newly added file in the branch.
6) Re-run svnmerge.py to merge the same commit.

What will happen is that 'svn merge' will see the already existing file and not 
merge the addition to the branch.  So when you go to commit, you get everything 
but that file added to the branch.

So I think that the current 'svn status' check for modifications isn't good 
enough, and that svnmerge.py should check for the existance of any files in the 
target of the merge before continuing.

See the script below which reproduces this.  You'll see this:

svn merge -r 4:5 file:///home/blair/tmp/repos/trunk .
Skipped 'file2'

Regards,
Blair


#!/bin/sh -x

rm -fr repos wc
svnadmin create repos
svn co file://`pwd`/repos wc
cd wc
svn mkdir trunk
touch trunk/file
svn add trunk/file
svn ci -m ''
svn mkdir branches
svn ci -m ''
svn cp trunk branches/b1
svn ci -m ''
cd branches/b1/
svnmerge -s -v -v init
svn ci -F svnmerge-commit-message.txt
cd ../../trunk/
touch file2
svn add file2
svn ci -m ''
cd ..
cd branches/
cd b1/
svnmerge  -s -v -v merge
svn revert -R .
svnmerge  -s -v -v merge
svn status



More information about the Svnmerge mailing list