Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You're going to need the Mq extension. If you don't have it turned on, do so by adding this to your <code>Mercurial.ini</code> or <code>.hgrc</code> file.</p> <pre><code>[extensions] hgext.mq= </code></pre> <p>If you're not familiar with it, the <a href="http://mercurial.selenic.com/wiki/MqExtension" rel="noreferrer">Mq extension</a> let's you manipulate history. The good news is, this will allow us to fix your repo. The bad news is that anyone who has a clone of the messed up repo will have to clone it again, because we'll be changing history.</p> <p>First, go make another clone of your repo to work in, so we don't mess anything up.</p> <p>Now, find the revision id of the merge changeset (that merged <code>default</code> and your named branch). Write it down. We'll refer to it as <code>changesetM</code>. Now find the revision id of the next changeset. Write it down. We'll refer to it as <code>changesetN</code>.</p> <p>Once you have those two revision ids, head over to your command prompt and <code>cd</code> into your repo. Then type out the following, replacing <code>changeset[M|N]</code> with the appropriate revision id.:</p> <pre><code>$ hg qimport -r changesetN:tip # This will add all of your changes since the merge to the queue $ hg qpop -a # This pops them all out of your history. $ hg strip changesetM # This removes the merge changeset. $ hg update -C default # Make sure we're on the default branch $ hg qpush -a # Take the changesets in the queue and push them back onto your history. $ hg qfinish -a # Remove changesets from the queue and finalize them as normal changesets. </code></pre> <p>Essentially, you are rebasing the new changesets on top of the default branch, removing the merge changeset in the process. Once you're done, you'll need to push the changes to a new repository on the server, and have your colleagues clone fresh copies.</p> <p>Lastly, if you have any other Mercurial questions, also check out <a href="http://kiln.stackexchange.com/" rel="noreferrer">kiln.stackexchange.com</a>.</p> <p><strong>UPDATE</strong></p> <p>I forgot to mention: If someone has based changes on something that was only in the other branch, it is possible that <code>hg qpush -a</code> will fail. You'll see a <code>foo.txt.rej</code> and <code>foo.txt.orig</code> file laying around. Unfortunately, you'll have to fix this yourself. To fix it, open the original file, the <code>.orig</code> file, and the <code>.rej</code> file and choose the right changes to merge in, saving them in the original file. Once you've merged it in, use <code>hg qrefresh</code> to update that patch to the new, merged patch. From their, you should be able to run <code>hg qpush -a</code> again and continue. If you run into the same error again on another patch, just follow the same process.</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