hgext/notify.py
changeset 9068 27a41250a9ce
parent 8935 f4f0e902b750
child 9104 c9c5aa12a46e
equal deleted inserted replaced
9067:2ebac2bf7ad5 9068:27a41250a9ce
     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
    10 Subscriptions can be managed through hgrc. Default mode is to print messages
    11 messages to stdout, for testing and configuring.
    11 to stdout, for testing and configuring.
    12 
    12 
    13 To use, configure notify extension and enable in hgrc like this:
    13 To use, configure notify extension and enable in hgrc like this:
    14 
    14 
    15    [extensions]
    15    [extensions]
    16    hgext.notify =
    16    hgext.notify =
    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
    50  notify config file has same format as regular hgrc. it has two sections so
    51  sections so you can express subscriptions in whatever way is handier
    51  you can express subscriptions in whatever way is handier for you.
    52  for you.
       
    53 
    52 
    54    [usersubs]
    53    [usersubs]
    55    # key is subscriber email, value is ","-separated list of glob patterns
    54    # key is subscriber email, value is ","-separated list of glob patterns
    56    user@host = pattern
    55    user@host = pattern
    57 
    56 
    59    # key is glob pattern, value is ","-separated list of subscriber emails
    58    # key is glob pattern, value is ","-separated list of subscriber emails
    60    pattern = user@host
    59    pattern = user@host
    61 
    60 
    62  glob patterns are matched against path to repository root.
    61  glob patterns are matched against path to repository root.
    63 
    62 
    64  if you like, you can put notify config file in repository that users
    63  if you like, you can put notify config file in repository that users can push
    65  can push changes to, they can manage their own subscriptions.'''
    64  changes to, they can manage their own subscriptions.
       
    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
    69 import email.Parser, fnmatch, socket, time
    69 import email.Parser, fnmatch, socket, time
    70 
    70