# HG changeset patch # User Matt Mackall # Date 2015-10-07 18:44:48 # Node ID 875e5d89dc86a616ac43c12519ded0d1d75e13f5 # Parent 0748083f28985fe4a7a539086250a0e4ad2eee22 # Parent 5a84a453b503d13b7a540cded3d52d0b50e3a57a merge with stable diff --git a/hgext/notify.py b/hgext/notify.py --- a/hgext/notify.py +++ b/hgext/notify.py @@ -406,6 +406,8 @@ def hook(ui, repo, hooktype, node=None, return count += 1 n.diff(ctx) + if not author: + author = ctx.user() data += ui.popbuffer() fromauthor = ui.config('notify', 'fromauthor') diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -713,7 +713,7 @@ def word(context, mapping, args): splitter = None tokens = text.split(splitter) - if num >= len(tokens): + if num >= len(tokens) or num < -len(tokens): return '' else: return tokens[num] diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -3448,6 +3448,11 @@ Test word for invalid numbers hg: parse error: word expects an integer index [255] +Test word for out of range + + $ hg log -R a --template "{word(10000, desc)}" + $ hg log -R a --template "{word(-10000, desc)}" + Test indent and not adding to empty lines $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a