--- a/mercurial/cmdutil.py Thu Dec 12 22:30:59 2019 -0800
+++ b/mercurial/cmdutil.py Thu Dec 12 15:55:33 2019 -0800
@@ -261,7 +261,10 @@
def check_at_most_one_arg(opts, *args):
- """abort if more than one of the arguments are in opts"""
+ """abort if more than one of the arguments are in opts
+
+ Returns the unique argument or None if none of them were specified.
+ """
previous = None
for x in args:
if opts.get(x):
@@ -270,6 +273,7 @@
_(b'cannot specify both --%s and --%s') % (previous, x)
)
previous = x
+ return previous
def check_incompatible_arguments(opts, first, *others):