Login | Register
My pages Projects Community openCollabNet

Discussions > users [DISABLED] > Merge trunk to branch clobers changes in renamed directory.

subversion
Discussion topic

There will be a brief maintenance window every Friday at 17:00 Pacific.
For further details, see CollabNet's maintenance and upgrade policy.

Back to topic list

Merge trunk to branch clobers changes in renamed directory.

Author Jason K Howlett <Jason_K_Howlett at raytheon dot com>
Full name Jason K Howlett <Jason_K_Howlett at raytheon dot com>
Date 2009-11-03 17:27:26 PST
Message Hi,

I have the following issue with SVN 1.6.1. I have two branches of the
trunk. In branch 1 I modify a file in some subdirectory of the source tree
and commit it. In branch 2 I rename the grandparent directory that
contains the file modified on branch b1. Branch b2 get reintegrated to the
trunk. The trunk then gets merged into branch b1. The original directory
containing the modified file is deleted without a tree conflict occurring
and the changes are lost. Is this a known problem, and how do I work
around it to be sure branch changes don't get clobbered when updating from
the trunk. The Bash script below recreates the stated problem.

Thanks for the help.

#!/bin/bash -v
rm -rf /tmp/svnprob
mkdir -p /tmp/svnprob

svnadmin create /tmp/svnprob/testrepo
mkdir -p /tmp/svnprob/repo/tr​unk/src/dir1/dir1_1
mkdir -p /tmp/svnprob/repo/tr​unk/src/dir1/dir1_2
mkdir -p /tmp/svnprob/repo/tr​unk/src/dir2
mkdir -p /tmp/svnprob/repo/branches
echo "Original line, file1.cpp" >>
/tmp/svnprob/repo/tr​unk/src/dir1/dir1_1/​file1.cpp
echo "Original line, file1.cpp" >>
/tmp/svnprob/repo/tr​unk/src/dir1/dir1_1/​file1.h
svn import /tmp/svnprob/repo/ file:///tmp/svnprob/testrepo/ -m "Initial
import"
rm -rf /tmp/svnprob/repo
svn co file:///tmp/svnprob/testrepo/ /tmp/svnprob/repo
svn cp file:///tmp/svnprob/​testrepo/trunk
file:///tmp/svnprob/​testrepo/branches/b1​ -m "Create branch b1"
svn up /tmp/svnprob/repo

echo "Another line to file.cpp" >>
/tmp/svnprob/repo/br​anches/b1/src/dir1/d​ir1_1/file1.cpp
echo "Another line to file.h" >>
/tmp/svnprob/repo/br​anches/b1/src/dir1/d​ir1_1/file1.h
svn ci -m "Branch change to file1.cpp" /tmp/svnprob/repo/branches/b1

svn cp file:///tmp/svnprob/​testrepo/trunk
file:///tmp/svnprob/​testrepo/branches/b2​ -m "Create branch b2"
svn up /tmp/svnprob/repo

cd /tmp/svnprob/repo/br​anches/b2/src
svn mv dir1 dir1_new
cd /tmp/svnprob/repo/branches/b2
svn ci -m "Rename dir1 to dir1_new"
cd /tmp/svnprob/repo/trunk
svn up
svn merge --reintegrate file:///tmp/svnprob/​testrepo/branches/b2​ .
svn ci -m "Merged branch b2 into trunk" /tmp/svnprob/repo/trunk

cd /tmp/svnprob/repo/branches/b1
svn merge file:///tmp/svnprob/​testrepo/trunk .
echo "SHOULDN'T A TREE CONFLICT OCCUR HERE?"
svn ci -m "Merge trunk to branch b1"

svn diff
file:///tmp/svnprob/​testrepo/branches/b1​/src/dir1/dir1_1/fil​e1.cpp@3
file:///tmp/svnprob/​testrepo/branches/b1​/src/dir1_new/dir1_1​/file1.cpp
echo "Oh no! My changes are lost"
Attachments

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

Merge trunk to branch clobers changes in renamed directory. Jason K Howlett <Jason_K_Howlett at raytheon dot com> Jason K Howlett <Jason_K_Howlett at raytheon dot com> 2009-11-03 17:27:26 PST
Messages per page: