Patchwork [4,of,9] run-tests: rename `lcmd` variable to `line_cmd`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 7, 2019, 12:16 p.m.
Message ID <5a3595259384c15ebce9.1567858603@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41533/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 7, 2019, 12:16 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1560525971 -3600
#      Fri Jun 14 16:26:11 2019 +0100
# Node ID 5a3595259384c15ebce94b662592e0091492a4b3
# Parent  e1cadbe3265f0d4dd8fa6384a65254aee12a1a48
# EXP-Topic test-match
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5a3595259384
run-tests: rename `lcmd` variable to `line_cmd`

This is clearer and more in line with some other variable names.

(This is a gratuitous cleanup that I made while investigating a bug).

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1612,9 +1612,9 @@  class TTest(Test):
         pos = -1
         postout = []
         for out_rawline in output:
-            out_line, lcmd = out_rawline, None
+            out_line, cmd_line = out_rawline, None
             if salt in out_rawline:
-                out_line, lcmd = out_rawline.split(salt, 1)
+                out_line, cmd_line = out_rawline.split(salt, 1)
 
             while out_line:
                 if not out_line.endswith(b'\n'):
@@ -1695,15 +1695,15 @@  class TTest(Test):
                                 continue
                     postout.append(b'  ' + el)
 
-            if lcmd:
+            if cmd_line:
                 # Add on last return code.
-                ret = int(lcmd.split()[1])
+                ret = int(cmd_line.split()[1])
                 if ret != 0:
                     postout.append(b'  [%d]\n' % ret)
                 if pos in after:
                     # Merge in non-active test bits.
                     postout += after.pop(pos)
-                pos = int(lcmd.split()[0])
+                pos = int(cmd_line.split()[0])
 
         if pos in after:
             postout += after.pop(pos)