Differences between revisions 10 and 11
Revision 10 as of 2008-01-04 15:24:01
Size: 1176
Editor: abuehl
Comment: +cat
Revision 11 as of 2008-01-13 16:12:08
Size: 1218
Editor: abuehl
Comment: lowercase links
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
A conflict occurs when two independent ["ChangeSet"]s modify overlapping sections of a file in different ways. During a ["Merge"], ["Mercurial"] may require the assistance of the user through a
["MergeProgram"] which can be used to ["Resolve"] those conflicts.
A '''conflict''' occurs when two independent [:ChangeSet:changesets] modify overlapping sections of a file in different ways. During a [:Merge:merge], Mercurial may require the assistance of the user through a
[:MergeProgram:merge program] which can be used to [:Resolve:resolve] those conflicts.
Line 6: Line 6:
If the ["MergeProgram"] is not a graphical tool, If the merge program is not a graphical tool,
Line 8: Line 8:
the ["Conflict"] in the file using ''conflict markers''.
A text editor can be used to ["Resolve"] the conflicts manually.
the conflict in the file using ''conflict markers''.
A text editor can be used to resolve the conflicts manually.
Line 55: Line 55:
See also: TutorialConflict See also: TutorialConflict, ImergeExtension

Conflict

A conflict occurs when two independent [:ChangeSet:changesets] modify overlapping sections of a file in different ways. During a [:Merge:merge], Mercurial may require the assistance of the user through a [:MergeProgram:merge program] which can be used to [:Resolve:resolve] those conflicts.

If the merge program is not a graphical tool, a common fallback behavior is to use diff3 for highlighting the conflict in the file using conflict markers. A text editor can be used to resolve the conflicts manually.


For example:

Given the base file:

$ cat base
A
B
C

assuming local is your modified copy of base:

$ cat local
A
B - my local changes
C

and assuming other is another modified copy of base:

$ cat other
A
B - changes made by others
C

then there's obviously a conflicting change on the B line. The "merged" content, as produced by the GNU diff3 program, will look like this:

$ diff3 -m local base other
A
<<<<<<< local
B - my local changes
||||||| base
B
=======
B - changes made by others
>>>>>>> other
C

See also: TutorialConflict, ImergeExtension


CategoryGlossary

Conflict (last edited 2012-11-11 18:40:24 by abuehl)