Perforce Public Knowledge Base - No Tagged Output for "p4 diff2 -ds" for Scripting APIs
Reset Search
 

 

Article

No Tagged Output for "p4 diff2 -ds" for Scripting APIs

« Go Back

Information

 
Problem

The user gets no output when doing p4 diff2 -ds using derived APIs.  The scripting APIs run in a tagged output mode by default.  However there is no tagged output mode for the p4 diff2 -ds summary format command.

Solution

In order to be able to view the output for p4 diff2 -ds, specify in the script that you want the output in a non-tagged mode when the p4 diff2 -ds command is used.

This is normally done by setting:

P4Perl:

$p4->Tagged(0);

P4Python:

p4.tagged = 0

P4Ruby*:

p4.tagged = false

* The current setting can be checked with "p4.tagged?".

P4PHP:

$p4->tagged = false;

Example:

#!/usr/bin/perl -w

# This P4Perl example takes the un-tagged output for the p4 diff2 -ds command and prints the result:

use strict;
use P4;
use Data::Dumper;

my $p4 = new P4;

$p4->SetClient('test_ws');
$p4->SetUser('bruno');
$p4->SetPort('localhost:20101');

# Uncomment the next line if connectiong to a Unicode enabled server:
#$p4->SetCharset("utf8");

$p4->Connect() or die("Was not able to connect\n");

print "Connected!\n";

$p4->Tagged(0);
my $fileOne = "//depot/simple.pl#1";
my $fileTwo= "//depot/nsimple.pl#1";
my @output = $p4->Run("diff2","-ds",$fileOne,$fileTwo);

print Dumper(@output);

$p4->Disconnect();

print "Disconnected\n";

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255