Skip to content
Snippets Groups Projects
Commit 0076643077a3 authored by Jordi Gutiérrez Hermoso's avatar Jordi Gutiérrez Hermoso
Browse files

record: use commands.diffwsopts instead of ad-hoc diffopts

The record extension is writing its own version of commands.diffwsopts
which is identical to commands.diffwsopts. Based on the principle that
code duplication increases maintenance burden, this patch removes
record's ad-hoc diffopts in favour of commands.diffwsopts
parent b4b77909318f
No related branches found
No related tags found
No related merge requests found
......@@ -18,15 +18,6 @@
lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
diffopts = [
('w', 'ignore-all-space', False,
_('ignore white space when comparing lines')),
('b', 'ignore-space-change', None,
_('ignore changes in the amount of white space')),
('B', 'ignore-blank-lines', None,
_('ignore changes whose lines are all blank')),
]
def scanpatch(fp):
"""like patch.iterhunks, but yield different events
......@@ -420,7 +411,7 @@
@command("record",
# same options as commit + white space diff options
commands.table['^commit|ci'][1][:] + diffopts,
commands.table['^commit|ci'][1][:] + commands.diffwsopts,
_('hg record [OPTION]... [FILE]...'))
def record(ui, repo, *pats, **opts):
'''interactively select changes to commit
......@@ -665,7 +656,7 @@
(qrecord,
# same options as qnew, but copy them so we don't get
# -i/--interactive for qrecord and add white space diff options
mq.cmdtable['^qnew'][1][:] + diffopts,
mq.cmdtable['^qnew'][1][:] + commands.diffwsopts,
_('hg qrecord [OPTION]... PATCH [FILE]...'))
_wrapcmd('qnew', mq.cmdtable, qnew, _("interactively record a new patch"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment