commit:     dfbca13b96e7dc73157030be3c1e8ae8ee6311b3
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: Sun Sep 20 02:00:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=dfbca13b

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 af50c1b..974de62 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -146,55 +146,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)
@@ -814,3 +766,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.")

Reply via email to