[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Subversion Issue: 'delete file' not transmitted to server when performing multiple merge-commit

From: <Neil.Tuffs_at_rwe.com>
Date: Thu, 13 Jan 2011 16:12:04 +0000

Dear Users,

My user reported that an extra file existed in the repository after
performing a merge (claiming this file was not in his working copy prior
to the commit). My initial thought was they had done the merges out of
sequence causing the deletion of a file before it was added, the user
was adamant this was not the case.

I created a copy of the repository (up to the revision immediately
before the merge) and reproduced the merge. The working copy was
correct however once committed the extra file appeared in the
repository. What appears to be the issue was when a revision containing
and add folder with files is merged, then delete one of the files in a
subsequent revision merge, the working copy is correct but the "delete"
was not transmitted to the server (only the add folder & contents). If
each merge revision was committed separately then the issue does not
appear (this is *not* a practical work-around since the merge-commit is
one logical unit of work - i.e. all the changes related to one defect).

We are currently using Subversion 1.6.12 (client & server), Apache 2.2
(server) and TortoiseSVN 1.6.10 (clients) in a Windows only environment
(Server 2003 / XP).

I have created a test script that reproduces the issue (the file that
should be deleted is 'trunk/folder3/file6.txt')

This script should be run twice (copy it to two separate directories),
once performing three merges with three commits (gives correct result)
and once performing three merges with one commit.

REM build starting structure
md start
md start\branches
md start\tags
md start\trunk
md start\trunk\folder1
echo > start\trunk\folder1\file1.txt
md start\trunk\folder2
echo > start\trunk\folder2\file2.txt
echo > start\trunk\folder2\file3.txt

REM initiate repository (set repo= saves code)
svnadmin create repo
set repo=file:///%cd:\=/%/repo

svn import start %repo% -m "Import Starting Structure"
svn copy %repo%/trunk %repo%/branches/dev -m ""

svn checkout %repo%/branches/dev dev

REM add new files
echo > dev\folder1\file4.txt
svn add dev/folder1/file4.txt
echo > dev\folder2\file5.txt
svn add dev/folder2/file5.txt
svn commit dev -m "Add some new files"

REM add new folder
md dev\folder3
echo > dev\folder3\file6.txt
echo > dev\folder3\file7.txt
svn add dev/folder3
REM modify a file
echo >> dev\folder2\file3.txt
svn commit dev -m "Add new folder/files + change a file"

svn del dev/folder2/file5.txt
svn del dev/folder3/file6.txt
svn commit dev -m "Delete some files"

svn checkout %repo%/trunk trunk

svn merge %repo%/branches/dev_at_3 trunk
REM comment-out on second run!!!
svn commit trunk -m "Merge changes back"

svn merge %repo%/branches/dev_at_4 trunk
REM comment-out on second run!!!
svn commit trunk -m "Merge changes back"

svn merge %repo%/branches/dev_at_5 trunk
svn commit trunk -m "Merge changes back"

svn ls -R trunk

The working copy (trunk) will be identical after both runs, however the
repositories are different. The file "file6.txt" that was deleted from
the "branches/dev/folder3" in revision 5 is not removed from
"trunk/folder3" when merged at the same time that this folder was added
in revision 4.

Awaiting an acknowledgement (and a "buddy" to confirm).

Neil Tuffs
Configuration & Release Management

RWE Supply & Trading GmbH
Windmill Hill Business Park
Whitehill Way

Tel (Internal): 7 322 2705
Tel (External): +44 (0)1793 892705
Fax: +44 (0)1793 893560
E-mail: neil.tuffs_at_rwe.com
Received on 2011-01-13 18:41:18 CET

This is an archived mail posted to the Subversion Dev mailing list.