/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/remote.py

  • Committer: Martin Pool
  • Date: 2007-08-28 10:56:41 UTC
  • mto: (2592.3.119 repository)
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: mbp@sourcefrog.net-20070828105641-pd0vwkmeop9e09rf
Add Repository.base on all repositories.

Repository.has_same_location now *just* checks the location, not the class -
this seems to fix problems in interaction between remote and vfs repositories.

Add str and repr on RemoteRepository.
 
RemoteRepository.fetch shortcircuits when given two repositories at the same
location, which is required by the underlying fetch code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
        self._leave_lock = False
255
255
        # for tests
256
256
        self._reconcile_does_inventory_gc = True
 
257
        self.base = self.bzrdir.transport.base
 
258
 
 
259
    def __str__(self):
 
260
        return "%s(%s)" % (self.__class__.__name__, self.base)
 
261
 
 
262
    __repr__ = __str__
257
263
 
258
264
    def abort_write_group(self):
259
265
        """Complete a write group on the decorated repository.
328
334
        return response[0] == 'yes'
329
335
 
330
336
    def has_same_location(self, other):
331
 
        return (self.__class__ == other.__class__ and
332
 
                self.bzrdir.transport.base == other.bzrdir.transport.base)
 
337
        return (self.base == other.base)
333
338
        
334
339
    def get_graph(self, other_repository=None):
335
340
        """Return the graph for this repository format"""
587
592
 
588
593
    def fetch(self, source, revision_id=None, pb=None):
589
594
        self._ensure_real()
 
595
        if self.has_same_location(source) or source.has_same_location(self):
 
596
            return 0, []
590
597
        return self._real_repository.fetch(
591
598
            source, revision_id=revision_id, pb=pb)
592
599