From: Zac Medico Date: Wed, 27 Oct 2010 16:04:50 +0000 (-0700) Subject: repoman: optimize svn keywords handling X-Git-Tag: v2.2.0_alpha2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2167ded8772eee4ea18a1e77ee35b11291524cf5;p=portage.git repoman: optimize svn keywords handling --- 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)