diff MoinMoin/wikiutil.py @ 1631:9f02d3c64f48

use ItemCache for page local edit-log, speedup InterWikiMap page handling if page does not exist
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 21 Oct 2006 04:37:50 +0200
parents b2322cdabd8a
children 0c301df3d4d0
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Sat Oct 21 03:13:04 2006 +0200
+++ b/MoinMoin/wikiutil.py	Sat Oct 21 04:37:50 2006 +0200
@@ -534,8 +534,11 @@
 def get_max_mtime(file_list, page):
     """ Returns the highest modification time of the files in file_list and the
     page page. """
-    return max([os.stat(filename).st_mtime for filename in file_list] +
-        [version2timestamp(page.mtime_usecs())])
+    timestamps = [os.stat(filename).st_mtime for filename in file_list]
+    if page.exists():
+        # exists() is cached and thus cheaper than mtime_usecs()
+        timestamps.append(version2timestamp(page.mtime_usecs()))
+    return max(timestamps)
 
 
 def load_wikimap(request):