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 5532C1387B1 for ; Mon, 21 Sep 2015 23:51:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C7C8E21C054; Mon, 21 Sep 2015 23:51:32 +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 2E76621C054 for ; Mon, 21 Sep 2015 23:51:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 74F9C340A1B for ; Mon, 21 Sep 2015 23:51:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F2D06252 for ; Mon, 21 Sep 2015 23:51:19 +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: <1442878967.4d38fd403a374a07def13421cd276c0b2de84605.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: 4d38fd403a374a07def13421cd276c0b2de84605 X-VCS-Branch: master Date: Mon, 21 Sep 2015 23:51:19 +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: 9f38bd91-5ecb-4937-b5c6-30ebd4a65512 X-Archives-Hash: 14b9a45db25022e74ef0ea3c3ea0cbfd Message-ID: <20150921235119.Yhg7-mtIxhXf4rvXCXX65GG08kTl5vFBdMWcWSLGVgw@z> commit: 4d38fd403a374a07def13421cd276c0b2de84605 Author: Brian Dolbec gentoo org> AuthorDate: Sat Sep 19 04:34:01 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Sep 21 23:42:47 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4d38fd40 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 4f516da..9d97b20 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -111,24 +111,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( @@ -826,3 +810,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