Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To augment <a href="https://stackoverflow.com/questions/7165989/mercurial-apply-a-bugfix-change-from-stable-named-branch-to-dev-branch/7166508#7166508">Tim's answer</a>, a different way to approach it is how the Mercurial recommend you do it if you can, plan ahead (I'll see if I can rustle up a link.)</p> <p>The plan goes that if you know that a bugfix/change has to go into several branches, you don't commit that changeset into one of those places to begin with, you do it somewhere else.</p> <p>Since you're fixing a bug, somewhere in the history of the project, that bug was introduced.</p> <p>And since the bugfix needs to go into more than one branch, that "somewhere" has to be before the point where you branched, otherwise the bug wouldn't be in both (/all) branches.</p> <p>So, the recommended way is to fix the bug where it was introduced, and then merge that changeset into each of the branches that needs it.</p> <p>Let's look at an example, we have <code>default</code> and <code>stable</code> branches:</p> <pre><code>1---2---3---4---5---6---7---8---9---10 default \ \ \ \ 11--------------12--13 stable </code></pre> <p>Then you discover that changeset 2 introduced a bug, and the bugfix needs to be applied to both <code>default</code> and <code>stable</code>. The way you describe it in the question, it looks like you would do this:</p> <pre><code>1---2---3---4---5---6---7---8---9---10--15 default \ \ /^-- merge stable into default \ \ / 11--------------12--13----14 stable ^-- bugfix </code></pre> <p>But this would merge changeset 13 into <code>default</code> as well. If you don't want that to happen, you would instead do this:</p> <pre><code> v-- bugfix 14--------------------------+--+ / | \ / | \ 1---2---3---4---5---6---7---8---9--x-10--15 default \ \ | ^-- merge 14 into default \ \ | 11--------------12--13--16 stable ^-- merge 14 into stable </code></pre> <p>For more information on how to use Mercurial in bugfixing-scenarios, the <a href="http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html" rel="nofollow noreferrer">9th Chapter of 'Mercurial: The Definitive Guide'</a> is well worth the read.</p>
    singulars
    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