# HG changeset patch # User Brendan Cully # Date 1160867003 25200 # Node ID 17894d1d9eea80338dcc9c1b19ebbe023d49484c # Parent defadc26e674b3a3afbb2d0d577a59c47e21abc5 hgweb: fix parent/child links across renames diff -r defadc26e674 -r 17894d1d9eea mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Sat Oct 14 15:28:45 2006 -0700 +++ b/mercurial/hgweb/hgweb_mod.py Sat Oct 14 16:03:23 2006 -0700 @@ -70,7 +70,11 @@ if len(siblings) == 1 and siblings[0].rev() == hiderev: return for s in siblings: - yield dict(node=hex(s.node()), rev=s.rev(), **args) + d = {'node': hex(s.node()), 'rev': s.rev()} + if hasattr(s, 'file'): + d['file'] = s.file() + d.update(args) + yield d def renamelink(self, fl, node): r = fl.renamed(node) @@ -318,8 +322,8 @@ "author": ctx.user(), "date": ctx.date(), "rename": self.renamelink(fl, n), - "parent": self.siblings(fctx.parents(), file=f), - "child": self.siblings(fctx.children(), file=f), + "parent": self.siblings(fctx.parents()), + "child": self.siblings(fctx.children()), "desc": ctx.description()}) parity = 1 - parity @@ -357,8 +361,8 @@ node=hex(fctx.node()), author=fctx.user(), date=fctx.date(), - parent=self.siblings(fctx.parents(), file=f), - child=self.siblings(fctx.children(), file=f), + parent=self.siblings(fctx.parents()), + child=self.siblings(fctx.children()), rename=self.renamelink(fl, n), permissions=fctx.manifest().execf(f)) @@ -395,8 +399,8 @@ date=fctx.date(), desc=fctx.description(), rename=self.renamelink(fl, n), - parent=self.siblings(fctx.parents(), file=f), - child=self.siblings(fctx.children(), file=f), + parent=self.siblings(fctx.parents()), + child=self.siblings(fctx.children()), permissions=fctx.manifest().execf(f)) def manifest(self, ctx, path):