annotate: start pager soon after command options are validated
It helps extracting helper class.
--- a/mercurial/commands.py Sat Nov 24 18:38:44 2018 +0900
+++ b/mercurial/commands.py Sat Nov 24 18:41:44 2018 +0900
@@ -333,6 +333,7 @@
repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
ctx = scmutil.revsingle(repo, rev)
+ ui.pager('annotate')
rootfm = ui.formatter('annotate', opts)
if ui.debugflag:
shorthex = pycompat.identity
@@ -381,8 +382,6 @@
'lineno': 'line_number',
}
- ui.pager('annotate')
-
if rootfm.isplain():
def makefunc(get, fmt):
return lambda x: fmt(get(x))