~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: 2008-06-05 04:05:05 UTC
  • mfrom: (3473.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080605040505-i9kqxg2fps2qjdi0
Add the 'alias' command (Tim Penhey)

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
 
109
100
        #       proper handling of stuff like
110
101
        path = osutils.normpath(osutils.pathjoin(
111
102
                    self._local_base, urlutils.unescape(relpath)))
112
 
        # on windows, our _local_base may or may not have a drive specified
113
 
        # (ie, it may be "/" or "c:/foo").
114
 
        # If 'relpath' is '/' we *always* get back an abspath without
115
 
        # the drive letter - but if our transport already has a drive letter,
116
 
        # we want our abspaths to have a drive letter too - so handle that
117
 
        # here.
118
 
        if (sys.platform == "win32" and self._local_base[1:2] == ":"
119
 
            and path == '/'):
120
 
            path = self._local_base[:3]
121
 
 
122
103
        return urlutils.local_path_to_url(path)
123
104
 
124
105
    def local_abspath(self, relpath):
127
108
        This function only exists for the LocalTransport, since it is
128
109
        the only one that has direct local access.
129
110
        This is mostly for stuff like WorkingTree which needs to know
130
 
        the local working directory.  The returned path will always contain
131
 
        forward slashes as the path separator, regardless of the platform.
132
 
 
 
111
        the local working directory.
 
112
        
133
113
        This function is quite expensive: it calls realpath which resolves
134
114
        symlinks.
135
115
        """