]> git.ipfire.org Git - thirdparty/git.git/commit - git-p4.py
git-p4: fully support unshelving changelists
authorLuke Diamand <luke@diamand.org>
Mon, 15 Oct 2018 11:14:08 +0000 (12:14 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Oct 2018 04:28:49 +0000 (13:28 +0900)
commit89143ac28a61578487af7324c653a9efa5e40034
tree149cba5b6bfcef8adef542d19814ca433b069b3a
parent088131273b7e781174eb1cffb7d4e0eb51066cba
git-p4: fully support unshelving changelists

The previous git-p4 unshelve support would check for changes
in Perforce to the files being unshelved since the original
shelve, and would complain if any were found.

This was to ensure that the user wouldn't end up with both the
shelved change delta, and some deltas from other changes in their
git commit.

e.g. given fileA:
      the
      quick
      brown
      fox

  change1: s/the/The/   <- p4 shelve this change
  change2: s/fox/Fox/   <- p4 submit this change
  git p4 unshelve 1     <- FAIL

This change teaches the P4Unshelve class to always create a parent
commit which matches the P4 tree (for the files being unshelved) at
the point prior to the P4 shelve being created (which is reported
in the p4 description for a shelved changelist).

That then means git-p4 can always create a git commit matching the
P4 shelve that was originally created, without any extra deltas.

The user might still need to use the --origin option though - there
is no way for git-p4 to work out the versions of all of the other
*unchanged* files in the shelve, since this information is not recorded
by Perforce.

Additionally this fixes handling of shelved 'move' operations.

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