[PATCH] run-tests: fix broken regular expression

Augie Fackler raf at durin42.com
Wed Apr 6 22:27:01 EDT 2016


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1459996007 14400
#      Wed Apr 06 22:26:47 2016 -0400
# Node ID f1b1c04a16722031fafac3f34dd8209c8c1b34fa
# Parent  4d5cfcfb9954b9d9ae59904287e35f081476ae32
run-tests: fix broken regular expression

The regular expression in use passed tests because the test repo only
has single-digit changesets present. When I tried to use this for real
today, it broke, because the regular expression would only match a
single digit.

https://xkcd.com/1171/, or something like that.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1864,7 +1864,7 @@ class TextTestRunner(unittest.TextTestRu
                     sub.wait()
                     m = re.search(
                         (r'\nThe first (?P<goodbad>bad|good) revision '
-                         r'is:\nchangeset: +\d:(?P<node>[a-f0-9]+)\n.*\n'
+                         r'is:\nchangeset: +\d+:(?P<node>[a-f0-9]+)\n.*\n'
                          r'summary: +(?P<summary>[^\n]+)\n'),
                         data, (re.MULTILINE | re.DOTALL))
                     if m is None:


More information about the Mercurial-devel mailing list