changeset 45120:44d5233e66a9

commands: use any() instead of `if a or b or c` Small cleanup for future when we have an option to show configs from shared rc. Differential Revision: https://phab.mercurial-scm.org/D8658
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 31 Aug 2019 14:33:26 +0200
parents 19748c73c208
children b6269741ed42
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Jul 06 14:49:19 2020 +0200
+++ b/mercurial/commands.py	Sat Aug 31 14:33:26 2019 +0200
@@ -2184,7 +2184,8 @@
     """
 
     opts = pycompat.byteskwargs(opts)
-    if opts.get(b'edit') or opts.get(b'local') or opts.get(b'global'):
+    editopts = (b'edit', b'local', b'global')
+    if any(opts.get(o) for o in editopts):
         if opts.get(b'local') and opts.get(b'global'):
             raise error.Abort(_(b"can't use --local and --global together"))