~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

  • Committer: Jonathan Riddell
  • Date: 2011-06-24 13:57:59 UTC
  • mto: This revision was merged to the branch mainline in revision 6003.
  • Revision ID: jriddell@canonical.com-20110624135759-263hx2et2kl1in39
change directory option to location argument

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
 
82
82
    def clone(self, offset=None):
83
83
        """See Transport.clone()."""
84
 
        path = urlutils.URL._combine_paths(self._cwd, offset)
 
84
        path = self._combine_paths(self._cwd, offset)
85
85
        if len(path) == 0 or path[-1] != '/':
86
86
            path += '/'
87
87
        url = self._scheme + path
289
289
            raise LockError('File %r already locked' % (self.path,))
290
290
        self.transport._locks[self.path] = self
291
291
 
 
292
    def __del__(self):
 
293
        # Should this warn, or actually try to cleanup?
 
294
        if self.transport:
 
295
            warnings.warn("MemoryLock %r not explicitly unlocked" % (self.path,))
 
296
            self.unlock()
 
297
 
292
298
    def unlock(self):
293
299
        del self.transport._locks[self.path]
294
300
        self.transport = None