The keys of keyword arguments should be str.
- skip-blame because we are adding just r'' prefixes.
hg-reviewers |
The keys of keyword arguments should be str.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | hgext/fastannotate/commands.py (8 lines) |
def bad(x, y): | def bad(x, y): | ||||
raise error.Abort("%s: %s" % (x, y)) | raise error.Abort("%s: %s" % (x, y)) | ||||
ctx = scmutil.revsingle(repo, rev) | ctx = scmutil.revsingle(repo, rev) | ||||
m = scmutil.match(ctx, pats, opts, badfn=bad) | m = scmutil.match(ctx, pats, opts, badfn=bad) | ||||
for p in ctx.walk(m): | for p in ctx.walk(m): | ||||
yield p | yield p | ||||
fastannotatecommandargs = { | fastannotatecommandargs = { | ||||
'options': [ | r'options': [ | ||||
('r', 'rev', '.', _('annotate the specified revision'), _('REV')), | ('r', 'rev', '.', _('annotate the specified revision'), _('REV')), | ||||
('u', 'user', None, _('list the author (long with -v)')), | ('u', 'user', None, _('list the author (long with -v)')), | ||||
('f', 'file', None, _('list the filename')), | ('f', 'file', None, _('list the filename')), | ||||
('d', 'date', None, _('list the date (short with -q)')), | ('d', 'date', None, _('list the date (short with -q)')), | ||||
('n', 'number', None, _('list the revision number (default)')), | ('n', 'number', None, _('list the revision number (default)')), | ||||
('c', 'changeset', None, _('list the changeset')), | ('c', 'changeset', None, _('list the changeset')), | ||||
('l', 'line-number', None, _('show line number at the first ' | ('l', 'line-number', None, _('show line number at the first ' | ||||
'appearance')), | 'appearance')), | ||||
('e', 'deleted', None, _('show deleted lines (slow) (EXPERIMENTAL)')), | ('e', 'deleted', None, _('show deleted lines (slow) (EXPERIMENTAL)')), | ||||
('', 'no-content', None, _('do not show file content (EXPERIMENTAL)')), | ('', 'no-content', None, _('do not show file content (EXPERIMENTAL)')), | ||||
('', 'no-follow', None, _("don't follow copies and renames")), | ('', 'no-follow', None, _("don't follow copies and renames")), | ||||
('', 'linear', None, _('enforce linear history, ignore second parent ' | ('', 'linear', None, _('enforce linear history, ignore second parent ' | ||||
'of merges (EXPERIMENTAL)')), | 'of merges (EXPERIMENTAL)')), | ||||
('', 'long-hash', None, _('show long changeset hash (EXPERIMENTAL)')), | ('', 'long-hash', None, _('show long changeset hash (EXPERIMENTAL)')), | ||||
('', 'rebuild', None, _('rebuild cache even if it exists ' | ('', 'rebuild', None, _('rebuild cache even if it exists ' | ||||
'(EXPERIMENTAL)')), | '(EXPERIMENTAL)')), | ||||
] + commands.diffwsopts + commands.walkopts + commands.formatteropts, | ] + commands.diffwsopts + commands.walkopts + commands.formatteropts, | ||||
'synopsis': _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...'), | r'synopsis': _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...'), | ||||
'inferrepo': True, | r'inferrepo': True, | ||||
} | } | ||||
def fastannotate(ui, repo, *pats, **opts): | def fastannotate(ui, repo, *pats, **opts): | ||||
"""show changeset information by line for each file | """show changeset information by line for each file | ||||
List changes in files, showing the revision id responsible for each line. | List changes in files, showing the revision id responsible for each line. | ||||
This command is useful for discovering when a change was made and by whom. | This command is useful for discovering when a change was made and by whom. | ||||
if showlines: | if showlines: | ||||
result, lines = result | result, lines = result | ||||
formatter.write(result, lines, existinglines=existinglines) | formatter.write(result, lines, existinglines=existinglines) | ||||
formatter.end() | formatter.end() | ||||
_newopts = set([]) | _newopts = set([]) | ||||
_knownopts = set([opt[1].replace('-', '_') for opt in | _knownopts = set([opt[1].replace('-', '_') for opt in | ||||
(fastannotatecommandargs['options'] + commands.globalopts)]) | (fastannotatecommandargs[r'options'] + commands.globalopts)]) | ||||
def _annotatewrapper(orig, ui, repo, *pats, **opts): | def _annotatewrapper(orig, ui, repo, *pats, **opts): | ||||
"""used by wrapdefault""" | """used by wrapdefault""" | ||||
# we need this hack until the obsstore has 0.0 seconds perf impact | # we need this hack until the obsstore has 0.0 seconds perf impact | ||||
if ui.configbool('fastannotate', 'unfilteredrepo'): | if ui.configbool('fastannotate', 'unfilteredrepo'): | ||||
repo = repo.unfiltered() | repo = repo.unfiltered() | ||||
# treat the file as text (skip the isbinary check) | # treat the file as text (skip the isbinary check) |