change email

Greg Lindahl lindahl at pbm.com
Mon Feb 18 14:56:12 CST 2008


I use "incoming.notify" on my central repo to send out change emails.

These appear from the email address of the owner of the central repo.

I'd prefer that the author of the changeset be the From:.

The following blecherous hack does this. But it modifies all From:
emails, which isn't right: "changegroup.notify" emails can have
multiple, different authors.

Do other users of "incoming.notify" think that doing this the right
way would be useful? Or did I miss an existing mechanism for doing
this?

--- notify.py.save      2007-10-23 16:17:35.000000000 -0700
+++ notify.py   2007-10-23 16:19:25.000000000 -0700
@@ -204,7 +204,9 @@
 
             sender = msg['From']
             if not sender:
-                sender = self.ui.config('email', 'from') or self.ui.username()
+                changes = self.repo.changelog.read(node)
+                sender = changes[1]
+#                sender = self.ui.config('email', 'from') or self.ui.username()
             if '@' not in sender or '@localhost' in sender:
                 sender = self.fixmail(sender)
             del msg['From']



More information about the Mercurial mailing list