[PATCH 1 of 2] check-commit: scan for multiple instances of error patterns

Matt Mackall mpm at selenic.com
Fri Feb 5 22:57:17 UTC 2016


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1454712722 21600
#      Fri Feb 05 16:52:02 2016 -0600
# Node ID d930d42d30dcbbb26fe82f685eddbb7857d69f31
# Parent  79139c7a88bd1567ec31f0856b24c3f559aef8d1
check-commit: scan for multiple instances of error patterns

diff -r 79139c7a88bd -r d930d42d30dc contrib/check-commit
--- a/contrib/check-commit	Fri Feb 05 15:18:40 2016 +0100
+++ b/contrib/check-commit	Fri Feb 05 16:52:02 2016 -0600
@@ -50,8 +50,7 @@
     printed = node is None
     hits = []
     for exp, msg in errors:
-        m = re.search(exp, commit)
-        if m:
+        for m in re.finditer(exp, commit):
             end = m.end()
             trailing = re.search(r'(\\n)+$', exp)
             if trailing:


More information about the Mercurial-devel mailing list