Submitted by: Joe Walker <Joe.Walker@barclaycard.co.uk> git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268067 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -0,0 +1,90 @@ | |||||
| <html> | |||||
| <body> | |||||
| <h2><a name="perforce">Perforce</a></h2> | |||||
| <h3>Description</h3> | |||||
| <p>Handles packages/modules retrieved from a <a href="http://www.perforce.com/">Perforce</a> repository.</p> | |||||
| <h3>Parameters</h3> | |||||
| <table border="1" cellpadding="2" cellspacing="0"> | |||||
| <tr> | |||||
| <td valign="top"><b>Attribute</b></td> | |||||
| <td valign="top"><b>Description</b></td> | |||||
| <td align="center" valign="top"><b>Required</b></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">localpath</td> | |||||
| <td valign="top">The local path of the file/directory to | |||||
| write file(s) to.</td> | |||||
| <td align="center" valign="top">Yes</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>user</td> | |||||
| <td>Specifies the user name, overriding the value of $P4USER, | |||||
| $USER, and $USERNAME in the environment.</td> | |||||
| <td><p align="center">No</p> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>port</td> | |||||
| <td>Specifies the server's listen address, overriding the | |||||
| value of $P4PORT in the environment and the default (perforce:1666).</td> | |||||
| <td><p align="center">No</p> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">version</td> | |||||
| <td valign="top">The revision number of the file being | |||||
| extracted.</td> | |||||
| <td align="center" valign="top">No</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">date</td> | |||||
| <td valign="top">Get files as of this date. Either [yyyy/mm/dd] | |||||
| or [yyyy/mm/dd:hh:mm:ss]. Note that [yyyy/mm/dd] means [yyyy/mm/dd:00:00:00], | |||||
| so if you want to include all events on that day refer to | |||||
| the next day.</td> | |||||
| <td align="center" valign="top">No</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">label</td> | |||||
| <td valign="top">A label from which to check out files.</td> | |||||
| <td align="center" valign="top">No</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">force</td> | |||||
| <td valign="top">"[true|false]". Forces | |||||
| resynchronization even if the client already has the | |||||
| file, and clobbers writable files. This flag doesn't | |||||
| affect open files.</td> | |||||
| <td align="center" valign="top">No, default "false"</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td>change</td> | |||||
| <td>Gets the file(s) as they were when a specified change | |||||
| number was applied.</td> | |||||
| <td><p align="center">No</p> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| <h3>Examples</h3> | |||||
| <pre> <perforce localpath="//path/to/source/..." | |||||
| force="true" | |||||
| change="4513" | |||||
| /></pre> | |||||
| <p>syncs the files in the source directory that are in the | |||||
| Perforce repository, as of change number 4513, overwriting any | |||||
| modified files in the current source tree is needed.</p> | |||||
| <pre> <perforce localpath="//path/to/source/..." /></pre> | |||||
| <p>Syncs with the latest version of the file in the repository.</p> | |||||
| </body> | |||||
| </html> | |||||
| @@ -4382,6 +4382,7 @@ it had been located at <code>htdocs/manual/ChangeLog.txt</code>.</p> | |||||
| <li><a href="junit.html">JUnit</a></li> | <li><a href="junit.html">JUnit</a></li> | ||||
| <li><a href="native2ascii.html">Native2Ascii</a></li> | <li><a href="native2ascii.html">Native2Ascii</a></li> | ||||
| <li><a href="#netrexxc">NetRexxC</a></li> | <li><a href="#netrexxc">NetRexxC</a></li> | ||||
| <li><a href="P4desc.html">Perforce</a></li> | |||||
| <li><a href="#renameexts">RenameExtensions</a></li> | <li><a href="#renameexts">RenameExtensions</a></li> | ||||
| <li><a href="#script">Script</a></li> | <li><a href="#script">Script</a></li> | ||||
| <li><a href="#vssget">VssGet</a></li> | <li><a href="#vssget">VssGet</a></li> | ||||
| @@ -63,7 +63,7 @@ starteam=org.apache.tools.ant.taskdefs.optional.scm.AntStarTeamCheckOut | |||||
| wljspc=org.apache.tools.ant.taskdefs.optional.jsp.WLJspc | wljspc=org.apache.tools.ant.taskdefs.optional.jsp.WLJspc | ||||
| jlink=org.apache.tools.ant.taskdefs.optional.jlink.JlinkTask | jlink=org.apache.tools.ant.taskdefs.optional.jlink.JlinkTask | ||||
| native2ascii=org.apache.tools.ant.taskdefs.optional.Native2Ascii | native2ascii=org.apache.tools.ant.taskdefs.optional.Native2Ascii | ||||
| p4sync=org.apache.tools.ant.taskdefs.optional.perforce.P4sync | |||||
| perforce=org.apache.tools.ant.taskdefs.optional.perforce.P4sync | |||||
| # deprecated ant tasks (kept for back compatibility) | # deprecated ant tasks (kept for back compatibility) | ||||
| javadoc2=org.apache.tools.ant.taskdefs.Javadoc | javadoc2=org.apache.tools.ant.taskdefs.Javadoc | ||||
| @@ -59,24 +59,87 @@ import org.apache.tools.ant.taskdefs.Exec; | |||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| /** | /** | ||||
| * A Perforce checkout utility. | |||||
| * Implements the ability to write: | |||||
| * <pre> | |||||
| * >p4sync dir="src" | |||||
| * force="no" | |||||
| * date="2000/04/01" | |||||
| * time="14:15:29" | |||||
| * label="labelname" | |||||
| * revision="#have" | |||||
| * viewonly="true" | |||||
| * /> | |||||
| * </pre> | |||||
| * Where: | |||||
| * 1. "dir" is mandatory, the rest are optional; | |||||
| * 2. If you specify time, you have to specify date. | |||||
| * 2a. If you specify date but not time, midnight is implied. | |||||
| * 3. You cannot specify more than one of (date, label, revision). | |||||
| * 4. Any "sync" error is considered a fatal error, and a BuildException is returned. | |||||
| * <h2><a name="perforce">Perforce</a></h2> | |||||
| * <h3>Description</h3> | |||||
| * <p>Handles packages/modules retrieved from a <a href="http://www.perforce.com/">Perforce</a> repository.</p> | |||||
| * <h3>Parameters</h3> | |||||
| * <table border="1" cellpadding="2" cellspacing="0"> | |||||
| * <tr> | |||||
| * <td valign="top"><b>Attribute</b></td> | |||||
| * <td valign="top"><b>Description</b></td> | |||||
| * <td align="center" valign="top"><b>Required</b></td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td valign="top">localpath</td> | |||||
| * <td valign="top">The local path of the file/directory to | |||||
| * write file(s) to.</td> | |||||
| * <td align="center" valign="top">Yes</td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td>user</td> | |||||
| * <td>Specifies the user name, overriding the value of $P4USER, | |||||
| * $USER, and $USERNAME in the environment.</td> | |||||
| * <td><p align="center">No</p> | |||||
| * </td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td>port</td> | |||||
| * <td>Specifies the server's listen address, overriding the | |||||
| * value of $P4PORT in the environment and the default (perforce:1666).</td> | |||||
| * <td><p align="center">No</p> | |||||
| * </td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td valign="top">version</td> | |||||
| * <td valign="top">The revision number of the file being | |||||
| * extracted.</td> | |||||
| * <td align="center" valign="top">No</td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td valign="top">date</td> | |||||
| * <td valign="top">Get files as of this date. Either [yyyy/mm/dd] | |||||
| * or [yyyy/mm/dd:hh:mm:ss]. Note that [yyyy/mm/dd] means [yyyy/mm/dd:00:00:00], | |||||
| * so if you want to include all events on that day refer to | |||||
| * the next day.</td> | |||||
| * <td align="center" valign="top">No</td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td valign="top">label</td> | |||||
| * <td valign="top">A label from which to check out files.</td> | |||||
| * <td align="center" valign="top">No</td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td valign="top">force</td> | |||||
| * <td valign="top">"[true|false]". Forces | |||||
| * resynchronization even if the client already has the | |||||
| * file, and clobbers writable files. This flag doesn't | |||||
| * affect open files.</td> | |||||
| * <td align="center" valign="top">No, default "false"</td> | |||||
| * </tr> | |||||
| * <tr> | |||||
| * <td>change</td> | |||||
| * <td>Gets the file(s) as they were when a specified change | |||||
| * number was applied.</td> | |||||
| * <td><p align="center">No</p> | |||||
| * </td> | |||||
| * </tr> | |||||
| * </table> | |||||
| * | |||||
| * <h3>Examples</h3> | |||||
| * | |||||
| * <pre> <perforce localpath="//path/to/source/..." | |||||
| * force="true" | |||||
| * change="4513" | |||||
| * /></pre> | |||||
| * | |||||
| * <p>syncs the files in the source directory that are in the | |||||
| * Perforce repository, as of change number 4513, overwriting any | |||||
| * modified files in the current source tree is needed. You cannot | |||||
| * specify more than one of (date, label, revision).</p> | |||||
| * | |||||
| * <pre> <perforce localpath="//path/to/source/..." /></pre> | |||||
| * | |||||
| * <p>Syncs with the latest version of the file in the repository.</p> | |||||
| */ | */ | ||||
| public class P4sync extends Exec { | public class P4sync extends Exec { | ||||
| private String p4user; | private String p4user; | ||||