changeset 156:32ce2c5d4d25

Fix some broken parent links in hgweb
author mpm@selenic.com
date Wed, 25 May 2005 09:04:38 -0800
parents 083c38bdfa64
children 2653740d8118
files mercurial/hgweb.py templates/map
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Wed May 25 08:54:54 2005 -0800
+++ b/mercurial/hgweb.py	Wed May 25 09:04:38 2005 -0800
@@ -122,9 +122,9 @@
         if len(files) > self.maxfiles:
             yield self.t("fileellipses")
 
-    def parent(self, t1, node, rev):
+    def parent(self, t1, node=nullid, rev=-1, **args):
         if node != hex(nullid):
-            yield self.t(t1, node = node, rev = rev)
+            yield self.t(t1, node = node, rev = rev, **args)
 
     def diff(self, node1, node2, files):
         def filterfiles(list, files):
@@ -359,9 +359,9 @@
                      date = time.asctime(time.gmtime(t)),
                      shortdesc = cgi.escape(cs[4].splitlines()[0]),
                      parent1 = self.parent("filerevparent",
-                                           hex(p1), fl.rev(p1)),
+                                           hex(p1), fl.rev(p1), file=f),
                      parent2 = self.parent("filerevparent",
-                                           hex(p2), fl.rev(p2)),
+                                           hex(p2), fl.rev(p2), file=f),
                      p1 = hex(p1), p2 = hex(p2),
                      p1rev = fl.rev(p1), p2rev = fl.rev(p2))
 
@@ -426,10 +426,10 @@
                      age = age(t),
                      date = time.asctime(time.gmtime(t)),
                      shortdesc = cgi.escape(cs[4].splitlines()[0]),
-                     parent1 = self.parent("filerevparent",
-                                           hex(p1), fl.rev(p1)),
-                     parent2 = self.parent("filerevparent",
-                                           hex(p2), fl.rev(p2)),
+                     parent1 = self.parent("fileannotateparent",
+                                           hex(p1), fl.rev(p1), file=f),
+                     parent2 = self.parent("fileannotateparent",
+                                           hex(p2), fl.rev(p2), file=f),
                      p1 = hex(p1), p2 = hex(p2),
                      p1rev = fl.rev(p1), p2rev = fl.rev(p2))
 
--- a/templates/map	Wed May 25 08:54:54 2005 -0800
+++ b/templates/map	Wed May 25 09:04:38 2005 -0800
@@ -23,5 +23,5 @@
 diffline = "#line#"
 changelogparent = "<tr><td align="right">parent:&nbsp;</td><td><a href="?cmd=changeset;node=#node#">#rev#:#node#</a></td></tr>"
 changesetparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=changeset;node=#node#">#rev#:#node#</a></td></tr>"
-filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=changeset;node=#node#">#rev#:#node#</a></td></tr>"
-fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=changeset;node=#node#">#rev#:#node#</a></td></tr>"
+filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#">#rev#:#node#</a></td></tr>"
+fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#">#rev#:#node#</a></td></tr>"