[PATCH] Strip out extraneous parts of the file path when doing a fetch from local repo

Martin Geisler mg at daimi.au.dk
Sun Mar 2 10:53:03 CST 2008


Jesse Glick <Jesse.Glick at Sun.COM> writes:

> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -1787,4 +1787,6 @@ def removeauth(url):
>      '''remove all authentication information from a url string'''
>      scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
>      netloc = netloc[netloc.find('@')+1:]
> +    if scheme == 'file':
> +        path = re.sub(r'.+[/\\]', '/.../', path)

Wont the regexp match too much if I have a filename with a backslash in
it? That is a legal filename character on a Linux filesystem...

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20080302/b5439239/attachment.pgp 


More information about the Mercurial-devel mailing list