[Updated] D8658: commands: use any() instead of `if a or b or c`

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Jul 15 16:16:51 UTC 2020


Closed by commit rHG44d5233e66a9: commands: use any() instead of `if a or b or c` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8658?vs=21743&id=21921

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8658/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8658

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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"))
 



To: pulkit, #hg-reviewers
Cc: joerg.sonnenberger, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200715/9cd18ff3/attachment.html>


More information about the Mercurial-patches mailing list