~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/urlutils.py

  • Committer: Martin Pool
  • Date: 2008-06-11 02:36:40 UTC
  • mfrom: (3490 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3492.
  • Revision ID: mbp@sourcefrog.net-20080611023640-db0lqd75yueksdw7
Merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    
76
76
    This assumes that both paths are already fully specified file:// URLs.
77
77
    """
78
 
    assert len(base) >= MIN_ABS_FILEURL_LENGTH, ('Length of base must be equal or'
79
 
        ' exceed the platform minimum url length (which is %d)' % 
80
 
        MIN_ABS_FILEURL_LENGTH)
81
 
 
 
78
    if len(base) < MIN_ABS_FILEURL_LENGTH:
 
79
        raise ValueError('Length of base must be equal or'
 
80
            ' exceed the platform minimum url length (which is %d)' %
 
81
            MIN_ABS_FILEURL_LENGTH)
82
82
    base = local_path_from_url(base)
83
83
    path = local_path_from_url(path)
84
84
    return escape(osutils.relpath(base, path))
574
574
    :return: A unicode string which can be safely encoded into the 
575
575
         specified encoding.
576
576
    """
577
 
    assert encoding is not None, 'you cannot specify None for the display encoding.'
 
577
    if encoding is None:
 
578
        raise ValueError('you cannot specify None for the display encoding')
578
579
    if url.startswith('file://'):
579
580
        try:
580
581
            path = local_path_from_url(url)