~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Robey Pointer
  • Date: 2006-07-01 19:03:33 UTC
  • mfrom: (1829 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: robey@lag.net-20060701190333-f58465aec4bd3412
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
            base = base + '/'
52
52
        super(LocalTransport, self).__init__(base)
53
53
        self._local_base = urlutils.local_path_from_url(base)
 
54
        ## mutter("_local_base: %r => %r", base, self._local_base)
54
55
 
55
56
    def should_cache(self):
56
57
        return False
314
315
            return True
315
316
 
316
317
 
317
 
class ScratchTransport(LocalTransport):
318
 
    """A transport that works in a temporary dir and cleans up after itself.
319
 
    
320
 
    The dir only exists for the lifetime of the Python object.
321
 
    Obviously you should not put anything precious in it.
322
 
    """
323
 
 
324
 
    def __init__(self, base=None):
325
 
        if base is None:
326
 
            base = tempfile.mkdtemp()
327
 
        super(ScratchTransport, self).__init__(base)
328
 
 
329
 
    def __del__(self):
330
 
        rmtree(self.base, ignore_errors=True)
331
 
        mutter("%r destroyed" % self)
332
 
 
333
 
 
334
318
class LocalRelpathServer(Server):
335
319
    """A pretend server for local transports, using relpaths."""
336
320