[PATCH STABLE] notify: fix fromauthor setting for 'incoming' hook type (issue4194)

Bruce Cran bruce.cran at gmail.com
Mon Oct 5 17:25:04 UTC 2015


# HG changeset patch
# User Bruce Cran <bruce.cran at gmail.com>
# Date 1444063396 21600
#      Mon Oct 05 10:43:16 2015 -0600
# Branch stable
# Node ID df6193e2344862558ca72c3f1fc23496b684406b
# Parent  93bfa9fc96e31f1cc5f444bdc2436966c665cf1f
notify: fix fromauthor setting for 'incoming' hook type (issue4194)

Set the author field in notification emails for the 'incoming' hook type
in addition to 'changegroup' and 'outgoing' types.

diff --git a/hgext/notify.py b/hgext/notify.py
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -401,16 +401,18 @@ def hook(ui, repo, hooktype, node=None, 
     else:
         if not n.node(ctx):
             ui.popbuffer()
             ui.note(_('notify: suppressing notification for merge %d:%s\n') %
                     (ctx.rev(), ctx.hex()[:12]))
             return
         count += 1
         n.diff(ctx)
+        if not author:
+            author = ctx.user()
 
     data += ui.popbuffer()
     fromauthor = ui.config('notify', 'fromauthor')
     if author and fromauthor:
         data = '\n'.join(['From: %s' % author, data])
 
     if count:
         n.send(ctx, count, data)


More information about the Mercurial-devel mailing list