From patchwork Wed Sep 29 04:52:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11508: histedit: remove redundant checks for unfinished histedit state From: phabricator X-Patchwork-Id: 49832 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 29 Sep 2021 04:52:24 +0000 martinvonz created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY 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. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11508 AFFECTED FILES hgext/histedit.py CHANGE DETAILS To: martinvonz, durin42, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -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: