1 |
commit: 518d4ec639187fa5c3565eeae05274abbeb7e813 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 17 12:22:01 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 27 19:06:53 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=518d4ec6 |
7 |
|
8 |
repoman: Remove support for getting messages from stdin |
9 |
|
10 |
Remove the support for getting commit messages from stdin, in favor |
11 |
of always using external editor. This was never very useful, especially |
12 |
given that was implemented poorly and with commit message verification |
13 |
it will become even more painful to keep. |
14 |
|
15 |
Reviewed-by: Brian Dolbec <dolsen <AT> gentoo.org> |
16 |
|
17 |
repoman/pym/repoman/actions.py | 4 +++- |
18 |
repoman/pym/repoman/utilities.py | 22 +--------------------- |
19 |
2 files changed, 4 insertions(+), 22 deletions(-) |
20 |
|
21 |
diff --git a/repoman/pym/repoman/actions.py b/repoman/pym/repoman/actions.py |
22 |
index 57b528312..cd954223a 100644 |
23 |
--- a/repoman/pym/repoman/actions.py |
24 |
+++ b/repoman/pym/repoman/actions.py |
25 |
@@ -585,7 +585,9 @@ class Actions(object): |
26 |
commitmessage = utilities.get_commit_message_with_editor( |
27 |
editor, message=qa_output, prefix=msg_prefix) |
28 |
else: |
29 |
- commitmessage = utilities.get_commit_message_with_stdin() |
30 |
+ print("EDITOR is unset or invalid. Please set EDITOR to your preferred editor.") |
31 |
+ print(bad("* no EDITOR found for commit message, aborting commit.")) |
32 |
+ sys.exit(1) |
33 |
except KeyboardInterrupt: |
34 |
logging.fatal("Interrupted; exiting...") |
35 |
sys.exit(1) |
36 |
|
37 |
diff --git a/repoman/pym/repoman/utilities.py b/repoman/pym/repoman/utilities.py |
38 |
index c204faa8d..1272f3fb6 100644 |
39 |
--- a/repoman/pym/repoman/utilities.py |
40 |
+++ b/repoman/pym/repoman/utilities.py |
41 |
@@ -1,6 +1,6 @@ |
42 |
# -*- coding:utf-8 -*- |
43 |
# repoman: Utilities |
44 |
-# Copyright 2007-2013 Gentoo Foundation |
45 |
+# Copyright 2007-2018 Gentoo Foundation |
46 |
# Distributed under the terms of the GNU General Public License v2 |
47 |
|
48 |
"""This module contains utility functions to help repoman find ebuilds to |
49 |
@@ -13,7 +13,6 @@ __all__ = [ |
50 |
"FindPackagesToScan", |
51 |
"FindPortdir", |
52 |
"get_commit_message_with_editor", |
53 |
- "get_commit_message_with_stdin", |
54 |
"get_committer_name", |
55 |
"have_ebuild_dir", |
56 |
"have_profile_dir", |
57 |
@@ -226,25 +225,6 @@ def get_commit_message_with_editor(editor, message=None, prefix=""): |
58 |
pass |
59 |
|
60 |
|
61 |
-def get_commit_message_with_stdin(): |
62 |
- """ |
63 |
- Read a commit message from the user and return it. |
64 |
- |
65 |
- @rtype: string or None |
66 |
- @return: A string on success or None if an error occurs. |
67 |
- """ |
68 |
- print( |
69 |
- "Please enter a commit message." |
70 |
- " Use Ctrl-d to finish or Ctrl-c to abort.") |
71 |
- commitmessage = [] |
72 |
- while True: |
73 |
- commitmessage.append(sys.stdin.readline()) |
74 |
- if not commitmessage[-1]: |
75 |
- break |
76 |
- commitmessage = "".join(commitmessage) |
77 |
- return commitmessage |
78 |
- |
79 |
- |
80 |
def FindPortdir(settings): |
81 |
""" Try to figure out what repo we are in and whether we are in a regular |
82 |
tree or an overlay. |