hgweb: generate query strings with parameters sorted by key
authorMads Kiilerich <mads@kiilerich.com>
Wed, 12 Dec 2012 02:38:14 +0100
changeset 18367 ae7215f4f7b9
parent 18366 fdf2f5730bd4
child 18368 de685145f5c2
hgweb: generate query strings with parameters sorted by key
mercurial/hgweb/webutil.py
tests/test-hgweb-commands.t
--- a/mercurial/hgweb/webutil.py	Wed Dec 12 02:51:02 2012 +0100
+++ b/mercurial/hgweb/webutil.py	Wed Dec 12 02:38:14 2012 +0100
@@ -353,7 +353,7 @@
         return sessionvars(copy.copy(self.vars), self.start)
     def __iter__(self):
         separator = self.start
-        for key, value in self.vars.iteritems():
+        for key, value in sorted(self.vars.iteritems()):
             yield {'name': key, 'value': str(value), 'separator': separator}
             separator = '&'
 
--- a/tests/test-hgweb-commands.t	Wed Dec 12 02:51:02 2012 +0100
+++ b/tests/test-hgweb-commands.t	Wed Dec 12 02:38:14 2012 +0100
@@ -976,8 +976,8 @@
   <a href="/file/cad8025a2e87?style=gitweb">files</a> |
   <a href="/help?style=gitweb">help</a>
   <br/>
-  <a href="/graph/3?style=gitweb&revcount=30">less</a>
-  <a href="/graph/3?style=gitweb&revcount=120">more</a>
+  <a href="/graph/3?revcount=30&style=gitweb">less</a>
+  <a href="/graph/3?revcount=120&style=gitweb">more</a>
   | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a> <br/>
   </div>
   
@@ -1049,8 +1049,8 @@
   </script>
   
   <div class="page_nav">
-  <a href="/graph/3?style=gitweb&revcount=30">less</a>
-  <a href="/graph/3?style=gitweb&revcount=120">more</a>
+  <a href="/graph/3?revcount=30&style=gitweb">less</a>
+  <a href="/graph/3?revcount=120&style=gitweb">more</a>
   | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a> 
   </div>