templatefilters: store the agescales in reverseorder directly
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 06 Mar 2010 13:29:54 +0100
changeset 10601 b98b6a7363ae
parent 10600 033d2fdc3b9d
child 10602 94145b531cf9
templatefilters: store the agescales in reverseorder directly
mercurial/templatefilters.py
--- a/mercurial/templatefilters.py	Sat Mar 06 12:45:14 2010 +0100
+++ b/mercurial/templatefilters.py	Sat Mar 06 13:29:54 2010 +0100
@@ -14,15 +14,13 @@
         return "".join([stringify(t) for t in thing if t is not None])
     return str(thing)
 
-agescales = [("second", 1),
-             ("minute", 60),
-             ("hour", 3600),
-             ("day", 3600 * 24),
+agescales = [("year", 3600 * 24 * 365),
+             ("month", 3600 * 24 * 30),
              ("week", 3600 * 24 * 7),
-             ("month", 3600 * 24 * 30),
-             ("year", 3600 * 24 * 365)]
-
-agescales.reverse()
+             ("day", 3600 * 24),
+             ("hour", 3600),
+             ("minute", 60),
+             ("second", 1),]
 
 def age(date):
     '''turn a (timestamp, tzoff) tuple into an age string.'''