~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Martin Pool
  • Date: 2009-07-24 03:15:56 UTC
  • mfrom: (4565 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4566.
  • Revision ID: mbp@sourcefrog.net-20090724031556-5zyef6f1ixtn6r3z
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1040
1040
 
1041
1041
    s = []
1042
1042
    head = rp
1043
 
    while len(head) >= len(base):
 
1043
    while True:
 
1044
        if len(head) <= len(base) and head != base:
 
1045
            raise errors.PathNotChild(rp, base)
1044
1046
        if head == base:
1045
1047
            break
1046
 
        head, tail = os.path.split(head)
 
1048
        head, tail = split(head)
1047
1049
        if tail:
1048
 
            s.insert(0, tail)
1049
 
    else:
1050
 
        raise errors.PathNotChild(rp, base)
 
1050
            s.append(tail)
1051
1051
 
1052
1052
    if s:
1053
 
        return pathjoin(*s)
 
1053
        return pathjoin(*reversed(s))
1054
1054
    else:
1055
1055
        return ''
1056
1056