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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>CVS Task</title>
  20. </head>
  21. <body>
  22. <h2 id="cvs">Cvs</h2>
  23. <h3>Description</h3>
  24. <p>Handles packages/modules retrieved from a <a href="https://www.nongnu.org/cvs/"
  25. target="_top">CVS</a> repository.</p>
  26. <p><strong>Important:</strong> This task needs <code>cvs</code> binary on the path. If it isn't, you
  27. will get an error (such as error <code>2</code> on Windows). If <code>&lt;cvs&gt;</code> doesn't
  28. work, try to execute <code>cvs.exe</code> from the command line in the target directory in which you
  29. are working. Also note that this task assumes that the cvs executable is compatible with the Unix
  30. version, this is not completely true for certain other CVS clients&mdash;like CVSNT for
  31. example&mdash;and some operation may fail when using such an incompatible client.</p>
  32. <p><strong>CVSNT Note</strong>: CVSNT prefers users to store the passwords inside the registry. If
  33. the <a href="cvspass.html">cvspass task</a> and the <var>passfile</var> attribute don't seem to work
  34. for you, the most likely reason is that CVSNT ignores your <samp>.cvspass</samp> file completely.
  35. See <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5">bugzilla report 21657</a>
  36. for recommended workarounds.</p>
  37. <h3>Parameters</h3>
  38. <table class="attr">
  39. <tr>
  40. <th>Attribute</th>
  41. <th>Description</th>
  42. <th>Required</th>
  43. </tr>
  44. <tr>
  45. <td>command</td>
  46. <td>the CVS command to execute.</td>
  47. <td>No; default is <q>checkout</q></td>
  48. </tr>
  49. <tr>
  50. <td>compression</td>
  51. <td><q>true</q> (equivalent to <var>compressionlevel</var>=<q>3</q>) or <q>false</q></td>
  52. <td>No; defaults to <q>false</q></td>
  53. </tr>
  54. <tr>
  55. <td>compressionlevel</td>
  56. <td>A number between <q>1</q> and <q>9</q> (corresponding to possible values for
  57. CVS <code>-z#</code> argument). Any other value is treated
  58. as <var>compression</var>=<q>false</q></td>
  59. <td>No; defaults to no compression</td>
  60. </tr>
  61. <tr>
  62. <td>cvsRoot</td>
  63. <td>the <code>CVSROOT</code> variable.</td>
  64. <td>No</td>
  65. </tr>
  66. <tr>
  67. <td>cvsRsh</td>
  68. <td>the <code>CVS_RSH</code> variable.</td>
  69. <td>No</td>
  70. </tr>
  71. <tr>
  72. <td>dest</td>
  73. <td>the directory where the checked out files should be placed. Note that this is different
  74. from CVS's <code>-d</code> command line switch as Apache Ant will never shorten pathnames to
  75. avoid empty directories.</td>
  76. <td>No; default is project's <var>basedir</var></td>
  77. </tr>
  78. <tr>
  79. <td>package</td>
  80. <td>the package/module to check out. <strong>Note</strong>: multiple attributes can be split
  81. using spaces. Use a nested <code>&lt;module&gt;</code> element if you want to specify a
  82. module with spaces in its name.</td>
  83. <td>No</td>
  84. </tr>
  85. <tr>
  86. <td>tag</td>
  87. <td>the tag of the package/module to check out.</td>
  88. <td>No</td>
  89. </tr>
  90. <tr>
  91. <td>date</td>
  92. <td>Use the most recent revision no later than the given date</td>
  93. <td>No</td>
  94. </tr>
  95. <tr>
  96. <td>quiet</td>
  97. <td>suppress informational messages. This is the same as <code>-q</code> on the command
  98. line.</td>
  99. <td>No; defaults to <q>false</q></td>
  100. </tr>
  101. <tr>
  102. <td>reallyquiet</td>
  103. <td>suppress all messages. This is the same as
  104. <code>-Q</code> on the command line. <em>since Ant 1.6</em>.</td>
  105. <td>No; defaults to <q>false</q></td>
  106. </tr>
  107. <tr>
  108. <td>noexec</td>
  109. <td>report only, don't change any files.</td>
  110. <td>No; defaults to <q>false</q></td>
  111. </tr>
  112. <tr>
  113. <td>output</td>
  114. <td>the file to direct standard output from the command.</td>
  115. <td>No; default is output to the log as <code>MSG_INFO</code></td>
  116. </tr>
  117. <tr>
  118. <td>error</td>
  119. <td>the file to direct standard error from the command.</td>
  120. <td>No; default is error to the log as <code>MSG_WARN</code></td>
  121. </tr>
  122. <tr>
  123. <td>append</td>
  124. <td>whether to append output/error when redirecting to a file.</td>
  125. <td>No; defaults to <q>false</q></td>
  126. </tr>
  127. <tr>
  128. <td>port</td>
  129. <td>Port used by CVS to communicate with the server.</td>
  130. <td>No; default is <q>2401</q></td>
  131. </tr>
  132. <tr>
  133. <td>passfile</td>
  134. <td>Password file to read passwords from.</td>
  135. <td>No; default is <q>~/.cvspass</q></td>
  136. </tr>
  137. <tr>
  138. <td>failonerror</td>
  139. <td>Stop the build process if the command exits with a return code other
  140. than <code>0</code>.</td>
  141. <td>No; defaults to <q>false</q></td>
  142. </tr>
  143. </table>
  144. <h3>Parameters specified as nested elements</h3>
  145. <h4>module</h4>
  146. <p>Specifies a package/module to work on, unlike the package attribute modules specified using this
  147. attribute can contain spaces in their name.</p>
  148. <table class="attr">
  149. <tr>
  150. <th>Attribute</th>
  151. <th>Description</th>
  152. <th>Required</th>
  153. </tr>
  154. <tr>
  155. <td>name</td>
  156. <td>The module's/package's name.</td>
  157. <td>Yes</td>
  158. </tr>
  159. </table>
  160. <h3>Examples</h3>
  161. <pre>
  162. &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
  163. package=&quot;ant&quot;
  164. dest=&quot;${ws.dir}&quot;/&gt;</pre>
  165. <p>checks out the package/module <samp>ant</samp> from the CVS repository pointed to by
  166. the <var>cvsRoot</var> attribute, and stores the files in <samp>${ws.dir}</samp>.</p>
  167. <pre>&lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
  168. <p>updates the package/module that has previously been checked out into <samp>${ws.dir}</samp>.</p>
  169. <pre>&lt;cvs command=&quot;-q diff -u -N&quot; output=&quot;patch.txt&quot;/&gt;</pre>
  170. <p>silently (<code>-q</code>) creates a file called <samp>patch.txt</samp> which contains a unified
  171. (<code>-u</code>) diff which includes new files added via <code>cvs add</code> (<code>-N</code>) and
  172. can be used as input to <code>patch</code>. The equivalent, using <code>&lt;commandline&gt;</code>
  173. elements, is:</p>
  174. <pre>
  175. &lt;cvs output=&quot;patch&quot;&gt;
  176. &lt;commandline&gt;
  177. &lt;argument value=&quot;-q&quot;/&gt;
  178. &lt;argument value=&quot;diff&quot;/&gt;
  179. &lt;argument value=&quot;-u&quot;/&gt;
  180. &lt;argument value=&quot;-N&quot;/&gt;
  181. &lt;/commandline&gt;
  182. &lt;/cvs&gt;</pre>
  183. <p>or:</p>
  184. <pre>
  185. &lt;cvs output=&quot;patch&quot;&gt;
  186. &lt;commandline&gt;
  187. &lt;argument line=&quot;-q diff -u -N&quot;/&gt;
  188. &lt;/commandline&gt;
  189. &lt;/cvs&gt;</pre>
  190. <p>You may include as many <code>&lt;commandline&gt;</code> elements as you like. Each will inherit
  191. the <var>failonerror</var>, <var>compression</var>, and other &quot;global&quot; parameters from
  192. the <code>&lt;cvs&gt;</code> element.</p>
  193. <pre> &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
  194. <p>Updates from the head of repository ignoring sticky bits (<code>-A</code>) and creating any new
  195. directories as necessary (<code>-d</code>).</p>
  196. <p>Note: the text of the command is passed to <code>cvs</code> &quot;as-is&quot; so any cvs options
  197. should appear before the command, and any command options should appear after the command as in the
  198. diff example above. See <a href="http://cvsbook.red-bean.com/cvsbook.html" target="_top">the CVS
  199. book</a> for details, specifically
  200. the <a href="http://cvsbook.red-bean.com/cvsbook.html#Commands%20And%20Options" target="_top">Guide
  201. to CVS commands</a></p>
  202. </body>
  203. </html>