[PATCH 1 of 3] run-tests: fixed warn detection on detecting warn only for lines

Simon Heimberg simohe at besonet.ch
Sun Feb 16 17:15:01 CST 2014


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1392590162 -3600
#      Sun Feb 16 23:36:02 2014 +0100
# Node ID 4b95042adedc640cd01e160dc98f34a8b5aa1c47
# Parent  0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
run-tests: fixed warn detection on detecting warn only for lines

The state "warned" was reported too often. The main problem was that
"False == 0" is true in python. Therefore use an empty string instead of 0
for reporting warn only for a line.
The other problem is fixed in the next patch.

diff -r 0e2877f8605d -r 4b95042adedc tests/run-tests.py
--- a/tests/run-tests.py	Sat Feb 15 22:09:32 2014 -0600
+++ b/tests/run-tests.py	Sun Feb 16 23:36:02 2014 +0100
@@ -797,10 +797,10 @@
             if isinstance(r, str):
                 if r == '+glob':
                     lout = el[:-1] + ' (glob)\n'
-                    r = 0 # warn only
+                    r = '' # warn only this line
                 elif r == '-glob':
                     lout = ''.join(el.rsplit(' (glob)', 1))
-                    r = 0 # warn only
+                    r = '' # warn only this line
                 else:
                     log('\ninfo, unknown linematch result: %r\n' % r)
                     r = False
@@ -810,7 +810,7 @@
                 if needescape(lout):
                     lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
                 postout.append("  " + lout) # let diff deal with it
-                if r != 0: # != warn only
+                if r != '': # if line failed
                     warnonly = False
 
         if lcmd:


More information about the Mercurial-devel mailing list