D1252: dirstate: move clear onto dirstatemap class

durham (Durham Goode) phabricator at mercurial-scm.org
Sat Oct 28 08:09:01 UTC 2017


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

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()
 



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


More information about the Mercurial-devel mailing list