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
1=== modified file 'bzrlib/osutils.py'
2--- bzrlib/osutils.py 2010-04-27 07:52:08 +0000
3+++ bzrlib/osutils.py 2010-04-30 07:03:34 +0000
4@@ -1149,7 +1149,7 @@
5
6
7 def relpath(base, path):
8- """Return path relative to base, or raise exception.
9+ """Return path relative to base, or raise PathNotChild exception.
10
11 The path may be either an absolute path or a path relative to the
12 current working directory.
13@@ -1157,6 +1157,9 @@
14 os.path.commonprefix (python2.4) has a bad bug that it works just
15 on string prefixes, assuming that '/u' is a prefix of '/u2'. This
16 avoids that problem.
17+
18+ NOTE: `base` should not have a trailing slash otherwise you'll get
19+ PathNotChild exceptions regardless of `path`.
20 """
21
22 if len(base) < MIN_ABS_PATHLENGTH: