commit: d14d811d8d26423c53704fe841b0d9a9843b310f Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Sat Sep 19 04:25:34 2015 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Sat Sep 19 04:25:34 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d14d811d
repoman/actions.py: Split out thick_manifest() pym/repoman/actions.py | 101 +++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index a538174..ba1e0a2 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -143,55 +143,7 @@ class Actions(object): # committed in one big commit at the end. print() elif not self.repo_settings.repo_config.thin_manifest: - if self.vcs_settings.vcs == 'cvs': - headerstring = "'\$(Header|Id).*\$'" - elif self.vcs_settings.vcs == "svn": - svn_keywords = dict((k.lower(), k) for k in [ - "Rev", - "Revision", - "LastChangedRevision", - "Date", - "LastChangedDate", - "Author", - "LastChangedBy", - "URL", - "HeadURL", - "Id", - "Header", - ]) - - for myfile in myupdates: - - # for CVS, no_expansion contains files that are excluded from expansion - if self.vcs_settings.vcs == "cvs": - if myfile in no_expansion: - continue - - # for SVN, expansion contains files that are included in expansion - elif self.vcs_settings.vcs == "svn": - if myfile not in expansion: - continue - - # Subversion keywords are case-insensitive - # in svn:keywords properties, - # but case-sensitive in contents of files. - enabled_keywords = [] - 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) - - myout = repoman_getstatusoutput( - "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile))) - if myout[0] == 0: - myheaders.append(myfile) - - print("%s have headers that will change." % green(str(len(myheaders)))) - print( - "* Files with headers will" - " cause the manifests to be changed and committed separately.") + self.thick_manifest(myupdates, myheaders, no_expansion, expansion) logging.info("myupdates: %s", myupdates) logging.info("myheaders: %s", myheaders) @@ -810,3 +762,54 @@ class Actions(object): except OSError: pass + + def thick_manifest(self, myupdates, myheaders, no_expansion, expansion): + if self.vcs_settings.vcs == 'cvs': + headerstring = "'\$(Header|Id).*\$'" + elif self.vcs_settings.vcs == "svn": + svn_keywords = dict((k.lower(), k) for k in [ + "Rev", + "Revision", + "LastChangedRevision", + "Date", + "LastChangedDate", + "Author", + "LastChangedBy", + "URL", + "HeadURL", + "Id", + "Header", + ]) + + for myfile in myupdates: + + # for CVS, no_expansion contains files that are excluded from expansion + if self.vcs_settings.vcs == "cvs": + if myfile in no_expansion: + continue + + # for SVN, expansion contains files that are included in expansion + elif self.vcs_settings.vcs == "svn": + if myfile not in expansion: + continue + + # Subversion keywords are case-insensitive + # in svn:keywords properties, + # but case-sensitive in contents of files. + enabled_keywords = [] + 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) + + myout = repoman_getstatusoutput( + "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile))) + if myout[0] == 0: + myheaders.append(myfile) + + print("%s have headers that will change." % green(str(len(myheaders)))) + print( + "* Files with headers will" + " cause the manifests to be changed and committed separately.")