Patchwork D7762: histedit: avoid using a list comprehension to fill a list with fixed values

login
register
mail settings
Submitter phabricator
Date Dec. 28, 2019, 3:04 a.m.
Message ID <differential-rev-PHID-DREV-s72qdumlrcqvpon2gnjh-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44107/
State Superseded
Headers show

Comments

phabricator - Dec. 28, 2019, 3:04 a.m.
mharbison72 created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Flagged by PyCharm as an unused assignment for the variable in the list.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7762

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: mharbison72, durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -308,7 +308,7 @@ 
         if len(a.verbs):
             v = b', '.join(sorted(a.verbs, key=lambda v: len(v)))
         actions.append(b" %s = %s" % (v, lines[0]))
-        actions.extend([b'  %s' for l in lines[1:]])
+        actions.extend([b'  %s'] * (len(lines) - 1))
 
     for v in (
         sorted(primaryactions)