/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Michael Ellerman
  • Date: 2005-10-26 10:03:47 UTC
  • mfrom: (1185.16.116)
  • mto: (1185.16.126)
  • mto: This revision was merged to the branch mainline in revision 1488.
  • Revision ID: michael@ellerman.id.au-20051026100347-bb0b2bd42f7953f2
MergeĀ mainline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import shutil
24
24
from stat import ST_MODE, S_ISDIR, ST_SIZE
25
25
import tempfile
 
26
import urllib
26
27
 
27
28
from bzrlib.trace import mutter
28
29
from bzrlib.transport import Transport, register_transport, \
59
60
            return LocalTransport(self.abspath(offset))
60
61
 
61
62
    def abspath(self, relpath):
62
 
        """Return the full url to the given relative path.
 
63
        """Return the full url to the given relative URL.
63
64
        This can be supplied with a string or a list
64
65
        """
65
 
        if isinstance(relpath, basestring):
66
 
            relpath = [relpath]
67
 
        return os.path.join(self.base, *relpath)
 
66
        assert isinstance(relpath, basestring)
 
67
        return os.path.join(self.base, urllib.unquote(relpath))
68
68
 
69
69
    def relpath(self, abspath):
70
70
        """Return the local path portion from a given absolute path.
115
115
        """Iter the relative paths of files in the transports sub-tree."""
116
116
        queue = list(self.list_dir('.'))
117
117
        while queue:
118
 
            relpath = queue.pop(0)
 
118
            relpath = urllib.quote(queue.pop(0))
119
119
            st = self.stat(relpath)
120
120
            if S_ISDIR(st[ST_MODE]):
121
121
                for i, basename in enumerate(self.list_dir(relpath)):
243
243
    def __del__(self):
244
244
        shutil.rmtree(self.base, ignore_errors=True)
245
245
        mutter("%r destroyed" % self)
246
 
 
247
 
# If nothing else matches, try the LocalTransport
248
 
register_transport(None, LocalTransport)
249
 
register_transport('file://', LocalTransport)