I am using subversion to manage my source code but I often run into a problem, any time I rename a folder and I modify a file in that folder, subversion goes haywire when I try and merge.
I am looking to find out how other people manage this kind of conflict.
Instead of trying to explain exactly what I did to get the issue, here is a script that generates the conflict I am asking about :
Run this script on a Linux machine that has subversion installed and it'll create a conflict. Make sure the folder /tmp/svn/ contains nothing otherwise this script will destroy whatever is in the folder :
#!/bin/bash
svn --version
mkdir /tmp/svn
cd /tmp/svn/
rm -rf /tmp/svn/repo
rm -rf /tmp/svn/co
rm -rf /tmp/svn/work
svnadmin create /tmp/svn/repo/
svn mkdir file:///tmp/svn/repo/branches/ --message ' setup '
svn mkdir file:///tmp/svn/repo/trunk/ --message ' setup '
svn mkdir file:///tmp/svn/repo/tags/ --message ' setup '
svn mkdir file:///tmp/svn/repo/trunk/folder --message ' setup '
svn mkdir file:///tmp/svn/repo/trunk/fun --message ' setup '
echo date > tmp
svn import -m 'setup' tmp file:///tmp/svn/repo/trunk/folder/MyCode.txt
svn cp file:///tmp/svn/repo/trunk/ file:///tmp/svn/repo/branches/work --message 'branch'
svn co file:///tmp/svn/repo/branches/work/ work
date >> work/folder/MyCode.txt
svn commit work/ --message 'Commit file'
svn up work/
svn rename file:///tmp/svn/repo/trunk/folder file:///tmp/svn/repo/trunk/fun/folder/ --message 'rename trunk'
svn merge ^/trunk work
Here is the conflict that is created by this script :
--- Merging r7 through r9 into 'work':
C work/folder
A work/fun/folder
A work/fun/folder/MyCode.txt
--- Recording mergeinfo for merge of r7 through r9 into 'work':
U work
Tree conflict on 'work/folder'
> local dir edit, incoming dir delete upon merge
Select: (r) mark resolved, (p) postpone, (q) quit resolution, (h) help: p
Summary of conflicts:
Tree conflicts: 1
Here is some information from my subversion : svn, version 1.8.8 (r1568071) compiled Aug 13 2014, 17:12:39 on x86_64-pc-linux-gnu
What is the correct way to resolve this issue?
Thanks,
David