[PATCH 3 of 8] Create repository objects instead of using own ConfigParser in hgwebdir

Thomas Arendsen Hein thomas at intevation.de
Sun Aug 28 13:00:19 CDT 2005


* Thomas Arendsen Hein <thomas at intevation.de> [20050828 19:09]:
> Create repository objects instead of using own ConfigParser in hgwebdir.

This made it easy to show the real time of new commits here instead
of the timestamp of the changelog file. Are more information (like
who did the last commit) wanted here?

Thomas

# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Node ID 51f26e856f3d42c3bb04ac7544a50fbe2625729d
# Parent  c54d03bdf2dcba6983664138fe2cd6fe0681002d
Use commit time instead of stat to check time of last change.

diff -r c54d03bdf2dcba6983664138fe2cd6fe0681002d -r 51f26e856f3d42c3bb04ac7544a50fbe2625729d mercurial/hgweb.py
--- a/mercurial/hgweb.py	Sun Aug 28 17:18:39 2005
+++ b/mercurial/hgweb.py	Sun Aug 28 17:50:13 2005
@@ -947,6 +947,7 @@
 
                 url = os.environ["REQUEST_URI"] + "/" + name
                 url = url.replace("//", "/")
+                changes = repo.changelog.read(repo.changelog.tip())
 
                 yield dict(contact=get("web", "contact") or
                                    get("web", "author", "unknown"),
@@ -954,8 +955,7 @@
                            url=url,
                            parity=parity,
                            shortdesc=get("web", "description", "unknown"),
-                           lastupdate=os.stat(os.path.join(path, ".hg",
-                                                "00changelog.d")).st_mtime)
+                           lastupdate=float(changes[2].split(' ')[0]))
 
                 parity = 1 - parity
 

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list