pretxnchangegroup regression?

Steven Stallion sstallion at gmail.com
Fri May 11 00:00:43 CDT 2012


All,

After upgrading to 2.2.1 I've noticed that my pretxnchangegroup hooks
started failing. Any attempt to do operate on the repository would end
up bailing with: 00changelog.i at 539e4b31b6dc: no node. I'm wondering if
this is a regression - this hook had been in use for the last year or
so on 1.7.5 with no problems.

The line that is blowing out in the sh hook is:

AUTHOR=`$HG log -r $HG_NODE --template "{author}"` || exit 1

I made the following change to tests/test-hook.t to verify behavior:

diff -r ddd4996740c7 tests/test-hook.t
--- a/tests/test-hook.t	Tue May 08 12:05:45 2012 -0500
+++ b/tests/test-hook.t	Thu May 10 21:58:44 2012 -0700
@@ -246,7 +246,7 @@
 incoming changes no longer there after

   $ echo '[hooks]' > .hg/hgrc
-  $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
+  $ echo 'pretxnchangegroup.forbid0 = hg log -r tip --template
"{author}\\n"' >> .hg/hgrc
   $ echo 'pretxnchangegroup.forbid1 = python "$TESTDIR"/printenv.py
pretxnchangegroup.forbid 1' >> .hg/hgrc
   $ hg pull ../a
   pulling from ../a
@@ -255,7 +255,7 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  4:539e4b31b6dc
+  test
   pretxnchangegroup.forbid hook:
HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b
HG_SOURCE=pull HG_URL=file:$TESTTMP/a
   transaction abort!
   rollback completed

This results in a similar failure:

$ python run-tests.py test-hook.t

--- /Users/stallion/Source/hg/tests/test-hook.t
+++ /Users/stallion/Source/hg/tests/test-hook.t.err
@@ -275,15 +275,10 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  changeset:   4:539e4b31b6dc
-  tag:         la
-  tag:         tip
-  user:        test
-  date:        Thu Jan 01 00:00:03 1970 +0000
-  summary:     Added tag a for changeset 07f3376c1e65
+  abort: 00changelog.i at 539e4b31b6dc: no node!
   transaction abort!
   rollback completed
-  abort: pretxnchangegroup.forbid1 hook exited with status 1
+  abort: pretxnchangegroup.forbid0 hook exited with status 255
   [255]
   $ hg -q tip
   3:07f3376c1e65

ERROR: /Users/stallion/Source/hg/tests/test-hook.t output changed
!
Failed test-hook.t: output changed
# Ran 1 tests, 0 skipped, 1 failed.

Am I missing something? For now I've disabled the hook, but I haven't
seen anything on the list to suggest others have come across this.

Cheers,

Steve


More information about the Mercurial-devel mailing list