Commit b5f78d47 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

annotate: check and update command options first

It helps extracting helper class.
parent 7c25d2233d53
......@@ -320,6 +320,14 @@ def annotate(ui, repo, *pats, **opts):
# to mimic the behavior of Mercurial before version 1.5
opts['file'] = True
if (not opts.get('user') and not opts.get('changeset')
and not opts.get('date') and not opts.get('file')):
opts['number'] = True
linenumber = opts.get('line_number') is not None
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'))
rev = opts.get('rev')
if rev:
repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
......@@ -373,14 +381,6 @@ def annotate(ui, repo, *pats, **opts):
'lineno': 'line_number',
}
if (not opts.get('user') and not opts.get('changeset')
and not opts.get('date') and not opts.get('file')):
opts['number'] = True
linenumber = opts.get('line_number') is not None
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 rootfm.isplain():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment