git-p4: remove unneeded semicolons from statements
Python allows the usage of compound statements where multiple statements are written on a single line separared by semicolons. It is also possible to add a semicolon after a single statement, however this is generally considered to be untidy, and is unnecessary. 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
990547aa2b701ff8cbdf85219175bd015371f55c
1 file changed
+14
-14
git-p4.py
+14
-14
@@ -813,7 +813,7 @@ def p4Cmd(cmd, *k, **kw):
813
result = {}
814
for entry in list:
815
result.update(entry)
816
- return result;
816
+ return result
817
818
819
def p4Where(depotPath):
@@ -914,8 +914,8 @@ def extractSettingsGitLog(log):
914
915
def gitBranchExists(branch):
916
proc = subprocess.Popen(["git", "rev-parse", branch],
917
- stderr=subprocess.PIPE, stdout=subprocess.PIPE);
918
- return proc.wait() == 0;
917
+ stderr=subprocess.PIPE, stdout=subprocess.PIPE)
918
+ return proc.wait() == 0
919
920
921
def gitUpdateRef(ref, newvalue):
@@ -3530,8 +3530,8 @@ class P4Sync(Command, P4UserMap):
3530
def importNewBranch(self, branch, maxChange):
3531
# make fast-import flush all changes to disk and update the refs using the checkpoint
3532
# command so that we can try to find the branch parent in the git history
3533
- self.gitStream.write("checkpoint\n\n");
3534
- self.gitStream.flush();
3533
+ self.gitStream.write("checkpoint\n\n")
3534
+ self.gitStream.flush()
3535
branchPrefix = self.depotPaths[0] + branch + "/"
3536
range = "@1,%s" % maxChange
3537
#print "prefix" + branchPrefix
@@ -3607,12 +3607,12 @@ class P4Sync(Command, P4UserMap):
3607
fullBranch = self.projectName + branch
3608
if fullBranch not in self.p4BranchesInGit:
3609
if not self.silent:
3610
- print("\n Importing new branch %s" % fullBranch);
3610
+ print("\n Importing new branch %s" % fullBranch)
3611
if self.importNewBranch(branch, change - 1):
3612
parent = ""
3613
self.p4BranchesInGit.append(fullBranch)
3614
if not self.silent:
3615
- print("\n Resuming with change %s" % change);
3615
+ print("\n Resuming with change %s" % change)
3616
3617
if self.verbose:
3618
print("parent determined through known branches: %s" % parent)
@@ -3680,7 +3680,7 @@ class P4Sync(Command, P4UserMap):
3680
% info['data'])
3681
if info['data'].find("must refer to client") >= 0:
3682
sys.stderr.write("This particular p4 error is misleading.\n")
3683
- sys.stderr.write("Perhaps the depot path was misspelled.\n");
3683
+ sys.stderr.write("Perhaps the depot path was misspelled.\n")
3684
sys.stderr.write("Depot path: %s\n" % " ".join(self.depotPaths))
3685
sys.exit(1)
3686
if 'p4ExitCode' in info:
@@ -3789,7 +3789,7 @@ class P4Sync(Command, P4UserMap):
3789
self.importProcess = subprocess.Popen(["git", "fast-import"],
3790
stdin=subprocess.PIPE,
3791
stdout=subprocess.PIPE,
3792
- stderr=subprocess.PIPE);
3792
+ stderr=subprocess.PIPE)
3793
self.gitOutput = self.importProcess.stdout
3794
self.gitStream = self.importProcess.stdin
3795
self.gitError = self.importProcess.stderr
@@ -3975,7 +3975,7 @@ class P4Sync(Command, P4UserMap):
3975
self.loadUserMapFromCache()
3976
self.labels = {}
3977
if self.detectLabels:
3978
- self.getLabels();
3978
+ self.getLabels()
3979
3980
if self.detectBranches:
3981
## FIXME - what's a P4 projectName ?
@@ -4061,9 +4061,9 @@ class P4Rebase(Command):
4061
4062
def rebase(self):
4063
if os.system("git update-index --refresh") != 0:
4064
- die("Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up to date or stash away all your changes with git stash.");
4064
+ die("Some files in your working directory are modified and different than what is in your index. You can use git update-index <filename> to bring the index up to date or stash away all your changes with git stash.")
4065
if len(read_pipe(["git", "diff-index", "HEAD", "--"])) > 0:
4066
- die("You have uncommitted changes. Please commit them before rebasing or stash them away with git stash.");
4066
+ die("You have uncommitted changes. Please commit them before rebasing or stash them away with git stash.")
4067
4068
[upstream, settings] = findUpstreamBranchPoint()
4069
if len(upstream) == 0:
@@ -4362,7 +4362,7 @@ def main():
4362
formatter = HelpFormatter())
4363
4364
try:
4365
- (cmd, args) = parser.parse_args(sys.argv[2:], cmd);
4365
+ (cmd, args) = parser.parse_args(sys.argv[2:], cmd)
4366
except:
4367
parser.print_help()
4368
raise
@@ -4378,7 +4378,7 @@ def main():
4378
if os.path.exists(cmd.gitdir):
4379
cdup = read_pipe(["git", "rev-parse", "--show-cdup"]).strip()
4380
if len(cdup) > 0:
4381
- chdir(cdup);
4381
+ chdir(cdup)
4382
4383
if not isValidGitDir(cmd.gitdir):
4384
if isValidGitDir(cmd.gitdir + "/.git"):