Skip to content
Snippets Groups Projects
Commit 0217f75b authored by Durham Goode's avatar Durham Goode
Browse files

dirstate: move clear onto dirstatemap class

A future diff will move the lazy loading aspect of dirstate to the dirstatemap
class. This means it requires a slightly different strategy of clearing than
just reinstantiating the object (since just reinstantiating the object will
lazily load the on disk data again later instead of remaining permanently
empty).

So let's give it it's own clear function.

Differential Revision: https://phab.mercurial-scm.org/D1252
parent fd782769
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment