~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-19 10:58:39 UTC
  • mfrom: (6383 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6386.
  • Revision ID: jelmer@canonical.com-20111219105839-uji05ck4rkm1mj4j
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
"""Implementation of Transport that uses memory for its storage.
18
20
 
19
21
The contents of the transport will be lost when the object is discarded,
81
83
 
82
84
    def clone(self, offset=None):
83
85
        """See Transport.clone()."""
84
 
        path = self._combine_paths(self._cwd, offset)
 
86
        path = urlutils.URL._combine_paths(self._cwd, offset)
85
87
        if len(path) == 0 or path[-1] != '/':
86
88
            path += '/'
87
89
        url = self._scheme + path
289
291
            raise LockError('File %r already locked' % (self.path,))
290
292
        self.transport._locks[self.path] = self
291
293
 
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
294
    def unlock(self):
299
295
        del self.transport._locks[self.path]
300
296
        self.transport = None