Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This isn't the normal work mode of Mercurial (or git). A repository can only contain a changeset if it also contains all of that changeset's ancestors. So you can't get D into a repo without also having A, B, and C in there.</p> <p>So here's:</p> <p><strong>What you Should have Done</strong></p> <p>Control the parentage of your changesets. Don't make C the parent of D just because you happen to have fixed D after C. Before you fix a bug <code>hg update</code> to the previous release.</p> <p>Imagine A was a release and B, C, and D, were all bug fixes. If you do a loop like this:</p> <pre><code>foreach bug you have: hg update A ... fix bug ... hg commit hg merge # merges with the "other" head </code></pre> <p>then you'll end up with a graph like this:</p> <pre><code>---[A]----[B2]--[C2]--[D2]---- | / / / +-[B] / / | / / +-----[C] / | / +---------[D] </code></pre> <p>and now if you want to create a release with only, say, B and D in it you can do:</p> <pre><code>hg update B hg merge D </code></pre> <p>and that creates a new head that has A + B + D but no C.</p> <p>Tl;Dr: make a change's parent be as early in history as you can, not whatever happens to be <em>tip</em> at the time.</p> <p><strong>What you can do Now</strong></p> <p>That's the ideal, but fortunately it's no big thing. You can never bring <strong>exactly</strong> D across without bringing C (because C's hash is part of the calculation of D's hash), but you can bring the work that's in D into a new head easily enough. Here are some ways, any of which will work:</p> <ul> <li>hg export / hg import</li> <li>hg transplant</li> <li>hg graft (new in 2.0)</li> <li>hg rebase (only possible if you haven't yet pushed)</li> </ul> <p>Any of those will let you bring that patch/delta that's in D over -- it will have a different hash ID and when some day you merge D in for real (using merge) you'll have duplicate work in two different changesets, but merge will figure it all out.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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