[meld/VersionControlRework: 28/123] meld.vc: Add the metadata cache for tree states everywhere
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/VersionControlRework: 28/123] meld.vc: Add the metadata cache for tree states everywhere
- Date: Sun, 19 Apr 2015 20:08:20 +0000 (UTC)
commit dbfcaa430222e056710b4a44ae068c6a35503de6
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Mar 22 08:55:37 2015 +1000
meld.vc: Add the metadata cache for tree states everywhere
meld/vc/_vc.py | 1 +
meld/vc/bzr.py | 7 ++-----
meld/vc/git.py | 4 ----
3 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index 8e8ec54..83758b2 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -122,6 +122,7 @@ class Vc(object):
if not self.root:
raise ValueError
self._tree_cache = {}
+ self._tree_meta_cache = {}
def commit_command(self, message):
raise NotImplementedError()
diff --git a/meld/vc/bzr.py b/meld/vc/bzr.py
index fef272e..eaf2e9e 100644
--- a/meld/vc/bzr.py
+++ b/meld/vc/bzr.py
@@ -90,10 +90,6 @@ class Vc(_vc.Vc):
''.join(state_2_map.keys()),
''.join(state_3_map.keys()),)
- def __init__(self, location):
- super(Vc, self).__init__(location)
- self._tree_meta_cache = {}
-
def commit_command(self, message):
return [self.CMD] + self.CMDARGS + ["commit", "-m", message]
@@ -164,7 +160,7 @@ class Vc(_vc.Vc):
raise
tree_cache = defaultdict(set)
- self._tree_meta_cache = tree_meta_cache = defaultdict(list)
+ tree_meta_cache = defaultdict(list)
self._rename_cache = rename_cache = {}
self._reverse_rename_cache = {}
# Files can appear twice in the list if they conflict and were renamed
@@ -220,6 +216,7 @@ class Vc(_vc.Vc):
self._tree_cache.update(
dict((x, max(y)) for x, y in tree_cache.items()))
+ self._tree_meta_cache = dict(tree_meta_cache)
def _get_dirsandfiles(self, directory, dirs, files):
tree = self._get_tree_cache()
diff --git a/meld/vc/git.py b/meld/vc/git.py
index 2028383..d01aa0e 100644
--- a/meld/vc/git.py
+++ b/meld/vc/git.py
@@ -68,10 +68,6 @@ class Vc(_vc.Vc):
file_encoding = sys.getfilesystemencoding()
- def __init__(self, location):
- super(Vc, self).__init__(location)
- self._tree_meta_cache = {}
-
@classmethod
def is_installed(cls):
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]