[PATCH 2 of 2 stable] hgweb: fixes invalid parents / children in comparison

wujek srujek wujek.srujek at gmail.com
Mon Jul 30 18:33:47 CDT 2012


# HG changeset patch
# User wujek srujek <wujek.srujek at googlemail.com>
# Date 1343689178 -7200
# Branch stable
# Node ID 8fdfd019797dd5b85c00d7b511ab2e6231dc6b19
# Parent  a9add455b8e6b2a15e0533895cb3f6c3b4529426
hgweb: fixes invalid parents / children in comparison

Previously, the parents / children were computed relative to the cset of the
currently shown file, which was wrong and inconsistent with diff and others.
With this patch, the listed csets are those that contain changes to the
currently compared file, which don't necessarily have to be the direct parents
and children of the changeset itself.

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -637,8 +637,8 @@
                 author=ctx.user(),
                 rename=rename,
                 branch=webutil.nodebranchnodefault(ctx),
-                parent=webutil.parents(ctx),
-                child=webutil.children(ctx),
+                parent=webutil.parents(fctx),
+                child=webutil.children(fctx),
                 leftrev=leftrev,
                 leftnode=hex(leftnode),
                 rightrev=rightrev,
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -628,7 +628,7 @@
   </tr>
   <tr>
    <th>children</th>
-   <td><a href="/file/559edbd9ed20/a">559edbd9ed20</a> </td>
+   <td></td>
   </tr>
   
   </table>
@@ -746,7 +746,7 @@
   </tr>
   <tr>
    <th>parents</th>
-   <td><a href="/file/559edbd9ed20/a">559edbd9ed20</a> </td>
+   <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
   </tr>
   <tr>
    <th>children</th>
@@ -870,7 +870,7 @@
   </tr>
   <tr>
    <th>parents</th>
-   <td><a href="/file/d73db4d812ff/a">d73db4d812ff</a> </td>
+   <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
   </tr>
   <tr>
    <th>children</th>


More information about the Mercurial-devel mailing list