Merge branch 'sw/git-p4-unshelve-branched-files' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Jul 2019 21:27:15 +0000 (14:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Jul 2019 21:27:15 +0000 (14:27 -0700)
"git p4" update.

* sw/git-p4-unshelve-branched-files:
git-p4: allow unshelving of branched files

1  2 
git-p4.py
t/t9832-unshelve.sh
diff --combined git-p4.py
index 0b5bfcbc5e3f9db6f60848069cb62db0694fa5e5,81a525858bf2229477f5222cc73869785b6daa0c..c71a6832e2fa0a632dc93155d0fa2b727c659f5e
+++ b/git-p4.py
@@@ -737,7 -737,7 +737,7 @@@ def extractLogMessageFromGitCommit(comm
  
      ## fixme: title is first line of commit, not 1st paragraph.
      foundTitle = False
 -    for log in read_pipe_lines("git cat-file commit %s" % commit):
 +    for log in read_pipe_lines(["git", "cat-file", "commit", commit]):
         if not foundTitle:
             if len(log) == 1:
                 foundTitle = True
@@@ -1309,7 -1309,7 +1309,7 @@@ class GitLFS(LargeFileSystem)
  
  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 --combined t/t9832-unshelve.sh
index 1286a5b824b77d71061fb890d9f528b46ecc087d,cde9f86cd6996f05b45d698e3f114d2e7da613a0..e9276c48f4a2e795899a03681a737c70635ab39c
@@@ -22,7 -22,10 +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 +43,7 @@@ test_expect_success 'create shelved cha
                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 <<EOF
  Change: new
@@@ -53,6 -57,7 +57,7 @@@ Files
        //depot/file_to_delete
        //depot/file_to_move
        //depot/moved_file
+       //depot/integrated_file
  EOF
  
        ) &&
@@@ -65,6 -70,7 +70,7 @@@
                test_path_is_file file2 &&
                test_cmp file1 "$cli"/file1 &&
                test_cmp file2 "$cli"/file2 &&
+               test_cmp file_to_integrate "$cli"/integrated_file &&
                test_path_is_missing file_to_delete &&
                test_path_is_missing file_to_move &&
                test_path_is_file moved_file
@@@ -174,5 -180,8 +180,5 @@@ test_expect_success 'unshelve specifyin
                test_path_is_file file_to_shelve
        )
  '
 -test_expect_success 'kill p4d' '
 -      kill_p4d
 -'
  
  test_done