[Patchew-devel] [PATCH] mbox: get version indicator from "PATCHv##"

Paolo Bonzini pbonzini at redhat.com
Fri Apr 6 09:29:30 UTC 2018


If "[PATCHv2]" is used without a space before the "v", Patchew misses the
version number.  For example http://next.patchew.org/QEMU/20180326153441.32641-1-f4bug@amsat.org/
mistakes the previous "v5" as "v1".

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 mbox.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mbox.py b/mbox.py
index 3692cc6..fe108f3 100644
--- a/mbox.py
+++ b/mbox.py
@@ -140,6 +140,8 @@ class MboxMessage(object):
     def get_version(self):
         v = 1
         for tag in self.get_prefixes(True):
+            if tag.startswith("PATCH"):
+                tag = tag[5:]
             if tag.startswith("V"):
                 try:
                     v = int(tag[1:])
-- 
2.16.2




More information about the Patchew-devel mailing list