Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I split work into multiple patches with mercurial queues?
    text
    copied!<p>If I've been churning away at the code for a while, and forgotten to create a patch series as I go, how do I create the patch series retrospectively? So far the only thing that comes to mind is:</p> <pre><code># Prepare and test the first batch of changes. $ hg qrecord -m 'first batch' 1.patch $ hg qnew -m 'stash downstream changes' stash-1.patch $ hg qdelete -k temp-1.patch $ make hello cc hello.c -o hello hello.c: In function ‘main’: hello.c:4: error: syntax error at end of input make: *** [hello] Error 1 $ echo '}' &gt;&gt; hello.c $ make hello cc hello.c -o hello $ hg qrefresh # Recover the stashed changes. $ patch -p1 &lt; .hg/patches/last.patch # And around we go again! $ hg qrecord -m 'second batch' 2.patch $ hg qnew -m 'stash downstream changes' stash-2.patch $ hg qdelete -k stash-2.patch $ make hello ... </code></pre> <p>This very cumbersome approach is also hazardous. I might forget the <code>-k</code> on <code>qdelete</code>, at which point I'll go bash my forehead against a brick wall for several minutes, or I might include too much or too little during the qrecord operation.</p> <p>Is there a better way?</p> <p>(What I'd really like is to be able to <code>hg qpop</code> to just before a patch I want to split, and use a currently non-existent command, <code>hg qunrecord</code>, to interactively suck changes out of the patch into my working directory. Once I'm happy with the changes, <code>hg qnew -f</code> could squeeze a new patch in front of the old one.)</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