##// END OF EJS Templates
hgweb: make "comparison" get parent from not filelog but changelog...
FUJIWARA Katsunori -
r21121:8c9e84b4 default
parent child Browse files
Show More
@@ -717,13 +717,13 b' def comparison(web, req, tmpl):'
717 rightrev = fctx.filerev()
717 rightrev = fctx.filerev()
718 rightnode = fctx.filenode()
718 rightnode = fctx.filenode()
719 rightlines = filelines(fctx)
719 rightlines = filelines(fctx)
720 parents = fctx.parents()
720 parent = ctx.p1()
721 if not parents:
721 if path not in parent:
722 leftrev = -1
722 leftrev = -1
723 leftnode = nullid
723 leftnode = nullid
724 leftlines = ()
724 leftlines = ()
725 else:
725 else:
726 pfctx = parents[0]
726 pfctx = parent[path]
727 leftrev = pfctx.filerev()
727 leftrev = pfctx.filerev()
728 leftnode = pfctx.filenode()
728 leftnode = pfctx.filenode()
729 leftlines = filelines(pfctx)
729 leftlines = filelines(pfctx)
@@ -923,6 +923,125 b' comparison removed file'
923 </html>
923 </html>
924
924
925
925
926 comparison not-modified file
927
928 $ echo e > e
929 $ hg add e
930 $ hg ci -m e
931 $ echo f > f
932 $ hg add f
933 $ hg ci -m f
934 $ hg tip --template "{node|short}\n"
935 41d9fc4a6ae1
936 $ hg diff -c tip e
937
938 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'comparison/tip/e'
939 200 Script output follows
940
941 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
942 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
943 <head>
944 <link rel="icon" href="/static/hgicon.png" type="image/png" />
945 <meta name="robots" content="index, nofollow" />
946 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
947 <script type="text/javascript" src="/static/mercurial.js"></script>
948
949 <title>test: e comparison</title>
950 </head>
951 <body>
952
953 <div class="container">
954 <div class="menu">
955 <div class="logo">
956 <a href="http://mercurial.selenic.com/">
957 <img src="/static/hglogo.png" alt="mercurial" /></a>
958 </div>
959 <ul>
960 <li><a href="/shortlog/41d9fc4a6ae1">log</a></li>
961 <li><a href="/graph/41d9fc4a6ae1">graph</a></li>
962 <li><a href="/tags">tags</a></li>
963 <li><a href="/bookmarks">bookmarks</a></li>
964 <li><a href="/branches">branches</a></li>
965 </ul>
966 <ul>
967 <li><a href="/rev/41d9fc4a6ae1">changeset</a></li>
968 <li><a href="/file/41d9fc4a6ae1">browse</a></li>
969 </ul>
970 <ul>
971 <li><a href="/file/41d9fc4a6ae1/e">file</a></li>
972 <li><a href="/file/tip/e">latest</a></li>
973 <li><a href="/diff/41d9fc4a6ae1/e">diff</a></li>
974 <li class="active">comparison</li>
975 <li><a href="/annotate/41d9fc4a6ae1/e">annotate</a></li>
976 <li><a href="/log/41d9fc4a6ae1/e">file log</a></li>
977 <li><a href="/raw-file/41d9fc4a6ae1/e">raw</a></li>
978 </ul>
979 <ul>
980 <li><a href="/help">help</a></li>
981 </ul>
982 </div>
983
984 <div class="main">
985 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
986 <h3>comparison e @ 5:41d9fc4a6ae1</h3>
987
988 <form class="search" action="/log">
989 <p></p>
990 <p><input name="rev" id="search1" type="text" size="30" /></p>
991 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
992 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
993 </form>
994
995 <div class="description">f</div>
996
997 <table id="changesetEntry">
998 <tr>
999 <th>author</th>
1000 <td>&#116;&#101;&#115;&#116;</td>
1001 </tr>
1002 <tr>
1003 <th>date</th>
1004 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1005 </tr>
1006 <tr>
1007 <th>parents</th>
1008 <td></td>
1009 </tr>
1010 <tr>
1011 <th>children</th>
1012 <td></td>
1013 </tr>
1014 </table>
1015
1016 <div class="overflow">
1017 <div class="sourcefirst"> comparison</div>
1018 <div class="legend">
1019 <span class="legendinfo equal">equal</span>
1020 <span class="legendinfo delete">deleted</span>
1021 <span class="legendinfo insert">inserted</span>
1022 <span class="legendinfo replace">replaced</span>
1023 </div>
1024
1025 <table class="bigtable">
1026 <thead class="header">
1027 <tr>
1028 <th>0:6b67ccefd5ce</th>
1029 <th>0:6b67ccefd5ce</th>
1030 </tr>
1031 </thead>
1032
1033 </table>
1034
1035 </div>
1036 </div>
1037 </div>
1038
1039 <script type="text/javascript">process_dates()</script>
1040
1041
1042 </body>
1043 </html>
1044
926 $ cd ..
1045 $ cd ..
927
1046
928 test import rev as raw-rev
1047 test import rev as raw-rev
General Comments 0
You need to be logged in to leave comments. Login now