Remove the support for getting commit messages from stdin, in favor of always using external editor. This was never very useful, especially given that was implemented poorly and with commit message verification it will become even more painful to keep. --- repoman/pym/repoman/actions.py | 4 +++- repoman/pym/repoman/utilities.py | 22 +--------------------- 2 files changed, 4 insertions(+), 22 deletions(-)
diff --git a/repoman/pym/repoman/actions.py b/repoman/pym/repoman/actions.py index 91603865c..6f561b64a 100644 --- a/repoman/pym/repoman/actions.py +++ b/repoman/pym/repoman/actions.py @@ -585,7 +585,9 @@ class Actions(object): commitmessage = utilities.get_commit_message_with_editor( editor, message=qa_output, prefix=msg_prefix) else: - commitmessage = utilities.get_commit_message_with_stdin() + print("EDITOR is unset or invalid. Please set EDITOR to your preferred editor.") + print(bad("* no EDITOR found for commit message, aborting commit.")) + sys.exit(1) except KeyboardInterrupt: logging.fatal("Interrupted; exiting...") sys.exit(1) diff --git a/repoman/pym/repoman/utilities.py b/repoman/pym/repoman/utilities.py index c204faa8d..1272f3fb6 100644 --- a/repoman/pym/repoman/utilities.py +++ b/repoman/pym/repoman/utilities.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- # repoman: Utilities -# Copyright 2007-2013 Gentoo Foundation +# Copyright 2007-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 """This module contains utility functions to help repoman find ebuilds to @@ -13,7 +13,6 @@ __all__ = [ "FindPackagesToScan", "FindPortdir", "get_commit_message_with_editor", - "get_commit_message_with_stdin", "get_committer_name", "have_ebuild_dir", "have_profile_dir", @@ -226,25 +225,6 @@ def get_commit_message_with_editor(editor, message=None, prefix=""): pass -def get_commit_message_with_stdin(): - """ - Read a commit message from the user and return it. - - @rtype: string or None - @return: A string on success or None if an error occurs. - """ - print( - "Please enter a commit message." - " Use Ctrl-d to finish or Ctrl-c to abort.") - commitmessage = [] - while True: - commitmessage.append(sys.stdin.readline()) - if not commitmessage[-1]: - break - commitmessage = "".join(commitmessage) - return commitmessage - - def FindPortdir(settings): """ Try to figure out what repo we are in and whether we are in a regular tree or an overlay. -- 2.16.1