comparison mercurial/commands.py @ 40755:d4c550c703d7

annotate: start pager soon after command options are validated It helps extracting helper class.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Nov 2018 18:41:44 +0900
parents e7d6a9082bdf
children 92c574684f75
comparison
equal deleted inserted replaced
40754:e7d6a9082bdf 40755:d4c550c703d7
331 rev = opts.get('rev') 331 rev = opts.get('rev')
332 if rev: 332 if rev:
333 repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') 333 repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
334 ctx = scmutil.revsingle(repo, rev) 334 ctx = scmutil.revsingle(repo, rev)
335 335
336 ui.pager('annotate')
336 rootfm = ui.formatter('annotate', opts) 337 rootfm = ui.formatter('annotate', opts)
337 if ui.debugflag: 338 if ui.debugflag:
338 shorthex = pycompat.identity 339 shorthex = pycompat.identity
339 else: 340 else:
340 def shorthex(h): 341 def shorthex(h):
378 'rev': 'number', 379 'rev': 'number',
379 'node': 'changeset', 380 'node': 'changeset',
380 'path': 'file', 381 'path': 'file',
381 'lineno': 'line_number', 382 'lineno': 'line_number',
382 } 383 }
383
384 ui.pager('annotate')
385 384
386 if rootfm.isplain(): 385 if rootfm.isplain():
387 def makefunc(get, fmt): 386 def makefunc(get, fmt):
388 return lambda x: fmt(get(x)) 387 return lambda x: fmt(get(x))
389 else: 388 else: