# HG changeset patch # User Matt Mackall # Date 1454712722 21600 # Node ID 897b2fcf079fbff72e0b6acfab58c63b5638cdc3 # Parent 8abd9f785030793485836f3708d8ab21e8724cf3 check-commit: scan for multiple instances of error patterns diff -r 8abd9f785030 -r 897b2fcf079f contrib/check-commit --- a/contrib/check-commit Fri Feb 05 10:22:14 2016 -0800 +++ 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: