~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/en/user-guide/resolving_conflicts.txt

  • Committer: Ian Clatworthy
  • Date: 2007-11-27 21:17:06 UTC
  • mto: (3054.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3055.
  • Revision ID: ian.clatworthy@internode.on.net-20071127211706-871zcqst0yi5tcvl
make fixes suggested by proof-readers

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Resolving conflicts
 
2
===================
 
3
 
 
4
Workflow
 
5
--------
 
6
 
 
7
Unlike some other tools that force you to resolve each conflict during
 
8
the merge process, Bazaar merges as much as it can and then reports the
 
9
conflicts. This can make conflict resolution easier because the contents
 
10
of the whole post-merge tree are available to help you decide how things
 
11
ought to be resolved. You may also wish to selectively run tests as you go
 
12
to confirm each resolution or group or resolutions is good.
 
13
 
 
14
Listing conflicts
 
15
-----------------
 
16
 
 
17
As well as being reported by the ``merge`` command, the list of outstanding
 
18
conflicts may be displayed at any time by using the ``conflicts``
 
19
command. It is also included as part of the output from the ``status``
 
20
command.
 
21
 
 
22
Resolving a conflict
 
23
--------------------
 
24
 
 
25
When a conflict is encountered, the ``merge`` command puts embedded
 
26
markers in each file showing the areas it couldn't resolve. It also
 
27
creates 3 files for each file with a conflict:
 
28
 
 
29
 * foo.BASE
 
30
 * foo.THIS
 
31
 * foo.OTHER
 
32
 
 
33
where ``foo`` is the name of the conflicted file.
 
34
In many cases, you can resolve conflicts by simply manually editing
 
35
each file in question, fixing the relevant areas and removing the
 
36
conflict markers as you go.
 
37
 
 
38
After fixing all the files in conflict, ask Bazaar to mark them as
 
39
resolved using the ``resolve`` command like this::
 
40
 
 
41
  bzr resolve
 
42
 
 
43
Alternatively, after fixing each file, you can mark it as resolved
 
44
like this::
 
45
 
 
46
  bzr resolve foo
 
47
 
 
48
Among other things, the ``resolve`` command cleans up the BASE,
 
49
THIS and OTHER files from your working tree.
 
50
 
 
51
Using the remerge command
 
52
-------------------------
 
53
 
 
54
In some cases, you may wish to try a different merge algorithm on a
 
55
given file. To do this, use the ``remerge`` command nominating
 
56
the file like this::
 
57
 
 
58
  bzr remerge --weave foo
 
59
 
 
60
where ``foo`` is the file and ``weave`` is one of the available
 
61
merge algorithms. See the online help for ``remerge`` or the
 
62
User Reference for further details.
 
63
 
 
64
Using external tools to resolve conflicts
 
65
-----------------------------------------
 
66
 
 
67
If you have a GUI tool you like using to resolve conflicts, be sure
 
68
to install the *extmerge* plugin. Once installed, it can be used
 
69
like this::
 
70
 
 
71
  bzr extmerge foo
 
72
 
 
73
where ``foo`` is the conflicted file. Rather than provide a list of
 
74
files to resolve, you can give the ``--all`` option to implicitly
 
75
specify all conflicted files.
 
76
 
 
77
The ``extmerge`` command uses the tool specified by the
 
78
``external_merge`` setting in your ``bazaar.conf`` file.
 
79
If not set, it will look for some popular merge tools such
 
80
as ``kdiff3`` or ``opendiff``, the latter being a command
 
81
line interface to the FileMerge utility in OS X.