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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Sep 7 08:16:42 EDT 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at 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).

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:


More information about the Mercurial-devel mailing list