histedit: remove redundant checks for unfinished histedit state
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 28 Sep 2021 09:25:05 -0700
changeset 48053 6256c7525222
parent 48052 d07d38ef6362
child 48054 f27a83399abb
histedit: remove redundant checks for unfinished histedit state Both text-based and curses-based histedit already check for unfinished operations (not just unfinished histedit), so there's no need to check specifically for unfinished histedit. Differential Revision: https://phab.mercurial-scm.org/D11508
hgext/histedit.py
--- a/hgext/histedit.py	Tue Sep 28 13:43:14 2021 +0200
+++ b/hgext/histedit.py	Tue Sep 28 09:25:05 2021 -0700
@@ -1697,13 +1697,6 @@
         cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
 
-        if os.path.exists(os.path.join(repo.path, b'histedit-state')):
-            raise error.Abort(
-                _(
-                    b'history edit already in progress, try '
-                    b'--continue or --abort'
-                )
-            )
         revs.extend(freeargs)
         if not revs:
             defaultrev = destutil.desthistedit(ui, repo)
@@ -1928,7 +1921,7 @@
             return f.read()
 
 
-def _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs):
+def _validateargs(ui, repo, freeargs, opts, goal, rules, revs):
     # TODO only abort if we try to histedit mq patches, not just
     # blanket if mq patches are applied somewhere
     mq = getattr(repo, 'mq', None)
@@ -1954,13 +1947,6 @@
                 _(b'only --commands argument allowed with --edit-plan')
             )
     else:
-        if state.inprogress():
-            raise error.Abort(
-                _(
-                    b'history edit already in progress, try '
-                    b'--continue or --abort'
-                )
-            )
         if outg:
             if revs:
                 raise error.Abort(_(b'no revisions allowed with --outgoing'))
@@ -1990,7 +1976,7 @@
     rules = opts.get(b'commands', b'')
     state.keep = opts.get(b'keep', False)
 
-    _validateargs(ui, repo, state, freeargs, opts, goal, rules, revs)
+    _validateargs(ui, repo, freeargs, opts, goal, rules, revs)
 
     hastags = False
     if revs: