Skip to content
  • Luke Diamand's avatar
    git-p4: fully support unshelving changelists · 89143ac2
    Luke Diamand authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarLuke Diamand <luke@diamand.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    89143ac2