Patchwork D4145: fix: pull out flag definitions to make them re-usable from extensions

login
register
mail settings
Submitter phabricator
Date Aug. 8, 2018, 12:10 p.m.
Message ID <7c7fd24cd9bdb638e3ef50112475c53d@localhost.localdomain>
Download mbox | patch
Permalink /patch/33416/
State Not Applicable
Headers show

Comments

phabricator - Aug. 8, 2018, 12:10 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb0c591950e51: fix: pull out flag definitions to make them re-usable from extensions (authored by hooper, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4145?vs=10020&id=10069

REVISION DETAIL
  https://phab.mercurial-scm.org/D4145

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS




To: hooper, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -96,15 +96,16 @@ 
 # user.
 configitem('fix', 'maxfilesize', default='2MB')
 
-@command('fix',
-    [('', 'all', False, _('fix all non-public non-obsolete revisions')),
-     ('', 'base', [], _('revisions to diff against (overrides automatic '
-                        'selection, and applies to every revision being '
-                        'fixed)'), _('REV')),
-     ('r', 'rev', [], _('revisions to fix'), _('REV')),
-     ('w', 'working-dir', False, _('fix the working directory')),
-     ('', 'whole', False, _('always fix every line of a file'))],
-    _('[OPTION]... [FILE]...'))
+allopt = ('', 'all', False, _('fix all non-public non-obsolete revisions'))
+baseopt = ('', 'base', [], _('revisions to diff against (overrides automatic '
+                             'selection, and applies to every revision being '
+                             'fixed)'), _('REV'))
+revopt = ('r', 'rev', [], _('revisions to fix'), _('REV'))
+wdiropt = ('w', 'working-dir', False, _('fix the working directory'))
+wholeopt = ('', 'whole', False, _('always fix every line of a file'))
+usage = _('[OPTION]... [FILE]...')
+
+@command('fix', [allopt, baseopt, revopt, wdiropt, wholeopt], usage)
 def fix(ui, repo, *pats, **opts):
     """rewrite file content in changesets or working directory