changeset 3398:17894d1d9eea

hgweb: fix parent/child links across renames
author Brendan Cully <brendan@kublai.com>
date Sat, 14 Oct 2006 16:03:23 -0700
parents defadc26e674
children 22a106cb5650
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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):