~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

New Branch.last_revision_info method, this is being done to allow
optimization of requests for both the number of revisions and the last
revision of a branch with smartservers and potentially future branch
formats. (Wouter van Heyst, Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
        else:
325
325
            return None
326
326
 
 
327
    def last_revision_info(self):
 
328
        """Return information about the last revision.
 
329
 
 
330
        :return: A tuple (revno, last_revision_id).
 
331
        """
 
332
        rh = self.revision_history()
 
333
        revno = len(rh)
 
334
        if revno:
 
335
            return (revno, rh[-1])
 
336
        else:
 
337
            return (0, _mod_revision.NULL_REVISION)
 
338
 
327
339
    def missing_revisions(self, other, stop_revision=None):
328
340
        """Return a list of new revisions that would perfectly fit.
329
341