git-p4: remove redundant backslash-continuations inside brackets

PEP8 recommends that backslash line continuations should only be used
for line-breaks outside parentheses.

This recommendation is described in the "Maximum Line Length" section:

https://www.python.org/dev/peps/pep-0008/#maximum-line-length

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Joel Holdsworth
2022-04-01 15:24:55 +01:00
committed by Junio C Hamano
parent 843d847ff7
commit 968e29e16b

View File

@ -2201,13 +2201,13 @@ class P4Submit(Command, P4UserMap):
print(" " + self.clientPath) print(" " + self.clientPath)
print("") print("")
print("To submit, use \"p4 submit\" to write a new description,") print("To submit, use \"p4 submit\" to write a new description,")
print("or \"p4 submit -i <%s\" to use the one prepared by" \ print("or \"p4 submit -i <%s\" to use the one prepared by"
" \"git p4\"." % fileName) " \"git p4\"." % fileName)
print("You can delete the file \"%s\" when finished." % fileName) print("You can delete the file \"%s\" when finished." % fileName)
if self.preserveUser and p4User and not self.p4UserIsMe(p4User): if self.preserveUser and p4User and not self.p4UserIsMe(p4User):
print("To preserve change ownership by user %s, you must\n" \ print("To preserve change ownership by user %s, you must\n"
"do \"p4 change -f <change>\" after submitting and\n" \ "do \"p4 change -f <change>\" after submitting and\n"
"edit the User field.") "edit the User field.")
if pureRenameCopy: if pureRenameCopy:
print("After submitting, renamed files must be re-synced.") print("After submitting, renamed files must be re-synced.")
@ -2350,7 +2350,7 @@ class P4Submit(Command, P4UserMap):
if self.dry_run: if self.dry_run:
print("Would create p4 label %s for tag" % name) print("Would create p4 label %s for tag" % name)
elif self.prepare_p4_only: elif self.prepare_p4_only:
print("Not creating p4 label %s for tag due to option" \ print("Not creating p4 label %s for tag due to option"
" --prepare-p4-only" % name) " --prepare-p4-only" % name)
else: else:
p4_write_pipe(["label", "-i"], labelTemplate) p4_write_pipe(["label", "-i"], labelTemplate)
@ -2515,12 +2515,12 @@ class P4Submit(Command, P4UserMap):
if not self.no_verify: if not self.no_verify:
try: try:
if not run_git_hook("p4-pre-submit"): if not run_git_hook("p4-pre-submit"):
print("\nThe p4-pre-submit hook failed, aborting the submit.\n\nYou can skip " \ print("\nThe p4-pre-submit hook failed, aborting the submit.\n\nYou can skip "
"this pre-submission check by adding\nthe command line option '--no-verify', " \ "this pre-submission check by adding\nthe command line option '--no-verify', "
"however,\nthis will also skip the p4-changelist hook as well.") "however,\nthis will also skip the p4-changelist hook as well.")
sys.exit(1) sys.exit(1)
except Exception as e: except Exception as e:
print("\nThe p4-pre-submit hook failed, aborting the submit.\n\nThe hook failed "\ print("\nThe p4-pre-submit hook failed, aborting the submit.\n\nThe hook failed "
"with the error '{0}'".format(e.message)) "with the error '{0}'".format(e.message))
sys.exit(1) sys.exit(1)
@ -2543,7 +2543,7 @@ class P4Submit(Command, P4UserMap):
applied.append(commit) applied.append(commit)
if self.prepare_p4_only: if self.prepare_p4_only:
if i < last: if i < last:
print("Processing only the first commit due to option" \ print("Processing only the first commit due to option"
" --prepare-p4-only") " --prepare-p4-only")
break break
else: else:
@ -4206,7 +4206,7 @@ class P4Clone(P4Sync):
if not self.cloneBare: if not self.cloneBare:
system(["git", "checkout", "-f"]) system(["git", "checkout", "-f"])
else: else:
print('Not checking out any branch, use ' \ print('Not checking out any branch, use '
'"git checkout -q -b master <branch>"') '"git checkout -q -b master <branch>"')
# auto-set this variable if invoked with --use-client-spec # auto-set this variable if invoked with --use-client-spec