~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

Apply David Allouches list_dir quoting fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    def __init__(self, base):
36
36
        """Set the base path where files will be stored."""
37
37
        if base.startswith('file://'):
38
 
            base = base[7:]
 
38
            base = base[len('file://'):]
39
39
        # realpath is incompatible with symlinks. When we traverse
40
40
        # up we might be able to normpath stuff. RBC 20051003
41
41
        base = normpath(abspath(base))
111
111
        """Iter the relative paths of files in the transports sub-tree."""
112
112
        queue = list(self.list_dir(u'.'))
113
113
        while queue:
114
 
            relpath = urllib.quote(queue.pop(0))
 
114
            relpath = queue.pop(0)
115
115
            st = self.stat(relpath)
116
116
            if S_ISDIR(st[ST_MODE]):
117
117
                for i, basename in enumerate(self.list_dir(relpath)):
222
222
        WARNING: many transports do not support this, so trying avoid using
223
223
        it if at all possible.
224
224
        """
225
 
        path = relpath
 
225
        path = self.abspath(relpath)
226
226
        try:
227
 
            path = self.abspath(relpath)
228
 
            return os.listdir(path)
229
 
        except (IOError, OSError),e:
 
227
            return [urllib.quote(entry) for entry in os.listdir(path)]
 
228
        except (IOError, OSError), e:
230
229
            self._translate_error(e, path)
231
230
 
232
231
    def stat(self, relpath):