equal
deleted
inserted
replaced
66 else: |
66 else: |
67 res += re.escape(c) |
67 res += re.escape(c) |
68 return head + res + tail |
68 return head + res + tail |
69 |
69 |
70 _globchars = {'[': 1, '{': 1, '*': 1, '?': 1} |
70 _globchars = {'[': 1, '{': 1, '*': 1, '?': 1} |
|
71 |
|
72 def pathto(n1, n2): |
|
73 '''return the relative path from one place to another''' |
|
74 if not n1: return n2 |
|
75 a, b = n1.split(os.sep), n2.split(os.sep) |
|
76 a.reverse(), b.reverse() |
|
77 while a and b and a[-1] == b[-1]: |
|
78 a.pop(), b.pop() |
|
79 b.reverse() |
|
80 return os.sep.join((['..'] * len(a)) + b) |
71 |
81 |
72 def canonpath(repo, cwd, myname): |
82 def canonpath(repo, cwd, myname): |
73 rootsep = repo.root + os.sep |
83 rootsep = repo.root + os.sep |
74 name = myname |
84 name = myname |
75 if not name.startswith(os.sep): |
85 if not name.startswith(os.sep): |