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

------------------------------------------------------------
revno: 3530
revision-id: [email protected]
parent: [email protected]
committer: John Arbash Meinel <[email protected]>
branch nick: lazy_revno
timestamp: Tue 2009-01-20 14:51:29 -0600
message:
  Expose get_lazy_revno_mapper() as part of Branch.
=== 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.
 

-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to