Mercurial_ The Definitive Guide - Bryan O'Sullivan [116]
The default data used when creating a changeset is as follows:
The commit date and time zone are the current date and time zone. Because this data is used to compute the identity of a changeset, this means that if you qpop a patch and qpush it again, the changeset that you push will have a different identity from the changeset you popped.
The author is the same as the default used by the hg commit command.
The commit message is any text from the patch file that comes before the first diff header. If there is no such text, a default commit message is used that identifies the name of the patch.
If a patch contains a Mercurial patch header, the information in the patch header overrides these defaults.
Options:
-a: Push all unapplied patches from the series file until there is none left to push.
-l: Add the name of the patch to the end of the commit message.
-m: If a patch fails to apply cleanly, use the entry for the patch in another saved queue to compute the parameters for a three-way merge, and perform a three-way merge using the normal Mercurial merge machinery. Use the resolution of the merge as the new patch content.
-n: Use the named queue if merging while pushing.
The qpush command reads, but does not modify, the series file. It appends one line to the hg status file for each patch that it pushes.
qrefresh—Update the Topmost Applied Patch
The qrefresh command updates the topmost applied patch. It modifies the patch, removes the old changeset that represented the patch, and creates a new changeset to represent the modified patch.
The qrefresh command looks for the following modifications:
Changes to the commit message, i.e., the text before the first diff header in the patch file, are reflected in the new changeset that represents the patch.
Modifications to tracked files in the working directory are added to the patch.
Changes to the files tracked using hg add, hg copy, hg remove, or hg rename.
Added files and copy and rename destinations are added to the patch, while removed files and rename sources are removed.
Even if qrefresh detects no changes, it still recreates the changeset that represents the patch. This causes the identity of the changeset to differ from the previous changeset that identified the patch.
Options:
-e: Modify the commit and patch description, using the preferred text editor.
-m: Modify the commit message and patch description, using the given text.
-l: Modify the commit message and patch description, using text from the given file.
qrename—Rename a Patch
The qrename command renames a patch, and changes the entry for the patch in the series file.
With a single argument, qrename renames the topmost applied patch. With two arguments, it renames its first argument to its second.
qseries—Print the Entire Patch Series
The qseries command prints the entire patch series from the series file. It prints only patch names, not empty lines or comments. It prints in order from first to be applied to last.
qtop—Print the Name of the Current Patch
The qtop command prints the name of the topmost currently applied patch.
qunapplied—Print Patches Not yet Applied
The qunapplied command prints the names of patches from the series file that are not yet applied. It prints them in order from the next patch that will be pushed to the last.
hg strip—Remove a Revision and Descendants
The hg strip command removes a revision, and all of its descendants, from the repository. It undoes the effects of the removed revisions from the repository, and updates the working directory to the first parent of the removed revision.
The hg strip command saves a backup of the removed changesets in a bundle, so that they can be reapplied if removed in error.
Options:
-b: Save unrelated changesets that are intermixed with the stripped changesets in the backup bundle.
-f: If a branch has multiple heads, remove all heads.
-n: Do not save a backup bundle.
MQ File Reference