aboutsummaryrefslogtreecommitdiffstats
path: root/git-p4.py
diff options
context:
space:
mode:
authorJoel Holdsworth <jholdsworth@nvidia.com>2022-04-01 15:24:59 +0100
committerJunio C Hamano <gitster@pobox.com>2022-04-01 13:15:44 -0700
commit7a3e83d0bd1d8fe004cd2f3dd4bc03bc8ca6fe9e (patch)
treecd44a5a73630ff717820e06e0313283c524435d7 /git-p4.py
parent6febb9f84307fab60af6873258006d98d97be87f (diff)
downloadgit-7a3e83d0bd1d8fe004cd2f3dd4bc03bc8ca6fe9e.tar.gz
git-p4: normalize indentation of lines in conditionals
PEP8 recommends that when wrapping the arguments of conditional statements, an extra level of indentation should be added to distinguish arguments from the body of the statement. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#indentation This patch either adds the indentation, or removes unnecessary wrapping. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/git-p4.py b/git-p4.py
index 97c2f82ee8..a25adc8bae 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1085,8 +1085,7 @@ def createOrUpdateBranchesFromOrigin(localRefPrefix="refs/remotes/p4/", silent=T
originHead = line
original = extractSettingsGitLog(extractLogMessageFromGitCommit(originHead))
- if ('depot-paths' not in original
- or 'change' not in original):
+ if 'depot-paths' not in original or 'change' not in original:
continue
update = False
@@ -2098,8 +2097,8 @@ class P4Submit(Command, P4UserMap):
if regexp:
# this file is a possibility...look for RCS keywords.
for line in read_pipe_lines(
- ["git", "diff", "%s^..%s" % (id, id), file],
- raw=True):
+ ["git", "diff", "%s^..%s" % (id, id), file],
+ raw=True):
if regexp.search(line):
if verbose:
print("got keyword match on %s in %s in %s" % (regex.pattern, line, file))
@@ -3112,9 +3111,9 @@ class P4Sync(Command, P4UserMap):
self.stream_file[k] = marshalled[k]
if (verbose and
- 'streamContentSize' in self.stream_file and
- 'fileSize' in self.stream_file and
- 'depotFile' in self.stream_file):
+ 'streamContentSize' in self.stream_file and
+ 'fileSize' in self.stream_file and
+ 'depotFile' in self.stream_file):
size = int(self.stream_file["fileSize"])
if size > 0:
progress = 100*self.stream_file['streamContentSize']/size
@@ -3930,8 +3929,7 @@ class P4Sync(Command, P4UserMap):
settings = extractSettingsGitLog(logMsg)
self.readOptions(settings)
- if ('depot-paths' in settings
- and 'change' in settings):
+ if 'depot-paths' in settings and 'change' in settings:
change = int(settings['change']) + 1
p4Change = max(p4Change, change)