# HG changeset patch # User Alexis S. L. Carvalho # Date 2006-11-15 20:56:47 # Node ID 48768b1ab23c5e0f539d0f06e999107d24388108 # Parent 6f6696962986175a0e60b4efd1c71fa22c64f062 fix util.pathto All users of this function pass a local path (which uses os.sep) as the first argument and a "/"-separated path as the second argument. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -207,9 +207,12 @@ def globre(pat, head='^', tail='$'): def pathto(n1, n2): '''return the relative path from one place to another. - this returns a path in the form used by the local filesystem, not hg.''' + n1 should use os.sep to separate directories + n2 should use "/" to separate directories + returns an os.sep-separated path. + ''' if not n1: return localpath(n2) - a, b = n1.split('/'), n2.split('/') + a, b = n1.split(os.sep), n2.split('/') a.reverse() b.reverse() while a and b and a[-1] == b[-1]: