What do you do with MQ?

Arne Babenhauserheide arne_bab at web.de
Tue Dec 6 14:42:43 UTC 2011


Hi, 

Mercurial Queues offer extremely powerful options for working with
unfinished changes.

It’s general usecase is clear: manage a queue of patches against a
given repository. But that is so vague that it does not say very much
and it also does not describe everything you can do with mq. So it
interests me, what you do with MQ in terms of actual actions.

To show what I mean instead of just telling, these are mq actions
which strike me as directly useful even when I don’t explicitely track
patches:


* amend the latest commit: 
  hg qimport -r tip ; hg qrefresh; hg qfinish -a

* fold two changesets: 
  hg qimport -r REV -r REV; hg qpop -a ; hg qfold ; hg qpush ; hg qfinish -a

* do many test commits and fold them into one when finished:
  hg qnew -m "change" 1; hg qnew -m "fix" 2; hg qpop 2 ; hg qfold 2 ; hg qfinish -a

* refactor commits to have atomic changes (one step per changeset): 
  (I failed to find an easy way here. What I’d need: hg qsplit: like
  qrecord, but takes the changes out of one patch and puts them into a
  new one. Then I could just qfold all related patches and qsplit them
  into atomic changesets)


Which mq actions do you use? (including those for tracking patches)

Best wishes, 
Arne

PS: I ask because I think that mq is mostly opaque to new users (it
was for me) even though it might fill some basic usecases as soon as
users want to change local history. For example to refactor patches
for inclusion in Mercurial.

PPS: I think this information should be quite useful for Liquid, too.



More information about the Mercurial mailing list