Rev 1255: Simplify checking for existing cache data. in http://people.samba.org/bzr/jelmer/bzr-svn/svn-1.5

Jelmer Vernooij jelmer at samba.org
Thu Jun 26 18:04:58 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/svn-1.5

------------------------------------------------------------
revno: 1255
revision-id: jelmer at samba.org-20080626170457-v5uwhd3jot0bq3m6
parent: jelmer at samba.org-20080626165630-1sbz5ppcncpnkvx8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: svn-1.5
timestamp: Thu 2008-06-26 19:04:57 +0200
message:
  Simplify checking for existing cache data.
modified:
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
=== modified file 'logwalker.py'
--- a/logwalker.py	2008-06-26 16:56:30 +0000
+++ b/logwalker.py	2008-06-26 17:04:57 +0000
@@ -218,6 +218,7 @@
         :param copyfrom_rev: Optional original rev this path was copied from.
         """
         assert action in ("A", "R", "D", "M")
+        assert not path.startswith("/")
         self.cachedb.execute("""
             REPLACE INTO changed_path
             (rev, path, action, copyfrom_path, copyfrom_rev)
@@ -676,9 +677,13 @@
         if peg_revnum == 0:
             return # we always know everything there is to know about revision 0
         
-        next_root_revnum = self.cache.get_next_cache("", peg_revnum)
-        if not next_root_revnum is None:
-            return # we have a recent enough full history cache
+        # we have a recent enough full history cache for the path or 
+        # one of its parent paths
+        pathels = path.split("/")
+        for i in xrange(len(pathels)+1):
+            parentpath = "/".join(pathels[:i])
+            if self.cache.get_next_cache(parentpath, peg_revnum) is not None:
+                return # 
         
         next_path_revnum = self.cache.get_next_cache(path, peg_revnum)
         if not next_path_revnum is None:




More information about the bazaar-commits mailing list