# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 2014-01-16 19:57:52 # Node ID 0076643077a3ff7e77f71b5ae22b50cc1164c108 # Parent b4b77909318f8cfb2ed094f85117abed52d0cff0 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 diff --git a/hgext/record.py b/hgext/record.py --- a/hgext/record.py +++ b/hgext/record.py @@ -18,15 +18,6 @@ testedwith = 'internal' 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 @@ the hunk is left unchanged. @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 @@ def uisetup(ui): (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"))