Thu Nov 17 14:41:33 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Make how_old() return a fixed date when caching is enabled.
how_old() becomes a problem when we have a cache, because the relative dates
will get stalled in the cache.
This is makes a workaround by making how_old() return a string containing the
fixed date, which isn't quite nice but it will do the trick until a better
solution comes up.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2015-04-15 14:38:48.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-04-15 14:38:48.000000000 +0000
@@ -113,6 +113,13 @@
return s
def how_old(epoch):
+ if config.cachedir:
+ # when we have a cache, the how_old() becomes a problem since
+ # the cached entries will have old data; so in this case just
+ # return a nice string
+ t = time.localtime(epoch)
+ s = time.strftime("%d %b %H:%M", t)
+ return s
age = int(time.time()) - int(epoch)
if age > 60*60*24*365*2:
s = str(age/60/60/24/365)