When trying to push to a repo that is protected with a pretxnchangegroup hook, I get this error: abort: 00changelog.i@b0933213c7e6: no node! The script tries to run "hg log -r bd559fee8e674321d046f8fbde845944ac7958bc:tip" When I run "hg debugknown" with the two node IDs, I get "11" in my local repo and "00" for the remote repo. For me, this looks as if the hook is run "outside" the transaction (i.e. at a time when the nodes are not yet added to the remote repo). A colleague of mine has the same problem. Server is running 2.2.1, I'm running 2.2.1. My colleague is running 1.8.4.
Hi Aaron, Can you show us the full script? You're correct that a pretxnchangegoup hook is run before the changesets are run before the transaction is complete. However, it can see the pending changesets. This is implemented by setting a HG_PENDING environment variable when executing the hook: if the hook runs "hg", then that process will see HG_PENDING and read a special pending changelog file. Other "hg" processes wont see HG_PENDING and wont read the pending changelog. So in other words: if you happen to clear the environment in your hook, then you will break this mechanism and the hook will no longer see the pending changeset.
Also, I should ask: where does bd559fee8e674321d046f8fbde845944ac7958bc come from? Is it $HG_NODE?
1. The variable HG_PENDING is set and contains the path to the repo into which I'm trying to push. 2. The relevant part of the script looks like so: hg log -r "$HG_NODE:tip" --template "{author}\n" No environment variables are cleared/modified in the script. "bd559fee8e674321d046f8fbde845944ac7958bc" is the ID the first changeset. As you assumed, it gets passed via $HG_NODE.
Hi! I also found same bug and I wrote full script to reproduce the problem completely. https://gist.github.com/2627033
Turning the bat file into an equivalent shell script: cd /tmp rm -rf repo clone hg init repo cd repo echo "hg heads" > .hg/heads.sh chmod +x .hg/heads.sh echo "[hooks]" > .hg/hgrc echo "pretxnchangegroup.heads = .hg/heads.sh" >> .hg/hgrc echo "a" > a hg commit -Am "added a" echo "b" > b hg commit -Am "added b" hg clone . ../clone cd ../clone hg update 0 echo "1" > 1 hg commit -Am "added 1" hg push -f let's 'hg bisect' reveal that the first bad revision is changeset: 16418:e5750c6716eb user: Matt Mackall <mpm@selenic.com> date: Fri Apr 13 21:35:48 2012 -0500 summary: revlog: increase readahead size
..a change that was backed out here: changeset: 16533:95698ee29181 branch: stable user: Matt Mackall <mpm@selenic.com> date: Fri Apr 27 13:07:29 2012 -0500 summary: revlog: backout e5750c6716eb ..so there was never a release that contained this change. Nor is it a very plausible candidate for causing anything other than performance changes.
mg's script doesn't fail for me.
What do we know about the node in the title?
It's an arbitrary changeset in the push. In my case, it was the last node but for a colleague, it was a node in the middle of the changegroup. Any command that I could run? For example a command that validates the structure of the repo or something?
Perhaps is obvious but this issue happens also in the pretxncommit Steps to reproduce: hg clone https://bitbucket.org/iperdomo/issue3428 # add [hooks] to the .hg/hgrc # [hooks] # pretxncommit = ./script/jscheck-hg echo "debugger;" >> test.js hg ci -m 'Dummy test' Performing jslint check on modified js resources abort: 00changelog.i@99c44b4e1569: no node!
Ok, well I'm still at a loss as to how to hit this issue. Martin, can you check your bisect again?
Also, can someone try adding --traceback to the command raising the abort?
I just made a simple commit and adding --traceback doesn't show any error stack trace. # Note 1: I'm using the repo mentioned in msg19935 hg --traceback commit -m 'Dummy commit 2' Performing jslint check on modified js resources abort: 00changelog.i@cc05fe7e0ffd: no node! # Note 2: The commit gets done hg log -l1 changeset: 3:cc05fe7e0ffd tag: tip user: Iván Perdomo <ivan.perdomo@openbravo.com> date: Tue May 08 22:57:23 2012 +0200 summary: Dummy commit 2
Presumably the error message comes from an hg command run in a hook, so that's where --traceback needs to be.
Attached you'll find traceback from to the 'hg log' call inside the hook
I retried the bisect, this time with a 'make local' as part of the bisect command. It now points to: changeset: 16414:e8d37b78acfb user: Bryan O'Sullivan <bryano@fb.com> date: Thu Apr 12 14:05:59 2012 -0700 summary: parsers: use base-16 trie for faster node->rev mapping This script is enough to provoke the error: rm -rf /tmp/{repo,clone} hg init /tmp/repo cd /tmp/repo echo "[hooks]" > .hg/hgrc echo "pretxnchangegroup = hg heads" >> .hg/hgrc echo "a" > a hg commit -Am "a" hg clone . ../clone cd ../clone echo "aa" > a hg commit -m "aa" hg push
Confirmed. Regression -> raising to urgent.
Test case: http://selenic.com/pipermail/mercurial-devel/2012-May/039883.html Bug fix: http://selenic.com/pipermail/mercurial-devel/2012-May/039884.html
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:31 EDT --- This bug was previously known as _bug_ 3428 at http://mercurial.selenic.com/bts/issue3428 Imported an attachment (id=1661) Bug Status was UNCONFIRMED but everconfirmed was true Setting status to CONFIRMED
Fixed by: http://www.selenic.com/hg/rev/e6dfbc5df76f
(In reply to comment #20) Is this fix included in version 2.2.2?
(In reply to comment #21) Yes. It is mentioned in the changelog here: http://mercurial.selenic.com/wiki/WhatsNew#Mercurial_2.2.2_.282012-06-01.29 I can also verify that I experienced the issue with 2.2.1 and no longer experience it with 2.2.2. Mark.
All of our developers have upgraded to release 2.2.3 one week ago and we didn't have any issues since. From our side, the bug can be closed.