[Svnmerge] Bugs when merging revisions that modify and delete files

Alan Barrett apb at cequrux.com
Mon Feb 13 01:06:02 PST 2006


On Sun, 12 Feb 2006, Giovanni Bajo wrote:
> >> I attach two scripts demonstrating what I believe are two bugs in
> >> svnmerge.py.
> Both bugs are actually a same bug in svnmerge init, which was already
> fixed in SVN. You can try with a later version of svnmerge.py:
> http://svn.collab.net/repos/svn/trunk/contrib/client-side/svnmerge.py.
> r18345 is fine for instance.

Thank you; that version does fix these bugs.  But if I

        (a) modify a file in the trunk, and commit;
        (b) make any unrelated change anywhere, and commit;
        (c) delete the modified file in the trunk

and then I try to merge both the modification (a) and the deletion (c)
in a single invocation of svnmerge.py, the file gets edited but not
deleted, and the file is not marked as being in a conflicted state.  I
attach a script to demonstrate this.

There's are two simple workarounds: merge (a), commit, then merge (c);
or notice the "Skipped 'file'" message, handle it like a conflict, and
delete the file before committing the results of the merge.

I don't know whether to call this a subversion bug (not marking the
skipped file as a conflict), or a svnmerge bug (not doing enough extra
magic to handle this case), or simply expected behaviour that has to be
handled at another layer.

--apb (Alan Barrett)
-------------- next part --------------
#!/bin/sh

TOP="$(pwd)"
REPO_DIR="${TOP}/repo"
REPO_URL="file://${REPO_DIR}"
WC="${TOP}/wc"

rm -rf "${REPO_DIR}" "${WC}" # clean up from previous runs

svnadmin create "${REPO_DIR}"
svn checkout "${REPO_URL}" "${WC}"

cd "${WC}"

svn mkdir trunk
svn commit -m "Create trunk" # rev 1

svn mkdir trunk/subdir
echo "First line of file" >trunk/subdir/file
svn add trunk/subdir/file
svn commit -m "Add subdir and subdir/file to trunk" # rev 2

svn update

svn copy trunk branch
svn commit -m "Create branch as a copy of trunk" # rev 3

(
  cd branch
  svnmerge.py init
  svn commit -m "Initialised svnmerge processing for trunk->branch" # rev 4
)

echo "Modified line in file" >trunk/subdir/file
svn commit -m "Modified subdir/file in trunk" # rev 5

echo "This is unrelated" >trunk/subdir/unrelated
svn add trunk/subdir/unrelated
svn commit -m "Add subdir/unrelated to trunk" # rev 6

svn delete trunk/subdir/file
svn commit -m "Deleted subdir/file in trunk" # rev 7

(
  cd branch
  svnmerge.py avail # works, prints "5-7"
  svnmerge.py merge -r5,7 # appears to succeed, but does not delete subdir/file
	# XXX: It would be nice if this worked better.
	# Note that the underlying "svn merge -r 4:5" edits subdir/file,
	# but the "svn merge -r "6:7" fails to delete subdir/file,
	# and prints "Skipped 'subdir/file'".
)


More information about the Svnmerge mailing list