# HG changeset patch # User Augie Fackler # Date 2017-02-19 20:09:41 # Node ID 3c22ad83868b018721737a1c0923fe5eb1068b73 # Parent 04344226b3ce8e3a1199067d9e38b33844f5fbcb annotate: start pager after we're sure we wont abort This avoids needlessly putting a short error message into the pager. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -361,7 +361,6 @@ def annotate(ui, repo, *pats, **opts): Returns 0 on success. """ - ui.pager('annotate') if not pats: raise error.Abort(_('at least one filename or pattern is required')) @@ -422,6 +421,8 @@ def annotate(ui, repo, *pats, **opts): if linenumber and (not opts.get('changeset')) and (not opts.get('number')): raise error.Abort(_('at least one of -n/-c is required for -l')) + ui.pager('annotate') + if fm.isplain(): def makefunc(get, fmt): return lambda x: fmt(get(x))