~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Martin Pool
  • Date: 2009-07-10 08:28:35 UTC
  • mto: This revision was merged to the branch mainline in revision 4566.
  • Revision ID: mbp@sourcefrog.net-20090710082835-j66cxs5vf3hji7l1
Split out RepositoryBase.has_same_fallbacks

Show diffs side-by-side

added added

removed removed

Lines of Context:
857
857
    foreign, etc.
858
858
    """
859
859
 
 
860
    def has_same_fallbacks(self, other_repo):
 
861
        my_fb = self._fallback_repositories
 
862
        other_fb = other_repo._fallback_repositories
 
863
        if len(my_fb) != len(other_fb):
 
864
            return False
 
865
        for f, g in zip(my_fb, other_fb):
 
866
            if not f.has_same_location(g):
 
867
                return False
 
868
        return True
 
869
 
860
870
 
861
871
class Repository(RepositoryBase):
862
872
    """Repository holding history for one or more branches.
1546
1556
                "May not fetch while in a write group.")
1547
1557
        # fast path same-url fetch operations
1548
1558
        # TODO: lift out to somewhere common with RemoteRepository
1549
 
        if (self.has_same_location(source) and fetch_spec is None
1550
 
            and ([f._transport.base for f in self._fallback_repositories]
1551
 
                 == [f._transport.base for f in source._fallback_repositories])):
 
1559
        if (self.has_same_location(source)
 
1560
            and fetch_spec is None
 
1561
            and self.has_same_fallbacks(source)):
1552
1562
            # check that last_revision is in 'from' and then return a
1553
1563
            # no-operation.
1554
1564
            if (revision_id is not None and