Patchwork [3,of,9] run-tests: rename `lout` variable to `out_line`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 7, 2019, 12:16 p.m.
Message ID <e1cadbe3265f0d4dd8fa.1567858602@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/41535/
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 1560525874 -3600
#      Fri Jun 14 16:24:34 2019 +0100
# Node ID e1cadbe3265f0d4dd8fa6384a65254aee12a1a48
# Parent  fd5c60869c435d10960d060fd0bd37dfb7dcea3c
# EXP-Topic test-match
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r e1cadbe3265f
run-tests: rename `lout` variable to `out_line`

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,13 +1612,13 @@  class TTest(Test):
         pos = -1
         postout = []
         for out_rawline in output:
-            lout, lcmd = out_rawline, None
+            out_line, lcmd = out_rawline, None
             if salt in out_rawline:
-                lout, lcmd = out_rawline.split(salt, 1)
-
-            while lout:
-                if not lout.endswith(b'\n'):
-                    lout += b' (no-eol)\n'
+                out_line, lcmd = out_rawline.split(salt, 1)
+
+            while out_line:
+                if not out_line.endswith(b'\n'):
+                    out_line += b' (no-eol)\n'
 
                 # Find the expected output at the current position.
                 els = [None]
@@ -1629,10 +1629,10 @@  class TTest(Test):
                 for i, el in enumerate(els):
                     r = False
                     if el:
-                        r, exact = self.linematch(el, lout)
+                        r, exact = self.linematch(el, out_line)
                     if isinstance(r, str):
                         if r == '-glob':
-                            lout = ''.join(el.rsplit(' (glob)', 1))
+                            out_line = ''.join(el.rsplit(' (glob)', 1))
                             r = '' # Warn only this line.
                         elif r == "retry":
                             postout.append(b'  ' + el)
@@ -1669,10 +1669,10 @@  class TTest(Test):
                         del els[i]
                     postout.append(b'  ' + el)
                 else:
-                    if self.NEEDESCAPE(lout):
-                        lout = TTest._stringescape(b'%s (esc)\n' %
-                                                   lout.rstrip(b'\n'))
-                    postout.append(b'  ' + lout) # Let diff deal with it.
+                    if self.NEEDESCAPE(out_line):
+                        out_line = TTest._stringescape(b'%s (esc)\n' %
+                                                   out_line.rstrip(b'\n'))
+                    postout.append(b'  ' + out_line) # Let diff deal with it.
                     if r != '': # If line failed.
                         warnonly = WARN_NO
                     elif warnonly == WARN_UNDEFINED: