Commit cf5a714c authored by Kai Willadsen's avatar Kai Willadsen

meld.vc: Factor out common individual-path updating

parent 096cb61b
......@@ -198,13 +198,14 @@ class Vc(object):
return self._tree_cache
def update_file_state(self, path):
""" Update the state of a specific file. For example after a file
has been modified and saved, its state may be out of date and require
updating. This can be implemented for Vc plugins that cache file
states, eg 'git' an 'bzr' so that the top-level file status is always
accurate.
"""Update the cached version control state of the given path.
After a file has been modified and saved, for example by
editing in the file comparison view, its state may be out of
date and require updating. The method updates the version
control object's internal cache of file state.
"""
pass
self._update_tree_state_cache(path)
def listdir(self, path="."):
try:
......
......@@ -366,9 +366,6 @@ class Vc(_vc.Vc):
for path in unversioned_entries:
self._tree_cache[get_real_path(path)] = _vc.STATE_NONE
def update_file_state(self, path):
self._update_tree_state_cache(path)
def _get_dirsandfiles(self, directory, dirs, files):
tree = self._get_tree_cache()
......
......@@ -122,9 +122,6 @@ class Vc(_vc.Vc):
state = self.state_map.get(statekey.strip(), _vc.STATE_NONE)
self._tree_cache[path] = state
def update_file_state(self, path):
self._update_tree_state_cache(path)
def _get_dirsandfiles(self, directory, dirs, files):
tree = self._get_tree_cache()
......
......@@ -216,9 +216,6 @@ class Vc(_vc.Vc):
self._tree_cache[mydir] = {}
self._tree_cache[mydir][name] = (item, rev)
def update_file_state(self, path):
self._update_tree_state_cache(path)
def _get_dirsandfiles(self, directory, dirs, files):
tree = self._get_tree_cache()
......
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