~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Parth Malwankar
  • Date: 2010-05-03 08:13:32 UTC
  • mfrom: (5199 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5210.
  • Revision ID: parth.malwankar@gmail.com-20100503081332-sccscii0dqslaqu3
merged in changes from trunk and resolved conflict in NEWS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import os
18
18
import re
19
19
import stat
20
 
from stat import (S_ISREG, S_ISDIR, S_ISLNK, ST_MODE, ST_SIZE,
21
 
                  S_ISCHR, S_ISBLK, S_ISFIFO, S_ISSOCK)
 
20
from stat import S_ISREG, S_ISDIR, S_ISLNK, ST_MODE, ST_SIZE
22
21
import sys
23
22
import time
24
23
import codecs
25
 
import warnings
26
24
 
27
25
from bzrlib.lazy_import import lazy_import
28
26
lazy_import(globals(), """
1149
1147
 
1150
1148
 
1151
1149
def relpath(base, path):
1152
 
    """Return path relative to base, or raise exception.
 
1150
    """Return path relative to base, or raise PathNotChild exception.
1153
1151
 
1154
1152
    The path may be either an absolute path or a path relative to the
1155
1153
    current working directory.
1157
1155
    os.path.commonprefix (python2.4) has a bad bug that it works just
1158
1156
    on string prefixes, assuming that '/u' is a prefix of '/u2'.  This
1159
1157
    avoids that problem.
 
1158
 
 
1159
    NOTE: `base` should not have a trailing slash otherwise you'll get
 
1160
    PathNotChild exceptions regardless of `path`.
1160
1161
    """
1161
1162
 
1162
1163
    if len(base) < MIN_ABS_PATHLENGTH: