~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

  • Committer: Patch Queue Manager
  • Date: 2014-09-22 19:14:34 UTC
  • mfrom: (6598.1.2 bzr)
  • Revision ID: pqm@pqm.ubuntu.com-20140922191434-6bbnpnxi5jab4vim
(richard-wilbur) Allows launchpad APIs to use proxies by default(Paul Gear).
 (Paul Gear)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
so this is primarily useful for testing.
21
21
"""
22
22
 
 
23
from __future__ import absolute_import
 
24
 
23
25
import os
24
26
import errno
25
 
import re
26
27
from stat import S_IFREG, S_IFDIR
27
28
from cStringIO import StringIO
28
 
import warnings
29
29
 
30
30
from bzrlib import (
31
31
    transport,
36
36
    LockError,
37
37
    InProcessTransport,
38
38
    NoSuchFile,
39
 
    TransportError,
40
39
    )
41
 
from bzrlib.trace import mutter
42
40
from bzrlib.transport import (
43
41
    AppendBasedFileStream,
44
42
    _file_streams,
81
79
 
82
80
    def clone(self, offset=None):
83
81
        """See Transport.clone()."""
84
 
        path = self._combine_paths(self._cwd, offset)
 
82
        path = urlutils.URL._combine_paths(self._cwd, offset)
85
83
        if len(path) == 0 or path[-1] != '/':
86
84
            path += '/'
87
85
        url = self._scheme + path
289
287
            raise LockError('File %r already locked' % (self.path,))
290
288
        self.transport._locks[self.path] = self
291
289
 
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
 
 
298
290
    def unlock(self):
299
291
        del self.transport._locks[self.path]
300
292
        self.transport = None