From 2167ded8772eee4ea18a1e77ee35b11291524cf5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 27 Oct 2010 09:04:50 -0700 Subject: [PATCH] repoman: optimize svn keywords handling --- bin/repoman | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/repoman b/bin/repoman index dd903370b..d24907310 100755 --- a/bin/repoman +++ b/bin/repoman @@ -2220,7 +2220,8 @@ else: if vcs == 'cvs': headerstring = "'\$(Header|Id).*\$'" elif vcs == "svn": - svn_keywords = ["Rev", + svn_keywords = dict((k.lower(), k) for k in [ + "Rev", "Revision", "LastChangedRevision", "Date", @@ -2230,7 +2231,8 @@ else: "URL", "HeadURL", "Id", - "Header"] + "Header", + ]) for myfile in myupdates: @@ -2246,8 +2248,9 @@ else: # Subversion keywords are case-insensitive in svn:keywords properties, but case-sensitive in contents of files. enabled_keywords = [] - for keyword in svn_keywords: - if keyword.lower() in (k.lower() for k in expansion[myfile]): + for k in expansion[myfile]: + keyword = svn_keywords.get(k.lower()) + if keyword is not None: enabled_keywords.append(keyword) headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords) -- 2.26.2