Merge lp:~bialix/bzr/relpath-docstring into lp:bzr

Proposed by Alexander Belchenko
Status: Merged
Approved by: bzr PQM
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~bialix/bzr/relpath-docstring
Merge into: lp:bzr
Diff against target: 22 lines (+4/-1)
1 file modified
bzrlib/osutils.py (+4/-1)
To merge this branch: bzr merge lp:~bialix/bzr/relpath-docstring
Reviewer Review Type Date Requested Status
Andrew Bennetts Approve
Parth Malwankar Approve
Review via email: mp+24442@code.launchpad.net

Commit message

Improve docstring of bzrlib.osutils.relpath

Description of the change

Trivial change based on the attempt to use that function.

To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

The meaning of "false negative result" wasn't clear to me. I had to experiment to be sure. How about saying "NOTE: `base` should not have a trailing slash otherwise you'll get PathNotChild exceptions regardless of `path`."?

Even better would be to fix that behaviour: that sounds very much like a bug to me. But in the meantime a clearer docstring is certainly an improvement.

review: Needs Fixing
Revision history for this message
Alexander Belchenko (bialix) wrote :

Changed as you suggested.

Revision history for this message
Parth Malwankar (parthm) wrote :

Looks good to me.

review: Approve
Revision history for this message
Andrew Bennetts (spiv) :
review: Approve
Revision history for this message
bzr PQM (bzr-pqm) wrote :

Successful steps
Failure output:
All lines of log output:
Executing star-merge http://bazaar.launchpad.net/~bialix/bzr/relpath-docstring at Mon May 3 07:26:17 2010
['Nothing to merge.']

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/osutils.py'
--- bzrlib/osutils.py 2010-04-27 07:52:08 +0000
+++ bzrlib/osutils.py 2010-04-30 07:03:34 +0000
@@ -1149,7 +1149,7 @@
11491149
11501150
1151def relpath(base, path):1151def relpath(base, path):
1152 """Return path relative to base, or raise exception.1152 """Return path relative to base, or raise PathNotChild exception.
11531153
1154 The path may be either an absolute path or a path relative to the1154 The path may be either an absolute path or a path relative to the
1155 current working directory.1155 current working directory.
@@ -1157,6 +1157,9 @@
1157 os.path.commonprefix (python2.4) has a bad bug that it works just1157 os.path.commonprefix (python2.4) has a bad bug that it works just
1158 on string prefixes, assuming that '/u' is a prefix of '/u2'. This1158 on string prefixes, assuming that '/u' is a prefix of '/u2'. This
1159 avoids that problem.1159 avoids that problem.
1160
1161 NOTE: `base` should not have a trailing slash otherwise you'll get
1162 PathNotChild exceptions regardless of `path`.
1160 """1163 """
11611164
1162 if len(base) < MIN_ABS_PATHLENGTH:1165 if len(base) < MIN_ABS_PATHLENGTH: