git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix handling of git-p4 on deleted files
@ 2010-10-18 15:39 Andrew Waters
  2010-10-22 10:20 ` Thomas Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Waters @ 2010-10-18 15:39 UTC (permalink / raw)
  To: git

When you submit changes containing deleted file the command 'p4 diff
-du ...' includes diffs for deleted files. This causes the failure:

open for read: <deleted file>: No such file or directory
Command failed: p4 diff -du ...

The problem is that perforce has been told to delete the file and then
we try to apply diffs to a file which no longer exists.

---
 contrib/fast-import/git-p4 |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c1ea643..04ce7e3 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -706,7 +706,9 @@ class P4Submit(Command):
             submitTemplate = self.prepareLogMessage(template, logMessage)
             if os.environ.has_key("P4DIFF"):
                 del(os.environ["P4DIFF"])
-            diff = p4_read_pipe("diff -du ...")
+            diff = ""
+            for editedFile in editedFiles:
+                diff += p4_read_pipe("diff -du %r" % editedFile)

             newdiff = ""
             for newFile in filesToAdd:
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-22 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-18 15:39 [PATCH] Fix handling of git-p4 on deleted files Andrew Waters
2010-10-22 10:20 ` Thomas Berg
2010-10-22 12:26   ` Andrew Waters
2010-10-22 18:52     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).