hgweb broken in current tip?

Jeremy Fitzhardinge jeremy at goop.org
Sun Sep 25 01:49:01 CDT 2005


Michal Kvasnica wrote:

>--- hgweb.py.orig       2005-09-24 11:08:26.396337000 +0200
>+++ hgweb.py    2005-09-24 11:08:28.766314000 +0200
>@@ -27,7 +27,7 @@
>         return "%d %s" % (c, plural(t, c))
>
>     now = time.time()
>-    then = x[0]
>+    then = x
>     delta = max(1, int(now - then))
>
>     scales = [["second", 1],
>
>  
>
I just encountered this too.  Unfortunately this change breaks when you
actually select a repository, because then 'x' becomes a tuple and x[0]
is the right thing to do.  I guess the stat mtime should be wrapped in a
tuple.

This works for me:

diff -r 77cd8068dbf4 mercurial/hgweb.py
--- a/mercurial/hgweb.py        Fri Sep 23 06:38:04 2005
+++ b/mercurial/hgweb.py        Sat Sep 24 23:48:24 2005
@@ -961,8 +961,8 @@
                            url=url,
                            parity=parity,
                            shortdesc=get("web", "description", "unknown"),
-                           lastupdate=os.stat(os.path.join(path, ".hg",
-                                              "00changelog.d")).st_mtime)
+                           lastupdate=(os.stat(os.path.join(path, ".hg",
+                                               "00changelog.d")).st_mtime,))

                 parity = 1 - parity



    J


More information about the Mercurial mailing list