D7546: exchange: replace a "not x in ys" by more Pythonic "x not in ys"

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Dec 5 17:03:53 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Found by one of our (Google-)internal tools.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -2577,7 +2577,7 @@
 ):
     """add phase heads part to the requested bundle"""
     if kwargs.get('phases', False):
-        if not b2caps or not b'heads' in b2caps.get(b'phases'):
+        if not b2caps or b'heads' not in b2caps.get(b'phases'):
             raise error.Abort(_(b'no common phases exchange method'))
         if heads is None:
             heads = repo.heads()



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list