Commit Graph

85 Commits

Author SHA1 Message Date
Michal Sznajder
d536428fac notify: support revset selection for subscriptions
A repo pattern for any notify configuration contains a glob matching the
path to the repo. Additionally, it may now contain a revset spec, separated
from the glob by '#'.

Example:
  [reposubs]
  */widgets#branch(release) = qa-team@example.com

This sends to ``qa-team@example.com`` whenever a changeset on the ``release``
branch triggers a notification in any repository ending in ``widgets``.

This patch was completely done by David Champion <dgc@uchicago.edu> with me
making tiny changes to his tests.
2012-08-13 22:42:10 +02:00
Martin Geisler
f92437e97c merge with stable 2012-06-13 20:14:28 +02:00
David Champion
fe8fba0ab7 notify: various fixes to docstring
Typo corrections, grammar adjustments, clarity improvements.
2012-05-29 07:07:10 -05:00
Augie Fackler
96d44b39f7 hgext: mark all first-party extensions as such 2012-05-15 14:37:49 -05:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
FUJIWARA Katsunori
116491f524 doc: fix careless document miss in help of hgext/notify
according to configuration example below, and direction of changeset
transference, this paragraph should describe about "changegroup" hook.

  [hooks]
  # one email for each incoming changeset
  incoming.notify = python:hgext.notify.hook
  # one email for all incoming changesets
  changegroup.notify = python:hgext.notify.hook

  # one email for all outgoing changesets
  outgoing.notify = python:hgext.notify.hook
2012-04-23 00:30:45 +09:00
Nikolaus Schueler
efb688abc6 notify: change behavior of "changegroup" hook
Change the behavior so that the sender (the "From" header in the notification
mail) in case of the "changegroup" hook is the user that did the first commit
in the changegroup.  The option is configurable, if you set "notify.fromauthor"
to "True" in your config, the new behavior is activated.  If you do not set the
option, the behavior is as before.  The commit adds to an existing test to show
various aspects of the changed behavior.
2011-12-15 13:57:54 +01:00
Mads Kiilerich
ae4bd7a809 notify: add option for writing to mbox
This makes it possible to test how the mails that are sent _really_ look like.
2011-11-23 02:36:33 +01:00
Patrick Mezard
50825774f7 notify: rewrite user documentation
The main intent is to turn the reference help into a configuration walkthrough.
It also fix several things:
- Do not suggest to use it for commit notifications, it cannot work
- Fix notify.strip default value
- Mention that subscriptions can be setup in Mercurial configuration files
- Improve notify.strip and notify.domain documentation
2011-07-26 21:30:12 +02:00
Patrick Mezard
6be8a9192e notify: remove unused url() method 2011-07-13 19:23:33 +02:00
Ingo Bressler
215b100937 notify: send changesets on 'outgoing' hook, updated doc 2011-06-14 13:29:25 +02:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Yuya Nishihara
92b5cbe067 notify: use util.ellipsis() to truncate long subject 2010-12-24 01:17:18 +09:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
70de345b15 hgext: enable extensions without "hgext." prefix in help texts 2009-12-22 00:50:03 +01:00
David Champion
93e20c18e6 notify: permit suppression of merge changeset notification
In some environments merges occur regularly but with no conflicts, and
committers find merge notifications more of a bother than a help.

By setting merge=False in [notify], merge notifications are suppressed.
This works both for incoming and for changegroup hooks.
2009-09-23 02:31:09 -05:00
Bryan O'Sullivan
c2ccd4cd98 Merge with crew 2009-09-28 13:21:41 -07:00
Martin Geisler
9f1896c083 do not attempt to translate ui.debug output 2009-09-19 01:15:38 +02:00
Bryan O'Sullivan
f90184795a notify: make it possible to pass extra info into templates 2009-08-24 16:30:42 -07:00
Dirkjan Ochtman
8bd1e15bc5 merge with crew-stable 2009-08-05 17:21:29 +02:00
Christian Ebert
ba76e4ec6a notify: do not mime encode multipart templates
Mulitpart templates should take care of this themselves.
See http://www.selenic.com/pipermail/mercurial/2009-July/027017.html

Also catch potential parsing errors gracefully.
2009-08-05 17:19:08 +02:00
Martin Geisler
e682fe597d notify: wrap docstrings at 70 characters 2009-07-26 01:55:18 +02:00
Martin Geisler
3951831e0b commands: use minirst parser when displaying help 2009-07-16 23:25:26 +02:00
Nicolas Dumazet
7eadbe8d42 for calls expecting bool args, pass bool instead of int
str.splitlines and email.message.as_string both expect a bool argument
defaulting at False: replace f(1) by f(True) and f(0) by f()
2009-07-13 09:50:26 +09:00
Martin Geisler
82d550f2c0 notify: fix indentation in module docstring 2009-07-09 22:43:24 +02:00
Martin Geisler
c5357392bb notify: cleanup module docstring 2009-07-09 22:42:43 +02:00
Martin Geisler
06ba3dfad7 notify: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Dirkjan Ochtman
c8e6583765 extensions: change descriptions for hook-providing extensions
Thanks to timeless and Dave Townsend for advice!
2009-06-24 13:42:34 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Martin Geisler
91a80784c5 notify: turned a set-like dict into a real set 2009-04-24 17:32:18 +02:00
Matt Mackall
371257fd73 ui: fold readsections into readconfig
readconfig now reads only single files
readconfig takes an optional list of sections
readconfig trusts files we're looking for sections in
2009-04-23 15:40:10 -05:00
Martin Geisler
e45e28d3cc notify, commands: word-wrap help strings 2009-04-08 00:41:07 +02:00
Martin Geisler
249541da43 expand "repo" to "repository" in help texts 2009-04-07 22:58:05 +02:00
Peter Arrenbrecht
bc21361ed2 cleanup: drop unused imports 2009-03-23 13:12:07 +01:00
Jim Correia
78e5b53d7d add --git option to commands supporting --patch (log, incoming, history, tip)
No short -g form, since it would conflict with -g from the graphlog extension.
2009-02-14 22:40:39 +01:00
Dirkjan Ochtman
e4978a94f5 notify: use contexts more pervasively 2009-02-05 18:21:22 +01:00
Christian Ebert
eecec58b3f notify: remove subfunctions that are called only once 2009-01-25 11:10:51 +01:00
Christian Ebert
4f717b637b notify: fix neglect of custom headers set via template
0366830cd960 introduced a bug that discarded all custom headers.
Add custom header to test template.
2009-01-15 01:38:52 +01:00
Christian Ebert
220c0bd0c0 notify: no charset conversion when testing
Same as for patchbomb.
Make "test" a notifier attribute so we don't have to check
the boolean over and over.
2008-12-02 15:31:33 +01:00
Dirkjan Ochtman
9ef9b3e5db cmdutil: use change contexts for cset-printer and cset-templater 2008-11-14 13:59:25 +01:00
Dirkjan Ochtman
2f6d26d640 patch: turn patch.diff() into a generator
This should even be a little faster than passing in an fp argument.
2008-11-03 16:48:23 +01:00
Dirkjan Ochtman
c5e3760e1d help: better documentation intro for a few extensions 2008-10-18 16:56:39 +02:00
Christian Ebert
586a27bcb7 notify: mime-encode messages
- addresses will be properly encoded
- message bodies will also be encoded as we are not sending
  patches that are meant to be applied
- update test output
- adapt test-keyword to ignore the new headers
2008-07-12 19:12:18 +01:00
divy@chelsio.com
3a7f22fad0 notify: fix diffstat printing
notify.diff() keeps line breaks in the diff buffer before calling
patch.diffstat().
patch.diffstat() however adds another line break when feeding diffstat input.
The added extra empty line leads to erroneous diffstat output.
This fix removes the line breaks in notify.diff() and adds it back to print them.
2008-09-03 01:49:16 +02:00
Dennis Schoen
7468181527 fix changegroup.notify hook broken by 644888ebfa31 2008-09-02 15:41:51 +02:00
Dirkjan Ochtman
77285359e6 merge with crew-stable 2008-08-07 09:53:27 +02:00
Doug Philips
8e9dcfc98a Let the notify extension use [diff] options too. 2008-08-07 09:31:42 +02:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00