4
4
Some operations, like merge, revert and pull, modify the contents of your
5
5
working tree. These modifications are programmatically generated, and so they
6
may conflict with the current state of your working tree.
8
When conflicts are present in your working tree (as shown by ``bzr
9
conflicts``), you should resolve them and then inform bzr that the conflicts
12
Resolving conflicts is sometimes not obvious. Either because the user that
13
should resolve them is not the one responsible for their occurrence, as is the
14
case when merging other people's work or because some conflicts are presented
15
in a way that is not easy to understand.
17
Bazaar tries to avoid conflicts ; its aim is to ask you to resolve the
18
conflict if and only if there's an actual conceptual conflict in the source
19
tree. Because Bazaar doesn't understand the real meaning of the files being
20
versioned, it can, when faced with ambiguities, fall short in either direction
21
trying to resolve the conflict itself. Many kinds of changes can be combined
22
programmatically, but sometimes only a human can determine the right thing to
25
When Bazaar generates a conflict, it adds information into the working tree to
26
present the conflicting versions, and it's up to you to find the correct
29
Whatever the conflict is, resolving it is roughly done in two steps::
31
- modify the working tree content so that the conflicted item is now in the
32
state you want to keep,
34
- inform Bazaar that the conflict is now solved and ask to cleanup any
35
remaining generated information (``bzr resolve <item>``).
37
For most conflict types, there are some obvious ways to modify the working
38
tree and put it into the desired state. For some types of conflicts, Bazaar
39
itself already made a choice, when possible.
41
Yet, whether Bazaar makes a choice or not, there are some other simple but
42
different ways to resolve the conflict.
6
may conflict with the current state of your working tree. Many kinds of changes
7
can be combined programmatically, but sometimes only a human can determine the
8
right thing to do. When this happens Bazaar will inform you that there is a
9
conflict and then ask you to resolve it. The command to tell Bazaar a conflict
10
is resolved is ``resolve``, but you must perform some action before you can do
44
13
Each type of conflict is explained below, and the action which must be done to
45
14
resolve the conflict is outlined.
47
Various actions are available depending on the kind of conflict, for some of
48
these actions, Bazaar can provide some help. In the end you should at least
49
inform Bazaar that you're done with the conflict with::
51
``bzr resolve FILE --action=done'
53
Note that this is the default action when a single file is involved so you can
58
See ``bzr help resolve`` for more details.
97
54
you are done editing, the file should look like it never had a conflict, and be
100
When you have resolved text conflicts, just run ``bzr resolve --auto``, and
101
Bazaar will auto-detect which conflicts you have resolved.
103
When the conflict is resolved, Bazaar deletes the previously generated
104
``.BASE``, ``.THIS`` and ``.OTHER`` files if they are still present in the
57
When you have resolved text conflicts, just run "bzr resolve", and Bazaar will
58
auto-detect which conflicts you have resolved.
112
65
Contents conflict in FILE
114
This conflict happens when there are conflicting changes in the working tree
115
and the merge source, but the conflicted items are not text files. They may
116
be binary files, or symlinks, or directories. It can even happen with files
117
that are deleted on one side, and modified on the other.
67
This conflict happens when there are conflicting changes in the target tree and
68
the merge source, but the conflicted items are not text files. They may be
69
binary files, or symlinks, or directories. It can even happen with files that
70
are deleted on one side, and modified on the other.
119
72
Like text conflicts, Bazaar will emit THIS, OTHER and BASE files. (They may be
120
73
regular files, symlinks or directories). But it will not include a "main copy"
121
74
of the file with herringbone conflict markers. It will appear that the "main
122
75
copy" has been renamed to THIS or OTHER.
124
To resolve that kind of conflict, you should rebuild FILE from either version
125
or a combination of both.
127
``bzr resolve`` recognizes the following actions:
129
- ``--action=take-this`` will issue ``bzr mv FILE.THIS FILE``,
130
- ``--action=take-other`` will issue ``bzr mv FILE.OTHER FILE``,
131
- ``--action=done`` will just mark the conflict as resolved.
133
Any action will also delete the previously generated ``.BASE``, ``.THIS`` and
134
``.OTHER`` files if they are still present in the working tree.
136
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
146
When pulling from or pushing to another branch, Bazaar informs you about tags
147
that conflict between the two branches; that is the same tag points to two
148
different revisions. You need not resolve these conflicts, but subsequent
149
uses of pull or push will result in the same message.
151
To resolve the conflict, you must apply the correct tags to either the target
152
branch or the source branch as appropriate. Use "bzr tags --show-ids -d
153
SOURCE_URL" to see the tags in the source branch. If you want to make the
154
target branch's tags match the source branch, then in the target branch do
155
``bzr tag --force -r revid:REVISION_ID CONFLICTING_TAG`` for each of the
156
CONFLICTING_TAGs, where REVISION_ID comes from the list of tags in the source
157
branch. You need not call "bzr resolve" after doing this. To resolve in
158
favor of the target branch, you need to similarly use ``tag --force`` in the
159
source branch. (Note that pulling or pushing using --overwrite will overwrite
77
To resolve this, use "bzr mv" to rename the file back to its normal name, and
78
combine the changes manually. When you are satisfied, run "bzr resolve
79
FILE". Bazaar cannot auto-detect when conflicts of this kind have been
167
87
Conflict adding file FILE. Moved existing file to FILE.moved.
169
89
Sometimes Bazaar will attempt to create a file using a pathname that has
170
already been used. The existing file will be renamed to "FILE.moved".
172
To resolve that kind of conflict, you should rebuild FILE from either version
173
or a combination of both.
175
``bzr resolve`` recognizes the following actions::
177
- ``--action=take-this`` will issue ``bzr rm FILE ; bzr mv FILE.moved FILE``,
178
- ``--action=take-other`` will issue ``bzr rm FILE.moved``,
179
- ``--action=done`` will just mark the conflict as resolved.
181
Note that you must get rid of FILE.moved before using ``--action=done``.
183
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
90
already been used. The existing file will be renamed to "FILE.moved". If
91
you wish, you can rename either one of these files, or combine their contents.
92
When you are satisfied, you can run "bzr resolve FILE" to mark the conflict as
185
95
Unversioned parent
186
96
------------------
205
115
Conflict adding files to FILE. Created directory.
207
This happens when a directory has been deleted in the target, but has new
208
children in the source. This is similar to the "unversioned parent" conflict,
209
except that the parent directory does not *exist*, instead of just being
210
unversioned. In this situation, Bazaar will create the missing parent.
211
Resolving this issue depends very much on the particular scenario.
213
To resolve that kind of conflict, you should either remove or rename the
214
children or the directory or a combination of both.
216
``bzr resolve`` recognizes the following actions::
218
- ``--action=take-this`` will issue ``bzr rm directory`` including the
220
- ``--action=take-other`` will acknowledge Bazaar choice to keep the children
221
and restoring the directory,
222
- ``--action=done`` will just mark the conflict as resolved.
224
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
117
This happens when a file has been deleted in the target, but has new children
118
in the source. This is similar to the "unversioned parent" conflict, except
119
that the parent directory does not *exist*, instead of just being unversioned.
120
In this situation, Bazaar will create the missing parent. Resolving this issue
121
depends very much on the particular scenario. You may wish to rename or delete
122
either the file or the directory. When you are satisfied, you can run "bzr
123
resolve FILE" to mark the conflict as resolved.
229
128
Typical message::
231
Conflict: can't delete DIR because it is not empty. Not deleting.
130
Conflict: can't delete FILE because it is not empty. Not deleting.
233
132
This is the opposite of "missing parent". A directory is deleted in the
234
133
source, but has new children in the target. Bazaar will retain the directory.
235
Resolving this issue depends very much on the particular scenario.
237
To resolve that kind of conflict, you should either remove or rename the
238
children or the directory or a combination of both.
240
``bzr resolve`` recognizes the following actions::
242
- ``--action=take-this`` will acknowledge Bazaar choice to keep the directory,
243
- ``--action=take-other`` will issue ``bzr rm directory`` including the
245
- ``--action=done`` will just mark the conflict as resolved.
247
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
134
Resolving this issue depends very much on the particular scenario. You may
135
wish to rename or delete either the file or the directory. When you are
136
satisfied, you can run "bzr resolve FILE" to mark the conflict as resolved.
254
143
Path conflict: PATH1 / PATH2
256
145
This happens when the source and target have each modified the name or parent
257
directory of a file. Bazaar will use the path elements from the source.
259
To resolve that kind of conflict, you just have to decide what name should be
260
retained for the file involved.
262
``bzr resolve`` recognizes the following actions::
264
- ``--action=take-this`` will revert Bazaar choice and keep ``PATH1`` by
265
issuing ``bzr mv PATH2 PATH1``,
266
- ``--action=take-other`` will acknowledge Bazaar choice of keeping ``PATH2``,
267
- ``--action=done`` will just mark the conflict as resolved.
269
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
146
directory of a file. Bazaar will use the path elements from the source. You
147
can rename the file, and once you have, run "bzr resolve FILE" to mark the
148
conflict as resolved.
285
164
$ bzr commit -m "BASE"
286
165
$ bzr branch . ../other
288
167
$ bzr commit -m "THIS"
289
$ bzr mv ../other/black ../other/white
168
$ bzr mv ../other/b ../other/a
290
169
$ bzr commit ../other -m "OTHER"
291
170
$ bzr merge ../other
293
In this situation, Bazaar will cancel the move, and leave ``white`` in
294
``black``. To resolve that kind of conflict, you just have to decide what
295
name should be retained for the directories involved.
297
``bzr resolve`` recognizes the following actions::
299
- ``--action=take-this`` will acknowledge Bazaar choice of leaving ``white``
301
- ``--action=take-other`` will revert Bazaar choice and move ``black`` in
302
``white`` by issuing ``bzr mv black/white white ; bzr mv black white``,
303
- ``--action=done`` will just mark the conflict as resolved.
305
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
172
In this situation, Bazaar will cancel the move, and leave "a" in "b".
173
You can rename the directories if you like, and once you have, run "bzr resolve
174
FILE" to mark the conflict as resolved.
307
176
Non-directory parent
308
177
--------------------
310
179
Typical message::
312
Conflict: foo.new is not a directory, but has files in it.
181
Conflict: FILE.new is not a directory, but has files in it.
313
182
Created directory.
315
This happens when one side has added files to a directory, and the other side
184
This happens when one side has added files to a directory, and the othe side
316
185
has changed the directory into a file or symlink. For example::
320
189
$ bzr commit -m "BASE"
321
190
$ bzr branch . ../other
324
193
$ bzr commit -m "THIS"
325
$ bzr mkdir ../other/foo/bar
194
$ bzr mkdir ../other/a/b
326
195
$ bzr commit ../other -m "OTHER"
327
196
$ bzr merge ../other
329
To resolve that kind of conflict, you have to decide what name should be
330
retained for the file, directory or symlink involved.
332
``bzr resolve`` recognizes the following actions::
334
- ``--action=take-this`` will issue ``bzr rm --force foo.new`` and
336
- ``--action=take-other`` will issue ``bzr rm --force foo`` and
337
``bzr mv foo.new foo``,
338
- ``--action=done`` will just mark the conflict as resolved.
340
Bazaar cannot auto-detect when conflicts of this kind have been resolved.
342
199
MalformedTransform
343
200
------------------