Patchwork D4146: fix: correctly set wdirwritten given that the dict item is deleted

login
register
mail settings
Submitter phabricator
Date Aug. 8, 2018, 12:10 p.m.
Message ID <b2aa3840a9ca461b617ee0eaa39d41d8@localhost.localdomain>
Download mbox | patch
Permalink /patch/33417/
State Not Applicable
Headers show

Comments

phabricator - Aug. 8, 2018, 12:10 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG35bc4b6e132d: fix: correctly set wdirwritten given that the dict item is deleted (authored by hooper, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4146?vs=10021&id=10071

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS




To: hooper, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -162,6 +162,7 @@ 
         # it makes the results more easily reproducible.
         filedata = collections.defaultdict(dict)
         replacements = {}
+        wdirwritten = False
         commitorder = sorted(revstofix, reverse=True)
         with ui.makeprogress(topic=_('fixing'), unit=_('files'),
                              total=sum(numitems.values())) as progress:
@@ -179,11 +180,12 @@ 
                     ctx = repo[rev]
                     if rev == wdirrev:
                         writeworkingdir(repo, ctx, filedata[rev], replacements)
+                        wdirwritten = bool(filedata[rev])
                     else:
                         replacerev(ui, repo, ctx, filedata[rev], replacements)
                     del filedata[rev]
 
-        cleanup(repo, replacements, bool(filedata[wdirrev]))
+        cleanup(repo, replacements, wdirwritten)
 
 def cleanup(repo, replacements, wdirwritten):
     """Calls scmutil.cleanupnodes() with the given replacements.