annotate doc/Makefile @ 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 9ef0850b9b68
children 3840cefa5222
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
671
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
1 SOURCES=$(wildcard *.[0-9].txt)
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
2 MAN=$(SOURCES:%.txt=%)
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
3 HTML=$(SOURCES:%.txt=%.html)
465
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
4
1006
b0e581438835 Generate html documentation by default, too.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 671
diff changeset
5 all: man html
465
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
6
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
7 man: $(MAN)
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
8
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
9 html: $(HTML)
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
10
1814
7956893e8458 generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1689
diff changeset
11 hg.1.txt: hg.1.gendoc.txt
7956893e8458 generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1689
diff changeset
12 touch hg.1.txt
7956893e8458 generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1689
diff changeset
13
1819
d657bfdc06c4 Regenerate hg.1.gendoc.txt if commands.py changed.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1814
diff changeset
14 hg.1.gendoc.txt: ../mercurial/commands.py
1814
7956893e8458 generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1689
diff changeset
15 python gendoc.py > $@
7956893e8458 generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1689
diff changeset
16
671
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
17 %: %.xml
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
18 xmlto man $*.xml
465
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
19
671
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
20 %.xml: %.txt
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
21 asciidoc -d manpage -b docbook $*.txt
465
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
22
671
efa4a7e2f322 Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents: 465
diff changeset
23 %.html: %.txt
1689
c6c76ead1cc1 Fall back to asciidoc6 html backend if html4 doesn't work.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1428
diff changeset
24 asciidoc -b html4 $*.txt || asciidoc -b html $*.txt
465
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
25
f8cb8d082d40 Add a doc makefile
mpm@selenic.com
parents:
diff changeset
26 clean:
1879
9ef0850b9b68 make clean now removes generated documentation.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1819
diff changeset
27 $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt