Mercurial > public > mercurial-scm > hg
comparison mercurial/templatefilters.py @ 9721:1d75c683ada1
templater: put 'ago' inside the age template filter
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Thu, 05 Nov 2009 14:44:29 +0100 |
parents | 20ed9909dbd9 |
children | 4d9dea174b84 |
comparison
equal
deleted
inserted
replaced
9720:bb00a159e594 | 9721:1d75c683ada1 |
---|---|
41 | 41 |
42 delta = max(1, int(now - then)) | 42 delta = max(1, int(now - then)) |
43 for t, s in agescales: | 43 for t, s in agescales: |
44 n = delta // s | 44 n = delta // s |
45 if n >= 2 or s == 1: | 45 if n >= 2 or s == 1: |
46 return fmt(t, n) | 46 return '%s ago' % fmt(t, n) |
47 | 47 |
48 para_re = None | 48 para_re = None |
49 space_re = None | 49 space_re = None |
50 | 50 |
51 def fill(text, width): | 51 def fill(text, width): |