Login | Register
My pages Projects Community openCollabNet

Discussions > users [DISABLED] > How to handle conflicts in merge operations

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

How to handle conflicts in merge operations

Author Igor Sverkos <igor dot sverkos at googlemail dot com>
Full name Igor Sverkos <igor dot sverkos at googlemail dot com>
Date 2009-12-08 04:52:11 PST
Message 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/setEn​vironment.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/setE​nvironment.cmd"?



--
Regards,
Igor

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

Messages

Show all messages in topic

How to handle conflicts in merge operations Igor Sverkos <igor dot sverkos at googlemail dot com> Igor Sverkos <igor dot sverkos at googlemail dot com> 2009-12-08 04:52:11 PST
Messages per page: