git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'

A custom diffing utility can be specified for the 'p4 diff' command by
setting the P4DIFF environment variable.  However when using a custom
diffing utility such as 'vimdiff' passing options like -du can cause
unexpected behavior.

Since the goal is to generate a unified diff of the changes and attach
them to the bottom of the p4 submit log we should unset P4DIFF if it
has been set in order to generate the diff properly.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
This commit is contained in:
Shawn Bohrer 2008-03-12 19:03:23 -05:00 committed by Simon Hausmann
parent 8ff45f2af5
commit 67abd41716

View File

@ -627,6 +627,8 @@ class P4Submit(Command):
if self.interactive:
submitTemplate = self.prepareLogMessage(template, logMessage)
if os.environ.has_key("P4DIFF"):
del(os.environ["P4DIFF"])
diff = read_pipe("p4 diff -du ...")
for newFile in filesToAdd: