Re: git-p4 move/delete errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 9, 2010 at 11:32 PM, Thomas Berg <merlin66b@xxxxxxxxx> wrote:

> Anyway, as far as I can see from the git-p4 source code, the command
> is only used to generate the diff preview in the interactive window
> that pops up when you "git p4 submit". So if you replace the line
> diff = p4_read_pipe("diff -du ...")
> with
> diff = ""
>
> it should start working again (the diff preview part will become
> empty). I'm unable to test it right now, but fairly sure it will work.
> I'll see if I can find a better solution when I have access to the
> Perforce server again.

It seems like they have done some bugfixes to "p4 diff -du ...", I
guess that's why we get different behaviour now. It prints the correct
output, but exits with an error code anyway when files have been
removed.

My solution is in the diff below. I'll run with it for a few days,
then I'll submit a proper patch to the mailing list (unless someone
else beat me to it).

Thomas

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c1ea643..19f4519 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -706,7 +706,7 @@ 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 = p4_read_pipe("diff -du ...", ignore_error=True)

             newdiff = ""
             for newFile in filesToAdd:
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]