Patchwork D10459: cmdutil: fix an uninitialize variable usage in clearunfinished()

login
register
mail settings
Submitter phabricator
Date April 17, 2021, 5:13 a.m.
Message ID <differential-rev-PHID-DREV-uog2meg4dapz6ijcxalj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48776/
State Superseded
Headers show

Comments

phabricator - April 17, 2021, 5:13 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I happened to notice that PyCharm flagged this while looking for something else.
  I'm pretty sure it meant to check the current state in the iteration, and not
  keep reusing the last one in the previous iteration.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3776,7 +3776,7 @@ 
             raise error.StateError(state.msg(), hint=state.hint())
 
     for s in statemod._unfinishedstates:
-        if s._opname == b'merge' or state._reportonly:
+        if s._opname == b'merge' or s._reportonly:
             continue
         if s._clearable and s.isunfinished(repo):
             util.unlink(repo.vfs.join(s._fname))