From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B8B281384AE for ; Sat, 19 Sep 2015 04:36:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3BA7D21C02D; Sat, 19 Sep 2015 04:36:33 +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 6807021C0E1 for ; Sat, 19 Sep 2015 04:36:32 +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 2869E340CC7 for ; Sat, 19 Sep 2015 04:36:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C1DAB20A for ; Sat, 19 Sep 2015 04:36:27 +0000 (UTC) From: "Brian Dolbec" 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" Message-ID: <1442637241.9311ffcfde2c6a8528ab3af23960cf995c614fa7.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:repoman 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: 9311ffcfde2c6a8528ab3af23960cf995c614fa7 X-VCS-Branch: repoman Date: Sat, 19 Sep 2015 04:36:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 039cf6b5-3c43-49c1-9173-62f5ad1898eb X-Archives-Hash: 63094d0712667e14900330387b69c9f6 commit: 9311ffcfde2c6a8528ab3af23960cf995c614fa7 Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 19 04:34:01 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sat Sep 19 04:34:01 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9311ffcf repoman/actions.py: Split out get_new_commit_message() pym/repoman/actions.py | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index 97d3458..44b2c04 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -108,24 +108,8 @@ class Actions(object): else: raise if not commitmessage or not commitmessage.strip(): - msg_prefix = "" - if self.scanner.repolevel > 1: - msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": " + commitmessage = self.get_new_commit_message(qa_output) - try: - editor = os.environ.get("EDITOR") - if editor and utilities.editor_is_executable(editor): - commitmessage = utilities.get_commit_message_with_editor( - editor, message=qa_output, prefix=msg_prefix) - else: - commitmessage = utilities.get_commit_message_with_stdin() - except KeyboardInterrupt: - logging.fatal("Interrupted; exiting...") - sys.exit(1) - if (not commitmessage or not commitmessage.strip() - or commitmessage.strip() == msg_prefix): - print("* no commit message? aborting commit.") - sys.exit(1) commitmessage = commitmessage.rstrip() myupdates, broken_changelog_manifests = self.changelogs( @@ -822,3 +806,24 @@ class Actions(object): portage.writemsg("!!! Disabled FEATURES='sign'\n") self.repo_settings.sign_manifests = False + + def get_new_commit_message(self, qa_output): + msg_prefix = "" + if self.scanner.repolevel > 1: + msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": " + + try: + editor = os.environ.get("EDITOR") + if editor and utilities.editor_is_executable(editor): + commitmessage = utilities.get_commit_message_with_editor( + editor, message=qa_output, prefix=msg_prefix) + else: + commitmessage = utilities.get_commit_message_with_stdin() + except KeyboardInterrupt: + logging.fatal("Interrupted; exiting...") + sys.exit(1) + if (not commitmessage or not commitmessage.strip() + or commitmessage.strip() == msg_prefix): + print("* no commit message? aborting commit.") + sys.exit(1) + return commitmessage