Patchwork run-tests: fix broken regular expression

login
register
mail settings
Submitter Augie Fackler
Date April 7, 2016, 2:27 a.m.
Message ID <f1b1c04a16722031fafa.1459996021@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/14410/
State Accepted
Headers show

Comments

Augie Fackler - April 7, 2016, 2:27 a.m.
# HG changeset patch
# User Augie Fackler <augie@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.
timeless - April 7, 2016, 2:49 a.m.
lgtm

On Wed, Apr 6, 2016 at 10:27 PM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie@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:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Yuya Nishihara - April 7, 2016, 2:27 p.m.
On Wed, 06 Apr 2016 22:27:01 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1459996007 14400
> #      Wed Apr 06 22:26:47 2016 -0400
> # Node ID f1b1c04a16722031fafac3f34dd8209c8c1b34fa
> # Parent  4d5cfcfb9954b9d9ae59904287e35f081476ae32
> run-tests: fix broken regular expression

Sure, queued. Thanks.

Patch

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: