Code review comment for lp:~jameinel/bzr/2.0.1-322807-branch-at-root

Revision history for this message
John A Meinel (jameinel) wrote :

This fixes bug #322807

Basically, cicp_canonical_relpath always assumed that 'abspath()' returned a path that did not have a trailing '/'. However, when working at the root of the filesytem, this was not true. (And, I believe, not true on Linux or Mac, either.)

So I changed:
  return current[len(abspath+1):]
to
  return current[len(abspath):].lstrip('/')

which seems to work just fine.

In the process of doing this, I also made the function handle when base doesn't actually exist, since it made testing easier. And I changed it to always run tests that I'm sure will pass. (We don't require the filesystem to have CICP to run _cicp_canonical_relpath, only if we wanted to call it by 'osutils.canonical_relpath()'. This should help increase PQM test coverage.)

« Back to merge proposal