~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-20 16:16:34 UTC
  • mfrom: (3123.5.18 hardlinks)
  • Revision ID: pqm@pqm.ubuntu.com-20071220161634-2kcjb650o21ydko4
Accelerate build_tree using similar workingtrees (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
            base = urlutils.local_path_to_url(base)
64
64
        if base[-1] != '/':
65
65
            base = base + '/'
66
 
 
67
 
        # Special case : windows has no "root", but does have
68
 
        # multiple lettered drives inside it. #240910
69
 
        if sys.platform == 'win32' and base == 'file:///':
70
 
            base = ''
71
 
            self._local_base = ''
72
 
            super(LocalTransport, self).__init__(base)
73
 
            return
74
 
            
75
66
        super(LocalTransport, self).__init__(base)
76
67
        self._local_base = urlutils.local_path_from_url(base)
77
68
 
105
96
    def abspath(self, relpath):
106
97
        """Return the full url to the given relative URL."""
107
98
        # TODO: url escape the result. RBC 20060523.
 
99
        assert isinstance(relpath, basestring), (type(relpath), relpath)
108
100
        # jam 20060426 Using normpath on the real path, because that ensures
109
101
        #       proper handling of stuff like
110
102
        path = osutils.normpath(osutils.pathjoin(
117
109
        This function only exists for the LocalTransport, since it is
118
110
        the only one that has direct local access.
119
111
        This is mostly for stuff like WorkingTree which needs to know
120
 
        the local working directory.  The returned path will always contain
121
 
        forward slashes as the path separator, regardless of the platform.
122
 
 
 
112
        the local working directory.
 
113
        
123
114
        This function is quite expensive: it calls realpath which resolves
124
115
        symlinks.
125
116
        """
520
511
        self._local_base = urlutils._win32_local_path_from_url(base)
521
512
 
522
513
    def abspath(self, relpath):
 
514
        assert isinstance(relpath, basestring), (type(relpath), relpath)
523
515
        path = osutils.normpath(osutils.pathjoin(
524
516
                    self._local_base, urlutils.unescape(relpath)))
525
517
        return urlutils._win32_local_path_to_url(path)