~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Ian Clatworthy
  • Date: 2009-01-14 07:17:52 UTC
  • mto: (3976.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3978.
  • Revision ID: ian.clatworthy@canonical.com-20090114071752-q4t19py601nrdrg4
more single revision clean-up

Show diffs side-by-side

added added

removed removed

Lines of Context:
467
467
        else:
468
468
            return (0, _mod_revision.NULL_REVISION)
469
469
 
 
470
    def _get_mainline_revno(self, revision_id):
 
471
        """Get the mainline revision number for a revision-id, if any.
 
472
 
 
473
        :return: the mainline revision number or 0 if not on the mainline.
 
474
        """
 
475
        last_revno, last_revision_id = self.last_revision_info()
 
476
        revno = last_revno
 
477
        for rev_id in self.repository.iter_reverse_revision_history(
 
478
                last_revision_id):
 
479
            if rev_id == revision_id:
 
480
                return revno
 
481
            revno -= 1
 
482
        else:
 
483
            return 0
 
484
 
470
485
    @deprecated_method(deprecated_in((1, 6, 0)))
471
486
    def missing_revisions(self, other, stop_revision=None):
472
487
        """Return a list of new revisions that would perfectly fit.