diff mercurial/hgweb/webcommands.py @ 29522:9c37df347485

hgweb: add link to parents of annotated revision in annotate view The link is embedded into a div with class="annotate-info" that only shows up upon hover of the annotate column. To avoid duplicate hover-overs (this new one and the one coming from link's title), drop "title" attribute from a element and put it in the annotate-info element.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 28 Jun 2016 11:42:42 +0200
parents c4fc33c477da
children df7d8ea90695
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Mon Jul 11 13:53:35 2016 +0200
+++ b/mercurial/hgweb/webcommands.py	Tue Jun 28 11:42:42 2016 +0200
@@ -864,6 +864,13 @@
     diffopts = patch.difffeatureopts(web.repo.ui, untrusted=True,
                                      section='annotate', whitespace=True)
 
+    def parents(f):
+        for p in f.parents():
+            yield {
+                "node": p.hex(),
+                "rev": p.rev(),
+            }
+
     def annotate(**map):
         if util.binary(fctx.data()):
             mt = (mimetypes.guess_type(fctx.path())[0]
@@ -882,6 +889,7 @@
                    "node": f.hex(),
                    "rev": rev,
                    "author": f.user(),
+                   "parents": parents(f),
                    "desc": f.description(),
                    "extra": f.extra(),
                    "file": f.path(),