From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-835859-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 9A8A81387B1
	for <garchives@archives.gentoo.org>; Mon, 21 Sep 2015 23:51:51 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 5BEDF21C057;
	Mon, 21 Sep 2015 23:51:36 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id E9BDD21C057
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Sep 2015 23:51:25 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 0F6AA3409ED
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Sep 2015 23:51:25 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 896C724C
	for <gentoo-commits@lists.gentoo.org>; Mon, 21 Sep 2015 23:51:19 +0000 (UTC)
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" <dolsen@gentoo.org>
Message-ID: <1442878966.f702bf4c75b03b19e214c6d9f5a376afa647dce5.dolsen@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/
X-VCS-Repository: proj/portage
X-VCS-Files: pym/repoman/actions.py
X-VCS-Directories: pym/repoman/
X-VCS-Committer: dolsen
X-VCS-Committer-Name: Brian Dolbec
X-VCS-Revision: f702bf4c75b03b19e214c6d9f5a376afa647dce5
X-VCS-Branch: master
Date: Mon, 21 Sep 2015 23:51:19 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 071683ff-c231-4ec1-b292-62622031d073
X-Archives-Hash: ae0a39488c819b0b4ffcd9139271e0ea
Message-ID: <20150921235119.7vivjYks0MkXdY406a23PLr5HdLvGuT4HPTquydTby0@z>

commit:     f702bf4c75b03b19e214c6d9f5a376afa647dce5
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 03:59:10 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f702bf4c

repoman/actions.py: split out a manifest function

 pym/repoman/actions.py | 110 +++++++++++++++++++++++++------------------------
 1 file changed, 57 insertions(+), 53 deletions(-)

diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index d70dd82..405a8c7 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -330,59 +330,7 @@ class Actions(object):
 						level=logging.ERROR, noiselevel=-1)
 					sys.exit(retval)
 
-		if True:
-			myfiles = mymanifests[:]
-			# If there are no header (SVN/CVS keywords) changes in
-			# the files, this Manifest commit must include the
-			# other (yet uncommitted) files.
-			if not myheaders:
-				myfiles += myupdates
-				myfiles += myremoved
-			myfiles.sort()
-
-			fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
-			mymsg = os.fdopen(fd, "wb")
-			mymsg.write(_unicode_encode(commitmessage))
-			mymsg.close()
-
-			commit_cmd = []
-			if self.options.pretend and self.vcs_settings.vcs is None:
-				# substitute a bogus value for pretend output
-				commit_cmd.append("cvs")
-			else:
-				commit_cmd.append(self.vcs_settings.vcs)
-			commit_cmd.extend(self.vcs_settings.vcs_global_opts)
-			commit_cmd.append("commit")
-			commit_cmd.extend(self.vcs_settings.vcs_local_opts)
-			if self.vcs_settings.vcs == "hg":
-				commit_cmd.extend(["--logfile", commitmessagefile])
-				commit_cmd.extend(myfiles)
-			else:
-				commit_cmd.extend(["-F", commitmessagefile])
-				commit_cmd.extend(f.lstrip("./") for f in myfiles)
-
-			try:
-				if self.options.pretend:
-					print("(%s)" % (" ".join(commit_cmd),))
-				else:
-					retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
-					if retval != os.EX_OK:
-						if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
-							not git_supports_gpg_sign():
-							# Inform user that newer git is needed (bug #403323).
-							logging.error(
-								"Git >=1.7.9 is required for signed commits!")
-
-						writemsg_level(
-							"!!! Exiting on %s (shell) "
-							"error code: %s\n" % (self.vcs_settings.vcs, retval),
-							level=logging.ERROR, noiselevel=-1)
-						sys.exit(retval)
-			finally:
-				try:
-					os.unlink(commitmessagefile)
-				except OSError:
-					pass
+		self.add_manifest(mymanifests, myheaders, myupdates, myremoved, commitmessage)
 
 		print()
 		if self.vcs_settings.vcs:
@@ -807,3 +755,59 @@ class Actions(object):
 
 			myupdates += myautoadd
 		return myupdates, broken_changelog_manifests
+
+
+	def add_manifest(self, mymanifests, myheaders, myupdates, myremoved,
+					commitmessage):
+		myfiles = mymanifests[:]
+		# If there are no header (SVN/CVS keywords) changes in
+		# the files, this Manifest commit must include the
+		# other (yet uncommitted) files.
+		if not myheaders:
+			myfiles += myupdates
+			myfiles += myremoved
+		myfiles.sort()
+
+		fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+		mymsg = os.fdopen(fd, "wb")
+		mymsg.write(_unicode_encode(commitmessage))
+		mymsg.close()
+
+		commit_cmd = []
+		if self.options.pretend and self.vcs_settings.vcs is None:
+			# substitute a bogus value for pretend output
+			commit_cmd.append("cvs")
+		else:
+			commit_cmd.append(self.vcs_settings.vcs)
+		commit_cmd.extend(self.vcs_settings.vcs_global_opts)
+		commit_cmd.append("commit")
+		commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+		if self.vcs_settings.vcs == "hg":
+			commit_cmd.extend(["--logfile", commitmessagefile])
+			commit_cmd.extend(myfiles)
+		else:
+			commit_cmd.extend(["-F", commitmessagefile])
+			commit_cmd.extend(f.lstrip("./") for f in myfiles)
+
+		try:
+			if self.options.pretend:
+				print("(%s)" % (" ".join(commit_cmd),))
+			else:
+				retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
+				if retval != os.EX_OK:
+					if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
+						not git_supports_gpg_sign():
+						# Inform user that newer git is needed (bug #403323).
+						logging.error(
+							"Git >=1.7.9 is required for signed commits!")
+
+					writemsg_level(
+						"!!! Exiting on %s (shell) "
+						"error code: %s\n" % (self.vcs_settings.vcs, retval),
+						level=logging.ERROR, noiselevel=-1)
+					sys.exit(retval)
+		finally:
+			try:
+				os.unlink(commitmessagefile)
+			except OSError:
+				pass