[PATCH 20/21] fix-svn-author-certs: use new format
Felipe Contreras
felipe.contreras at gmail.com
Sun May 13 10:14:28 EDT 2012
Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
---
fix-svn-author-certs.py | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/fix-svn-author-certs.py b/fix-svn-author-certs.py
index 9545d67..af3df0a 100755
--- a/fix-svn-author-certs.py
+++ b/fix-svn-author-certs.py
@@ -43,7 +43,12 @@ with open("svn-revisions", "r") as f:
svn_map[svn_revision] = [mtn_revision]
svn_authormap = {}
-with open("svn-patch-authors", "r") as f:
+with open("svn_authors_map.txt", "r") as f:
+ for l in f:
+ key, value = l.rstrip().split(" = ")
+ svn_authormap[key] = value
+
+with open("svn_authors.txt", "r") as f:
for l in f:
mark = l.find("#") >= 0
l = l.replace(" # ", " ").strip()
@@ -54,6 +59,11 @@ with open("svn-patch-authors", "r") as f:
author = author[:author.index("(")].strip()
except ValueError:
pass
+ if mark and author in svn_authormap:
+ author = svn_authormap[author]
+ else:
+ if author.find("Unknown ") == 0:
+ author = author[8:]
revisions = svn_map[revision]
for revision in revisions:
@@ -82,11 +92,8 @@ with open("svn-patch-authors", "r") as f:
mtn=mtn, revision=revision)
os.system(cmd)
- try:
- author = author_map[author.lower()]
- except KeyError:
- if not mark:
- 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