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.

cvs.html 7.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>CVS Task</title>
  5. <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
  6. </head>
  7. <body>
  8. <h2><a name="cvs">Cvs</a></h2>
  9. <h3>Description</h3>
  10. <p>Handles packages/modules retrieved from a
  11. <a href="http://www.cvshome.org/" target="_top">CVS</a> repository.</p>
  12. <p><b>Important:</b> This task needs &quot;<code>cvs</code>&quot; on the path. If it isn't, you will get
  13. an error (such as error <code>2</code> on windows). If <code>&lt;cvs&gt;</code> doesn't work, try to execute <code>cvs.exe</code>
  14. from the command line in the target directory in which you are working.
  15. <h3>Parameters</h3>
  16. <table border="1" cellpadding="2" cellspacing="0">
  17. <tr>
  18. <td valign="top"><b>Attribute</b></td>
  19. <td valign="top"><b>Description</b></td>
  20. <td align="center" valign="top"><b>Required</b></td>
  21. </tr>
  22. <tr>
  23. <td valign="top">command</td>
  24. <td valign="top">the CVS command to execute.</td>
  25. <td align="center" valign="top">No, default &quot;checkout&quot;.</td>
  26. </tr>
  27. <tr>
  28. <td valign="top">compression</td>
  29. <td valign="top"><code>true</code> or <code>false</code> - if set
  30. to true, this is the same as <code>compressionlevel=&quot;3&quot;</code></td>
  31. <td align="center" valign="top">No. Defaults to false.</td>
  32. </tr>
  33. <tr>
  34. <td valign="top">compressionlevel</td>
  35. <td valign="top">A number between 1 and 9 (corresponding to
  36. possible values for CVS' <code>-z#</code> argument). Any
  37. other value is treated as <code>compression=&quot;false&quot;</code></td>
  38. <td align="center" valign="top">No. Defaults to no compression.</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">cvsRoot</td>
  42. <td valign="top">the <code>CVSROOT</code> variable.</td>
  43. <td align="center" valign="top">No</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">cvsRsh</td>
  47. <td valign="top">the <code>CVS_RSH</code> variable.</td>
  48. <td align="center" valign="top">No</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">dest</td>
  52. <td valign="top">the directory where the checked out files should
  53. be placed. Note that this is different from CVS's <code>-d</code> command line
  54. switch as Ant will never shorten pathnames to avoid empty
  55. directories.</td>
  56. <td align="center" valign="top">No, default is project's basedir.</td>
  57. </tr>
  58. <tr>
  59. <td valign="top">package</td>
  60. <td valign="top">the package/module to check out.</td>
  61. <td align="center" valign="top">No</td>
  62. </tr>
  63. <tr>
  64. <td valign="top">tag</td>
  65. <td valign="top">the tag of the package/module to check out.</td>
  66. <td align="center" valign="top">No</td>
  67. </tr>
  68. <tr>
  69. <td valign="top">date</td>
  70. <td valign="top">Use the most recent revision no later than the given date</td>
  71. <td align="center" valign="top">No</td>
  72. </tr>
  73. <tr>
  74. <td valign="top">quiet</td>
  75. <td valign="top">suppress informational messages. This is the same as <code>-q</code> on the command line.</td>
  76. <td align="center" valign="top">No, default &quot;false&quot;</td>
  77. </tr>
  78. <tr>
  79. <td valign="top">reallyquiet</td>
  80. <td valign="top">suppress all messages. This is the same as
  81. <code>-Q</code> on the command line. <em>since Ant 1.6</em>.</td>
  82. <td align="center" valign="top">No, default &quot;false&quot;</td>
  83. </tr>
  84. <tr>
  85. <td valign="top">noexec</td>
  86. <td valign="top">report only, don't change any files.</td>
  87. <td align="center" valign="top">No, default to &quot;false&quot;</td>
  88. </tr>
  89. <tr>
  90. <td valign="top">output</td>
  91. <td valign="top">the file to direct standard output from the command.</td>
  92. <td align="center" valign="top">No, default output to ANT Log as <code>MSG_INFO</code>.</td>
  93. </tr>
  94. <tr>
  95. <td valign="top">error</td>
  96. <td valign="top">the file to direct standard error from the command.</td>
  97. <td align="center" valign="top">No, default error to ANT Log as <code>MSG_WARN</code>.</td>
  98. </tr>
  99. <tr>
  100. <td valign="top">append</td>
  101. <td valign="top">whether to append output/error when redirecting to a file.</td>
  102. <td align="center" valign="top">No, default to &quot;false&quot;.</td>
  103. </tr>
  104. <tr>
  105. <td valign="top">port</td>
  106. <td valign="top">Port used by CVS to communicate with the server.</td>
  107. <td align="center" valign="top">No, default port <code>2401</code>.</td>
  108. </tr>
  109. <tr>
  110. <td valign="top">passfile</td>
  111. <td valign="top">Password file to read passwords from.</td>
  112. <td align="center" valign="top">No, default file <code>~/.cvspass</code>.</td>
  113. </tr>
  114. <tr>
  115. <td valign="top">failonerror</td>
  116. <td valign="top">Stop the build process if the command exits with a
  117. return code other than <code>0</code>. Defaults to &quot;false&quot;</td>
  118. <td align="center" valign="top">No</td>
  119. </tr>
  120. </table>
  121. <h3>Examples</h3>
  122. <pre> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
  123. package=&quot;ant&quot;
  124. dest=&quot;${ws.dir}&quot;
  125. /&gt;</pre>
  126. <p>checks out the package/module &quot;ant&quot; from the CVS
  127. repository pointed to by the <code>cvsRoot</code> attribute, and stores the files in &quot;<code>${ws.dir}</code>&quot;.</p>
  128. <pre> &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
  129. <p>updates the package/module that has previously been checked out into
  130. &quot;<code>${ws.dir}</code>&quot;.</p>
  131. <pre> &lt;cvs command=&quot;-q diff -u -N&quot; output=&quot;patch.txt&quot;/&gt;</pre>
  132. <p>silently (<code>-q</code>) creates a file called <code>patch.txt</code> which contains a unified (<code>-u</code>) diff which includes new files added via &quot;cvs add&quot; (<code>-N</code>) and can be used as input to patch.
  133. The equivalent, using <code>&lt;commandline&gt;</code> elements, is:
  134. </p>
  135. <pre>
  136. &lt;cvs output=&quot;patch&quot;&gt;
  137. &lt;commandline&gt;
  138. &lt;argument value=&quot;-q&quot;/&gt;
  139. &lt;argument value=&quot;diff&quot;/&gt;
  140. &lt;argument value=&quot;-u&quot;/&gt;
  141. &lt;argument value=&quot;-N&quot;/&gt;
  142. &lt;/commandline&gt;
  143. &lt;/cvs&gt;
  144. </pre>
  145. or:
  146. <pre>
  147. &lt;cvs output=&quot;patch&quot;&gt;
  148. &lt;commandline&gt;
  149. &lt;argument line=&quot;-q diff -u -N&quot;/&gt;
  150. &lt;/commandline&gt;
  151. &lt;/cvs&gt;
  152. </pre>
  153. <p>
  154. You may include as many <code>&lt;commandline&gt;</code> elements as you like.
  155. Each will inherit the <code>failonerror</code>, <code>compression</code>, and other &quot;global&quot; parameters
  156. from the <code>&lt;cvs&gt;</code> element.
  157. </p>
  158. <pre> &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
  159. <p>Updates from the head of repository ignoring sticky bits (<code>-A</code>) and creating any new directories as necessary (<code>-d</code>).</p>
  160. <p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any cvs options should appear
  161. before the command, and any command options should appear after the command as in the diff example
  162. above. See <a href="http://www.cvshome.org/docs/manual/cvs-1.11.13/cvs.html" target="_top">the cvs manual</a> for details,
  163. specifically the <a href="http://www.cvshome.org/docs/manual/cvs-1.11.13/cvs_16.html" target="_top">Guide to CVS commands</a></p>
  164. <hr>
  165. <p align="center">Copyright &copy; 2000-2004 The Apache Software
  166. Foundation. All rights Reserved.</p>
  167. </body>
  168. </html>