From: Simon Williams Date: Wed, 22 May 2019 06:21:20 +0000 (+0100) Subject: git-p4: allow unshelving of branched files X-Git-Tag: v2.23.0-rc0~113^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0108f47eb30b9b473e044285b731e2fbca803170?hp=-c git-p4: allow unshelving of branched files When unshelving a changelist, git-p4 tries to work out the appropriate parent commit in a given branch (default: HEAD). To do this, it looks at the state of any pre-existing files in the target Perforce branch, omitting files added in the shelved changelist. Currently, only files added (or move targets) are classed as new. However, files integrated from other branches (i.e. a 'branch' action) also need to be considered as added, for this purpose. Signed-off-by: Simon Williams Acked-by: Luke Diamand Signed-off-by: Junio C Hamano --- 0108f47eb30b9b473e044285b731e2fbca803170 diff --git a/git-p4.py b/git-p4.py index 5b79920f46..81a525858b 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1309,7 +1309,7 @@ def processContent(self, git_mode, relPath, contents): class Command: delete_actions = ( "delete", "move/delete", "purge" ) - add_actions = ( "add", "move/add" ) + add_actions = ( "add", "branch", "move/add" ) def __init__(self): self.usage = "usage: %prog [options]" diff --git a/t/t9832-unshelve.sh b/t/t9832-unshelve.sh index 41c09f11f4..cde9f86cd6 100755 --- a/t/t9832-unshelve.sh +++ b/t/t9832-unshelve.sh @@ -22,7 +22,10 @@ test_expect_success 'init depot' ' : >file_to_move && p4 add file_to_delete && p4 add file_to_move && - p4 submit -d "add files to delete" + p4 submit -d "add files to delete" && + echo file_to_integrate >file_to_integrate && + p4 add file_to_integrate && + p4 submit -d "add file to integrate" ) ' @@ -40,6 +43,7 @@ test_expect_success 'create shelved changelist' ' p4 delete file_to_delete && p4 edit file_to_move && p4 move file_to_move moved_file && + p4 integrate file_to_integrate integrated_file && p4 opened && p4 shelve -i <