diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -636,7 +636,8 @@ class hgweb(object): def annotate(**map): last = None - for lineno, (f, l) in enumerate(fctx.annotate(follow=True)): + lines = enumerate(fctx.annotate(follow=True, linenumber=True)) + for lineno, ((f, targetline), l) in lines: fnode = f.filenode() name = self.repo.ui.shortuser(f.user()) @@ -648,6 +649,7 @@ class hgweb(object): "rev": f.rev(), "author": name, "file": f.path(), + "targetline": targetline, "line": l, "lineid": "l%d" % (lineno + 1), "linenumber": "% 6d" % (lineno + 1)} diff --git a/templates/gitweb/map b/templates/gitweb/map --- a/templates/gitweb/map +++ b/templates/gitweb/map @@ -24,7 +24,7 @@ fileannotate = fileannotate.tmpl filediff = filediff.tmpl filelog = filelog.tmpl fileline = '
#linenumber# #line|escape#
#linenumber#
#line|escape#
#linenumber#
#line|escape#
#line|escape#
#line|escape#