git-p4: add unshelve command
commit123f631761dab8c37391ba1584122c2578f51923
authorLuke Diamand <luke@diamand.org>
Wed, 23 May 2018 22:20:26 +0000 (23 23:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 May 2018 23:58:28 +0000 (24 08:58 +0900)
treeeb83d531d38c473363e1669496c91d21c781e57c
parente3a80781f5932f5fea12a49eb06f3ade4ed8945c
git-p4: add unshelve command

This can be used to "unshelve" a shelved P4 commit into
a git commit.

For example:

  $ git p4 unshelve 12345

The resulting commit ends up in the branch:
   refs/remotes/p4/unshelved/12345

If that branch already exists, it is renamed - for example
the above branch would be saved as p4/unshelved/12345.1.

git-p4 checks that the shelved changelist is based on files
which are at the same Perforce revision as the origin branch
being used for the unshelve (HEAD by default). If they are not,
it will refuse to unshelve. This is to ensure that the unshelved
change does not contain other changes mixed-in.

The reference branch can be changed manually with the "--origin"
option.

The change adds a new Unshelve command class. This just runs the
existing P4Sync code tweaked to handle a shelved changelist.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-p4.txt
git-p4.py
t/t9832-unshelve.sh [new file with mode: 0755]