hgweb: fix parent/child links across renames
authorBrendan Cully <brendan@kublai.com>
Sat, 14 Oct 2006 16:03:23 -0700
changeset 3392 17894d1d9eea
parent 3391 defadc26e674
child 3393 22a106cb5650
hgweb: fix parent/child links across renames
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):