No subject

Schueler.external at lantiq.com Schueler.external at lantiq.com
Thu Nov 17 04:28:50 CST 2011


I got a question about the notify extension and a suggestion to improve it.

Do I see it right that for the "incoming.notify" hook the mail message contains the committer as sender, where as for "changegroup.notify" the mail has the user given in the config of the pushing repo as sender?

We here at Lantiq would prefer to have the first committer as sender for changegroup and I worked out a "solution" for this:

diff --git a/hgext/notify.py b/hgext/notify.py
--- a/hgext/notify.py
+++ b/hgext/notify.py
@@ -294,6 +294,7 @@ def hook(ui, repo, hooktype, node=None,
     data = ''
     count = 0
     if hooktype == 'changegroup' or hooktype == 'outgoing':
+        ui.write('From: %s\n' % ctx.user())
         start, end = ctx.rev(), len(repo)
         for rev in xrange(start, end):
             if n.node(repo[rev]):


But, as I see it, its not a clean solution because it does not use the templater classes that compose the mail text.

Could you think of a cleaner solution, maybe extending the templater in a way so you can prepend a "preamble" to the mail text? Additionally the templater would have to have a loop to compose the mail text for all the commits in the changegroup.



More information about the Mercurial-devel mailing list