Rev 1567: Move lazy dictionary code to branchprops.py. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Sat Aug 9 00:53:16 BST 2008


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

------------------------------------------------------------
revno: 1567
revision-id: jelmer at samba.org-20080808235312-n61qyziird0o9h20
parent: jelmer at samba.org-20080808225051-s3se1zu72nvzpqwf
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-08-09 01:53:12 +0200
message:
  Move lazy dictionary code to branchprops.py.
modified:
  branchprops.py                 branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'branchprops.py'
--- a/branchprops.py	2008-08-03 15:12:02 +0000
+++ b/branchprops.py	2008-08-08 23:53:12 +0000
@@ -19,6 +19,7 @@
 from bzrlib.errors import NoSuchRevision
 from bzrlib.trace import mutter
 
+from bzrlib.plugins.svn import logwalker
 from bzrlib.plugins.svn.core import SubversionException
 from bzrlib.plugins.svn.errors import ERR_FS_NO_SUCH_REVISION
 
@@ -58,6 +59,9 @@
         """
         assert isinstance(revnum, int)
         assert isinstance(path, str)
+        return logwalker.lazy_dict({}, self._real_get_changed_properties, path, revnum)
+
+    def _real_get_changed_properties(self, path, revnum):
         if self.log.get_change(path, revnum) is None:
             return {}
         current = self.get_properties(path, revnum)

=== modified file 'repository.py'
--- a/repository.py	2008-08-03 00:02:00 +0000
+++ b/repository.py	2008-08-08 23:53:12 +0000
@@ -421,7 +421,7 @@
                             if not bp in paths:
                                 svn_fileprops = {}
                             else:
-                                svn_fileprops = logwalker.lazy_dict({}, self.branchprop_list.get_changed_properties, bp, revnum)
+                                svn_fileprops = self.branchprop_list.get_changed_properties(bp, revnum)
                             yield RevisionMetadata(self, bp, paths, revnum, revprops, svn_fileprops)
 
     def all_revision_ids(self, layout=None, mapping=None):
@@ -544,7 +544,7 @@
             except NoSuchRevision:
                 continue
 
-            svn_fileprops = logwalker.lazy_dict({}, self.branchprop_list.get_changed_properties, branch, revnum)
+            svn_fileprops = self.branchprop_list.get_changed_properties(branch, revnum)
             svn_revprops = self._log.revprop_list(revnum)
             revmeta = RevisionMetadata(self, branch, None, revnum, svn_revprops, svn_fileprops)
 
@@ -578,7 +578,7 @@
         (path, revnum, mapping) = self.lookup_revision_id(revision_id)
         
         svn_revprops = self._log.revprop_list(revnum)
-        svn_fileprops = logwalker.lazy_dict({}, self.branchprop_list.get_changed_properties, path, revnum)
+        svn_fileprops = self.branchprop_list.get_changed_properties(path, revnum)
 
         revmeta = RevisionMetadata(self, path, None, revnum, svn_revprops, svn_fileprops)
 
@@ -622,7 +622,7 @@
             revprops = self._log.revprop_list(revnum)
 
         if changed_fileprops is None:
-            changed_fileprops = logwalker.lazy_dict({}, self.branchprop_list.get_changed_properties, path, revnum)
+            changed_fileprops = self.branchprop_list.get_changed_properties(path, revnum)
 
         return self.get_revmap().get_revision_id(revnum, path, mapping, revprops, changed_fileprops)
 
@@ -723,7 +723,7 @@
             if not bp in paths:
                 svn_fileprops = {}
             else:
-                svn_fileprops = logwalker.lazy_dict({}, self.branchprop_list.get_changed_properties, bp, revnum)
+                svn_fileprops = self.branchprop_list.get_changed_properties(bp, revnum)
 
             yield RevisionMetadata(self, bp, paths, revnum, revprops, svn_fileprops)
 




More information about the bazaar-commits mailing list