changeset 14617:23f4e1e40988

notify: send changesets on 'outgoing' hook, updated doc
author Ingo Bressler <dev@ingobressler.net>
date Tue, 14 Jun 2011 13:29:25 +0200
parents 64dfbe576455
children 110d75f0abb3
files hgext/notify.py tests/test-notify.t
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/notify.py	Tue Jun 14 13:31:32 2011 +1000
+++ b/hgext/notify.py	Tue Jun 14 13:29:25 2011 +0200
@@ -21,6 +21,8 @@
   incoming.notify = python:hgext.notify.hook
   # batch emails when many changesets incoming at one time
   changegroup.notify = python:hgext.notify.hook
+  # batch emails when many changesets outgoing at one time (client side)
+  outgoing.notify = python:hgext.notify.hook
 
   [notify]
   # config items go here
@@ -37,7 +39,8 @@
   style = ...            # style file to use when formatting email
   template = ...         # template to use when formatting email
   incoming = ...         # template to use when run as incoming hook
-  changegroup = ...      # template when run as changegroup hook
+  outgoing = ...         # template to use when run as outgoing hook
+  changegroup = ...      # template to use when run as changegroup hook
   maxdiff = 300          # max lines of diffs to include (0=none, -1=all)
   maxsubject = 67        # truncate subject line longer than this
   diffstat = True        # add a diffstat before the diff content
@@ -290,7 +293,7 @@
     ui.pushbuffer()
     data = ''
     count = 0
-    if hooktype == 'changegroup':
+    if hooktype == 'changegroup' or hooktype == 'outgoing':
         start, end = ctx.rev(), len(repo)
         for rev in xrange(start, end):
             if n.node(repo[rev]):
--- a/tests/test-notify.t	Tue Jun 14 13:31:32 2011 +1000
+++ b/tests/test-notify.t	Tue Jun 14 13:29:25 2011 +0200
@@ -32,6 +32,8 @@
     incoming.notify = python:hgext.notify.hook
     # batch emails when many changesets incoming at one time
     changegroup.notify = python:hgext.notify.hook
+    # batch emails when many changesets outgoing at one time (client side)
+    outgoing.notify = python:hgext.notify.hook
   
     [notify]
     # config items go here
@@ -48,7 +50,8 @@
     style = ...            # style file to use when formatting email
     template = ...         # template to use when formatting email
     incoming = ...         # template to use when run as incoming hook
-    changegroup = ...      # template when run as changegroup hook
+    outgoing = ...         # template to use when run as outgoing hook
+    changegroup = ...      # template to use when run as changegroup hook
     maxdiff = 300          # max lines of diffs to include (0=none, -1=all)
     maxsubject = 67        # truncate subject line longer than this
     diffstat = True        # add a diffstat before the diff content