Online Book Reader

Home Category

Mercurial_ The Definitive Guide - Bryan O'Sullivan [115]

By Root 970 0
By default, it prints the header of the topmost applied patch. Given an argument, it prints the header of the named patch.

qimport—Import a Third-Party Patch into the Queue

The qimport command adds an entry for an external patch to the series file, and copies the patch into the .hg/patches directory. It adds the entry immediately after the topmost applied patch, but does not push the patch.

If the .hg/patches directory is a repository, qimport automatically does an hg add of the imported patch.

qinit—Prepare a Repository to Work with MQ

The qinit command prepares a repository to work with MQ. It creates a directory called .hg/patches.

Option:

-c: Create .hg/patches as a repository in its own right. Also creates a .hgignore file that will ignore the status file.

When the .hg/patches directory is a repository, the qimport and qnew commands automatically hg add new patches.

qnew—Create a New Patch

The qnew command creates a new patch. It takes one mandatory argument, the name to use for the patch file. The newly created patch is created empty by default. It is added to the series file after the current topmost applied patch, and is immediately pushed on top of that patch.

If qnew finds modified files in the working directory, it will refuse to create a new patch unless the -f option is used (see below). This behavior allows you to qrefresh your topmost applied patch before you apply a new patch on top of it.

Options:

-f: Create a new patch if the contents of the working directory are modified. Any outstanding modifications are added to the newly created patch, so after this command completes, the working directory will no longer be modified.

-m: Use the given text as the commit message. This text will be stored at the beginning of the patch file, before the patch data.

qnext—Print the Name of the Next Patch

The qnext command prints the name of the next patch in the series file after the topmost applied patch. This patch will become the topmost applied patch if you run qpush.

qpop—Pop Patches Off the Stack

The qpop command removes applied patches from the top of the stack of applied patches. By default, it removes only one patch.

This command removes the changesets that represent the popped patches from the repository, and updates the working directory to undo the effects of the patches.

The qpop command takes an optional argument, which it uses as the name or index of the patch to pop to. If given a name, it will pop patches until the named patch is the topmost applied patch. If given a number, qpop treats the number as an index into the entries in the series file, counting from zero (empty lines and lines containing only comments do not count). It pops patches until the patch identified by the given index is the topmost applied patch.

The qpop command does not read or write patches or the series file. It is thus safe to qpop a patch that you have removed from the series file, or a patch that you have renamed or deleted entirely. In the latter two cases, use the name of the patch as it was when you applied it.

By default, the qpop command will not pop any patches if the working directory has been modified. You can override this behavior using the -f option, which reverts all modifications in the working directory.

Options:

-a: Pop all applied patches. This returns the repository to its state before you applied any patches.

-f: Forcibly revert any modifications to the working directory when popping.

-n: Pop a patch from the named queue.

The qpop command removes one line from the end of the status file for each patch that it pops.

qprev—Print the Name of the Previous Patch

The qprev command prints the name of the patch in the series file that comes before the topmost applied patch. This will become the topmost applied patch if you run qpop.

qpush—Push Patches onto the Stack

The qpush command adds patches onto the applied stack. By default, it adds only one patch.

This command creates a new changeset to represent each applied patch,

Return Main Page Previous Page Next Page

®Online Book Reader