You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

perforce.html 31 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  1. <html>
  2. <head>
  3. <title>Perforce Tasks</title>
  4. </head>
  5. <body>
  6. <h1>Perforce Tasks User Manual</h1>
  7. <p>by</p>
  8. <ul>
  9. <li>Les Hughes (<a href="mailto:leslie.hughes@rubus.com">leslie.hughes@rubus.com</a>)</li>
  10. <li>Kirk Wylie (<a href="mailto:kirk@radik.com">kirk@radik.com</a>)</li>
  11. <li>Matt Bishop (<a href="mailto:matt@thebishops.org">matt@thebishops.org</a>)</li>
  12. <li>Antoine Levy-Lambert (<a href="mailto:levylambert@tiscali-dsl.de">levylambert@tiscali-dsl.de</a>)</li>
  13. </ul>
  14. <p>Version $Revision$ - $Date$</p>
  15. <hr>
  16. <h2>Contents</h2>
  17. <ul>
  18. <li><a href="#intro">Introduction</a></li>
  19. <li><a href="#tasks">The Tasks</a></li>
  20. <li><a href="#changes">Change History</a></li>
  21. </ul>
  22. <br>
  23. <h2><a name="intro">Introduction</a></h2>
  24. <p>These tasks provide an interface to the <a href="http://www.perforce.com" target="_top">Perforce</a> SCM.
  25. The <code>org.apache.tools.ant.taskdefs.optional.perforce</code> package consists of a simple framework to support
  26. p4 functionality as well as some Ant tasks encapsulating frequently used (by me :-) p4 commands.
  27. However, the addition of new p4 commands is a pretty simple task (see the source).
  28. Although it is possible to use these commands on the desktop,
  29. they were primarily intended to be used by automated build systems.</p>
  30. <p><b>Note:</b> These tasks require the <a href="http://jakarta.apache.org/oro" target="_top">oro 2.0.XXX</a> regular
  31. expression package. Simply download this package and copy the jakarta-oro-2.0.XXX.jar file into Ant's lib directory.
  32. You will also need the Perforce client executable (p4 or p4.exe but not p4win.exe) in your path.
  33. </p>
  34. <h2><a name="tasks">The Tasks</a></h2>
  35. <table border="0" cellspacing="0" cellpadding="3">
  36. <tr>
  37. <td><a href="#p4sync">P4Sync</a></td>
  38. <td>Synchronise a workspace to a depot</td>
  39. </tr>
  40. <tr>
  41. <td><a href="#p4change">P4Change</a></td>
  42. <td>Request a new changelist from the Perforce server</td>
  43. </tr>
  44. <tr>
  45. <td><a href="#p4edit">P4Edit</a></td>
  46. <td>Open files for edit (checkout)</td>
  47. </tr>
  48. <tr>
  49. <td><a href="#p4submit">P4Submit</a></td>
  50. <td>Submit a changelist to the Perforce server (checkin)</td>
  51. </tr>
  52. <tr>
  53. <td><a href="#p4have">P4Have</a></td>
  54. <td>List current files in client view, useful for reporting</td>
  55. </tr>
  56. <tr>
  57. <td><a href="#p4label">P4Label</a></td>
  58. <td>Create a label reflecting files in the current workspace</td>
  59. </tr>
  60. <tr>
  61. <td><a href="#p4labelsync">P4Labelsync</a></td>
  62. <td>Syncs an existing label</td>
  63. </tr>
  64. <tr>
  65. <td><a href="#p4counter">P4Counter</a></td>
  66. <td>Obtain or set the value of a counter</td>
  67. </tr>
  68. <tr>
  69. <td><a href="#p4reopen">P4Reopen</a></td>
  70. <td>Move files between changelists</td>
  71. </tr>
  72. <tr>
  73. <td><a href="#p4revert">P4Revert</a></td>
  74. <td>Revert files</td>
  75. </tr>
  76. <tr>
  77. <td><a href="#p4add">P4Add</a></td>
  78. <td>Add files</td>
  79. </tr>
  80. <tr>
  81. <td><a href="#p4delete">P4Delete</a></td>
  82. <td>Delete files</td>
  83. </tr>
  84. <tr>
  85. <td><a href="#p4integrate">P4Integrate</a></td>
  86. <td>Integrate files</td>
  87. </tr>
  88. <tr>
  89. <td><a href="#p4resolve">P4Resolve</a></td>
  90. <td>Resolve files</td>
  91. </tr>
  92. <tr>
  93. <td><a href="#p4fstat">P4Fstat</a></td>
  94. <td>Show differences between local repository and p4 repository</td>
  95. </tr>
  96. </table>
  97. <h3>General P4 Properties</h3>
  98. <p>Each p4 task requires a number of settings, either through build-wide properties, individual attributes
  99. or environment variables. These are
  100. </p>
  101. <table border="1" cellpadding="2" cellspacing="0">
  102. <tr>
  103. <td valign="top"><b>Property</b></td>
  104. <td valign="top"><b>Attribute</b></td>
  105. <td valign="top"><b>Env Var</b></td>
  106. <td valign="top"><b>Description</b></td>
  107. <td align="center" valign="top"><b>Default</b></td>
  108. </tr>
  109. <tr>
  110. <td valign="top">p4.port</td>
  111. <td valign="top">port</td>
  112. <td valign="top">P4PORT</td>
  113. <td valign="top">The p4d server and port to connect to</td>
  114. <td valign="top">perforce:1666</td>
  115. </tr>
  116. <tr>
  117. <td valign="top">p4.client</td>
  118. <td valign="top">client</td>
  119. <td valign="top">P4CLIENT</td>
  120. <td valign="top">The p4 client spec to use</td>
  121. <td valign="top">The logged in username</td>
  122. </tr>
  123. <tr>
  124. <td valign="top">p4.user</td>
  125. <td valign="top">user</td>
  126. <td valign="top">P4USER</td>
  127. <td valign="top">The p4 username</td>
  128. <td valign="top">The logged in username</td>
  129. </tr>
  130. <tr>
  131. <td valign="top" align="center">--</td>
  132. <td valign="top">view</td>
  133. <td valign="top" align="center">--</td>
  134. <td valign="top">The client, branch or label view to operate upon. See the p4 user guide for more info.</td>
  135. <td valign="top">//...</td>
  136. </tr>
  137. </table>
  138. <p> Your local installation of Perforce may require other settings (e.g.
  139. P4PASSWD, P4CONFIG). Many of these settings can be set using the globalopts
  140. attribute (described below), but not all. If a setting cannot be set
  141. by the command-line options, then it can only be set outside of Ant as an
  142. environment variable.
  143. </p>
  144. <p>
  145. Additionally, you may also specify the following attributes:
  146. </p>
  147. <p>
  148. <table border="1" cellpadding="2" cellspacing="0">
  149. <tr>
  150. <td valign="top"><b>Attribute</b></td>
  151. <td valign="top"><b>Description</b></td>
  152. <td align="center" valign="top"><b>Required</b></td>
  153. </tr>
  154. <tr>
  155. <td valign="top">failonerror</td>
  156. <td valign="top">Specifies whether to stop the build
  157. (<code>true</code>|<code>yes</code>|<code>on</code>)
  158. or keep going (<code>false</code>|<code>no</code>|<code>off</code>)
  159. if an error is returned from the p4 command.</td>
  160. <td valign="top">No; defaults to true.</td>
  161. </tr>
  162. <tr>
  163. <td valign="top">globalopts<br></td>
  164. <td valign="top">Specifies global options for perforce to use while
  165. executing the task. These properties should be concatenated into one
  166. string,<br>
  167. such as "-P <i>password</i> -C EUCJIS". Use the command-line option
  168. syntax, NOT the environment variable names. See the<br>
  169. Perforce Command Reference for details.</td>
  170. <td valign="top">No<br></td>
  171. </tr>
  172. </table>
  173. </p>
  174. <h3>Examples</h3>
  175. <p>Setting in the environment:-</p>
  176. <p>
  177. (Unix csh)</p>
  178. <pre>setenv P4PORT myperforcebox:1666</pre>
  179. <p>(Unix sh et al)</p>
  180. <pre>P4USER=myp4userid; export P4USER</pre>
  181. <p>Using build properties:-</p>
  182. <pre>&lt;property name=&quot;p4.client&quot; value=&quot;nightlybuild&quot;/&gt;</pre>
  183. <p>Using task attributes:-</p>
  184. <pre>
  185. &lt;p4Whatever
  186. port=&quot;myserver:1666&quot;
  187. client=&quot;smoketest&quot;
  188. user=&quot;smoketestdude&quot;
  189. .
  190. .
  191. .
  192. /&gt;
  193. </pre>
  194. <p>
  195. For more information regarding the underlying 'p4' commands you are referred to the Perforce Command Reference
  196. available from the <a href="http://www.perforce.com/" target="_top">Perforce website</a>.
  197. </p>
  198. <hr>
  199. <h2>Task Descriptions</h2>
  200. <h2><a name="p4sync">P4Sync</a></h2>
  201. <h3>Description:</h3>
  202. <p>Synchronize the current workspace with the depot.</p>
  203. <h3>Parameters</h3>
  204. <table border="1" cellpadding="2" cellspacing="0">
  205. <tr>
  206. <td valign="top"><b>Attribute</b></td>
  207. <td valign="top"><b>Description</b></td>
  208. <td align="center" valign="top"><b>Required</b></td>
  209. </tr>
  210. <tr>
  211. <td valign="top">force</td>
  212. <td valign="top">force a refresh of files, if this attribute has
  213. been set.</td>
  214. <td valign="top" align="center">no - if ommitted, it will be off,
  215. otherwise a refresh will be forced.</td>
  216. </tr>
  217. <tr>
  218. <td valign="top">label</td>
  219. <td valign="top">sync client to label</td>
  220. <td valign="top" align="center">no</td>
  221. </tr>
  222. </table>
  223. <h3>Examples</h3>
  224. <pre>&lt;p4sync label=&quot;nightlybuild-0.0123&quot; force=&quot;foo&quot;/&gt;
  225. &lt;p4sync view=&quot;//depot/projects/projectfoo/main/src/...&quot;/&gt;
  226. </pre>
  227. <hr>
  228. <h2><a name="p4change">P4Change</a></h2>
  229. <h3>Description:</h3>
  230. <p>Request a new changelist from the Perforce server.
  231. This task sets the ${p4.change} property which can then be passed to <A HREF="#p4submit">P4Submit</A>,
  232. <A HREF="#p4edit">P4Edit</A>, or <a HREF="#p4add">P4Add</A>, or <a HREF="#p4delete">P4Delete</A>,
  233. then to <A HREF="#p4submit">P4Submit</A>.
  234. </p>
  235. <h3>Parameters</h3>
  236. <table border="1" cellpadding="2" cellspacing="0">
  237. <tr>
  238. <td valign="top"><b>Attribute</b></td>
  239. <td valign="top"><b>Description</b></td>
  240. <td align="center" valign="top"><b>Required</b></td>
  241. </tr>
  242. <tr>
  243. <td valign="top">description</td>
  244. <td valign="top">Description for ChangeList. If none specified, it will
  245. default to "AutoSubmit By Ant"</td>
  246. <td valign="top" align="center">No.</td>
  247. </tr>
  248. </table>
  249. <h3>Examples</h3>
  250. <pre>&lt;p4change description="Change Build Number in Script"&gt;
  251. </pre>
  252. <hr>
  253. <h2><a name="p4edit">P4Edit</a></h2>
  254. <h3>Description:</h3>
  255. <p>Open file(s) for edit. P4Change should be used to obtain a new changelist for P4Edit as,
  256. although P4Edit can open files to the default change, P4Submit cannot yet submit it.
  257. </p>
  258. <h3>Parameters</h3>
  259. <table border="1" cellpadding="2" cellspacing="0">
  260. <tr>
  261. <td valign="top"><b>Attribute</b></td>
  262. <td valign="top"><b>Description</b></td>
  263. <td align="center" valign="top"><b>Required</b></td>
  264. </tr>
  265. <tr>
  266. <td valign="top">view</td>
  267. <td valign="top">The filespec to request to edit</td>
  268. <td valign="top" align="center">Yes</td>
  269. </tr>
  270. <tr>
  271. <td valign="top">change</td>
  272. <td valign="top">An existing changelist number to assign files to.</td>
  273. <td valign="top" align="center">No, but see above.</td>
  274. </tr>
  275. </table>
  276. <h3>Examples</h3>
  277. <pre>
  278. &lt;p4edit
  279. view=&quot;//depot/projects/projectfoo/main/src/Blah.java...&quot;
  280. change=&quot;${p4.change}&quot;/&gt;
  281. </pre>
  282. <hr>
  283. <h2><a name="p4submit">P4Submit</a></h2>
  284. <h3>Description:</h3>
  285. <p>Submit a changelist, usually obtained from P4Change.
  286. <p>P4Submit will also change the value of the property p4.change if the change list is renamed by the Perforce server.
  287. <p>P4Submit will set a property p4.needsresolve to 1 if the change could not be submitted due to files needing resolving.
  288. <p>Files will need resolve if at the time of checking in, the revision that was checked out to do the current edit
  289. is not the latest any more.
  290. <p>If no files need resolve, the p4.needsresolve will be set to 0.
  291. </p>
  292. <h3>Parameters</h3>
  293. <table border="1" cellpadding="2" cellspacing="0">
  294. <tr>
  295. <td valign="top"><b>Attribute</b></td>
  296. <td valign="top"><b>Description</b></td>
  297. <td align="center" valign="top"><b>Required</b></td>
  298. </tr>
  299. <tr>
  300. <td valign="top">change</td>
  301. <td valign="top">The changelist number to submit</td>
  302. <td valign="top" align="center">Yes</td>
  303. </tr>
  304. </table>
  305. <h3>Examples</h3>
  306. <pre>&lt;p4submit change=&quot;${p4.change}&quot;/&gt;
  307. </pre>
  308. <hr>
  309. <h2><a name="p4have">P4Have</a></h2>
  310. <h3>Description:</h3>
  311. <p>List handy file info reflecting the current client contents.
  312. </p>
  313. <h3>Parameters</h3>
  314. <table border="1" cellpadding="2" cellspacing="0">
  315. <tr>
  316. <td valign="top"><b>Attribute</b></td>
  317. <td valign="top"><b>Description</b></td>
  318. <td align="center" valign="top"><b>Required</b></td>
  319. </tr>
  320. <tr>
  321. <td valign="top">None</td>
  322. <td valign="top" align="center">--</td>
  323. <td valign="top" align="center">--</td>
  324. </tr>
  325. </table>
  326. <h3>Examples</h3>
  327. <pre>&lt;p4have/&gt;
  328. </pre>
  329. <hr>
  330. <h2><a name="p4label">P4Label</a></h2>
  331. <h3>Description:</h3>
  332. <p>Create a new label and set contents to reflect current client file revisions.
  333. </p>
  334. <h3>Parameters</h3>
  335. <table border="1" cellpadding="2" cellspacing="0">
  336. <tr>
  337. <td valign="top"><b>Attribute</b></td>
  338. <td valign="top"><b>Description</b></td>
  339. <td align="center" valign="top"><b>Required</b></td>
  340. </tr>
  341. <tr>
  342. <td valign="top">name</td>
  343. <td valign="top">The name of the label</td>
  344. <td valign="top" align="center">Yes</td>
  345. </tr>
  346. <tr>
  347. <td valign="top">view</td>
  348. <td valign="top">client view to use for label</td>
  349. <td valign="top" align="center">No</td>
  350. </tr>
  351. <tr>
  352. <td valign="top">desc</td>
  353. <td valign="top">Label Description</td>
  354. <td valign="top" align="center">No</td>
  355. </tr>
  356. <tr>
  357. <td valign="top">lock</td>
  358. <td valign="top">Lock the label once created.</td>
  359. <td valign="top" align="center">No</td>
  360. </tr>
  361. </table>
  362. <h3>Examples</h3>
  363. <pre>
  364. &lt;p4label
  365. name=&quot;NightlyBuild:${DSTAMP}:${TSTAMP}&quot;
  366. desc=&quot;Auto Nightly Build&quot;
  367. lock=&quot;locked&quot;
  368. /&gt;
  369. </pre>
  370. <hr>
  371. <h2><a name="p4labelsync">P4Labelsync</a></h2>
  372. <h3>Description:</h3>
  373. <p>Syncs an existing label against the current workspace or against specified revisions.
  374. </p>
  375. <h3>Parameters</h3>
  376. <table border="1" cellpadding="2" cellspacing="0">
  377. <tr>
  378. <td valign="top"><b>Attribute</b></td>
  379. <td valign="top"><b>Description</b></td>
  380. <td align="center" valign="top"><b>Required</b></td>
  381. <td align="center" valign="top"><b>Perforce command line flag</b></td>
  382. </tr>
  383. <tr>
  384. <td valign="top">name</td>
  385. <td valign="top">The name of the label</td>
  386. <td valign="center" align="center">Yes</td>
  387. <td valign="top" align="center">-l labelname</td>
  388. </tr>
  389. <tr>
  390. <td valign="top">view</td>
  391. <td valign="top">
  392. list of files or revision specs separated by : or ;<br>
  393. in the absence of this attribute, the labelsync will be done against the current Perforce client or the value of the p4client attribute or the value of the p4.client property or the value of the environment variable P4CLIENT</td>
  394. <td valign="center" align="center">No</td>
  395. <td valign="center" align="center">file[revRange] ... </td>
  396. </tr>
  397. <tr>
  398. <td valign="top">simulationmode</td>
  399. <td valign="top">Displays which effect the operation would have on the label but do not actually do it</td>
  400. <td valign="center" align="center">No</td>
  401. <td valign="top" align="center">-n</td>
  402. </tr>
  403. <tr>
  404. <td valign="top">add</td>
  405. <td valign="top">If set to true, preserve files which exist in the label, but not in the current view</td>
  406. <td valign="center" align="center">No</td>
  407. <td valign="top" align="center">-a</td>
  408. </tr>
  409. <tr>
  410. <td valign="top">delete</td>
  411. <td valign="top">If set to true, remove from the label the files mentioned in the view attribute</td>
  412. <td valign="center" align="center">No</td>
  413. <td valign="top" align="center">-d</td>
  414. </tr>
  415. </table>
  416. <h3>Examples</h3>
  417. <pre>
  418. &lt;
  419. p4labelsync
  420. name=&quot;current_release&quot;
  421. view="//depot/...#head;//depot2/file1#25"
  422. add=&quot;true&quot;
  423. /&gt;
  424. </pre>
  425. This example will add into the label called <i>current_release</i> the current head revision of all the files located under <i>//depot</i>
  426. and the revision 25 of the file <i>//depot2/file1</i>.
  427. <pre>
  428. &lt;
  429. p4labelsync
  430. name=&quot;current_release&quot;
  431. p4client=&quot;myclient&quot;
  432. /&gt;
  433. </pre>
  434. This example will update the label called <i>current_release</i> so that it reflects the Perforce client <i>myclient</i>.<br>
  435. Files present in the label before the sync and not present currently in the client will be removed from the label, because the add attribute is not set.
  436. <pre>
  437. &lt;
  438. p4labelsync
  439. name=&quot;current_release&quot;
  440. /&gt;
  441. </pre>
  442. This example will update the label called <i>current_release</i> so that it reflects the current default client for the ant Perforce tasks.<br>
  443. The default client is by order of priority :
  444. <ul>
  445. <li>
  446. the value of the p4.client property if set in the project
  447. </li>
  448. <li>
  449. the value of the P4CLIENT environment variable
  450. </li>
  451. <li>
  452. the default Perforce client from the Windows registry under Windows operating systems
  453. </li>
  454. </ul>
  455. Files present in the label before the sync and not present currently in the client will be removed from the label, because the add attribute is not set.
  456. <hr>
  457. <h2><a name="p4counter">P4Counter</a></h2>
  458. <h3>Description:</h3>
  459. <p>
  460. Obtain or set the value of a counter. When used in its base form
  461. (where only the counter name is provided), the counter value will be
  462. printed to the output stream. When the value is provided, the counter
  463. will be set to the value provided. When a property name is provided,
  464. the property will be filled with the value of the counter. You may
  465. not specify to both get and set the value of the counter in the same
  466. Task.
  467. </p>
  468. <P>
  469. The user performing this task must have Perforce &quot;review&quot; permissions
  470. as defined by Perforce protections in order for this task to succeed.
  471. </P>
  472. <h3>Parameters</h3>
  473. <table border="1" cellpadding="2" cellspacing="0">
  474. <tr>
  475. <td valign="top"><b>Attribute</b></td>
  476. <td valign="top"><b>Description</b></td>
  477. <td align="center" valign="top"><b>Required</b></td>
  478. </tr>
  479. <tr>
  480. <td valign="top">name</td>
  481. <td valign="top">The name of the counter</td>
  482. <td valign="top" align="center">Yes</td>
  483. </tr>
  484. <tr>
  485. <td valign="top">value</td>
  486. <td valign="top">The new value for the counter</td>
  487. <td valign="top" align="center">No</td>
  488. </tr>
  489. <tr>
  490. <td valign="top">property</td>
  491. <td valign="top">The property to be set with the value of the counter</td>
  492. <td valign="top" align="center">No</td>
  493. </tr>
  494. </table>
  495. <h3>Examples</h3>
  496. Print the value of the counter named &quot;last-clean-build&quot; to the output stream:
  497. <pre>
  498. &lt;p4counter name=&quot;last-clean-build&quot;/&gt;
  499. </PRE>
  500. Set the value of the counter based on the value of the &quot;TSTAMP&quot; property:
  501. <PRE>
  502. &lt;p4counter name=&quot;last-clean-build&quot; value=&quot;${TSTAMP}&quot;/&gt;
  503. </PRE>
  504. Set the value of the &quot;p4.last.clean.build&quot; property to the current
  505. value of the &quot;last-clean-build&quot; counter:
  506. <PRE>
  507. &lt;p4counter name=&quot;last-clean-build&quot; property=&quot;${p4.last.clean.build}&quot;/&gt;
  508. </pre>
  509. <hr>
  510. <h2><a name="p4reopen">P4Reopen</a></h2>
  511. <h3>Description:</h3>
  512. <p>
  513. Move (or reopen in Perforce speak) checkout files between changelists.
  514. </p>
  515. <h3>Parameters</h3>
  516. <table border="1" cellpadding="2" cellspacing="0">
  517. <tr>
  518. <td valign="top"><b>Attribute</b></td>
  519. <td valign="top"><b>Description</b></td>
  520. <td align="center" valign="top"><b>Required</b></td>
  521. </tr>
  522. <tr>
  523. <td valign="top">tochange</td>
  524. <td valign="top">The changelist to move files to.</td>
  525. <td valign="top" align="center">Yes</td>
  526. </tr>
  527. </table>
  528. <h3>Examples</h3>
  529. Move all open files to the default changelist
  530. <pre>
  531. &lt;p4reopen view=&quot;//...&quot; tochange=&quot;default&quot;/&gt;
  532. </PRE>
  533. Create a new changelist then reopen into it, any files from the view //projects/foo/main/...
  534. <PRE>
  535. &lt;p4change description="Move files out of the way"/&gt;
  536. &lt;p4reopen view=&quot;//projects/foo/main/...&quot; tochange=&quot;${p4.change}&quot;/&gt;
  537. </pre>
  538. <hr>
  539. <h2><a name="p4revert">P4Revert</a></h2>
  540. <h3>Description:</h3>
  541. <p>
  542. Reverts files.
  543. </p>
  544. <h3>Parameters</h3>
  545. <table border="1" cellpadding="2" cellspacing="0">
  546. <tr>
  547. <td valign="top"><b>Attribute</b></td>
  548. <td valign="top"><b>Description</b></td>
  549. <td align="center" valign="top"><b>Required</b></td>
  550. </tr>
  551. <tr>
  552. <td valign="top">change</td>
  553. <td valign="top">The changelist to revert.</td>
  554. <td valign="top" align="center">No</td>
  555. </tr>
  556. <tr>
  557. <td valign="top">revertOnlyUnchanged</td>
  558. <td valign="top">Revert only unchanged files (p4 revert -a)</td>
  559. <td valign="top" align="center">No</td>
  560. </tr>
  561. </table>
  562. <h3>Examples</h3>
  563. Revert everything!
  564. <pre>
  565. &lt;p4revert view=&quot;//...&quot;/&gt;
  566. </PRE>
  567. Revert any unchanged files in the default change
  568. <PRE>
  569. &lt;p4revert change="default" revertonlyunchanged=&quot;true&quot;/&gt;
  570. </pre>
  571. <hr>
  572. <h2><a name="p4add">P4Add</a></h2>
  573. <h3>Description:</h3>
  574. <p>
  575. Adds files specified in nested fileset children.
  576. </p>
  577. <h3>Parameters</h3>
  578. <table border="1" cellpadding="2" cellspacing="0">
  579. <tr>
  580. <td valign="top"><b>Attribute</b></td>
  581. <td valign="top"><b>Description</b></td>
  582. <td align="center" valign="top"><b>Required</b></td>
  583. </tr>
  584. <tr>
  585. <td valign="top">commandlength</td>
  586. <td valign="top">A positive integer specifying the maximum length
  587. of the commandline when calling Perforce to add the files.
  588. Defaults to 450, higher values mean faster execution,
  589. but also possible failures.</td>
  590. <td valign="top" align="center">No</td>
  591. </tr>
  592. <tr>
  593. <td valign="top">changelist</td>
  594. <td valign="top">If specified the open files are associated with the
  595. specified pending changelist number; otherwise the open files are
  596. associated with the default changelist.</td>
  597. <td valign="top" align="center">No</td>
  598. </tr>
  599. </table>
  600. <h3>Examples</h3>
  601. Require a changelist, add all java files starting from a directory,
  602. and submit
  603. <pre>
  604. &lt;p4change/&gt;
  605. &lt;p4add commandlength=&quot;20000&quot; changelist=&quot;${p4.change}&quot;&gt;
  606. &lt;fileset dir=&quot;../dir/src/&quot; includes=&quot;**/*.java&quot;/&gt;
  607. &lt;p4add&gt;
  608. &lt;p4submit change=&quot;${p4.change}&quot;/&gt;
  609. </pre>
  610. <hr>
  611. <h2><a name="p4fstat">P4Fstat</a></h2>
  612. <h3>Description:</h3>
  613. <p>
  614. Lists files under Perforce control and files not under Perforce control in one or several filesets
  615. </p>
  616. <h3>Parameters</h3>
  617. <table border="1" cellpadding="2" cellspacing="0">
  618. <tr>
  619. <td valign="top"><b>Attribute</b></td>
  620. <td valign="top"><b>Description</b></td>
  621. <td align="center" valign="top"><b>Required</b></td>
  622. </tr>
  623. <tr>
  624. <td valign="top">showfilter</td>
  625. <td valign="top">should be one of
  626. <table border="1">
  627. <tr><td>value</td><td>description</td></tr>
  628. <tr><td>&quot;all&quot;</td><td>list all files, first the ones which are under Perforce control, then the others</td></tr>
  629. <tr><td>&quot;existing&quot;</td><td>list only files under Perforce control</td></tr>
  630. <tr><td>&quot;non-existing&quot;</td><td>list only files which are not under Perforce control</td></tr></table>
  631. </td>
  632. <td valign="top" align="center">Yes</td>
  633. </tr>
  634. <tr>
  635. <td valign="top">fileset</td>
  636. <td valign="top">one or several <a href="../CoreTypes/fileset.html">fileset(s)</a></td>
  637. <td valign="top" align="center">yes (at least one fileset is needed)</td>
  638. </tr>
  639. </table>
  640. Several nested filesets can be used with P4Fstat, one should be there at least.
  641. <h3>Examples</h3>
  642. will list all the files under C:\dev\gnu\depot, sorted by under Perforce or not under Perforce<br>
  643. <pre>
  644. &lt;project name=&quot;p4fstat&quot; default=&quot;p4fstat&quot; basedir=&quot;C:\dev\gnu&quot;&gt;
  645. &lt;target name=&quot;p4fstat&quot; &gt;
  646. &lt;p4fstat showfilter=&quot;all&quot;&gt;
  647. &lt;fileset dir=&quot;depot&quot; includes=&quot;**/*&quot;/&gt;
  648. &lt;/p4fstat&gt;
  649. &lt;/target&gt;
  650. &lt;/project&gt;</p>
  651. </pre>
  652. <h2><a name="p4delete">P4Delete</a></h2>
  653. <h3>Description:</h3>
  654. <p>Open file(s) for delete. P4Change should be used to obtain a new changelist for P4Delete as,
  655. although P4Delete can open files to the default change, P4Submit cannot yet submit it.
  656. </p>
  657. <h3>Parameters</h3>
  658. <table border="1" cellpadding="2" cellspacing="0">
  659. <tr>
  660. <td valign="top"><b>Attribute</b></td>
  661. <td valign="top"><b>Description</b></td>
  662. <td align="center" valign="top"><b>Required</b></td>
  663. </tr>
  664. <tr>
  665. <td valign="top">view</td>
  666. <td valign="top">The filespec to request to delete</td>
  667. <td valign="top" align="center">Yes</td>
  668. </tr>
  669. <tr>
  670. <td valign="top">change</td>
  671. <td valign="top">An existing changelist number to assign files to.</td>
  672. <td valign="top" align="center">No, but see above.</td>
  673. </tr>
  674. </table>
  675. <h3>Examples</h3>
  676. <pre>
  677. &lt;p4delete
  678. view=&quot;//depot/projects/projectfoo/main/src/Blah.java...&quot;
  679. change=&quot;${p4.change}&quot;/&gt;
  680. </pre>
  681. <hr>
  682. <h2><a name="p4integrate">P4Integrate</a></h2>
  683. <h3>Description:</h3>
  684. <p>Open file(s) for integrate. P4Change should be used to obtain a new changelist for P4Integrate as,
  685. although P4Integrate can open files to the default change, P4Submit cannot yet submit it.
  686. </p>
  687. <h3>Parameters</h3>
  688. <p>If this task is used without using a branch definition, both fromfile and tofile must be supplied.
  689. If a branch definition is supplied, at least one of fromfile or tofile should be supplied.
  690. Both fromfile and tofile can be supplied together with a branch definition.</p>
  691. <table border="1" cellpadding="2" cellspacing="0">
  692. <tr>
  693. <td valign="top"><b>Attribute</b></td>
  694. <td valign="top"><b>Description</b></td>
  695. <td align="center" valign="top"><b>Required</b></td>
  696. <td align="center" valign="top"><b>Perforce command line flag</b></td>
  697. </tr>
  698. <tr>
  699. <td valign="top">fromfile</td>
  700. <td valign="top">Original file or view</td>
  701. <td valign="top" align="center">required if a branch is not specified</td>
  702. <td valign="top" align="center"></td>
  703. </tr>
  704. <tr>
  705. <td valign="top">tofile</td>
  706. <td valign="top">Target file or view.</td>
  707. <td valign="top" align="center">required if a branch is not specified</td>
  708. <td valign="top" align="center"></td>
  709. </tr>
  710. <tr>
  711. <td valign="top">branch</td>
  712. <td valign="top">Name of branch specification</td>
  713. <td valign="center">No</td>
  714. <td valign="top" align="center">-b</td>
  715. </tr>
  716. <tr>
  717. <td valign="top">change</td>
  718. <td valign="top">An existing changelist number to assign files to.</td>
  719. <td valign="top" align="center">No, but see above.</td>
  720. <td valign="top" align="center">-c</td>
  721. </tr>
  722. <tr>
  723. <td valign="top">forceintegrate</td>
  724. <td valign="top">Forces integration regardless of previous integration history (*)</td>
  725. <td valign="center">No</td>
  726. <td valign="top" align="center">-f</td>
  727. </tr>
  728. <tr>
  729. <td valign="top">restoredeletedrevisions</td>
  730. <td valign="top">Enables integration around deleted revisions (*)</td>
  731. <td valign="center">No</td>
  732. <td valign="top" align="center">-d</td>
  733. </tr>
  734. <tr>
  735. <td valign="top">leavetargetrevision</td>
  736. <td valign="top">Prevents target files from being synced to head revision before integration (*)</td>
  737. <td valign="center">No</td>
  738. <td valign="top" align="center">-h</td>
  739. </tr>
  740. <tr>
  741. <td valign="top">enablebaselessmerges</td>
  742. <td valign="top">Forces integration to existing target files which have no integration history relative to the source files (*)</td>
  743. <td valign="center">No</td>
  744. <td valign="top" align="center">-i</td>
  745. </tr>
  746. <tr>
  747. <td valign="top">simulationmode</td>
  748. <td valign="top">Displays which integrations are necessary but do not actually schedule them (*)</td>
  749. <td valign="center">No</td>
  750. <td valign="top" align="center">-n</td>
  751. </tr>
  752. <tr>
  753. <td valign="top">reversebranchmappings</td>
  754. <td valign="top">Reverses mappings in the branch view, with source and target files exchanging place (*)</td>
  755. <td valign="center">No</td>
  756. <td valign="top" align="center">-r</td>
  757. </tr>
  758. <tr>
  759. <td valign="top">propagatesourcefiletype</td>
  760. <td valign="top">Makes source file type propagate to existing target files (*)</td>
  761. <td valign="center">No</td>
  762. <td valign="top" align="center">-t</td>
  763. </tr>
  764. <tr>
  765. <td valign="top">nocopytargetfiles</td>
  766. <td valign="top">Prevents the physical delivery on disk of new target files (*)</td>
  767. <td valign="center">No</td>
  768. <td valign="top" align="center">-v</td>
  769. </tr>
  770. </table>
  771. <br>
  772. (*) The following applies for a number of flags. The default is false. To set the flag, use &quot;true&quot;
  773. <h3>Examples</h3>
  774. <pre>
  775. &lt;p4integrate
  776. fromfile=&quot;//depot/projects/projectfoo/main/src/Blah.java...&quot;
  777. tofile=&quot;//depot/projects/projectfoo/release/src/Blah.java...&quot;
  778. change=&quot;${p4.change}&quot;/&gt;
  779. </pre>
  780. <hr>
  781. <h2><a name="p4resolve">P4Resolve</a></h2>
  782. <h3>Description:</h3>
  783. <p>Resolves files. You want to do this if :
  784. <ul>
  785. <li>
  786. there have been or there may be concurrent edits of the same file. For instance, you have begun to edit a file, and while you were working on it, somebody has submitted a new version of the same file. When you first attempt to submit your file(s), you will get a message (property p4.needsresolve set).
  787. </li>
  788. <li>
  789. you have just been doing an integration to existing target files
  790. </li>
  791. </ul>
  792. P4Resolve does not use a change list number (it takes it from the files it is working on).
  793. </p>
  794. <h3>Parameters</h3>
  795. <table border="1" cellpadding="2" cellspacing="0">
  796. <tr>
  797. <td valign="top"><b>Attribute</b></td>
  798. <td valign="top"><b>Description</b></td>
  799. <td align="center" valign="top"><b>Required</b></td>
  800. <td align="center" valign="top"><b>Perforce command line flag</b></td>
  801. </tr>
  802. <tr>
  803. <td valign="top">view</td>
  804. <td valign="top">The filespec to request to delete</td>
  805. <td valign="top" align="center">Yes</td>
  806. <td valign="top" align="center"></td>
  807. </tr>
  808. <tr>
  809. <td valign="top">resolvemode</td>
  810. <td valign="top">Should have one of these values :
  811. <ul>
  812. <li>&quot;automatic&quot;</li>
  813. <li>&quot;force&quot;</li>
  814. <li>&quot;safe&quot;</li>
  815. <li>&quot;theirs&quot;</li>
  816. <li>&quot;yours&quot;</li>
  817. </ul></td>
  818. <td valign="top" align="center">Yes</td>
  819. <td valign="top" align="center">corresponds to one of -am -af -as -at -ay </td>
  820. </tr>
  821. <tr>
  822. <td valign="top">redoall</td>
  823. <td valign="top">allows previously resolved files to be resolved again (*)</td>
  824. <td valign="top" align="center">No</td>
  825. <td valign="top" align="center">-f</td>
  826. </tr>
  827. <tr>
  828. <td valign="top">simulationmode</td>
  829. <td valign="top">Lists the integrations which would be performed, without actually doing them. (*)</td>
  830. <td valign="top" align="center">No</td>
  831. <td valign="top" align="center">-n</td>
  832. </tr>
  833. <tr>
  834. <td valign="top">forcetextmode</td>
  835. <td valign="top">Attempts a textual merge, even for binary files (*)</td>
  836. <td valign="top" align="center">No</td>
  837. <td valign="top" align="center">-t</td>
  838. </tr>
  839. <tr>
  840. <td valign="top">markersforall</td>
  841. <td valign="top">Puts in markers for all changes, conflicting or not (*)</td>
  842. <td valign="top" align="center">No</td>
  843. <td valign="top" align="center">-v</td>
  844. </tr>
  845. </table>
  846. <br>
  847. (*) The following applies for a number of flags. The default is false. To set the flag, use &quot;true&quot;
  848. <h3>Examples</h3>
  849. <pre>
  850. &lt;p4resolve
  851. view=&quot;//depot/projects/projectfoo/main/src/Blah.java...&quot;
  852. change=&quot;${p4.change}&quot;
  853. resolvemode=&quot;automatic&quot;/&gt;
  854. </pre>
  855. <h2><a name="changes">Change History</a></h2>
  856. <table border="1" cellpadding="2" cellspacing="0">
  857. <tr>
  858. <td valign="top">Sept 2000</td>
  859. <td valign="top" align="center">--</td>
  860. <td valign="top">Internal Release within Rubus</td>
  861. </tr>
  862. <tr>
  863. <td valign="top">Nov 2000</td>
  864. <td valign="top">V1.0</td>
  865. <td valign="top">Initial Release donated to ASF :-)</td>
  866. </tr>
  867. <tr>
  868. <td valign="top">Jan 2001</td>
  869. <td valign="top">V1.1</td>
  870. <td valign="top">Fixed cross platform (NT/Unix) bug<br>
  871. Refactored p4 output handling code<br>
  872. Refactored exec'ing code</td>
  873. </tr>
  874. <tr>
  875. <td valign="top">Jan 2003</td>
  876. <td valign="top">V1.2</td>
  877. <td valign="top">Added globalopts to P4Base to allow
  878. additional global options to be set.<br>
  879. Added p4fstat task</td>
  880. </tr>
  881. <tr>
  882. <td valign="top">May 2003</td>
  883. <td valign="top">V1.3</td>
  884. <td valign="top">Added p4labelsync, p4resolve, p4integrate.<br>
  885. Changed p4submit (detection of changes of change numbers,
  886. and of failed submits due to resolution needed)</td>
  887. </tr>
  888. </table>
  889. <hr>
  890. <p align="center">Copyright &copy; 2001-2003 Apache Software Foundation. All rights
  891. Reserved.</p>
  892. </body>
  893. </html>