Commit 4c8d0fd2 authored by Kai Willadsen's avatar Kai Willadsen

vc: _lookup_tree_cache is poorly named

parent d4fbbdf8
......@@ -192,12 +192,12 @@ class Vc(object):
def get_working_directory(self, workdir):
return workdir
def _lookup_tree_cache(self, directory):
def cache_tree(self, directory):
raise NotImplementedError()
def _get_tree_cache(self, directory):
if self._tree_cache is None:
self._tree_cache = self._lookup_tree_cache(directory)
self._tree_cache = self.cache_tree(directory)
return self._tree_cache
def update_file_state(self, path):
......
......@@ -140,7 +140,9 @@ class Vc(_vc.Vc):
files = []
for p in paths:
if os.path.isdir(p):
entries = self._lookup_tree_cache(p)
# FIXME: This used to be self._lookup_files(p), which
# definitely didn't do what we wanted.
entries = self.cache_tree(p)
names = [
x for x, y in entries.items() if y in self.commit_statuses]
files.extend(names)
......@@ -148,7 +150,7 @@ class Vc(_vc.Vc):
files.append(os.path.relpath(p, self.root))
return sorted(list(set(files)))
def _lookup_tree_cache(self, rootdir):
def cache_tree(self, rootdir):
branch_root = _vc.popen(
[self.CMD] + self.CMDARGS + ["root", rootdir]).read().rstrip('\n')
entries = []
......
......@@ -367,7 +367,7 @@ class Vc(_vc.Vc):
for path in unversioned_entries:
tree_state[get_real_path(path)] = _vc.STATE_NONE
def _lookup_tree_cache(self, rootdir):
def cache_tree(self, rootdir):
# Get a list of all files in rootdir, as well as their status
tree_state = {}
self._update_tree_state_cache("./", tree_state)
......
......@@ -122,7 +122,7 @@ class Vc(_vc.Vc):
state = self.state_map.get(statekey.strip(), _vc.STATE_NONE)
tree_state[path] = state
def _lookup_tree_cache(self, rootdir):
def cache_tree(self, rootdir):
# Get a list of all files in rootdir, as well as their status
tree_state = {}
self._update_tree_state_cache("./", tree_state)
......
......@@ -214,7 +214,7 @@ class Vc(_vc.Vc):
tree_state[mydir] = {}
tree_state[mydir][name] = (item, rev)
def _lookup_tree_cache(self, rootdir):
def cache_tree(self, rootdir):
# Get a list of all files in rootdir, as well as their status
tree_state = {}
self._update_tree_state_cache(rootdir, 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