]> git.ipfire.org Git - thirdparty/git.git/commit - git-p4.py
git p4: gracefully fail if some commits could not be applied
authorPete Wyckoff <pw@padd.com>
Sun, 9 Sep 2012 20:16:03 +0000 (16:16 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2012 04:52:52 +0000 (21:52 -0700)
commit67b0fe2eb6b70f530be347260c3792509a900feb
treefc6343a528a282b5d38abbe4a9511c870f240d7b
parent8c2913508644bb3ef511c7edac1b15cfafe61df5
git p4: gracefully fail if some commits could not be applied

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: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
t/t9810-git-p4-rcs.sh
t/t9815-git-p4-submit-fail.sh [new file with mode: 0755]