~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Robert Collins
  • Date: 2006-08-08 23:19:29 UTC
  • mfrom: (1884 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1912.
  • Revision ID: robertc@robertcollins.net-20060808231929-4e3e298190214b3a
current status

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
326
327
            return True
327
328
 
328
329
 
329
 
class ScratchTransport(LocalTransport):
330
 
    """A transport that works in a temporary dir and cleans up after itself.
331
 
    
332
 
    The dir only exists for the lifetime of the Python object.
333
 
    Obviously you should not put anything precious in it.
334
 
    """
335
 
 
336
 
    def __init__(self, base=None):
337
 
        if base is None:
338
 
            base = tempfile.mkdtemp()
339
 
        super(ScratchTransport, self).__init__(base)
340
 
 
341
 
    def __del__(self):
342
 
        rmtree(self.base, ignore_errors=True)
343
 
        mutter("%r destroyed" % self)
344
 
 
345
 
 
346
330
class LocalRelpathServer(Server):
347
331
    """A pretend server for local transports, using relpaths."""
348
332