MCPcopy Create free account
hub / github.com/boostorg/build / relpath

Function relpath

v2/util/path.py:895–904  ·  view source on GitHub ↗
(p1, p2)

Source from the content-addressed store, hash-verified

893 return commonpath(l1[1:], l2[1:], common+[l1[0]])
894
895def relpath(p1, p2):
896 (common,l1,l2) = commonpath(split(p1), split(p2))
897 p = []
898 if len(l1) > 0:
899 p = [ '../' * len(l1) ]
900 p = p + l2
901 if p:
902 return os.path.join( *p )
903 else:
904 return "."

Callers

nothing calls this directly

Calls 2

commonpathFunction · 0.85
splitFunction · 0.85

Tested by

no test coverage detected