diff hgext/fix.py @ 37595:e2506748b47f

fix: add --all flag to fix non-public non-obsolete revisions Differential Revision: https://phab.mercurial-scm.org/D3213
author Danny Hooper <hooper@google.com>
date Fri, 30 Mar 2018 16:40:25 -0700
parents 893ff8c3bc57
children 1edf3738e000
line wrap: on
line diff
--- a/hgext/fix.py	Sat Mar 24 14:28:24 2018 -0400
+++ b/hgext/fix.py	Fri Mar 30 16:40:25 2018 -0700
@@ -95,7 +95,8 @@
 configitem('fix', 'maxfilesize', default='2MB')
 
 @command('fix',
-    [('', 'base', [], _('revisions to diff against (overrides automatic '
+    [('', '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')),
@@ -125,6 +126,11 @@
     revisions are not forgotten in later ones. The --base flag can be used to
     override this default behavior, though it is not usually desirable to do so.
     """
+    if opts['all']:
+        if opts['rev']:
+            raise error.Abort(_('cannot specify both "--rev" and "--all"'))
+        opts['rev'] = ['not public() and not obsolete()']
+        opts['working_dir'] = True
     with repo.wlock(), repo.lock():
         revstofix = getrevstofix(ui, repo, opts)
         basectxs = getbasectxs(repo, opts, revstofix)