style: fix various flake8 warning stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 10 Nov 2018 15:37:22 +0100
branchstable
changeset 4235 e30119dfd626
parent 4231 3eb78bdcdd7c
child 4236 259d57b906a4
child 4265 4d62095d9fe6
style: fix various flake8 warning
hgext3rd/evolve/__init__.py
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/obsexchange.py
hgext3rd/evolve/serveronly.py
hgext3rd/topic/__init__.py
--- a/hgext3rd/evolve/__init__.py	Tue Nov 06 15:53:18 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Sat Nov 10 15:37:22 2018 +0100
@@ -437,8 +437,8 @@
     # extsetup functions.
     evolvecommands = ui.configlist('experimental', 'evolutioncommands', [])
     evolveopts = ui.configlist('experimental', 'evolution')
-    if evolveopts and (commandopt not in evolveopts and
-                       'all' not in evolveopts):
+    if evolveopts and (commandopt not in evolveopts
+                       and 'all' not in evolveopts):
         # We build whitelist containing the commands we want to enable
         whitelist = set()
         for cmd in evolvecommands:
@@ -1303,8 +1303,8 @@
                            "backup bundle")),
     ])
 def stripwrapper(orig, ui, repo, *revs, **kwargs):
-    if (not ui.configbool('experimental', 'prunestrip', False) or
-        kwargs.get('bundle', False)):
+    if (not ui.configbool('experimental', 'prunestrip', False)
+        or kwargs.get('bundle', False)):
         return orig(ui, repo, *revs, **kwargs)
 
     if kwargs.get('force'):
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Nov 06 15:53:18 2018 +0530
+++ b/hgext3rd/evolve/cmdrewrite.py	Sat Nov 10 15:37:22 2018 +0100
@@ -1279,10 +1279,10 @@
                 # The user hasn't yet decided what to do with the revived
                 # cset, let's ask
                 sset = obsutil.successorssets(repo, ctx.node())
-                nodivergencerisk = (len(sset) == 0 or
-                                    (len(sset) == 1 and
-                                     len(sset[0]) == 1 and
-                                     repo[sset[0][0]].rev() == ctx.rev()
+                nodivergencerisk = (len(sset) == 0
+                                    or (len(sset) == 1
+                                        and len(sset[0]) == 1
+                                        and repo[sset[0][0]].rev() == ctx.rev()
                                     ))
                 if nodivergencerisk:
                     duplicate = False
--- a/hgext3rd/evolve/evolvecmd.py	Tue Nov 06 15:53:18 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Sat Nov 10 15:37:22 2018 +0100
@@ -1623,9 +1623,9 @@
     """logic for handling of `hg evolve --stop`"""
     updated = False
     pctx = None
-    if (evolvestate['command'] == 'evolve' and
-        evolvestate['category'] == 'contentdivergent' and
-        evolvestate['relocated']):
+    if (evolvestate['command'] == 'evolve'
+        and evolvestate['category'] == 'contentdivergent'
+        and evolvestate['relocated']):
         oldother = evolvestate['old-other']
         if oldother:
             with repo.wlock(), repo.lock():
@@ -1728,8 +1728,8 @@
     """logic for handling of `hg evolve --continue`"""
 
     with repo.wlock(), repo.lock():
-        if (evolvestate['command'] == 'next' or
-            evolvestate['category'] == 'orphan'):
+        if (evolvestate['command'] == 'next'
+            or evolvestate['category'] == 'orphan'):
             _completeorphan(ui, repo, evolvestate)
         elif evolvestate['category'] == 'phasedivergent':
             _completephasedivergent(ui, repo, evolvestate)
@@ -1752,8 +1752,8 @@
             for rev in evolvestate['revs']:
                 # XXX: prevent this lookup by storing nodes instead of revnums
                 curctx = unfi[rev]
-                if (curctx.node() not in evolvestate['replacements'] and
-                    curctx.node() not in evolvestate['skippedrevs']):
+                if (curctx.node() not in evolvestate['replacements']
+                    and curctx.node() not in evolvestate['skippedrevs']):
                     newnode = _solveone(ui, repo, curctx, evolvestate, False,
                                         confirm, progresscb, category,
                                         lastsolved=lastsolved)
--- a/hgext3rd/evolve/obsexchange.py	Tue Nov 06 15:53:18 2018 +0530
+++ b/hgext3rd/evolve/obsexchange.py	Sat Nov 10 15:37:22 2018 +0100
@@ -67,8 +67,8 @@
 def _addobscommontob2pull(orig, pullop, kwargs):
     ret = orig(pullop, kwargs)
     ui = pullop.repo.ui
-    if ('obsmarkers' in kwargs and
-        pullop.remote.capable('_evoext_getbundle_obscommon')):
+    if ('obsmarkers' in kwargs
+        and pullop.remote.capable('_evoext_getbundle_obscommon')):
         boundaries = obsdiscovery.buildpullobsmarkersboundaries(pullop)
         if 'common' in boundaries:
             common = boundaries['common']
--- a/hgext3rd/evolve/serveronly.py	Tue Nov 06 15:53:18 2018 +0530
+++ b/hgext3rd/evolve/serveronly.py	Sat Nov 10 15:37:22 2018 +0100
@@ -3,7 +3,7 @@
 OBSOLESCENCE IS AN EXPERIMENTAL FEATURE MAKE SURE YOU UNDERSTOOD THE INVOLVED
 CONCEPT BEFORE USING IT.
 
-/!\ THIS EXTENSION IS INTENDED FOR SERVER SIDE ONLY USAGE /!\
+! THIS EXTENSION IS INTENDED FOR SERVER SIDE ONLY USAGE !
 
 For client side usages it is recommended to use the evolve extension for
 improved user interface.'''
--- a/hgext3rd/topic/__init__.py	Tue Nov 06 15:53:18 2018 +0530
+++ b/hgext3rd/topic/__init__.py	Sat Nov 10 15:37:22 2018 +0100
@@ -391,10 +391,10 @@
                 current = self.currenttopic
                 if current:
                     ctx.extra()[constants.extrakey] = current
-            if (isinstance(ctx, context.memctx) and
-                ctx.extra().get('amend_source') and
-                ctx.topic() and
-                not self.currenttopic):
+            if (isinstance(ctx, context.memctx)
+                and ctx.extra().get('amend_source')
+                and ctx.topic()
+                and not self.currenttopic):
                 # we are amending and need to remove a topic
                 del ctx.extra()[constants.extrakey]
             return super(topicrepo, self).commitctx(ctx, error=error)