[PATCH] httprepo: order URL query string fields for readability

Matt Mackall mpm at selenic.com
Mon Mar 7 11:58:12 CST 2011


On Mon, 2011-03-07 at 15:42 +0800, Steven Brown wrote:
> # HG changeset patch
> # User Steven Brown <StevenGBrown at gmail.com>
> # Date 1299483431 -28800
> # Node ID 0342e936d1359a4bf562634cb36cab13b3052f74
> # Parent  c2eda93961ec30c984ea9244c8d8c72da72d405d
> httprepo: order URL query string fields for readability
> - cmd is always first, since the other fields are arguments to that command.
> - The other fields are in alphabetical order, rather than random order.

Hey, someone who knows how to show off their patch:

> example "hg serve" output
> BEFORE
> 127.0.0.1 - - [26/Feb/2011 14:20:07] "GET /?bases=fa5962be1d87fe9a57244a14033550e192e57521+1a38f137b190482eaf0986594cd6e6b486c76fec&cmd=changegroupsubset&heads=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521 HTTP/1.1" 200 -
> 127.0.0.1 - - [26/Feb/2011 14:00:50] "GET /?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" 200 -
> 127.0.0.1 - - [26/Feb/2011 14:17:28] "GET /?nodes=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521&cmd=branches HTTP/1.1" 200 -
> 
> AFTER
> 127.0.0.1 - - [26/Feb/2011 14:21:28] "GET /?cmd=changegroupsubset&bases=fa5962be1d87fe9a57244a14033550e192e57521+1a38f137b190482eaf0986594cd6e6b486c76fec&heads=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521 HTTP/1.1" 200 -
> 127.0.0.1 - - [26/Feb/2011 13:48:13] "GET /?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" 200 -
> 127.0.0.1 - - [26/Feb/2011 14:19:17] "GET /?cmd=branches&nodes=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521 HTTP/1.1" 200 -

Very nice. Queued, thanks.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list