Aug 25, 2010

Reordering patches in a mercurial queues ( hg mq )

I have converted a Repository from Subversion to Mercurial - From a centralized Repository to a distributed Repository, although I use Mercurial with a centralized master repositroy.

The reason for changing to Mercurial for me was to have the whole content
locally, even when I do not have a connection to the central server repository and the Mercurial Queues Extension.

I have some changes, which are not ready for commitment, so in Subversion I had a lot of working directories but MQ allows to use patches, which can be applied and removed.

If the order of the patches is not what you want, a reorder is necessray:

[ewer:sunray1:/users/trinomic/ewer/entw/vsop]$ hg qseries

applying vspipeCompile also pushes eaiTacReference

[ewer:sunray1:/users/trinomic/ewer/entw/vsop]$ hg qpush vspipeCompile
Wende eaiTacReference an
Wende vspipeCompile an
Patch vspipeCompile ist leer
jetzt bei: vspipeCompile

qpush has an option --move to reorder the patches.

[ewer:sunray1:/users/trinomic/ewer/entw/vsop]$ hg qpop -a
Entferne (obersten) oldDemoWfl4EaiServer
Entferne (obersten) vspipeCompile
Entferne (obersten) eaiTacReference
Patchschlange ist jetzt leer
[ewer:sunray1:/users/trinomic/ewer/entw/vsop]$ hg qpush --move oldDemoWfl4EaiServer
Wende oldDemoWfl4EaiServer an
jetzt bei: oldDemoWfl4EaiServer
[ewer:sunray1:/users/trinomic/ewer/entw/vsop]$ hg qapplied

I think, as long as the patches do not depend on each other this a way
to remove some change sets.