[PATCH 5 of 5] run-tests: print more information on unnecessary glob matching

Simon Heimberg simohe at besonet.ch
Sat Jul 13 17:25:15 CDT 2013


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1373752969 -7200
# Node ID 338c9f0989b8ed6fb1352a564f4f503de1cdb6d5
# Parent  dfbcc4f0944be9c93f72bb7942cde25457bd6559
run-tests: print more information on unnecessary glob matching

Extend the message with the test name and the approximate line number. It now
looks similar to the warning about a missing glob for path matching.

old message:
......
Info, unnecessary glob: at a/b/c (glob)
..

new message:
......
Info, unnecessary glob in test test-example.t (after line 9): at a/b/c (glob)
..

diff -r dfbcc4f0944b -r 338c9f0989b8 tests/run-tests.py
--- a/tests/run-tests.py	Son Jul 14 00:02:48 2013 +0200
+++ b/tests/run-tests.py	Son Jul 14 00:02:49 2013 +0200
@@ -597,7 +597,7 @@
     if el + '\n' == l:
         if os.altsep:
             # matching on "/" is not needed for this line
-            log("\nInfo, unnecessary glob: %s (glob)" % el)
+            return 'glob'
         return True
     i, n = 0, len(el)
     res = ''
@@ -790,6 +790,9 @@
                 if r == 'slash':
                     log('\ninfo, missing glob in test %s (after line %d): %s'
                         % (test, pos, el))
+                elif r == 'glob':
+                    log('\ninfo, unnecessary glob in test %s (after line %d):'
+                        ' %s (glob)\n' % (test, pos, el[-1]))
             else:
                 if needescape(lout):
                     lout = stringescape(lout.rstrip('\n')) + " (esc)\n"


More information about the Mercurial-devel mailing list