What do you do with MQ?

Alain Leufroy alain.leufroy at logilab.fr
Wed Dec 7 09:10:58 UTC 2011


> * amend the latest commit:
>   hg qimport -r tip ; hg qrefresh; hg qfinish -a
+1
> * 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
I'm doing this for each changeset :D

> * 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)

With GNU/Linux:

qsplit(){ hg qimport -r ${1}:tip && \
          hg qpop ${1}.diff && \
          hg qfold $(hg qseries|grep -v ${1}.diff) && \
          hg pop -a && \
          patch -p1 < $(hg root)/.hg/patches/${1}.diff && \
          hg qcrecord splitted_1.diff && hg qremove $1.diff; \
          }
then

qsplit 1
hg qcrecord splitted_2.diff
...

* And strip

>
> 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.
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>

-- 
Alain Leufroy
LOGILAB, Paris (France)
http://www.logilab.fr
Informatique scientifique & gestion de connaissances


More information about the Mercurial mailing list