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

login
register
mail settings
Submitter phabricator
Date Dec. 30, 2019, 1:33 p.m.
Message ID <dd1039dd652a3ee56ecbd77e7ee1cb2c@localhost.localdomain>
Download mbox | patch
Permalink /patch/44135/
State Not Applicable
Headers show

Comments

phabricator - Dec. 30, 2019, 1:33 p.m.
Closed by commit rHG801b8d314791: histedit: avoid using a list comprehension to fill a list with fixed values (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7762?vs=18993&id=19022

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7762/new/

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: mharbison72, durin42, #hg-reviewers, pulkit
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)