# HG changeset patch # User Benoit Boissinot # Date 1267878594 -3600 # Node ID b98b6a7363ae69e0538bfc605d3e056a7b444d79 # Parent 033d2fdc3b9d3e33fd33d45109aafdb4a5cb3273 templatefilters: store the agescales in reverseorder directly diff -r 033d2fdc3b9d -r b98b6a7363ae 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.'''