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

How to handle conflicts in merge operations

From: Igor Sverkos <igor.sverkos_at_googlemail.com>
Date: Tue, 8 Dec 2009 13:52:08 +0100

Hello!

I have questions regarding conflict handling and best practice with merge
operations.

That's how our repository looks actual (HEAD == r1):

/branches                     @1
/tags                         @1
/trunk                        @1
/trunk/file1.c                @1
/trunk/setEnv.cmd             @1

Now, we will branch /trunk into /branches/v1.0. After commit (r2), our
repository looks like:

/branches                     @2
/branches/v1.0                @2
/branches/v1.0/file1.c        @1
/branches/v1.0/setEnv.cmd     @1
/tags                         @1
/trunk                        @1
/trunk/file1.c                @1
/trunk/setEnv.cmd             @1

We will start developing of v1.0 in our new branch (/branches/v1.0).
We add "file2.c" and edit "setEnv.cmd". After commit (r3), our repository looks
like:

/branches                     @3
/branches/v1.0                @3
/branches/v1.0/file1.c        @1
/branches/v1.0/file2.c        @3
/branches/v1.0/setEnv.cmd     @3
/tags                         @1
/trunk                        @1
/trunk/file1.c                @1
/trunk/setEnv.cmd             @1

Another team member will fix a bug "/trunk/setEnv.cmd" After commit (r4), our
repository looks like:

/branches                     @3
/branches/v1.0                @3
/branches/v1.0/file1.c        @1
/branches/v1.0/file2.c        @3
/branches/v1.0/setEnv.cmd     @3
/tags                         @1
/trunk                        @4
/trunk/file1.c                @1
/trunk/setEnv.cmd             @4

While another team member is fixing a bug in trunk, another member has started
to refactoring our project. He renamed "setEnv.cmd" into
"setEnvironment.cmd" using the "svn rename" command. After the commit (r5), our
repository looks like:

/branches                             @5
/branches/v1.0                        @5
/branches/v1.0/file1.c                @1
/branches/v1.0/file2.c                @3
/branches/v1.0/setEnvironment.cmd     @5
/tags                                 @1
/trunk                                @4
/trunk/file1.c                        @1
/trunk/setEnv.cmd                     @4

Now we want to sync our branch with the latest version of trunk, to port the the
latest fixes. That's where our problems starts.

Doing a merge will result in a tree conflict:
SVN wants to merge the changes from "/trunk/setEnv.cmd" (r4) into
"/branches/v1.0/setEnv.cmd", but there is no "setEnv.cmd" (the file was renamed
in r5).

If you renamed the file in trunk and just modified "setEnv.cmd" in the branch,
then your tree conflict would be in "/branches/v1.0/setEnv.cmd" and there would
be a "newly" added file "setEnvironment.cmd".

My questions:
1) How would you deal with such a conflict? If there a many changes, how would
one keep track of them? Is there a way to see "setEnvironment.cmd" was
"setEnv.cmd"?

2) In the example, would you do a manuall diff between "/trunk/setEnv.cmd" and
"/branches/v1.0/setEnvironment.cmd"?

-- 
Regards,
Igor
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2428173
Please start new threads on the <users_at_subversion.apache.org> mailing list.
To subscribe to the new list, send an empty e-mail to <users-subscribe_at_subversion.apache.org>.
Received on 2009-12-08 15:05:54 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.