~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-08-07 08:28:35 UTC
  • mfrom: (2671.1.5 repository-equality)
  • Revision ID: pqm@pqm.ubuntu.com-20070807082835-sxq0vmfbvsebps5z
(Andrew Bennetts) Remove Repository.__eq__/__ne__ methods, replace with has_same_location method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
        return '%s(%r)' % (self.__class__.__name__, 
236
236
                           self.bzrdir.transport.base)
237
237
 
238
 
    def __eq__(self, other):
 
238
    def has_same_location(self, other):
 
239
        """Returns a boolean indicating if this repository is at the same
 
240
        location as another repository.
 
241
 
 
242
        This might return False even when two repository objects are accessing
 
243
        the same physical repository via different URLs.
 
244
        """
239
245
        if self.__class__ is not other.__class__:
240
246
            return False
241
247
        return (self.control_files._transport.base ==
242
248
                other.control_files._transport.base)
243
249
 
244
 
    def __ne__(self, other):
245
 
        return not self == other
246
 
 
247
250
    def is_locked(self):
248
251
        return self.control_files.is_locked()
249
252