##// END OF EJS Templates
webcommands: get correct parents when comparing a removed file (issue4962)...
av6 -
r27158:522ffc18 default
parent child Browse files
Show More
@@ -854,6 +854,7 b' def comparison(web, req, tmpl):'
854 return [_('(binary file %s, hash: %s)') % (mt, hex(f.filenode()))]
854 return [_('(binary file %s, hash: %s)') % (mt, hex(f.filenode()))]
855 return f.data().splitlines()
855 return f.data().splitlines()
856
856
857 fctx = None
857 parent = ctx.p1()
858 parent = ctx.p1()
858 leftrev = parent.rev()
859 leftrev = parent.rev()
859 leftnode = parent.node()
860 leftnode = parent.node()
@@ -869,10 +870,14 b' def comparison(web, req, tmpl):'
869 leftlines = filelines(pfctx)
870 leftlines = filelines(pfctx)
870 else:
871 else:
871 rightlines = ()
872 rightlines = ()
872 fctx = ctx.parents()[0][path]
873 pfctx = ctx.parents()[0][path]
873 leftlines = filelines(fctx)
874 leftlines = filelines(pfctx)
874
875
875 comparison = webutil.compare(tmpl, context, leftlines, rightlines)
876 comparison = webutil.compare(tmpl, context, leftlines, rightlines)
877 if fctx is not None:
878 ctx = fctx
879 else:
880 ctx = ctx
876 return tmpl('filecomparison',
881 return tmpl('filecomparison',
877 file=path,
882 file=path,
878 node=hex(ctx.node()),
883 node=hex(ctx.node()),
@@ -884,8 +889,8 b' def comparison(web, req, tmpl):'
884 author=ctx.user(),
889 author=ctx.user(),
885 rename=rename,
890 rename=rename,
886 branch=webutil.nodebranchnodefault(ctx),
891 branch=webutil.nodebranchnodefault(ctx),
887 parent=webutil.parents(fctx),
892 parent=webutil.parents(ctx),
888 child=webutil.children(fctx),
893 child=webutil.children(ctx),
889 tags=webutil.nodetagsdict(web.repo, ctx.node()),
894 tags=webutil.nodetagsdict(web.repo, ctx.node()),
890 bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()),
895 bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()),
891 leftrev=leftrev,
896 leftrev=leftrev,
@@ -927,7 +927,7 b' comparison removed file'
927 </tr>
927 </tr>
928 <tr>
928 <tr>
929 <th>parents</th>
929 <th>parents</th>
930 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
930 <td><a href="/file/d73db4d812ff/a">d73db4d812ff</a> </td>
931 </tr>
931 </tr>
932 <tr>
932 <tr>
933 <th>children</th>
933 <th>children</th>
General Comments 0
You need to be logged in to leave comments. Login now