[PATCH 13/21] fix-svn-author-certs: fix valid author checks

Felipe Contreras felipe.contreras at gmail.com
Sun May 13 10:14:21 EDT 2012


Let's not warn if the author from monotone has a valid format, or the
svn authors file has a mark (stating that the author is correct).

Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
---
 fix-svn-author-certs.py |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fix-svn-author-certs.py b/fix-svn-author-certs.py
index db348bf..9545d67 100755
--- a/fix-svn-author-certs.py
+++ b/fix-svn-author-certs.py
@@ -3,6 +3,7 @@
 
 import os
 import sys
+import re
 
 sys.stdout.write("Correcting author certs based on svn-patch-authors...")
 sys.stdout.flush()
@@ -44,6 +45,7 @@ with open("svn-revisions", "r") as f:
 svn_authormap = {}
 with open("svn-patch-authors", "r") as f:
     for l in f:
+        mark = l.find("#") >= 0
         l = l.replace(" # ", " ").strip()
         index = l.index(" ")
         revision = l[:index]
@@ -69,7 +71,8 @@ with open("svn-patch-authors", "r") as f:
             try:
                 existing_author = author_map[existing_author.lower()]
             except KeyError:
-                print "Missing author: %s" % existing_author
+                if not re.match('.*<.*>', existing_author):
+                    print "Missing author: %s" % existing_author
             cmd = "{mtn} cert {revision} committer {existing_author}".format(
                 mtn=mtn, revision=revision,
                 existing_author=shellquote(existing_author))
@@ -82,7 +85,8 @@ with open("svn-patch-authors", "r") as f:
             try:
                 author = author_map[author.lower()]
             except KeyError:
-                print "Missing author: %s" % author
+                if not mark:
+                    print "Missing author: %s" % author
             cmd = "{mtn} cert {revision} author {author}".format(
                 mtn=mtn, revision=revision,
                 author=shellquote(author))
-- 
1.7.10.1




More information about the Devel mailing list