[PATCH] parser: Detect series markers Mercurial produces

Andrew Shadura andrew.shadura at collabora.co.uk
Sun Jan 22 11:44:54 AEDT 2017


Unlike Git, Mercurial produces email subject lines of the
following format: "[PATCH M of N] ...". '(?:/| of )' pattern
matches both 'M/N' and 'M of N' formats.

Signed-off-by: Andrew Shadura <andrew.shadura at collabora.co.uk>
---
 patchwork/parser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/patchwork/parser.py b/patchwork/parser.py
index 16cc53c..2e692fa 100644
--- a/patchwork/parser.py
+++ b/patchwork/parser.py
@@ -309,7 +309,7 @@ def parse_series_marker(subject_prefixes):
         (x, n) if markers found, else (None, None)
     """
 
-    regex = re.compile('^([0-9]+)/([0-9]+)$')
+    regex = re.compile('^([0-9]+)(?:/| of )([0-9]+)$')
     m = _find_matching_prefix(subject_prefixes, regex)
     if m:
         return (int(m.group(1)), int(m.group(2)))
-- 
2.1.4



More information about the Patchwork mailing list