aboutsummaryrefslogtreecommitdiffstats
path: root/git-p4.py
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-07-27 09:16:54 -0700
committerJunio C Hamano <gitster@pobox.com>2022-07-27 09:16:55 -0700
commit04e340b29bc51d8b220a1fe3b4a145fbd222cc6d (patch)
tree34d22680b709ffcc3899855a80ea5bf334ad1363 /git-p4.py
parent13d0c000496888e3ec953eec0d2c257eec701e76 (diff)
parent198551ca54f6ff1c95c9357ccca9ae37298811bf (diff)
downloadgit-04e340b29bc51d8b220a1fe3b4a145fbd222cc6d.tar.gz
Merge branch 'mb/p4-fixes'
Fix a few issues in "git p4". * mb/p4-fixes: git-p4: fix error handling in P4Unshelve.renameBranch() git-p4: fix typo in P4Submit.applyCommit()
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/git-p4.py b/git-p4.py
index 8fbf6eb1fe..8f20d15f27 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2226,7 +2226,7 @@ class P4Submit(Command, P4UserMap):
raw=True):
if regexp.search(line):
if verbose:
- print("got keyword match on %s in %s in %s" % (regex.pattern, line, file))
+ print("got keyword match on %s in %s in %s" % (regexp.pattern, line, file))
kwfiles[file] = regexp
break
@@ -4369,19 +4369,16 @@ class P4Unshelve(Command):
def renameBranch(self, branch_name):
"""Rename the existing branch to branch_name.N ."""
- found = True
for i in range(0, 1000):
backup_branch_name = "{0}.{1}".format(branch_name, i)
if not gitBranchExists(backup_branch_name):
# 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))
break
-
- if not found:
- sys.exit("gave up trying to rename existing branch {0}".format(sync.branch))
+ else:
+ sys.exit("gave up trying to rename existing branch {0}".format(branch_name))
def findLastP4Revision(self, starting_point):
"""Look back from starting_point for the first commit created by git-p4