Patchwork [1,of,4] hgweb: remove unused code in annotate web command

login
register
mail settings
Submitter Denis Laxalde
Date June 6, 2016, 8:03 a.m.
Message ID <506891a0db9f74ec9fee.1465200197@sh77.tls.logilab.fr>
Download mbox | patch
Permalink /patch/15420/
State Accepted
Headers show

Comments

Denis Laxalde - June 6, 2016, 8:03 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1464786998 -7200
#      Wed Jun 01 15:16:38 2016 +0200
# Node ID 506891a0db9f74ec9fee2c0bd3a7ed6af12eb83b
# Parent  48b38b16a8f83ea98ebdf0b370f59fd90dc17935
hgweb: remove unused code in annotate web command
Yuya Nishihara - June 8, 2016, 12:18 p.m.
On Mon, 06 Jun 2016 10:03:17 +0200, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde@logilab.fr>
> # Date 1464786998 -7200
> #      Wed Jun 01 15:16:38 2016 +0200
> # Node ID 506891a0db9f74ec9fee2c0bd3a7ed6af12eb83b
> # Parent  48b38b16a8f83ea98ebdf0b370f59fd90dc17935
> hgweb: remove unused code in annotate web command

Good catch. Queued this, thanks.

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -864,7 +864,6 @@  def annotate(web, req, tmpl):
                                      section='annotate', whitespace=True)
 
     def annotate(**map):
-        last = None
         if util.binary(fctx.data()):
             mt = (mimetypes.guess_type(fctx.path())[0]
                   or 'application/octet-stream')
@@ -874,11 +873,6 @@  def annotate(web, req, tmpl):
             lines = enumerate(fctx.annotate(follow=True, linenumber=True,
                                             diffopts=diffopts))
         for lineno, ((f, targetline), l) in lines:
-            fnode = f.filenode()
-
-            if last != fnode:
-                last = fnode
-
             yield {"parity": next(parity),
                    "node": f.hex(),
                    "rev": f.rev(),