Patchwork D1252: dirstate: move clear onto dirstatemap class

login
register
mail settings
Submitter phabricator
Date Oct. 28, 2017, 8:09 a.m.
Message ID <979d453abf845816232c0c5bc919b3ff@localhost.localdomain>
Download mbox | patch
Permalink /patch/25297/
State Not Applicable
Headers show

Comments

phabricator - Oct. 28, 2017, 8:09 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0217f75b6e59: dirstate: move clear onto dirstatemap class (authored by durham, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1252?vs=3128&id=3145

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: durham, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -593,8 +593,7 @@ 
         return path
 
     def clear(self):
-        self._map = dirstatemap(self._ui, self._opener, self._root)
-        self._map.setparents(nullid, nullid)
+        self._map.clear()
         self._lastnormaltime = 0
         self._updatedfiles.clear()
         self._dirty = True
@@ -1210,6 +1209,11 @@ 
         # for consistent view between _pl() and _read() invocations
         self._pendingmode = None
 
+    def clear(self):
+        self._map = {}
+        self.copymap = {}
+        self.setparents(nullid, nullid)
+
     def iteritems(self):
         return self._map.iteritems()