webcommands: do not modify repo.tagslist() stable
authorPatrick Mezard <patrick@mezard.eu>
Fri, 27 Jul 2012 17:48:49 +0200
branchstable
changeset 17261 c0068b058fcd
parent 17255 3e856d8abe9c
child 17262 f62cac85ce79
webcommands: do not modify repo.tagslist() Repeatedly refreshing a gitweb summary page served by hg serve would show the tags list switching between two different sequences.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri Jul 27 13:56:19 2012 +0200
+++ b/mercurial/hgweb/webcommands.py	Fri Jul 27 17:48:49 2012 +0200
@@ -394,8 +394,7 @@
                 branches=webutil.nodebranchdict(web.repo, ctx))
 
 def tags(web, req, tmpl):
-    i = web.repo.tagslist()
-    i.reverse()
+    i = reversed(web.repo.tagslist())
     parity = paritygen(web.stripecount)
 
     def entries(notip=False, limit=0, **map):
@@ -466,8 +465,7 @@
                 latestentry=lambda **x: entries(1, **x))
 
 def summary(web, req, tmpl):
-    i = web.repo.tagslist()
-    i.reverse()
+    i = reversed(web.repo.tagslist())
 
     def tagentries(**map):
         parity = paritygen(web.stripecount)