summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Luke Diamand <luke@diamand.org>2016-12-02 22:43:19 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-12-05 12:55:01 -0800
commit46c609e9ffdbf8d9aba096836386b57371ed16b8 (patch)
tree756f463499427874048d75993b3390fb51e82c90 /t
parentgit-p4: allow submit to create shelved changelists. (diff)
downloadtgif-46c609e9ffdbf8d9aba096836386b57371ed16b8.tar.xz
git-p4: support updating an existing shelved changelist
Adds new option "--update-shelve CHANGELIST" which updates an existing shelved changelist. The original changelist must have been created by the current user. This allows workflow something like: hack hack hack git commit git p4 submit --shelve $mail interested parties about shelved changelist make corrections git commit --amend git p4 submit --update-shelve $CHANGELIST $mail interested parties about shelved changelist etc Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9807-git-p4-submit.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index 42a5fada58..e37239e657 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -444,6 +444,44 @@ test_expect_success 'submit --shelve' '
)
'
+# Update an existing shelved changelist
+
+test_expect_success 'submit --update-shelve' '
+ test_when_finished cleanup_git &&
+ git p4 clone --dest="$git" //depot &&
+ (
+ cd "$cli" &&
+ p4 revert ... &&
+ cd "$git" &&
+ git config git-p4.skipSubmitEdit true &&
+ test_commit "test-update-shelved-change" &&
+ git p4 submit --origin=HEAD^ --shelve &&
+
+ shelf_cl=$(p4 -G changes -s shelved -m 1 |\
+ marshal_dump change) &&
+ test -n $shelf_cl &&
+ echo "updating shelved change list $shelf_cl" &&
+
+ echo "updated-line" >>shelf.t &&
+ echo added-file.t >added-file.t &&
+ git add shelf.t added-file.t &&
+ git rm -f test-update-shelved-change.t &&
+ git commit --amend -C HEAD &&
+ git show --stat HEAD &&
+ git p4 submit -v --origin HEAD^ --update-shelve $shelf_cl &&
+ echo "done git p4 submit"
+ ) &&
+ (
+ cd "$cli" &&
+ change=$(p4 -G changes -s shelved -m 1 //depot/... | \
+ marshal_dump change) &&
+ p4 unshelve -c $change -s $change &&
+ grep -q updated-line shelf.t &&
+ p4 describe -S $change | grep added-file.t &&
+ test_path_is_missing test-update-shelved-change.t
+ )
+'
+
test_expect_success 'kill p4d' '
kill_p4d
'