[MERGE] Use last-revision in BzrBranch6.revno() to avoid loading the whole history

Robert Collins robertc at robertcollins.net
Sun Dec 2 20:24:55 GMT 2007


bb:tweak

On Sun, 2007-12-02 at 20:28 +0100, Lukáš Lalinský wrote:
> BzrBranch6 branches have the last revision number stored in
> ".bzr/branch/last-revision", there is no need to load the whole history.



+    def revno(self):
+        """Return current revision number for this branch.
+
+        That is equivalent to the number of revisions committed to
+        this branch.
+        """
+        return self.last_revision_info()[0]

I think this should just become the default implementation of revno
rather than overriding just in branch6. All branches are required to
provide a last_revision_info() method.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071203/b853d18a/attachment.pgp 


More information about the bazaar mailing list