# HG changeset patch # User Brendan Cully # Date 1160972415 25200 # Node ID 970b2d6de3b31c727454545b05bd5e61651f55ed # Parent 2e1d8b238b6cada7d2694df6bf542106acba7e59 hgweb: link to file parents in filediff, rather than changeset parents 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 @@ -553,8 +553,8 @@ class hgweb(object): def filediff(self, fctx): n = fctx.node() path = fctx.path() - parents = fctx.changectx().parents() - p1 = parents[0].node() + parents = fctx.parents() + p1 = parents and parents[0].node() or nullid def diff(**map): yield self.diff(p1, n, [path]) diff --git a/templates/gitweb/map b/templates/gitweb/map --- a/templates/gitweb/map +++ b/templates/gitweb/map @@ -41,9 +41,9 @@ tagentry = '< diffblock = '
#lines#
' changelogtag = 'tag:#tag|escape#' changesettag = 'tag#tag|escape#' -filediffparent = 'parent #rev#:#node|short#' +filediffparent = 'parent {rev}:{node|short}' filelogparent = 'parent #rev#: #node|short#' -filediffchild = 'child #rev#:#node|short#' +filediffchild = 'child {rev}:{node|short}' filelogchild = 'child #rev#: #node|short#' shortlog = shortlog.tmpl shortlogentry = '#date|age# ago#author##desc|strip|firstline|escape#changeset | manifest'