comparison mercurial/util.py @ 1976:df8416346bb7

Enable path validation for copy, rename, debugwalk and other canonpath users. This fixed the last bit of issue134. Added some tests to test-rename and test-walk.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 19 Mar 2006 14:53:58 +0100
parents f92cf4a8cedd
children 04c17fc39c84 4b0535c678d6
comparison
equal deleted inserted replaced
1975:6e1a8ea5d717 1976:df8416346bb7
183 name = myname 183 name = myname
184 if not name.startswith(os.sep): 184 if not name.startswith(os.sep):
185 name = os.path.join(root, cwd, name) 185 name = os.path.join(root, cwd, name)
186 name = os.path.normpath(name) 186 name = os.path.normpath(name)
187 if name.startswith(rootsep): 187 if name.startswith(rootsep):
188 return pconvert(name[len(rootsep):]) 188 name = name[len(rootsep):]
189 audit_path(name)
190 return pconvert(name)
189 elif name == root: 191 elif name == root:
190 return '' 192 return ''
191 else: 193 else:
192 raise Abort('%s not under root' % myname) 194 raise Abort('%s not under root' % myname)
193 195