~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-30 00:55:00 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3811.
  • Revision ID: john@arbash-meinel.com-20081030005500-r5cej1cxflqhs3io
Switch so that we are using a simple timestamp as the first action.

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
            
66
75
        super(LocalTransport, self).__init__(base)
67
76
        self._local_base = urlutils.local_path_from_url(base)
68
77
 
100
109
        #       proper handling of stuff like
101
110
        path = osutils.normpath(osutils.pathjoin(
102
111
                    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
 
103
122
        return urlutils.local_path_to_url(path)
104
123
 
105
124
    def local_abspath(self, relpath):
108
127
        This function only exists for the LocalTransport, since it is
109
128
        the only one that has direct local access.
110
129
        This is mostly for stuff like WorkingTree which needs to know
111
 
        the local working directory.
112
 
        
 
130
        the local working directory.  The returned path will always contain
 
131
        forward slashes as the path separator, regardless of the platform.
 
132
 
113
133
        This function is quite expensive: it calls realpath which resolves
114
134
        symlinks.
115
135
        """