git-p4: indent with 4-spaces

PEP8 recommends that all code should be indented in 4-space units. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#indentation Previously git-p4 had multiple cases where code was indented with a non-multiple of 4-spaces. This patch fixes each of these. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Joel Holdsworth committed Apr 1, 2022 at 15:24 UTC 812ee74ea0d499000402fdfa3388cc69e72cdaf2
1 file changed +9 -9
git-p4.py
+9 -9
@@ -877,12 +877,12 @@ def extractLogMessageFromGitCommit(commit):
877 ## fixme: title is first line of commit, not 1st paragraph.
878 foundTitle = False
879 for log in read_pipe_lines(["git", "cat-file", "commit", commit]):
880 - if not foundTitle:
881 - if len(log) == 1:
882 - foundTitle = True
883 - continue
880 + if not foundTitle:
881 + if len(log) == 1:
882 + foundTitle = True
883 + continue
884
885 - logMessage += log
885 + logMessage += log
886 return logMessage
887
888
@@ -1094,7 +1094,7 @@ def createOrUpdateBranchesFromOrigin(localRefPrefix = "refs/remotes/p4/", silent
1094
1095
1096 def originP4BranchesExist():
1097 - return gitBranchExists("origin") or gitBranchExists("origin/p4") or gitBranchExists("origin/p4/master")
1097 + return gitBranchExists("origin") or gitBranchExists("origin/p4") or gitBranchExists("origin/p4/master")
1098
1099
1100 def p4ParseNumericChangeRange(parts):
@@ -2116,7 +2116,7 @@ class P4Submit(Command, P4UserMap):
2116 submitTemplate = self.prepareLogMessage(template, logMessage, jobs)
2117
2118 if self.preserveUser:
2119 - submitTemplate += "\n######## Actual user %s, modified after commit\n" % p4User
2119 + submitTemplate += "\n######## Actual user %s, modified after commit\n" % p4User
2120
2121 if self.checkAuthorship and not self.p4UserIsMe(p4User):
2122 submitTemplate += "######## git author %s does not match your p4 account.\n" % gitEmail
@@ -2565,7 +2565,7 @@ class P4Submit(Command, P4UserMap):
2565
2566 # exit with error unless everything applied perfectly
2567 if len(commits) != len(applied):
2568 - sys.exit(1)
2568 + sys.exit(1)
2569
2570 return True
2571
@@ -3401,7 +3401,7 @@ class P4Sync(Command, P4UserMap):
3401 p = p[:-1]
3402 p = p[p.strip().rfind("/") + 1:]
3403 if not p.endswith("/"):
3404 - p += "/"
3404 + p += "/"
3405 return p
3406
3407 def getBranchMapping(self):