Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There's no technical reason why you cannot merge with an ancestor: as you've found out, Mercurial does support it in some circumstances. So it's purely a GUI restriction. The reasoning behind this is that when <code>hg update</code> would give you the same result as <code>hg merge</code>, then you should use that instead for simplicity.</p> <p>A <em>merge</em> is just a mix of three repository states: the common ancestor and the two changesets you're merging. Three-way merging is done on a hunk by hunk basis. The table for merging local with remote looks like this:</p> <pre><code>ancestor local remote -&gt; merge old old old old (nobody changed the hunk) old new old new (I changed the hunk) old old new new (you changed the hunk) old new new new (hunk was cherry picked onto both branches) old foo bar &lt;!&gt; (conflict, both changed hunk but differently) </code></pre> <p>If <code>local</code> is an ancestor of <code>remote</code>, then <code>ancestor == local</code>. So the table becomes:</p> <pre><code>ancestor local remote -&gt; merge old old old old (nobody changed the hunk) old old new new (you changed the hunk) </code></pre> <p>In both cases, the <code>merge</code> column contain what was in the <code>remote</code> column. In your example, <code>local</code> is <code>default</code> and <code>remote</code> is <code>file-content</code>:</p> <pre><code>$ hg update default $ hg merge file-content </code></pre> <p>The result is a merge changeset that looks just like <code>file-content</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload