Commit b6af48b8 authored by Kai Willadsen's avatar Kai Willadsen

meld.vc: Pull out common cache_tree implementations

parent e2e8c0ad
......@@ -192,8 +192,10 @@ class Vc(object):
def get_working_directory(self, workdir):
return workdir
def cache_tree(self, directory):
raise NotImplementedError()
def cache_tree(self):
tree_state = {}
self._update_tree_state_cache("./", tree_state)
return tree_state
def _get_tree_cache(self):
if not self._tree_cache:
......
......@@ -148,11 +148,6 @@ class Vc(_vc.Vc):
files.append(os.path.relpath(p, self.root))
return sorted(list(set(files)))
def cache_tree(self):
tree_state = {}
self._update_tree_state_cache("./", tree_state)
return tree_state
def _update_tree_state_cache(self, path, tree_state):
# FIXME: This actually clears out state information, because the
# current API doesn't have any state outside of _tree_cache.
......
......@@ -367,11 +367,6 @@ class Vc(_vc.Vc):
for path in unversioned_entries:
tree_state[get_real_path(path)] = _vc.STATE_NONE
def cache_tree(self):
tree_state = {}
self._update_tree_state_cache("./", tree_state)
return tree_state
def update_file_state(self, path):
tree_state = self._get_tree_cache()
self._update_tree_state_cache(path, tree_state)
......
......@@ -122,11 +122,6 @@ class Vc(_vc.Vc):
state = self.state_map.get(statekey.strip(), _vc.STATE_NONE)
tree_state[path] = state
def cache_tree(self):
tree_state = {}
self._update_tree_state_cache("./", tree_state)
return tree_state
def update_file_state(self, path):
tree_state = self._get_tree_cache()
self._update_tree_state_cache(path, tree_state)
......
......@@ -216,11 +216,6 @@ class Vc(_vc.Vc):
tree_state[mydir] = {}
tree_state[mydir][name] = (item, rev)
def cache_tree(self):
tree_state = {}
self._update_tree_state_cache('./', tree_state)
return tree_state
def update_file_state(self, path):
tree_state = self._get_tree_cache()
self._update_tree_state_cache(path, tree_state)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment