Patchwork D905: style: never put multiple statements on one line

login
register
mail settings
Submitter phabricator
Date Oct. 2, 2017, 5:31 p.m.
Message ID <32c8a9b4e28a677d6cf998fbe2699f92@localhost.localdomain>
Download mbox | patch
Permalink /patch/24407/
State Not Applicable
Headers show

Comments

phabricator - Oct. 2, 2017, 5:31 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5326e4ef1dab: style: never put multiple statements on one line (authored by alex_gaynor, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D905?vs=2327&id=2343

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

AFFECTED FILES
  mercurial/keepalive.py
  mercurial/pure/bdiff.py
  mercurial/pure/mpatch.py
  mercurial/sshserver.py
  mercurial/util.py

CHANGE DETAILS




To: alex_gaynor, durin42, #hg-reviewers, ryanmce, indygreg
Cc: indygreg, sid0, lothiraldan, ryanmce, mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1605,8 +1605,10 @@ 
         ifp.close()
         ofp.close()
     except: # re-raises
-        try: os.unlink(temp)
-        except OSError: pass
+        try:
+            os.unlink(temp)
+        except OSError:
+            pass
         raise
     return temp
 
diff --git a/mercurial/sshserver.py b/mercurial/sshserver.py
--- a/mercurial/sshserver.py
+++ b/mercurial/sshserver.py
@@ -127,7 +127,8 @@ 
                 r = impl()
                 if r is not None:
                     self.sendresponse(r)
-            else: self.sendresponse("")
+            else:
+                self.sendresponse("")
         return cmd != ''
 
     def _client(self):
diff --git a/mercurial/pure/mpatch.py b/mercurial/pure/mpatch.py
--- a/mercurial/pure/mpatch.py
+++ b/mercurial/pure/mpatch.py
@@ -75,7 +75,8 @@ 
     # copy all the patches into our segment so we can memmove from them
     pos = b2 + bl
     m.seek(pos)
-    for p in bins: m.write(p)
+    for p in bins:
+        m.write(p)
 
     for plen in plens:
         # if our list gets too long, execute it
diff --git a/mercurial/pure/bdiff.py b/mercurial/pure/bdiff.py
--- a/mercurial/pure/bdiff.py
+++ b/mercurial/pure/bdiff.py
@@ -60,7 +60,8 @@ 
 
     bin = []
     p = [0]
-    for i in a: p.append(p[-1] + len(i))
+    for i in a:
+        p.append(p[-1] + len(i))
 
     d = difflib.SequenceMatcher(None, a, b).get_matching_blocks()
     d = _normalizeblocks(a, b, d)
diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -135,7 +135,8 @@ 
                 del self._connmap[connection]
                 del self._readymap[connection]
                 self._hostmap[host].remove(connection)
-                if not self._hostmap[host]: del self._hostmap[host]
+                if not self._hostmap[host]:
+                    del self._hostmap[host]
         finally:
             self._lock.release()
 
@@ -621,7 +622,8 @@ 
         f = fo.readline()
         if f:
             foo = foo + f
-        else: break
+        else:
+            break
     fo.close()
     m = md5(foo)
     print(format % ('keepalive readline', m.hexdigest()))