~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-08-25 00:47:04 UTC
  • Revision ID: mbp@sourcefrog.net-20050825004704-e3c75123f29539bf
- expose 'find-merge-base' as a new expert command,
  to help in debugging merges

  move UnrelatedBranches exception into bzrlib.errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
896
896
        revno, info = self.get_revision_info(revision)
897
897
        return info
898
898
 
 
899
 
 
900
    def revision_id_to_revno(self, revision_id):
 
901
        """Given a revision id, return its revno"""
 
902
        history = self.revision_history()
 
903
        try:
 
904
            return history.index(revision_id) + 1
 
905
        except ValueError:
 
906
            raise bzrlib.errors.NoSuchRevision(self, revision_id)
 
907
 
 
908
 
899
909
    def get_revision_info(self, revision):
900
910
        """Return (revno, revision id) for revision identifier.
901
911