]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-p4: seperate multiple statements onto seperate lines
authorJoel Holdsworth <jholdsworth@nvidia.com>
Fri, 1 Apr 2022 14:25:03 +0000 (15:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Apr 2022 20:15:44 +0000 (13:15 -0700)
PEP8 discourages the use of compound statements where there are multiple
statements on a single line in the "Other Recommendations" section:

https://www.python.org/dev/peps/pep-0008/#other-recommendations

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py

index 524a7a5c992cad28b12c1e4eca9b4002f1299606..c3239cdabc83615a1eba0cec51a2bf3ccfa40696 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -1191,7 +1191,8 @@ def p4ChangesForPaths(depotPaths, changeRange, requestedBlockSize):
             else:
                 block_size = max(2, block_size // 2)
 
-            if verbose: print("block size error, retrying with block size {0}".format(block_size))
+            if verbose:
+                print("block size error, retrying with block size {0}".format(block_size))
             continue
         except P4Exception as e:
             die('Error retrieving changes description ({0})'.format(e.p4ExitCode))
@@ -1818,7 +1819,9 @@ class P4Submit(Command, P4UserMap):
                 (changelist, newUser))
 
         c = changes[0]
-        if c['User'] == newUser: return   # nothing to do
+        if c['User'] == newUser:
+            # Nothing to do
+            return
         c['User'] = newUser
         # p4 does not understand format version 3 and above
         input = marshal.dumps(c, 2)