[issue229] Hooks that use the python: syntax

Daniel Santa Cruz byteshack at gmail.com
Thu May 4 17:14:41 CDT 2006


Maybe I'm missing something?

Here is a proof-of-concept of what I'm tryingn to do.  This is what I
get for the output:

$ ./proof.sh
pushing to ../trunk
searching for changes
common changesets up to e630d87abff0
adding changesets
add changeset 5dbf335ab08e
adding manifests
adding file changes
adding a.txt revisions
added 1 changesets with 1 changes to 1 files
calling hook incoming: myhook.hook
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line
3480, in dispatch
    return d()
  File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line
3455, in <lambda>
    d = lambda: func(u, repo, *args, **cmdoptions)
  File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line
2300, in push
    r = repo.push(other, opts['force'], revs=revs)
  File "/usr/lib/python2.4/site-packages/mercurial/localrepo.py", line
1112, in push
    return remote.addchangegroup(cg)
  File "/usr/lib/python2.4/site-packages/mercurial/localrepo.py", line
1538, in addchangegroup
    self.hook("incoming", node=hex(self.changelog.node(i)))
  File "/usr/lib/python2.4/site-packages/mercurial/localrepo.py", line
148, in hook
    r = callhook(hname, cmd[7:].strip()) and r
  File "/usr/lib/python2.4/site-packages/mercurial/localrepo.py", line
93, in callhook
    raise util.Abort(_('%s hook is invalid '
Abort: incoming hook is invalid (import of "myhook" failed)
abort: incoming hook is invalid (import of "myhook" failed)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proof.sh
Type: application/x-sh
Size: 709 bytes
Desc: not available
Url : http://www.selenic.com/pipermail/mercurial/attachments/20060504/3798e41b/proof.sh


More information about the Mercurial mailing list