From d0b7c3d7ff9b89d700b4dfd0cd51705aa02bd48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 12 Jul 2010 00:14:39 +0200 Subject: Support '--ask' option to 'repoman commit'. --- bin/repoman | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin/repoman') diff --git a/bin/repoman b/bin/repoman index f14dc4533..3532c4b2b 100755 --- a/bin/repoman +++ b/bin/repoman @@ -52,6 +52,7 @@ from repoman import utilities from repoman.herdbase import make_herd_base from _emerge.Package import Package from _emerge.RootConfig import RootConfig +from _emerge.userquery import userquery import portage.checksum import portage.const import portage.dep @@ -163,6 +164,9 @@ def ParseArgs(args, qahelp): parser.description += "\nDistributed under the terms of the GNU General Public License v2" parser.description += "\nmodes: " + " | ".join(map(green,mode_keys)) + parser.add_option('-a', '--ask', dest='ask', + help='Request a confirmation before commiting') + parser.add_option('-m', '--commitmsg', dest='commitmsg', help='specify a commit message on the command line') @@ -2276,6 +2280,10 @@ else: commitmessage += ", RepoMan options: --force" commitmessage += ")" + if options.ask and userquery('Commit changes?', True) != 'Yes': + print("* aborting commit.") + sys.exit(1) + if vcs in ('cvs', 'svn') and (myupdates or myremoved): myfiles = myupdates + myremoved if not myheaders and "sign" not in repoman_settings.features: -- cgit v1.2.3-1-g7c22