5
Some operations, like merge, revert and pull, modify the contents of your
6
working tree. These modifications are programmatically generated, and so they
7
may conflict with the current state of your working tree. Many kinds of changes
8
can be combined programmatically, but sometimes only a human can determine the
9
right thing to do. When this happens Bazaar will inform you that there is a
10
conflict and then ask you to resolve it. The command to tell Bazaar a conflict
11
is resolved is ``resolve``, but you must perform some action before you can do
14
Each type of conflict is explained below, and the action which must be done to
15
resolve the conflict is outlined.
24
These are produced when a text merge cannot completely reconcile two sets of
25
text changes. Bazaar will emit files for each version with the extensions
26
THIS, OTHER, and BASE. THIS is the version of the file from the target tree,
27
i.e. the tree that you are merging changes into. OTHER is the version that you
28
are merging into the target. BASE is an older version that is used as a basis
31
In the main copy of the file, Bazaar will include all the changes that it
32
could reconcile, and any un-reconciled conflicts are surrounded by
33
"herringbone" markers like ``<<<<<<<``.
35
Say the initial text is "The project leader released it.", and THIS modifies it
36
to "Martin Pool released it.", while OTHER modifies it to "The project leader
37
released Bazaar." A conflict would look like this::
40
Martin Pool released it.
42
The project leader released Bazaar.
45
The correct resolution would be "Martin Pool released Bazaar."
47
You can handle text conflicts either by editing the main copy of the file, or
48
by invoking external tools on the THIS, OTHER and BASE versions. It's worth
49
mentioning that resolving text conflicts rarely involves picking one set of
50
changes over the other. More often, the two sets of changes must be
51
intelligently combined.
53
If you edit the main copy, be sure to remove the herringbone markers. When
54
you are done editing, the file should look like it never had a conflict, and be
57
When you have resolved text conflicts, just run "bzr resolve", and Bazaar will
58
auto-detect which conflicts you have resolved.
64
Contents conflict in FILE
66
This conflict happens when there are conflicting changes in the target tree and
67
the merge source, but the conflicted items are not text files. They may be
68
binary files, or symlinks, or directories. It can even happen with files that
69
are deleted on one side, and modified on the other.
71
Like text conflicts, Bazaar will emit THIS, OTHER and BASE files. (They may be
72
regular files, symlinks or directories). But it will not include a "main copy"
73
of the file with herringbone conflict markers. It will appear that the "main
74
copy" has been renamed to THIS or OTHER.
76
To resolve this, use "bzr mv" to rename the file back to its normal name, and
77
combine the changes manually. When you are satisfied, run "bzr resolve
78
FILE". Bazaar cannot auto-detect when conflicts of this kind have been
85
Conflict adding file FILE. Moved existing file to FILE.moved.
87
Sometimes Bazaar will attempt to create a file using a pathname that has
88
already been used. The existing file will be renamed to "FILE.moved". If
89
you wish, you can rename either one of these files, or combine their contents.
90
When you are satisfied, you can run "bzr resolve FILE" to mark the conflict as
97
Conflict because FILE is not versioned, but has versioned children.
99
Sometimes Bazaar will attempt to create a file whose parent directory is not
100
versioned. This happens when the directory has been deleted in the target,
101
but has a new child in the source, or vice versa. In this situation, Bazaar
102
will version the parent directory as well. Resolving this issue depends
103
very much on the particular scenario. You may wish to rename or delete either
104
the file or the directory. When you are satisfied, you can run "bzr resolve
105
FILE" to mark the conflict as resolved.
111
Conflict adding files to FILE. Created directory.
113
This happens when a file has been deleted in the target, but has new children
114
in the source. This is similar to the "unversioned parent" conflict, except
115
that the parent directory does not *exist*, instead of just being unversioned.
116
In this situation, Bazaar will create the missing parent. Resolving this issue
117
depends very much on the particular scenario. You may wish to rename or delete
118
either the file or the directory. When you are satisfied, you can run "bzr
119
resolve FILE" to mark the conflict as resolved.
125
Conflict: can't delete FILE because it is not empty. Not deleting.
127
This is the opposite of "missing parent". A directory is deleted in the
128
source, but has new children in the target. Bazaar will retain the directory.
129
Resolving this issue depends very much on the particular scenario. You may
130
wish to rename or delete either the file or the directory. When you are
131
satisfied, you can run "bzr resolve FILE" to mark the conflict as resolved.
137
Path conflict: PATH1 / PATH2
139
This happens when the source and target have each modified the name or parent
140
directory of a file. Bazaar will use the path elements from the source. You
141
can rename the file, and once you have, run "bzr resolve FILE" to mark the
142
conflict as resolved.
148
Conflict moving FILE into DIRECTORY. Cancelled move.
150
This happens when the source and the target have each moved directories, so
151
that, if the change could be applied, a directory would be contained by itself.
157
$ bzr commit -m "BASE"
158
$ bzr branch . ../other
160
$ bzr commit -m "THIS"
161
$ bzr mv ../other/b ../other/a
162
$ bzr commit ../other -m "OTHER"
165
In this situation, Bazaar will cancel the move, and leave "a" in "b".
166
You can rename the directories if you like, and once you have, run "bzr resolve
167
FILE" to mark the conflict as resolved.
171
It is possible (though very rare) for Bazaar to raise a MalformedTransform
172
exception. This means that Bazaar encounted a filesystem conflict that it was
173
unable to resolve. This usually indicates a bug. Please let us know if you
174
encounter this. Our bug tracker is at https://launchpad.net/bzr/+bugs