Source

mutable-history / docs / from-mq.rst

From MQ To Evolve, The Refugee Book

Cheat sheet

==============================  ============================================
mq command                       new equivalent
==============================  ============================================

qseries                         ``log``
qnew                            ``commit``
qrefresh                        ``amend``
qpop                            ``update`` or ``qdown``
qpush                           ``update`` or ``gup`` sometimes ``stabilize``
qrm                             ``kill``
qfold                           ``amend -c`` (for now, ``collapse`` soon)
qdiff                           ``odiff``

qfinish                         --
qimport                         --

Replacement details

hg qseries

All your work in progress is now in real changeset all the time.

You can use the standard log to display them. You can use the phase revset to display unfinished business only and templates to have the same kind of compact output qseries has.:

[alias]
wip = log -r 'not public()' --template='{rev}:{node|short} {desc|firstline}\n'

hg qnew

With evolve you handle standard changesets without additional overlay.

Standard changeset are created using hg commit as usual.:

$ hg commit

If you want to keep the "wip are not pushed" behavior, you are looking for setting your changeset in the secret phase using the phase command.

Note that you only need it for the first commit you want to be secret. Later commits will inherit their parents phase.

If you always want your new commit to be in the secret phase, your should consider updating your configuration:

[phases] new-commit=secret

hg qref

A dedicated command from evolve will allow you to rewrite the changeset you are currently on.:

$ hg amend

This command takes the same options as commit, plus the switch '-e' (--edit) to edit the commit message in an editor.

Amend have also a -c switch which allow you to make an explicit amending commit before rewriting a changeset.:

$ hg record -m 'feature A'
# oups, I forget some stuff
$ hg record babar.py
$ hg amend -c .^ # .^ refer to "working directoy parent, here 'feature A'

Warning

hg commit --amend from Mercurial 2.2 does not lay obsolet marker yet and should not be used.

note: refresh is an alias for amend

hg qpop

the following command emulate the behavior of hg qpop:

$ hg gdown

If you need to go back to an arbitrary commit you can just use:

$ hg update

Note

gdown and update allow movement with working directory changes applied and gracefully merge them.

hg qpush

When you rewrite changesets, descendants of rewritten changesets are marked as "unstable". You need to rewrite them on top of the new version of their ancestor.

The evolution extension adds a command to rewrite "unstable" changesets:

$ hg stabilize

You can also decide to do it manually using:

$ hg graft -O <old-version>

or:

$ hg rebase -r <revset for old version> -d .

note: using graft allow you to pick the changeset you want next as the --move option of qpush do.

hg qrm

evolution introduce a new command to mark a changeset as "obsolete".:

$ hg kill <revset>

hg qfold

$ hg up <top-most-changeset>
$ amend --edit -c <bottom-most-changeset>

or later:

$ hg collapse # XXX not implemented
$ hg rebase --collapse # XXX not tested

hg qdiff

odiff is an alias for hg diff -r .^ it works as qdiff, but outside mq.

hg qfinish and hg qimport

Are not necessary anymore. If you want to control exchange and mutability of changesets, see the phase feature

hg qcommit

If you really need to send patches through versioned mq patches, you should look at the qsync extension.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.