~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/urlutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
# jam 20060502 Sorted to 'l' because the final target is 'local_path_from_url'
182
182
def _posix_local_path_from_url(url):
183
183
    """Convert a url like file:///path/to/foo into /path/to/foo"""
 
184
    url = split_segment_parameters_raw(url)[0]
184
185
    file_localhost_prefix = 'file://localhost/'
185
186
    if url.startswith(file_localhost_prefix):
186
187
        path = url[len(file_localhost_prefix) - 1:]
209
210
    if not url.startswith('file://'):
210
211
        raise errors.InvalidURL(url, 'local urls must start with file:///, '
211
212
                                     'UNC path urls must start with file://')
 
213
    url = split_segment_parameters_raw(url)[0]
212
214
    # We strip off all 3 slashes
213
215
    win32_url = url[len('file:'):]
214
216
    # check for UNC path: //HOST/path