mercurial/templatefilters.py
changeset 13666 c49cddce0a81
parent 13593 cc4721ed7a2a
child 13951 7a6a8a069aac
--- a/mercurial/templatefilters.py	Wed Mar 16 23:09:14 2011 +0100
+++ b/mercurial/templatefilters.py	Wed Mar 16 03:28:56 2011 +0100
@@ -36,16 +36,22 @@
 
     now = time.time()
     then = date[0]
+    future = False
     if then > now:
-        return 'in the future'
-
-    delta = max(1, int(now - then))
-    if delta > agescales[0][1] * 2:
-        return util.shortdate(date)
+        future = True
+        delta = max(1, int(then - now))
+        if delta > agescales[0][1] * 30:
+            return 'in the distant future'
+    else:
+        delta = max(1, int(now - then))
+        if delta > agescales[0][1] * 2:
+            return util.shortdate(date)
 
     for t, s in agescales:
         n = delta // s
         if n >= 2 or s == 1:
+            if future:
+                return '%s from now' % fmt(t, n)
             return '%s ago' % fmt(t, n)
 
 def basename(path):