~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Lalo Martins
  • Date: 2005-09-08 11:08:13 UTC
  • mto: (1185.1.22)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: lalo@exoweb.net-20050908110811-49e867a4d2c07bf2
getting rid of branch.lookup_revision()

Show diffs side-by-side

added added

removed removed

Lines of Context:
883
883
        commit(self, *args, **kw)
884
884
        
885
885
 
886
 
    def lookup_revision(self, revision):
887
 
        """Return the revision identifier for a given revision specifier."""
888
 
        # XXX: I'm not sure this method belongs here; I'd rather have the
889
 
        # revision spec stuff be an UI thing, and branch blissfully unaware
890
 
        # of it.
891
 
        # Also, I'm not entirely happy with this method returning None
892
 
        # when the revision doesn't exist.
893
 
        # But I'm keeping the contract I found, because this seems to be
894
 
        # used in a lot of places - and when I do change these, I'd rather
895
 
        # figure out case-by-case which ones actually want to care about
896
 
        # revision specs (eg, they are UI-level) and which ones should trust
897
 
        # that they have a revno/revid.
898
 
        #   -- lalo@exoweb.net, 2005-09-07
899
 
        from bzrlib.errors import NoSuchRevision
900
 
        from bzrlib.revisionspec import RevisionSpec
901
 
        try:
902
 
            spec = RevisionSpec(self, revision)
903
 
        except NoSuchRevision:
904
 
            return None
905
 
        return spec.rev_id
906
 
 
907
 
 
908
886
    def revision_id_to_revno(self, revision_id):
909
887
        """Given a revision id, return its revno"""
910
888
        history = self.revision_history()