/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Vincent Ladeuil
  • Date: 2007-06-20 14:25:06 UTC
  • mfrom: (2540 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070620142506-txsb1v8538kpsafw
merge bzr.dev @ 2540

Show diffs side-by-side

added added

removed removed

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