Question

I'm trying to run hg pull -u, but it gives the following error:

searching for changes
/bin/sh: !: not found
abort: preoutgoing.mq-no-push hook exited with status 1

my .hgrc includes this hook, which I'm guessing is causing the problem:

preoutgoing.mq-no-push = ! hg qtop > /dev/null 2>&1

hg incoming gives me the list of changes as I would expect and there are no mq patches in either the local or remote repository (hg qapplied and hg qseries return nothing).

The easy fix was to comment out this part of my .hgrc file. Then I could pull, but on merging I discovered that I had multiple heads in my repository, is that what was causing the error? If so, a more accurate error message might be nice. If not, does anybody have a better workaround?

Was it helpful?

Solution 2

It turns out that my /bin/sh is jsh, which defines ! differently. To get around this I changed the commands in my .hgrc file to explicitly call bash as follows:

prechangegroup.mq-no-pull = bash -c "! hg qtop > /dev/null 2>&1"
preoutgoing.mq-no-push = bash -c "! hg qtop > /dev/null 2>&1"

OTHER TIPS

The error message is accurate. The problem is that the mq-no-push hook exited with a status of 1. Mercuial doesn't know what the hook is for and so it can't tell you anything other than its return code. It's up to the hook itself to provide a meaningful message as to why you can't push.

If you look at the output before the abort line, you can see that the problem is that your shell /bin/sh cannot find the command ! which means that the hook isn't actually working and makes me believe that the hook is not formatted correctly. I don't know enough about Linux/Unix/MacOSX shells to know what the solution is. I looked on the mq extension page and the configuration that you have is the same as the examples given so I wonder if there is something set up incorrectly in your shell.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top