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.6 KiB

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