<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Conflict Types — Bazaar v2.2.4 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.2.4', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/bzr.ico"/> <link rel="top" title="Bazaar v2.2.4 documentation" href="../index.html" /> <link rel="up" title="Bazaar User Reference" href="index.html" /> <link rel="next" title="Current Storage Formats" href="current-formats-help.html" /> <link rel="prev" title="Configuration Settings" href="configuration-help.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="current-formats-help.html" title="Current Storage Formats" accesskey="N">next</a></li> <li class="right" > <a href="configuration-help.html" title="Configuration Settings" accesskey="P">previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.2.4)</a> »</li> <li><a href="index.html" accesskey="U">Bazaar User Reference</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="conflict-types"> <h1>Conflict Types<a class="headerlink" href="#conflict-types" title="Permalink to this headline">¶</a></h1> <p>Some operations, like merge, revert and pull, modify the contents of your working tree. These modifications are programmatically generated, and so they may conflict with the current state of your working tree.</p> <p>When conflicts are present in your working tree (as shown by <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">conflicts</span></tt>), you should resolve them and then inform bzr that the conflicts have been resolved.</p> <p>Resolving conflicts is sometimes not obvious. Either because the user that should resolve them is not the one responsible for their occurrence, as is the case when merging other people’s work or because some conflicts are presented in a way that is not easy to understand.</p> <p>Bazaar tries to avoid conflicts ; its aim is to ask you to resolve the conflict if and only if there’s an actual conceptual conflict in the source tree. Because Bazaar doesn’t understand the real meaning of the files being versioned, it can, when faced with ambiguities, fall short in either direction trying to resolve the conflict itself. Many kinds of changes can be combined programmatically, but sometimes only a human can determine the right thing to do.</p> <p>When Bazaar generates a conflict, it adds information into the working tree to present the conflicting versions, and it’s up to you to find the correct resolution.</p> <p>Whatever the conflict is, resolving it is roughly done in two steps:</p> <div class="highlight-python"><pre>- modify the working tree content so that the conflicted item is now in the</pre> </div> <blockquote> <div>state you want to keep,</div></blockquote> <ul class="simple"> <li>inform Bazaar that the conflict is now solved and ask to cleanup any remaining generated information (<tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span> <span class="pre"><item></span></tt>).</li> </ul> <p>For most conflict types, there are some obvious ways to modify the working tree and put it into the desired state. For some types of conflicts, Bazaar itself already made a choice, when possible.</p> <p>Yet, whether Bazaar makes a choice or not, there are some other simple but different ways to resolve the conflict.</p> <p>Each type of conflict is explained below, and the action which must be done to resolve the conflict is outlined.</p> <p>Various actions are available depending on the kind of conflict, for some of these actions, Bazaar can provide some help. In the end you should at least inform Bazaar that you’re done with the conflict with:</p> <div class="highlight-python"><pre>``bzr resolve FILE --action=done'</pre> </div> <p>Note that this is the default action when a single file is involved so you can simply use:</p> <div class="highlight-python"><pre>``bzr resolve FILE``</pre> </div> <p>See <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">help</span> <span class="pre">resolve</span></tt> for more details.</p> <div class="section" id="text-conflicts"> <h2>Text conflicts<a class="headerlink" href="#text-conflicts" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Text conflict in FILE</pre> </div> <p>These are produced when a text merge cannot completely reconcile two sets of text changes. Bazaar will emit files for each version with the extensions THIS, OTHER, and BASE. THIS is the version of the file from the target tree, i.e. the tree that you are merging changes into. OTHER is the version that you are merging into the target. BASE is an older version that is used as a basis for comparison.</p> <p>In the main copy of the file, Bazaar will include all the changes that it could reconcile, and any un-reconciled conflicts are surrounded by “herringbone” markers like <tt class="docutils literal"><span class="pre"><<<<<<<</span></tt>.</p> <p>Say the initial text is “The project leader released it.”, and THIS modifies it to “Martin Pool released it.”, while OTHER modifies it to “The project leader released Bazaar.” A conflict would look like this:</p> <div class="highlight-python"><pre><<<<<<< TREE Martin Pool released it. ======= The project leader released Bazaar. >>>>>>> MERGE-SOURCE</pre> </div> <p>The correct resolution would be “Martin Pool released Bazaar.”</p> <p>You can handle text conflicts either by editing the main copy of the file, or by invoking external tools on the THIS, OTHER and BASE versions. It’s worth mentioning that resolving text conflicts rarely involves picking one set of changes over the other. More often, the two sets of changes must be intelligently combined.</p> <p>If you edit the main copy, be sure to remove the herringbone markers. When you are done editing, the file should look like it never had a conflict, and be ready to commit.</p> <p>When you have resolved text conflicts, just run <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span> <span class="pre">--auto</span></tt>, and Bazaar will auto-detect which conflicts you have resolved.</p> <p>When the conflict is resolved, Bazaar deletes the previously generated <tt class="docutils literal"><span class="pre">.BASE</span></tt>, <tt class="docutils literal"><span class="pre">.THIS</span></tt> and <tt class="docutils literal"><span class="pre">.OTHER</span></tt> files if they are still present in the working tree.</p> </div> <div class="section" id="content-conflicts"> <h2>Content conflicts<a class="headerlink" href="#content-conflicts" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Contents conflict in FILE</pre> </div> <p>This conflict happens when there are conflicting changes in the working tree and the merge source, but the conflicted items are not text files. They may be binary files, or symlinks, or directories. It can even happen with files that are deleted on one side, and modified on the other.</p> <p>Like text conflicts, Bazaar will emit THIS, OTHER and BASE files. (They may be regular files, symlinks or directories). But it will not include a “main copy” of the file with herringbone conflict markers. It will appear that the “main copy” has been renamed to THIS or OTHER.</p> <p>To resolve that kind of conflict, you should rebuild FILE from either version or a combination of both.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">--action=take-this</span></tt> will issue <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">mv</span> <span class="pre">FILE.THIS</span> <span class="pre">FILE</span></tt>,</li> <li><tt class="docutils literal"><span class="pre">--action=take-other</span></tt> will issue <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">mv</span> <span class="pre">FILE.OTHER</span> <span class="pre">FILE</span></tt>,</li> <li><tt class="docutils literal"><span class="pre">--action=done</span></tt> will just mark the conflict as resolved.</li> </ul> <p>Any action will also delete the previously generated <tt class="docutils literal"><span class="pre">.BASE</span></tt>, <tt class="docutils literal"><span class="pre">.THIS</span></tt> and <tt class="docutils literal"><span class="pre">.OTHER</span></tt> files if they are still present in the working tree.</p> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="tag-conflicts"> <h2>Tag conflicts<a class="headerlink" href="#tag-conflicts" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflicting tags: version-0.1</pre> </div> <p>When pulling from or pushing to another branch, Bazaar informs you about tags that conflict between the two branches; that is the same tag points to two different revisions. You need not resolve these conflicts, but subsequent uses of pull or push will result in the same message.</p> <p>To resolve the conflict, you must apply the correct tags to either the target branch or the source branch as appropriate. Use “bzr tags –show-ids -d SOURCE_URL” to see the tags in the source branch. If you want to make the target branch’s tags match the source branch, then in the target branch do <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">tag</span> <span class="pre">--force</span> <span class="pre">-r</span> <span class="pre">revid:REVISION_ID</span> <span class="pre">CONFLICTING_TAG</span></tt> for each of the CONFLICTING_TAGs, where REVISION_ID comes from the list of tags in the source branch. You need not call “bzr resolve” after doing this. To resolve in favor of the target branch, you need to similarly use <tt class="docutils literal"><span class="pre">tag</span> <span class="pre">--force</span></tt> in the source branch. (Note that pulling or pushing using –overwrite will overwrite all tags as well.)</p> </div> <div class="section" id="duplicate-paths"> <h2>Duplicate paths<a class="headerlink" href="#duplicate-paths" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflict adding file FILE. Moved existing file to FILE.moved.</pre> </div> <p>Sometimes Bazaar will attempt to create a file using a pathname that has already been used. The existing file will be renamed to “FILE.moved”.</p> <p>To resolve that kind of conflict, you should rebuild FILE from either version or a combination of both.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <div class="highlight-python"><pre>- ``--action=take-this`` will issue ``bzr rm FILE ; bzr mv FILE.moved FILE``, - ``--action=take-other`` will issue ``bzr rm FILE.moved``, - ``--action=done`` will just mark the conflict as resolved.</pre> </div> <p>Note that you must get rid of FILE.moved before using <tt class="docutils literal"><span class="pre">--action=done</span></tt>.</p> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="unversioned-parent"> <h2>Unversioned parent<a class="headerlink" href="#unversioned-parent" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflict because FILE is not versioned, but has versioned children.</pre> </div> <p>Sometimes Bazaar will attempt to create a file whose parent directory is not versioned. This happens when the directory has been deleted in the target, but has a new child in the source, or vice versa. In this situation, Bazaar will version the parent directory as well. Resolving this issue depends very much on the particular scenario. You may wish to rename or delete either the file or the directory. When you are satisfied, you can run “bzr resolve FILE” to mark the conflict as resolved.</p> </div> <div class="section" id="missing-parent"> <h2>Missing parent<a class="headerlink" href="#missing-parent" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflict adding files to FILE. Created directory.</pre> </div> <p>This happens when a directory has been deleted in the target, but has new children in the source. This is similar to the “unversioned parent” conflict, except that the parent directory does not <em>exist</em>, instead of just being unversioned. In this situation, Bazaar will create the missing parent. Resolving this issue depends very much on the particular scenario.</p> <p>To resolve that kind of conflict, you should either remove or rename the children or the directory or a combination of both.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <div class="highlight-python"><pre>- ``--action=take-this`` will issue ``bzr rm directory`` including the children, - ``--action=take-other`` will acknowledge Bazaar choice to keep the children</pre> </div> <blockquote> <div>and restoring the directory,</div></blockquote> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">--action=done</span></tt> will just mark the conflict as resolved.</li> </ul> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="deleting-parent"> <h2>Deleting parent<a class="headerlink" href="#deleting-parent" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflict: can't delete DIR because it is not empty. Not deleting.</pre> </div> <p>This is the opposite of “missing parent”. A directory is deleted in the source, but has new children in the target. Bazaar will retain the directory. Resolving this issue depends very much on the particular scenario.</p> <p>To resolve that kind of conflict, you should either remove or rename the children or the directory or a combination of both.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <div class="highlight-python"><pre>- ``--action=take-this`` will acknowledge Bazaar choice to keep the directory, - ``--action=take-other`` will issue ``bzr rm directory`` including the</pre> </div> <blockquote> <div>children,</div></blockquote> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">--action=done</span></tt> will just mark the conflict as resolved.</li> </ul> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="path-conflict"> <h2>Path conflict<a class="headerlink" href="#path-conflict" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Path conflict: PATH1 / PATH2</pre> </div> <p>This happens when the source and target have each modified the name or parent directory of a file. Bazaar will use the path elements from the source.</p> <p>To resolve that kind of conflict, you just have to decide what name should be retained for the file involved.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <div class="highlight-python"><pre>- ``--action=take-this`` will revert Bazaar choice and keep ``PATH1`` by</pre> </div> <blockquote> <div>issuing <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">mv</span> <span class="pre">PATH2</span> <span class="pre">PATH1</span></tt>,</div></blockquote> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">--action=take-other</span></tt> will acknowledge Bazaar choice of keeping <tt class="docutils literal"><span class="pre">PATH2</span></tt>,</li> <li><tt class="docutils literal"><span class="pre">--action=done</span></tt> will just mark the conflict as resolved.</li> </ul> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="parent-loop"> <h2>Parent loop<a class="headerlink" href="#parent-loop" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflict moving FILE into DIRECTORY. Cancelled move.</pre> </div> <p>This happens when the source and the target have each moved directories, so that, if the change could be applied, a directory would be contained by itself. For example:</p> <div class="highlight-python"><pre>$ bzr init $ bzr mkdir white $ bzr mkdir black $ bzr commit -m "BASE" $ bzr branch . ../other $ bzr mv white black $ bzr commit -m "THIS" $ bzr mv ../other/black ../other/white $ bzr commit ../other -m "OTHER" $ bzr merge ../other</pre> </div> <p>In this situation, Bazaar will cancel the move, and leave <tt class="docutils literal"><span class="pre">white</span></tt> in <tt class="docutils literal"><span class="pre">black</span></tt>. To resolve that kind of conflict, you just have to decide what name should be retained for the directories involved.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <div class="highlight-python"><pre>- ``--action=take-this`` will acknowledge Bazaar choice of leaving ``white``</pre> </div> <blockquote> <div>in <tt class="docutils literal"><span class="pre">black</span></tt>,</div></blockquote> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">--action=take-other</span></tt> will revert Bazaar choice and move <tt class="docutils literal"><span class="pre">black</span></tt> in <tt class="docutils literal"><span class="pre">white</span></tt> by issuing <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">mv</span> <span class="pre">black/white</span> <span class="pre">white</span> <span class="pre">;</span> <span class="pre">bzr</span> <span class="pre">mv</span> <span class="pre">black</span> <span class="pre">white</span></tt>,</li> <li><tt class="docutils literal"><span class="pre">--action=done</span></tt> will just mark the conflict as resolved.</li> </ul> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="non-directory-parent"> <h2>Non-directory parent<a class="headerlink" href="#non-directory-parent" title="Permalink to this headline">¶</a></h2> <p>Typical message:</p> <div class="highlight-python"><pre>Conflict: foo.new is not a directory, but has files in it. Created directory.</pre> </div> <p>This happens when one side has added files to a directory, and the other side has changed the directory into a file or symlink. For example:</p> <div class="highlight-python"><pre>$ bzr init $ bzr mkdir foo $ bzr commit -m "BASE" $ bzr branch . ../other $ rmdir foo $ touch foo $ bzr commit -m "THIS" $ bzr mkdir ../other/foo/bar $ bzr commit ../other -m "OTHER" $ bzr merge ../other</pre> </div> <p>To resolve that kind of conflict, you have to decide what name should be retained for the file, directory or symlink involved.</p> <p><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">resolve</span></tt> recognizes the following actions:</p> <div class="highlight-python"><pre>- ``--action=take-this`` will issue ``bzr rm --force foo.new`` and</pre> </div> <blockquote> <div><tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">add</span> <span class="pre">foo</span></tt>,</div></blockquote> <ul class="simple"> <li><tt class="docutils literal"><span class="pre">--action=take-other</span></tt> will issue <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">rm</span> <span class="pre">--force</span> <span class="pre">foo</span></tt> and <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">mv</span> <span class="pre">foo.new</span> <span class="pre">foo</span></tt>,</li> <li><tt class="docutils literal"><span class="pre">--action=done</span></tt> will just mark the conflict as resolved.</li> </ul> <p>Bazaar cannot auto-detect when conflicts of this kind have been resolved.</p> </div> <div class="section" id="malformedtransform"> <h2>MalformedTransform<a class="headerlink" href="#malformedtransform" title="Permalink to this headline">¶</a></h2> <p>It is possible (though very rare) for Bazaar to raise a MalformedTransform exception. This means that Bazaar encountered a filesystem conflict that it was unable to resolve. This usually indicates a bug. Please let us know if you encounter this. Our bug tracker is at <a class="reference external" href="https://launchpad.net/bzr/+bugs">https://launchpad.net/bzr/+bugs</a></p> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Conflict Types</a><ul> <li><a class="reference internal" href="#text-conflicts">Text conflicts</a></li> <li><a class="reference internal" href="#content-conflicts">Content conflicts</a></li> <li><a class="reference internal" href="#tag-conflicts">Tag conflicts</a></li> <li><a class="reference internal" href="#duplicate-paths">Duplicate paths</a></li> <li><a class="reference internal" href="#unversioned-parent">Unversioned parent</a></li> <li><a class="reference internal" href="#missing-parent">Missing parent</a></li> <li><a class="reference internal" href="#deleting-parent">Deleting parent</a></li> <li><a class="reference internal" href="#path-conflict">Path conflict</a></li> <li><a class="reference internal" href="#parent-loop">Parent loop</a></li> <li><a class="reference internal" href="#non-directory-parent">Non-directory parent</a></li> <li><a class="reference internal" href="#malformedtransform">MalformedTransform</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="configuration-help.html" title="previous chapter">Configuration Settings</a></p> <h4>Next topic</h4> <p class="topless"><a href="current-formats-help.html" title="next chapter">Current Storage Formats</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/user-reference/conflict-types-help.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="current-formats-help.html" title="Current Storage Formats" >next</a></li> <li class="right" > <a href="configuration-help.html" title="Configuration Settings" >previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.2.4)</a> »</li> <li><a href="index.html" >Bazaar User Reference</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009, Canonical Ltd. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. </div> </body> </html>