/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: Andrew Bennetts
  • Date: 2008-09-08 12:59:00 UTC
  • mfrom: (3695 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908125900-8ywtsr7jqyyatjz0
Merge from bzr.dev.

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
 
96
105
    def abspath(self, relpath):
97
106
        """Return the full url to the given relative URL."""
98
107
        # TODO: url escape the result. RBC 20060523.
99
 
        assert isinstance(relpath, basestring), (type(relpath), relpath)
100
108
        # jam 20060426 Using normpath on the real path, because that ensures
101
109
        #       proper handling of stuff like
102
110
        path = osutils.normpath(osutils.pathjoin(
109
117
        This function only exists for the LocalTransport, since it is
110
118
        the only one that has direct local access.
111
119
        This is mostly for stuff like WorkingTree which needs to know
112
 
        the local working directory.
113
 
        
 
120
        the local working directory.  The returned path will always contain
 
121
        forward slashes as the path separator, regardless of the platform.
 
122
 
114
123
        This function is quite expensive: it calls realpath which resolves
115
124
        symlinks.
116
125
        """
511
520
        self._local_base = urlutils._win32_local_path_from_url(base)
512
521
 
513
522
    def abspath(self, relpath):
514
 
        assert isinstance(relpath, basestring), (type(relpath), relpath)
515
523
        path = osutils.normpath(osutils.pathjoin(
516
524
                    self._local_base, urlutils.unescape(relpath)))
517
525
        return urlutils._win32_local_path_to_url(path)