summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorJoel Holdsworth <jholdsworth@nvidia.com>2022-04-01 15:25:02 +0100
committerJunio C Hamano <gitster@pobox.com>2022-04-01 13:15:44 -0700
commit4768af208850ef3de74908c498acf9f8956cf545 (patch)
treeb89499363d3eee70f5dc84502464e192ef3a8f2a /git-p4.py
parent77956b9de5266de6e597509a4d58e2f0bcafd09a (diff)
downloadgit-4768af208850ef3de74908c498acf9f8956cf545.tar.gz
git-p4: move inline comments to line above
PEP8 recommends that all inline comments should be separated from code by two spaces, in the "Inline Comments" section: https://www.python.org/dev/peps/pep-0008/#inline-comments However, because all instances of these inline comments extended to an excessive line length, they have been moved onto a seprate line. 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.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/git-p4.py b/git-p4.py
index c003b6246d..524a7a5c99 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1979,7 +1979,9 @@ class P4Submit(Command, P4UserMap):
for line in f.readlines():
newdiff += "+" + line
except UnicodeDecodeError:
- pass # Found non-text data and skip, since diff description should only include text
+ # Found non-text data and skip, since diff description
+ # should only include text
+ pass
f.close()
return (diff + newdiff).replace('\r\n', '\n')
@@ -2975,7 +2977,8 @@ class P4Sync(Command, P4UserMap):
if 'fileSize' in self.stream_file:
size = int(self.stream_file['fileSize'])
else:
- size = 0 # deleted files don't get a fileSize apparently
+ # Deleted files don't get a fileSize apparently
+ size = 0
sys.stdout.write('\r%s --> %s (%s)\n' % (
file_path, relPath, format_size_human_readable(size)))
sys.stdout.flush()
@@ -4233,7 +4236,8 @@ class P4Unshelve(Command):
for i in range(0, 1000):
backup_branch_name = "{0}.{1}".format(branch_name, i)
if not gitBranchExists(backup_branch_name):
- gitUpdateRef(backup_branch_name, branch_name) # copy ref to backup
+ # Copy ref to backup
+ gitUpdateRef(backup_branch_name, branch_name)
gitDeleteRef(branch_name)
found = True
print("renamed old unshelve branch to {0}".format(backup_branch_name))