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>
Joel Holdsworth committed
Apr 1, 2022 at 15:24 UTC
7a3e83d0bd1d8fe004cd2f3dd4bc03bc8ca6fe9e
1 file changed
+7
-9
git-p4.py
+7
-9
@@ -1085,8 +1085,7 @@ def createOrUpdateBranchesFromOrigin(localRefPrefix="refs/remotes/p4/", silent=T
1085
originHead = line
1086
1087
original = extractSettingsGitLog(extractLogMessageFromGitCommit(originHead))
1088
- if ('depot-paths' not in original
1089
- or 'change' not in original):
1088
+ if 'depot-paths' not in original or 'change' not in original:
1089
continue
1090
1091
update = False
@@ -2098,8 +2097,8 @@ class P4Submit(Command, P4UserMap):
2097
if regexp:
2098
# this file is a possibility...look for RCS keywords.
2099
for line in read_pipe_lines(
2101
- ["git", "diff", "%s^..%s" % (id, id), file],
2102
- raw=True):
2100
+ ["git", "diff", "%s^..%s" % (id, id), file],
2101
+ raw=True):
2102
if regexp.search(line):
2103
if verbose:
2104
print("got keyword match on %s in %s in %s" % (regex.pattern, line, file))
@@ -3112,9 +3111,9 @@ class P4Sync(Command, P4UserMap):
3111
self.stream_file[k] = marshalled[k]
3112
3113
if (verbose and
3115
- 'streamContentSize' in self.stream_file and
3116
- 'fileSize' in self.stream_file and
3117
- 'depotFile' in self.stream_file):
3114
+ 'streamContentSize' in self.stream_file and
3115
+ 'fileSize' in self.stream_file and
3116
+ 'depotFile' in self.stream_file):
3117
size = int(self.stream_file["fileSize"])
3118
if size > 0:
3119
progress = 100*self.stream_file['streamContentSize']/size
@@ -3930,8 +3929,7 @@ class P4Sync(Command, P4UserMap):
3929
settings = extractSettingsGitLog(logMsg)
3930
3931
self.readOptions(settings)
3933
- if ('depot-paths' in settings
3934
- and 'change' in settings):
3932
+ if 'depot-paths' in settings and 'change' in settings:
3933
change = int(settings['change']) + 1
3934
p4Change = max(p4Change, change)
3935