style: never put multiple statements on one line
authorAlex Gaynor <agaynor@mozilla.com>
Fri, 29 Sep 2017 15:49:20 +0000
changeset 34435 5326e4ef1dab
parent 34434 884b595f5195
child 34436 c1fe66e89f57
style: never put multiple statements on one line Differential Revision: https://phab.mercurial-scm.org/D905
mercurial/keepalive.py
mercurial/pure/bdiff.py
mercurial/pure/mpatch.py
mercurial/sshserver.py
mercurial/util.py
--- a/mercurial/keepalive.py	Mon Oct 02 18:18:57 2017 +0100
+++ b/mercurial/keepalive.py	Fri Sep 29 15:49:20 2017 +0000
@@ -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()))
--- a/mercurial/pure/bdiff.py	Mon Oct 02 18:18:57 2017 +0100
+++ b/mercurial/pure/bdiff.py	Fri Sep 29 15:49:20 2017 +0000
@@ -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)
--- a/mercurial/pure/mpatch.py	Mon Oct 02 18:18:57 2017 +0100
+++ b/mercurial/pure/mpatch.py	Fri Sep 29 15:49:20 2017 +0000
@@ -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
--- a/mercurial/sshserver.py	Mon Oct 02 18:18:57 2017 +0100
+++ b/mercurial/sshserver.py	Fri Sep 29 15:49:20 2017 +0000
@@ -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):
--- a/mercurial/util.py	Mon Oct 02 18:18:57 2017 +0100
+++ b/mercurial/util.py	Fri Sep 29 15:49:20 2017 +0000
@@ -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