hgweb: keep original order from hgwebdir config files (
issue1535)
--- a/mercurial/hgweb/hgwebdir_mod.py Thu Nov 05 15:01:00 2009 +0100
+++ b/mercurial/hgweb/hgwebdir_mod.py Thu Nov 05 15:06:35 2009 +0100
@@ -89,7 +89,6 @@
name = name[len(prefix):]
self.repos.append((name.lstrip('/'), repo))
- self.repos.sort()
self.lastrefresh = time.time()
def run(self):
@@ -196,7 +195,7 @@
yield {"type" : i[0], "extension": i[1],
"node": nodeid, "url": url}
- sortdefault = 'name', False
+ sortdefault = None, False
def entries(sortcolumn="", descending=False, subdir="", **map):
rows = []
--- a/tests/test-hgwebdir.out Thu Nov 05 15:01:00 2009 +0100
+++ b/tests/test-hgwebdir.out Thu Nov 05 15:06:35 2009 +0100
@@ -29,6 +29,7 @@
200 Script output follows
+/t/a/
/b/
/coll/a/
/coll/a/.hg/patches/
@@ -39,7 +40,6 @@
/rcoll/b/
/rcoll/b/d/
/rcoll/c/
-/t/a/
200 Script output follows
@@ -64,7 +64,7 @@
<table class="bigtable">
<tr>
- <th><a href="?sort=-name">Name</a></th>
+ <th><a href="?sort=name">Name</a></th>
<th><a href="?sort=description">Description</a></th>
<th><a href="?sort=contact">Contact</a></th>
<th><a href="?sort=lastchange">Last change</a></th>
@@ -72,7 +72,7 @@
</tr>
<tr class="parity0">
-<td><a href="/b/?style=paper">b</a></td>
+<td><a href="/t/a/?style=paper">t/a</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -80,7 +80,7 @@
</tr>
<tr class="parity1">
-<td><a href="/coll/a/?style=paper">coll/a</a></td>
+<td><a href="/b/?style=paper">b</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -88,7 +88,7 @@
</tr>
<tr class="parity0">
-<td><a href="/coll/a/.hg/patches/?style=paper">coll/a/.hg/patches</a></td>
+<td><a href="/coll/a/?style=paper">coll/a</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -96,7 +96,7 @@
</tr>
<tr class="parity1">
-<td><a href="/coll/b/?style=paper">coll/b</a></td>
+<td><a href="/coll/a/.hg/patches/?style=paper">coll/a/.hg/patches</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -104,7 +104,7 @@
</tr>
<tr class="parity0">
-<td><a href="/coll/c/?style=paper">coll/c</a></td>
+<td><a href="/coll/b/?style=paper">coll/b</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -112,7 +112,7 @@
</tr>
<tr class="parity1">
-<td><a href="/rcoll/a/?style=paper">rcoll/a</a></td>
+<td><a href="/coll/c/?style=paper">coll/c</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -120,7 +120,7 @@
</tr>
<tr class="parity0">
-<td><a href="/rcoll/a/.hg/patches/?style=paper">rcoll/a/.hg/patches</a></td>
+<td><a href="/rcoll/a/?style=paper">rcoll/a</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -128,7 +128,7 @@
</tr>
<tr class="parity1">
-<td><a href="/rcoll/b/?style=paper">rcoll/b</a></td>
+<td><a href="/rcoll/a/.hg/patches/?style=paper">rcoll/a/.hg/patches</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -136,7 +136,7 @@
</tr>
<tr class="parity0">
-<td><a href="/rcoll/b/d/?style=paper">rcoll/b/d</a></td>
+<td><a href="/rcoll/b/?style=paper">rcoll/b</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -144,7 +144,7 @@
</tr>
<tr class="parity1">
-<td><a href="/rcoll/c/?style=paper">rcoll/c</a></td>
+<td><a href="/rcoll/b/d/?style=paper">rcoll/b/d</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -152,7 +152,7 @@
</tr>
<tr class="parity0">
-<td><a href="/t/a/?style=paper">t/a</a></td>
+<td><a href="/rcoll/c/?style=paper">rcoll/c</a></td>
<td>unknown</td>
<td>Foo Bar <foo.bar@example.com></td>
<td class="age">seconds ago</td>
@@ -200,7 +200,7 @@
<table class="bigtable">
<tr>
- <th><a href="?sort=-name">Name</a></th>
+ <th><a href="?sort=name">Name</a></th>
<th><a href="?sort=description">Description</a></th>
<th><a href="?sort=contact">Contact</a></th>
<th><a href="?sort=lastchange">Last change</a></th>