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

Paolo Bonzini posted 1 patch 6 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew-ci tags/patchew/20180406092930.13947-1-pbonzini@redhat.com
mbox.py | 2 ++
1 file changed, 2 insertions(+)
[Patchew-devel] [PATCH] mbox: get version indicator from "PATCHv##"
Posted by Paolo Bonzini 6 years, 3 months ago
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@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

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel