[meld/VersionControlRework: 24/123] meld.vc: Factor out common individual-path updating



commit cf5a714c66f7aeef9c58dcd7adb68d3b9b2dbf6f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Mar 22 08:21:01 2015 +1000

    meld.vc: Factor out common individual-path updating

 meld/vc/_vc.py       |   13 +++++++------
 meld/vc/git.py       |    3 ---
 meld/vc/mercurial.py |    3 ---
 meld/vc/svn.py       |    3 ---
 4 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index d6ab453..8e8ec54 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -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:
diff --git a/meld/vc/git.py b/meld/vc/git.py
index 1dc0d6f..2028383 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -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()
diff --git a/meld/vc/mercurial.py b/meld/vc/mercurial.py
index f8ede30..8bb765b 100644
--- a/meld/vc/mercurial.py
+++ b/meld/vc/mercurial.py
@@ -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()
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index bb31189..9cd68f7 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -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()
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]