The go programming language has a page on code reviews using mq and it states: "Since pulling, pushing, updating and committing while mq patches are applied can damage your repository".
I understand why pushing or updating could be an issue, but is pulling an issue?
If you have mq patches applied and you pull will your repository be damaged?
It can certainly be an issue if you accidentally merge with the upstream changesets while you have MQ patches applied in your repository. Here's a scenario I just tried out which seems to exhibit problems:
hg qpush -a
hg pull
(but don'thg update
). this creates a new branch (hg heads
shows the branch you're on asqtip
and the new branch you just pulled astip
)hg update -C tip
, but do so without popping your patches.hg merge
. Oops! You just merged in an MQ patch that was neverqfinished
.Since MQ works by creating and destroying history, the patch changesets look like normal parts of the history. However, since you "leap-frogged" over the applied patches and merged them with a non-patch changeset, you can no longer pop the patches off. In fact, running
hg qpop
will abort with a message saying:I generally just try to be careful and conscious about pulling or pushing when I'm working with a patch queue, but the hooks suggested by the go page provide a nice safeguard.
Note that you can always rebase your patches on top of upstream changesets as well. See this page for a description of how to do that.