jrk/git-p4 — Issue #2: Crash when a patch fails to apply and new files existed
Author: KingDuckZ
Created: 2011-12-12 17:41:56+00:00
State: open

I'm trying to submit a commit from git to p4. The commit touches two existing files and adds two new files to the repository. For some reason the patch doesn't apply (I did git p4 rebase already), and the script crashes as soon as it tries to revert the non-existing files. VectorOld.cpp is the new file I'm trying to add. Here is the output:

Perforce checkout for depot path //depot/LSProjects/ located at X:\p4_repo\LSProjects\
Synchronizing p4 checkout...
... - file(s) up-to-date.
Applying 1c14369cbb707361fe859be73a35c011279b40c0 [MS] VectorOld imported again.

//depot/LSProjects/LSFramework/Main/UnitTests/LibTester/VectorTest.cpp#1 - opened for edit
//depot/LSProjects/LSFramework/Main/UnitTests/LibTester/build/LibTester.vcproj#2 - opened for edit
... //depot/LSProjects/LSFramework/Main/UnitTests/LibTester/build/LibTester.vcproj - also opened by programmer@LS2011_GOOFY
:21: trailing whitespace.
#include "LibTesterPCH.h"
:22: trailing whitespace.
#include "VectorOld.h"
:23: trailing whitespace.

:24: trailing whitespace.
/* --------------------------------------------------------------------------------- */
:25: trailing whitespace.

error: patch failed: LSFramework/Main/UnitTests/LibTester/VectorTest.cpp:4
error: LSFramework/Main/UnitTests/LibTester/VectorTest.cpp: patch does not apply
error: patch failed: LSFramework/Main/UnitTests/LibTester/build/LibTester.vcproj:397
error: LSFramework/Main/UnitTests/LibTester/build/LibTester.vcproj: patch does not apply
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/LSProjects/LSFramework/Main/UnitTests/LibTester/VectorTest.cpp#1 - was edit, reverted
//depot/LSProjects/LSFramework/Main/UnitTests/LibTester/build/LibTester.vcproj#2 - was edit, reverted
Traceback (most recent call last):
File "D:\Program Files (x86)\Git/libexec/git-core\git-p4", line 2362, in
main()
File "D:\Program Files (x86)\Git/libexec/git-core\git-p4", line 2357, in main
if not cmd.run(args):
File "D:\Program Files (x86)\Git/libexec/git-core\git-p4", line 1140, in run
self.applyCommit(commit)
File "D:\Program Files (x86)\Git/libexec/git-core\git-p4", line 971, in applyCommit
os.remove(f)
WindowsError: [Error 2] The system cannot find the file specified: 'LSFramework/Main/UnitTests/LibTester/VectorOld.cpp'