From 0678804e3e1bb566523547a11432d5b92ed9b066 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 f21420e26..1cd0adc5b 100755 --- a/bin/repoman +++ b/bin/repoman @@ -2217,7 +2217,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", @@ -2227,7 +2228,8 @@ else: "URL", "HeadURL", "Id", - "Header"] + "Header", + ]) for myfile in myupdates: @@ -2243,8 +2245,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