[meld/VersionControlRework: 31/123] vc.svn: Minimal adaptation of SVN to use saner tree cache format
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/VersionControlRework: 31/123] vc.svn: Minimal adaptation of SVN to use saner tree cache format
- Date: Sun, 19 Apr 2015 20:08:35 +0000 (UTC)
commit 850d367cf9bb1702a8a912fe02b986ede42f78ad
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Mar 22 09:44:01 2015 +1000
vc.svn: Minimal adaptation of SVN to use saner tree cache format
meld/vc/svn.py | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index 9cd68f7..7c64d9c 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -211,25 +211,21 @@ class Vc(_vc.Vc):
rev = None
if "revision" in status.attrib:
rev = status.attrib["revision"]
- mydir, name = os.path.split(path)
- if mydir not in self._tree_cache:
- self._tree_cache[mydir] = {}
- self._tree_cache[mydir][name] = (item, rev)
+ state = self.state_map.get(item, _vc.STATE_NONE)
+ self._tree_cache[path] = state
+ self._tree_meta_cache[path] = rev
def _get_dirsandfiles(self, directory, dirs, files):
tree = self._get_tree_cache()
- if not directory in tree:
- return [], []
-
retfiles = []
retdirs = []
- dirtree = tree[directory]
+ for path in sorted(tree.keys()):
+ if os.path.dirname(path) != directory:
+ continue
- for name in sorted(dirtree.keys()):
- svn_state, rev = dirtree[name]
- path = os.path.join(directory, name)
+ name = os.path.basename(path)
isdir = os.path.isdir(path)
if isdir:
@@ -241,8 +237,8 @@ class Vc(_vc.Vc):
if name != directory:
retdirs.append( _vc.Dir(path,name,state) )
else:
- state = self.state_map.get(svn_state, _vc.STATE_NONE)
- rev_label = _("Revision %s") % rev
+ state = self._tree_cache[path]
+ rev_label = _("Revision %s") % self._tree_meta_cache[path]
retfiles.append(_vc.File(path, name, state, options=rev_label))
return retdirs, retfiles
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]