<HTML><HEAD><TITLE>P4Web User Guide - Issuing P4 Commands</TITLE></HEAD><BODY><FONT SIZE=-1><B>P4Web Release 2012.1 User Guide</B></FONT><BR>
<FONT SIZE=-1><B><A HREF="quickstart.html">[Getting Started]</A> <A HREF="howto.html">[How To...]</A> <A HREF="tips.html">[Browser Tips]</A> <A HREF="defs.html">[Glossary]</A> <A HREF="roadmap.html">[Road Map]</A> </B></FONT><BR>
<H3>Issuing P4 Commands</H3>
<p> For details about p4 commands, refer to the <i>Perforce Command Reference</i>.
To issue P4 commands using P4Web:
<p>Click <img src="../icons/p4cmd.gif">. P4Web displays the <b>P4 Command</b>
field.
<p>Type your command into the field (omitting "p4") and click <b>Go</b>.
Results are displayed as text.
<p> To specify paths that include spaces, enclose the path in double quotes.
For example:
<pre> fstat "//depot/dir/file name.h"</pre>
<p>
<p> <b>Note</b>: Due to a limitation of http protocol, you cannot specify filenames
that contain the special characters @ or # when issuing commands using the
P4 tab.
</p>
<h4>Embedding P4 Commands in URLs </h4>
<p>You can execute p4 commands by embedding them in URLs. Command results are
displayed by your browser as text. (This feature is notably useful for Java
applications.)</p>
<p> To embed commands in URLs, use the following format:: </p>
<blockquote>
<p><tt>http://[<i>webhost</i>:<i>port</i>]/p4 <i>command</i> [<i>cmdflags</i>]
[<i>args</i>]?ac=160</tt> (or <tt>ac=161 </tt>for tagged output)</p>
</blockquote>
<P><b>Example</b>: <tt>http://localhost:8080/p4 client -d oldclient?ac=160</tt>
<h4>Entering revision specifiers</h4>
<p>On the command line, revision ranges are preceded by either # (for numeric
revision specifiers) or @ (for dates, labels, or changelists). To embed revision
specifiers in URLs, append %3e followed by %2523 for # or %2540 for @. </p>
<p><b>Example</b>: for <tt>//depot/s/myfile.cpp#9</tt> enter: </p>
<blockquote>
<pre>//depot/s/myfile.cpp%3e%25239</pre>
</blockquote>
<p>
<h4>Specifying special characters</h4>
<p>Spaces can be entered as is or specified as %20.</p>
<p><b>Example</b>: <tt>http://localhost:8080/p4%20clients?ac=161 </tt>
<p>To specify a percent sign in a file name, enter %25.
<p> <b>Example</b>: for <tt>//depot/s/per%25cent.txt</tt>, enter:
<blockquote>
<pre>//depot/s/per%2525cent.txt</pre>
</blockquote>
<h4>Limitations on commands</h4>
For commands issued through the P4 tab or in URLs, the following limitations
apply:
<ul>
<li>In Browse mode, you cannot issue commands that update the workspace (for
example, <tt>p4 sync</tt>).<p></li>
<li>For commands that display forms to edit specifications (for example, <tt>p4
client</tt>), you must specify the <tt>-o</tt> flag. <b>Result</b>: the
browser displays the specification text. The following p4 commands require
the <tt>-o</tt> flag
<ul>
<li> <tt>branch</tt></li>
<li><tt> change</tt></li>
<li><tt> changelist</tt></li>
<li><tt> client</tt></li>
<li><tt> depot</tt></li>
<li><tt> group</tt></li>
<li><tt> job</tt></li>
<li><tt> jobspec</tt></li>
<li><tt> label</tt></li>
<li><tt> user</tt></li>
<li><tt> workspace</tt><p></li>
</ul>
</li>
<li>You cannot specify p4 flags in URL commands, only command-specific flags.
For details about command flags, refer to the <i>Perforce Command Reference</i>.
The following p4 flags are invalid in URL commands:
<ul>
<li><tt>-C <i>charset</i></tt></li>
<li><tt> -c <i>client</i></tt></li>
<li><tt> -d <i>dir</i></tt></li>
<li><tt> -G</tt></li>
<li><tt> -h</tt></li>
<li><tt> -H <i>host</i></tt></li>
<li><tt> -L <i>language</i></tt></li>
<li><tt> -P <i>password</i></tt></li>
<li><tt> -p <i>port</i></tt></li>
<li><tt> -s</tt></li>
<li><tt> -u <i>user</i></tt></li>
<li><tt> -V</tt></li>
<li><tt> -x <i>file</i></tt></li>
</ul>
</li>
</ul>
<P>
<HR>
<FONT SIZE=-1><I>
Copyright 2012 <A HREF="http://www.perforce.com">Perforce Software</A>.
All rights reserved.
</I></FONT>
</BODY></HTML>