mercurial/hgweb/webcommands.py
changeset 27159 7e10b860c174
parent 27158 522ffc189671
child 27160 c533435cbc37
--- a/mercurial/hgweb/webcommands.py	Sat Nov 28 16:02:22 2015 +0800
+++ b/mercurial/hgweb/webcommands.py	Sat Nov 28 16:46:31 2015 +0800
@@ -838,7 +838,6 @@
     if 'file' not in req.form:
         raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
     path = webutil.cleanpath(web.repo, req.form['file'][0])
-    rename = path in ctx and webutil.renamelink(ctx[path]) or []
 
     parsecontext = lambda v: v == 'full' and -1 or int(v)
     if 'context' in req.form:
@@ -875,8 +874,10 @@
 
     comparison = webutil.compare(tmpl, context, leftlines, rightlines)
     if fctx is not None:
+        rename = webutil.renamelink(fctx)
         ctx = fctx
     else:
+        rename = []
         ctx = ctx
     return tmpl('filecomparison',
                 file=path,