Skip to content

Commit 9f4588d

Browse files
committed
Merge branch 'ld/p4-unshelve-fix'
The "unshelve" subcommand of "git p4" used incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected. * ld/p4-unshelve-fix: git-p4: use HEAD~$n to find parent commit for unshelve git-p4 unshelve: adding a commit breaks git-p4 unshelve
2 parents 6c430a6 + 0acbf59 commit 9f4588d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

git-p4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4237,7 +4237,7 @@ def findLastP4Revision(self, starting_point):
42374237
"""
42384238

42394239
for parent in (range(65535)):
4240-
log = extractLogMessageFromGitCommit("{0}^{1}".format(starting_point, parent))
4240+
log = extractLogMessageFromGitCommit("{0}~{1}".format(starting_point, parent))
42414241
settings = extractSettingsGitLog(log)
42424242
if 'change' in settings:
42434243
return settings

t/t9832-unshelve.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ test_expect_success 'init depot' '
2929
)
3030
'
3131

32+
# Create an initial clone, with a commit unrelated to the P4 change
33+
# on HEAD
3234
test_expect_success 'initial clone' '
33-
git p4 clone --dest="$git" //depot/@all
35+
git p4 clone --dest="$git" //depot/@all &&
36+
test_commit -C "$git" "unrelated"
3437
'
3538

3639
test_expect_success 'create shelved changelist' '

0 commit comments

Comments
 (0)