~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2007-06-15 07:01:24 UTC
  • mfrom: (2528 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2530.
  • Revision ID: mbp@sourcefrog.net-20070615070124-clpwqh5gxc4wbf9l
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
847
847
    _formats = {}
848
848
    """The known formats."""
849
849
 
 
850
    def __eq__(self, other):
 
851
        return self.__class__ is other.__class__
 
852
 
 
853
    def __ne__(self, other):
 
854
        return not (self == other)
 
855
 
850
856
    @classmethod
851
857
    def find_format(klass, a_bzrdir):
852
858
        """Return the format for the branch object in a_bzrdir."""
2077
2083
        if revision_id is None:
2078
2084
            revno, revision_id = self.last_revision_info()
2079
2085
        else:
2080
 
            revno = self.revision_id_to_revno(revision_id)
 
2086
            # To figure out the revno for a random revision, we need to build
 
2087
            # the revision history, and count its length.
 
2088
            # We don't care about the order, just how long it is.
 
2089
            # Alternatively, we could start at the current location, and count
 
2090
            # backwards. But there is no guarantee that we will find it since
 
2091
            # it may be a merged revision.
 
2092
            revno = len(list(self.repository.iter_reverse_revision_history(
 
2093
                                                                revision_id)))
2081
2094
        destination.set_last_revision_info(revno, revision_id)
2082
2095
 
2083
2096
    def _make_tags(self):