Mercurial > hg
comparison hgext/notify.py @ 9104:c9c5aa12a46e
notify: cleanup module docstring
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Thu, 09 Jul 2009 22:42:43 +0200 |
parents | 27a41250a9ce |
children | 6188f2cc4a37 |
comparison
equal
deleted
inserted
replaced
9103:9c7a5d70e72f | 9104:c9c5aa12a46e |
---|---|
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2, incorporated herein by reference. | 6 # GNU General Public License version 2, incorporated herein by reference. |
7 | 7 |
8 '''hooks for sending email notifications at commit/push time | 8 '''hooks for sending email notifications at commit/push time |
9 | 9 |
10 Subscriptions can be managed through hgrc. Default mode is to print messages | 10 Subscriptions can be managed through a hgrc file. Default mode is to print |
11 to stdout, for testing and configuring. | 11 messages to stdout, for testing and configuring. |
12 | 12 |
13 To use, configure notify extension and enable in hgrc like this: | 13 To use, configure the notify extension and enable it in hgrc like this: |
14 | 14 |
15 [extensions] | 15 [extensions] |
16 hgext.notify = | 16 hgext.notify = |
17 | 17 |
18 [hooks] | 18 [hooks] |
20 incoming.notify = python:hgext.notify.hook | 20 incoming.notify = python:hgext.notify.hook |
21 # batch emails when many changesets incoming at one time | 21 # batch emails when many changesets incoming at one time |
22 changegroup.notify = python:hgext.notify.hook | 22 changegroup.notify = python:hgext.notify.hook |
23 | 23 |
24 [notify] | 24 [notify] |
25 # config items go in here | 25 # config items go here |
26 | 26 |
27 config items: | 27 Required configuration items: |
28 | 28 |
29 REQUIRED: | |
30 config = /path/to/file # file containing subscriptions | 29 config = /path/to/file # file containing subscriptions |
31 | 30 |
32 OPTIONAL: | 31 Optional configuration items: |
32 | |
33 test = True # print messages to stdout for testing | 33 test = True # print messages to stdout for testing |
34 strip = 3 # number of slashes to strip for url paths | 34 strip = 3 # number of slashes to strip for url paths |
35 domain = example.com # domain to use if committer missing domain | 35 domain = example.com # domain to use if committer missing domain |
36 style = ... # style file to use when formatting email | 36 style = ... # style file to use when formatting email |
37 template = ... # template to use when formatting email | 37 template = ... # template to use when formatting email |
45 [email] | 45 [email] |
46 from = user@host.com # email address to send as if none given | 46 from = user@host.com # email address to send as if none given |
47 [web] | 47 [web] |
48 baseurl = http://hgserver/... # root of hg web site for browsing commits | 48 baseurl = http://hgserver/... # root of hg web site for browsing commits |
49 | 49 |
50 notify config file has same format as regular hgrc. it has two sections so | 50 The notify config file has same format as a regular hgrc file. It has two |
51 you can express subscriptions in whatever way is handier for you. | 51 sections so you can express subscriptions in whatever way is handier for you. |
52 | 52 |
53 [usersubs] | 53 [usersubs] |
54 # key is subscriber email, value is ","-separated list of glob patterns | 54 # key is subscriber email, value is ","-separated list of glob patterns |
55 user@host = pattern | 55 user@host = pattern |
56 | 56 |
57 [reposubs] | 57 [reposubs] |
58 # key is glob pattern, value is ","-separated list of subscriber emails | 58 # key is glob pattern, value is ","-separated list of subscriber emails |
59 pattern = user@host | 59 pattern = user@host |
60 | 60 |
61 glob patterns are matched against path to repository root. | 61 Glob patterns are matched against path to repository root. |
62 | 62 |
63 if you like, you can put notify config file in repository that users can push | 63 If you like, you can put notify config file in repository that users can push |
64 changes to, they can manage their own subscriptions. | 64 changes to, they can manage their own subscriptions. |
65 ''' | 65 ''' |
66 | 66 |
67 from mercurial.i18n import _ | 67 from mercurial.i18n import _ |
68 from mercurial import patch, cmdutil, templater, util, mail | 68 from mercurial import patch, cmdutil, templater, util, mail |