Mercurial > hg
view tests/test-update-reverse.out @ 2155:ff255b41b4aa
support hooks written in python.
to write hook in python, create module with hook function inside.
make sure mercurial can import module (put it in $PYTHONPATH or load it
as extension). hook function should look like this:
def myhook(ui, repo, hooktype, **kwargs):
if hook_passes:
return True
elif hook_explicitly_fails:
return False
elif some_other_failure:
import util
raise util.Abort('helpful failure message')
else:
return
# implicit return of None makes hook fail!
then in .hgrc, add hook with "python:" prefix:
[hooks]
commit = python:mymodule.myhook
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 28 Apr 2006 15:50:22 -0700 |
parents | 7544700fd931 |
children | b2ae81a7df29 |
line wrap: on
line source
Main should be gone a changeset: 3:ded32b0db104 tag: tip user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: Added side2 changeset: 2:92a816cea698 parent: 0:537353581d3d user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: Added side1 changeset: 1:221226fb2bd8 user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: Added main changeset: 0:537353581d3d user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: Added a Should have two heads, side2 and main changeset: 3:ded32b0db104 tag: tip user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: Added side2 changeset: 1:221226fb2bd8 user: test date: Mon Jan 12 13:46:40 1970 +0000 summary: Added main Should show a side1 side2 a side1 side2 resolving manifests force 1 allow None moddirstate True linear False ancestor 8515d4bfda76 local 1c0f48f8ece6 remote 0594b9004bae remote deleted side2, clobbering remote deleted side1, clobbering remote created main getting main removing side1 removing side2 1 files updated, 0 files merged, 2 files removed, 0 files unresolved Should only show a main a main