Rev 1762: Support skipping whether branch was changed at all. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Mon Sep 1 21:01:11 BST 2008


At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1762
revision-id: jelmer at samba.org-20080901200110-2batz3cg8enf6i7s
parent: jelmer at samba.org-20080901195601-ce885t45iinkj6zb
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-09-01 22:01:10 +0200
message:
  Support skipping whether branch was changed at all.
modified:
  branchprops.py                 branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'branchprops.py'
--- a/branchprops.py	2008-09-01 19:36:56 +0000
+++ b/branchprops.py	2008-09-01 20:01:10 +0000
@@ -41,6 +41,9 @@
         if (path, revnum) in self._props_cache:
             return self._props_cache[path, revnum]
 
+        return logwalker.lazy_dict({}, self._real_get_properties, path, revnum)
+
+    def _real_get_properties(self, path, revnum):
         try:
             (_, _, props) = self.log._transport.get_dir(path, 
                 revnum)
@@ -52,7 +55,7 @@
         self._props_cache[path, revnum] = props
         return props
 
-    def get_changed_properties(self, path, revnum):
+    def get_changed_properties(self, path, revnum, skip_check=False):
         """Get the contents of a Subversion file property.
 
         Will use the cache.
@@ -63,10 +66,10 @@
         """
         assert isinstance(revnum, int)
         assert isinstance(path, str)
-        return logwalker.lazy_dict({}, self._real_get_changed_properties, path, revnum)
+        return logwalker.lazy_dict({}, self._real_get_changed_properties, path, revnum, skip_check)
 
-    def _real_get_changed_properties(self, path, revnum):
-        if self.log.get_change(path, revnum) is None:
+    def _real_get_changed_properties(self, path, revnum, skip_check):
+        if skip_check or self.log.get_change(path, revnum) is None:
             return {}
         current = self.get_properties(path, revnum)
         if current == {}:

=== modified file 'repository.py'
--- a/repository.py	2008-09-01 19:56:01 +0000
+++ b/repository.py	2008-09-01 20:01:10 +0000
@@ -134,7 +134,7 @@
         if prev_path is None and prev_revnum == -1:
             previous_fileprops = {}
         else:
-            previous_fileprops = logwalker.lazy_dict({}, self.repository.branchprop_list.get_properties, prev_path.encode("utf-8"), prev_revnum)
+            previous_fileprops = self.repository.branchprop_list.get_lazy_properties(prev_path.encode("utf-8"), prev_revnum)
 
         previous = previous_fileprops.get(SVN_PROP_SVK_MERGE, "")
 
@@ -503,7 +503,8 @@
                             if not bp in paths:
                                 svn_fileprops = {}
                             else:
-                                svn_fileprops = self.branchprop_list.get_changed_properties(bp, revnum)
+                                svn_fileprops = self.branchprop_list.get_changed_properties(bp, revnum, 
+                                                                                            skip_check=True)
                             yield self._revmeta(bp, paths, revnum, revprops, svn_fileprops)
 
     def all_revision_ids(self, layout=None, mapping=None):
@@ -814,7 +815,7 @@
             if not bp in paths:
                 svn_fileprops = {}
             else:
-                svn_fileprops = self.branchprop_list.get_changed_properties(bp, revnum)
+                svn_fileprops = self.branchprop_list.get_changed_properties(bp, revnum, skip_check=True)
 
             yield self._revmeta(bp, paths, revnum, revprops, svn_fileprops)
 




More information about the bazaar-commits mailing list