[PATCH 3 of 4] annotate: start pager soon after command options are validated

Yuya Nishihara yuya at tcha.org
Sat Nov 24 07:34:17 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1543052504 -32400
#      Sat Nov 24 18:41:44 2018 +0900
# Node ID 3ba66c3809b43da8216aea05b0cef15bf3a53109
# Parent  b37d6fbea8df01bd7ea822435f4bfce2a97112e7
annotate: start pager soon after command options are validated

It helps extracting helper class.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -333,6 +333,7 @@ def annotate(ui, repo, *pats, **opts):
         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 @@ def annotate(ui, repo, *pats, **opts):
         'lineno': 'line_number',
     }
 
-    ui.pager('annotate')
-
     if rootfm.isplain():
         def makefunc(get, fmt):
             return lambda x: fmt(get(x))


More information about the Mercurial-devel mailing list