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

login
register
mail settings
Submitter Matt Mackall
Date Feb. 5, 2016, 10:57 p.m.
Message ID <d930d42d30dcbbb26fe8.1454713037@ruin.waste.org>
Download mbox | patch
Permalink /patch/13023/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Matt Mackall - Feb. 5, 2016, 10:57 p.m.
# HG changeset patch
# User Matt Mackall <mpm@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

Patch

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: