Gill Bates
Gill Bates

Reputation: 15237

SVN does not see conflicts between original folder and moved version

I have a folder in trunk with old directory structure, and branch where several directories were grouped as subfolders of new folder:

old(trunk) > root/dirA
                 /dirB
                 /dirC

new(branch) > root/dirGROUP/dirA
                           /dirB
                           /dirC

In new directories was moved with svn move command.

There are text conflicts exist between files of old dirA and new dirA.

And when I do svn merge --reintegrate http://url.to.the.branch SVN just deletes old dirA, dirB, dirC and gives me just new directory structure, without noticing conflicts between files of old and new dirA versions as if it was independent directories. Files in new dirA were merged with A status.
Does SVN supports such merges by default? If yes it turns out that I missed something
If no - how to teach SVN to notice this conflicts?

Upvotes: 3

Views: 150

Answers (1)

Amarpreet Singh
Amarpreet Singh

Reputation: 2270

This might help now, I have two solutions for this.The problem you faced can be overcome with these approach.

Solution1 :

Say you have following files

/branch/foo/src/com
/branch/foo/test/com
/trunk/src/main/java/com
/trunk/src/test/java/com

Before you moved src/com to src/main/java/com and test/com to src/test/java/com you could have done:

cd $TRUNK
svn merge -r N:M http://server/branch/foo .

What you could do now is:

cd $TRUNK
svn merge -r N:M http://server/branch/foo/src/com src/main/java/com
svn merge -r N:M http://server/branch/foo/test/com src/test/java/com

OR what else you could have done is

Solution2 :

1) Do svn up to get latest copy of code ( in old dir structure)

svn up 

2) copy dirs with unix commands in dir dir stucture

cp -r /root/dirA /root/dirGroup/
cp -r /root/dirB /root/dirGroup/
cp -r /root/dirC /root/dirGroup/ 

Now you have local copy in your desired path.

3) Delete the old files.

svn -d file names.
svn ci 

4) Add new files an d dirs svn add dirA svn add dirB svn add dirC svn ci for all three dir

Upvotes: 3

Related Questions