Rev 3530: Expose get_lazy_revno_mapper() as part of Branch. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/lazy_revno

John Arbash Meinel john at arbash-meinel.com
Tue Jan 20 20:51:34 GMT 2009


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/lazy_revno

------------------------------------------------------------
revno: 3530
revision-id: john at arbash-meinel.com-20090120205129-gdq72b12vcjgpp95
parent: john at arbash-meinel.com-20090120204747-n99z00a1jpr2k58k
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: lazy_revno
timestamp: Tue 2009-01-20 14:51:29 -0600
message:
  Expose get_lazy_revno_mapper() as part of Branch.
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2009-01-08 19:15:20 +0000
+++ b/bzrlib/branch.py	2009-01-20 20:51:29 +0000
@@ -26,6 +26,7 @@
         config as _mod_config,
         debug,
         errors,
+        graph,
         lockdir,
         lockable_files,
         repository,
@@ -208,6 +209,19 @@
         # modify the return value.
         return mapping
 
+    def get_lazy_revno_mapper(self):
+        """Get a LazyRevnoMapper.
+
+        This can determine dotted revnos without having to load the whole
+        graph.
+        """
+        # XXX: should be cached and properly tested
+        g = self.repository.get_graph()
+        revno, last_rev = self.last_revision_info()
+        mapper = graph.LazyRevnoMapper(self.repository.get_graph(),
+                                       last_rev, revno)
+        return mapper
+
     def _gen_revno_map(self):
         """Create a new mapping from revision ids to dotted revnos.
 



More information about the bazaar-commits mailing list