[PATCH] hgweb: make the escape filter remove null characters (issue2567)

Matt Mackall mpm at selenic.com
Tue Oct 16 12:37:52 CDT 2012


On Mon, 2012-10-15 at 09:44 -0700, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1350319414 25200
> # Node ID 78d828137d39cc7999631d9e2dc6535e3b4e8a91
> # Parent  fec69c72e2b4b159512fb0d37707d635554ae1cf
> hgweb: make the escape filter remove null characters (issue2567)

Queued for default, with some minor fixups:

> -  $ hg ci -Ambranch
> +  $ env HGEDITOR="printf 'branch commit with null character: \0' >> $1" hg ci -A

This is asking for portability issues. Instead, I used some inline
Python:

+  >>> open('msg', 'wb').write('branch commit with null character: \0\n')
+  $ hg ci -l msg
+  $ rm msg

> -    <title>branch</title>
> -    <id>http://*:$HGPORT/#changeset-ba87b23d29ca67a305625d81a20ac279c1e3f444</id> (glob)
> -    <link href="http://*:$HGPORT/rev/ba87b23d29ca"/> (glob)
> +    <title>branch commit with null character: </title>
> +    <id>http://sid0x220:$HGPORT/#changeset-cad8025a2e87f88c06259790adfa15acb4080123</id>
> +    <link href="http://sid0x220:$HGPORT/rev/cad8025a2e87"/>

Your machine name snuck into the tests.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list