[PATCH 1 of 1] hgwebdir: correct name output for path wildcards without prefix (issue2310)

Laurens Holst laurens.nospam at grauw.nl
Fri Jul 30 15:01:40 CDT 2010


Never mind, it is already fixed last week in 
http://mercurial.selenic.com/hg/hg/rev/8f8a7976f4bc — what are the odds 
for such an old issue :).

~Laurens

Op 30-7-2010 21:58, Laurens Holst schreef:
> # HG changeset patch
> # User Laurens Holst<laurens.hg at grauw.nl>
> # Date 1280519631 -7200
> # Branch stable
> # Node ID 8802d93abcba83baa315395d61d851ec785e86a3
> # Parent  52e4ac3e63f780114c5b7613fe0643b305d09789
> hgwebdir: correct name output for path wildcards without prefix (issue2310)
>
> When you pass ´*´ or ´**´ to hgweb, without prefixing it ([paths] / = **),
> the first character gets stripped from the resulting names.
> To test: findrepos([('/', '**')]) yields ('g-stable', 'hg-stable'), etc.
> This patch fixes the issue by special casing the situation where root is ´.´.
>
> diff -r 52e4ac3e63f7 -r 8802d93abcba mercurial/hgweb/hgwebdir_mod.py
> --- a/mercurial/hgweb/hgwebdir_mod.py	Tue Jul 27 14:40:25 2010 -0400
> +++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 30 21:53:51 2010 +0200
> @@ -35,7 +35,10 @@
>           roothead = os.path.normpath(os.path.abspath(roothead))
>           for path in util.walkrepos(roothead, followsym=True, recurse=recurse):
>               path = os.path.normpath(path)
> -            name = util.pconvert(path[len(roothead):]).strip('/')
> +            if roothead == '.':
> +                name = util.pconvert(path)
> +            else:
> +                name = util.pconvert(path[len(roothead):]).strip('/')
>               if prefix:
>                   name = prefix + '/' + name
>               repos.append((name, path))
>    
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>    


-- 
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Backbase employee; www.backbase.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100730/96c14df7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5278 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100730/96c14df7/attachment.bin>


More information about the Mercurial-devel mailing list