1. 17 9月, 2012 1 次提交
    • P
      git p4: gracefully fail if some commits could not be applied · 67b0fe2e
      Pete Wyckoff 提交于
      If a commit fails to apply cleanly to the p4 tree, an interactive
      prompt asks what to do next.  In all cases (skip, apply, write),
      the behavior after the prompt had a few problems.
      
      Change it so that it does not claim erroneously that all commits
      were applied.  Instead list the set of the patches under
      consideration, and mark with an asterisk those that were
      applied successfully.  Like this example:
      
          Applying 592f1f9 line5 in file1 will conflict
          ...
          Unfortunately applying the change failed!
          What do you want to do?
          [s]kip this patch / [a]pply the patch forcibly and with .rej files / [w]rite the patch to a file (patch.txt) s
          Skipping! Good luck with the next patches...
          //depot/file1#4 - was edit, reverted
          Applying b8db1c6 okay_commit_after_skip
          ...
          Change 6 submitted.
          Applied only the commits marked with '*':
            592f1f9 line5 in file1 will conflict
          * b8db1c6 okay_commit_after_skip
      
      Do not try to sync and rebase unless all patches were applied.
      If there was a conflict during the submit, there is sure to be one
      at the rebase.  Let the user to do the sync and rebase manually.
      
      This changes how a couple tets in t9810-git-p4-rcs.sh behave:
      
          - git p4 now does not leave files open and edited in the
            client
      
          - If a git commit contains a change to a file that was
            deleted in p4, the test used to check that the sync/rebase
            loop happened after the failure to apply the change.  Since
            now sync/rebase does not happen after failure, do not test
            this.  Normal rebase machinery, outside of git p4, will let
            rebase --skip work.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Acked-by: NLuke Diamand <luke@diamand.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      67b0fe2e