cmdutil: fix an uninitialize variable usage in clearunfinished()
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 17 Apr 2021 00:28:21 -0400
changeset 46969 d9531094cf8e
parent 46968 2c843ad68528
child 46970 99aed233aa8d
cmdutil: fix an uninitialize variable usage in clearunfinished() 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. Differential Revision: https://phab.mercurial-scm.org/D10459
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Mon Apr 05 14:19:17 2021 +0800
+++ b/mercurial/cmdutil.py	Sat Apr 17 00:28:21 2021 -0400
@@ -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))