~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics/en/conflicts.txt

  • Committer: Vincent Ladeuil
  • Date: 2009-12-07 10:38:09 UTC
  • mfrom: (4795.5.14 forgot-commit-message)
  • mto: This revision was merged to the branch mainline in revision 4870.
  • Revision ID: v.ladeuil+lp@free.fr-20091207103809-63ocky0xx7nudbnb
commit warns for file-name-like messages

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Conflicts Types
 
2
===============
 
3
 
 
4
Some operations, like merge, revert and pull, modify the contents of your
 
5
working tree.  These modifications are programmatically generated, and so they
 
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
 
11
this.
 
12
 
 
13
Each type of conflict is explained below, and the action which must be done to
 
14
resolve the conflict is outlined.
 
15
 
 
16
 
 
17
Text conflicts
 
18
--------------
 
19
 
 
20
Typical message::
 
21
 
 
22
  Text conflict in FILE
 
23
 
 
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
 
29
for comparison.
 
30
 
 
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 ``<<<<<<<``.
 
34
 
 
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::
 
38
 
 
39
  <<<<<<< TREE
 
40
  Martin Pool released it.
 
41
  =======
 
42
  The project leader released Bazaar.
 
43
  >>>>>>> MERGE-SOURCE
 
44
 
 
45
The correct resolution would be "Martin Pool released Bazaar."
 
46
 
 
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.
 
52
 
 
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
 
55
ready to commit.
 
56
 
 
57
When you have resolved text conflicts, just run "bzr resolve", and Bazaar will
 
58
auto-detect which conflicts you have resolved.
 
59
 
 
60
Content conflicts
 
61
-----------------
 
62
 
 
63
Typical message::
 
64
 
 
65
  Contents conflict in FILE
 
66
 
 
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.
 
71
 
 
72
Like text conflicts, Bazaar will emit THIS, OTHER and BASE files.  (They may be
 
73
regular files, symlinks or directories).  But it will not include a "main copy"
 
74
of the file with herringbone conflict markers.  It will appear that the "main
 
75
copy" has been renamed to THIS or OTHER.
 
76
 
 
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
 
80
resolved.
 
81
 
 
82
Tag conflicts
 
83
-------------
 
84
 
 
85
Typical message::
 
86
 
 
87
  Conflicting tags:
 
88
      version-0.1
 
89
 
 
90
When pulling from or pushing to another branch, Bazaar informs you about tags
 
91
that conflict between the two branches; that is the same tag points to two
 
92
different revisions.  You need not resolve these conflicts, but subsequent
 
93
uses of pull or push will result in the same message.
 
94
 
 
95
To resolve the conflict, you must apply the correct tags to either the target
 
96
branch or the source branch as appropriate.  Use "bzr tags --show-ids -d
 
97
SOURCE_URL" to see the tags in the source branch.  If you want to make the
 
98
target branch's tags match the source branch, then in the target branch do 
 
99
``bzr tag --force -r revid:REVISION_ID CONFLICTING_TAG`` for each of the
 
100
CONFLICTING_TAGs, where REVISION_ID comes from the list of tags in the source
 
101
branch.  You need not call "bzr resolve" after doing this.  To resolve in favor of the target branch, you need to similarly use ``tag --force`` in the source
 
102
branch.  (Note that pulling or pushing using --overwrite will overwrite all
 
103
tags as well.)
 
104
 
 
105
Duplicate paths
 
106
---------------
 
107
 
 
108
Typical message::
 
109
 
 
110
  Conflict adding file FILE.  Moved existing file to FILE.moved.
 
111
 
 
112
Sometimes Bazaar will attempt to create a file using a pathname that has
 
113
already been used.  The existing file will be renamed to "FILE.moved".  If
 
114
you wish, you can rename either one of these files, or combine their contents.
 
115
When you are satisfied, you can run "bzr resolve FILE" to mark the conflict as
 
116
resolved.
 
117
 
 
118
Unversioned parent
 
119
------------------
 
120
 
 
121
Typical message::
 
122
 
 
123
    Conflict because FILE is not versioned, but has versioned children.
 
124
 
 
125
Sometimes Bazaar will attempt to create a file whose parent directory is not
 
126
versioned.  This happens when the directory has been deleted in the target,
 
127
but has a new child in the source, or vice versa.  In this situation, Bazaar
 
128
will version the parent directory as well.  Resolving this issue depends
 
129
very much on the particular scenario.  You may wish to rename or delete either
 
130
the file or the directory.  When you are satisfied, you can run "bzr resolve
 
131
FILE" to mark the conflict as resolved.
 
132
 
 
133
Missing parent
 
134
--------------
 
135
 
 
136
Typical message::
 
137
 
 
138
  Conflict adding files to FILE.  Created directory.
 
139
 
 
140
This happens when a file has been deleted in the target, but has new children
 
141
in the source.  This is similar to the "unversioned parent" conflict, except
 
142
that the parent directory does not *exist*, instead of just being unversioned.
 
143
In this situation, Bazaar will create the missing parent.  Resolving this issue
 
144
depends very much on the particular scenario.  You may wish to rename or delete
 
145
either the file or the directory.  When you are satisfied, you can run "bzr
 
146
resolve FILE" to mark the conflict as resolved.
 
147
 
 
148
Deleting parent
 
149
---------------
 
150
 
 
151
Typical message::
 
152
 
 
153
  Conflict: can't delete FILE because it is not empty.  Not deleting.
 
154
 
 
155
This is the opposite of "missing parent".  A directory is deleted in the
 
156
source, but has new children in the target.  Bazaar will retain the directory.
 
157
Resolving this issue depends very much on the particular scenario.  You may
 
158
wish to rename or delete either the file or the directory.  When you are
 
159
satisfied, you can run "bzr resolve FILE" to mark the conflict as resolved.
 
160
 
 
161
Path conflict
 
162
-------------
 
163
 
 
164
Typical message::
 
165
 
 
166
  Path conflict: PATH1 / PATH2
 
167
 
 
168
This happens when the source and target have each modified the name or parent
 
169
directory of a file.  Bazaar will use the path elements from the source.  You
 
170
can rename the file, and once you have, run "bzr resolve FILE" to mark the
 
171
conflict as resolved.
 
172
 
 
173
Parent loop
 
174
-----------
 
175
 
 
176
Typical message::
 
177
 
 
178
  Conflict moving FILE into DIRECTORY.  Cancelled move.
 
179
 
 
180
This happens when the source and the target have each moved directories, so
 
181
that, if the change could be applied, a directory would be contained by itself.
 
182
For example::
 
183
 
 
184
  $ bzr init
 
185
  $ bzr mkdir a
 
186
  $ bzr mkdir b
 
187
  $ bzr commit -m "BASE"
 
188
  $ bzr branch . ../other
 
189
  $ bzr mv a b
 
190
  $ bzr commit -m "THIS"
 
191
  $ bzr mv ../other/b ../other/a
 
192
  $ bzr commit ../other -m "OTHER"
 
193
  $ bzr merge ../other
 
194
 
 
195
In this situation, Bazaar will cancel the move, and leave "a" in "b".
 
196
You can rename the directories if you like, and once you have, run "bzr resolve
 
197
FILE" to mark the conflict as resolved.
 
198
 
 
199
Non-directory parent
 
200
--------------------
 
201
 
 
202
Typical message::
 
203
 
 
204
  Conflict: FILE.new is not a directory, but has files in it.
 
205
  Created directory.
 
206
 
 
207
This happens when one side has added files to a directory, and the othe side
 
208
has changed the directory into a file or symlink.  For example::
 
209
 
 
210
  $ bzr init
 
211
  $ bzr mkdir a
 
212
  $ bzr commit -m "BASE"
 
213
  $ bzr branch . ../other
 
214
  $ rmdir a
 
215
  $ touch a
 
216
  $ bzr commit -m "THIS"
 
217
  $ bzr mkdir ../other/a/b
 
218
  $ bzr commit ../other -m "OTHER"
 
219
  $ bzr merge ../other
 
220
 
 
221
 
 
222
MalformedTransform
 
223
------------------
 
224
 
 
225
It is possible (though very rare) for Bazaar to raise a MalformedTransform
 
226
exception.  This means that Bazaar encountered a filesystem conflict that it was
 
227
unable to resolve.  This usually indicates a bug.  Please let us know if you
 
228
encounter this.  Our bug tracker is at https://launchpad.net/bzr/+bugs