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

Alan Barrett apb at cequrux.com
Sat Feb 11 01:51:48 PST 2006


I attach two scripts demonstrating what I believe are two bugs in
svnmerge.py.  I am using the version of svnmerge.py distributed
with subversion-1.3.0.  It identifies itself as "svnmerge r17383
modified: 2005-11-16 01:57:56 +0100 (Wed, 16 Nov 2005)".

The first bug is that, when a file is deleted in the top level directory
of the source branch, "svnmerge avail" in the destination branch fails
with an error like this:

    svnmerge: command execution failed (exit code: 1)
    svn log --quiet -r2:6 "file:///wherever/repo/trunk/file"
    svn: File not found: revision 6, path '/trunk/file'

(The error does not occur when a file is deleted in a subdirectory of
the source branch; only when it is deleted in the top level directory of
the source branch.)

The second bug is that, when a file in the source branch is first
modified and then deleted, "svnmerge merge" in the destination branch
fails to delete the file.  It prints a message like this:

    Skipped missing target: 'file'

(The error does not occur if I use "svn merge -r 4:6 URL", but does
occur if I use "svnmerge.py merge -r5-6", which should mean almost the
same thing.)

--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

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

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/file
svn commit -m "Modified file in trunk" # rev 5

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

(
  cd branch
  svnmerge.py avail # BUG: fails with the following output:
  # svnmerge: command execution failed (exit code: 1)
  # svn log --quiet -r2:6 "file:///wherever/repo/trunk/file"
  # svn: File not found: revision 6, path '/trunk/file'
  #
  # Note that the error does not occur if the file is in a subdirectory.
)
-------------- 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 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

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

(
  cd branch
  svnmerge.py avail # works, prints "5-6"
  svnmerge.py merge -r5-6 # BUG: fails to delete subdir/file, and prints this:
  # Skipped missing target: 'file'
  #
  # Note that "svn merge -r 4:6 ${REPO_URL}/trunk" works properly.
)


More information about the Svnmerge mailing list