[PATCH 5 of 5] crecord: add config option to avoid commit confirmation
Ryan McElroy
rm at fb.com
Fri Mar 18 14:18:48 EDT 2016
# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1458324736 25200
# Fri Mar 18 11:12:16 2016 -0700
# Node ID 23c1bcba1e7bfeee14a4ec4a55dfa61a97d87388
# Parent e59c0deb368d99163912d379d4c7b87beb22f2a6
crecord: add config option to avoid commit confirmation
The commit confirmation is pretty useless -- it gives no way to view what you
have selected, so you're blindly choosing whether to proceed or not, and it adds
a lot of unecessary friction to committing. This patch adds the ability to skip
this check by setting a simple config flag.
diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1400,6 +1400,11 @@ the following are valid keystrokes:
def confirmcommit(self):
"""ask for 'y' to be pressed to confirm selected. return True if
confirmed."""
+
+ confirmcommit = self.ui.configbool('curses', 'confirmcommit', True)
+ if not confirmcommit:
+ return True
+
text = "are you sure you want to confirm the selected changes [yn]? "
response = self.confirmationwindow(text)
if response is None:
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -386,6 +386,15 @@ If no suitable authentication entry is f
for credentials as usual if required by the remote.
+``curses``
+-----------
+
+``confirmcommit``
+ Optional Boolean. Defaults to true.
+ If true, curses-based interfaces such as 'hg commit -i' and 'hg revert -i'
+ will prompt if the user wants to continue, or wants to return to the
+ selection interface. If false, this prompt will be skipped.
+
``committemplate``
------------------
More information about the Mercurial-devel
mailing list