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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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 <kbd>cvs</kbd> binary on the path. If it isn't, you
  27. will get an error (such as <code>error=2</code> on Windows). If <code>&lt;cvs&gt;</code> doesn't
  28. work, try to execute <kbd>cvs.exe</kbd> from the command line in the target directory in which you
  29. are working. Also note that this task assumes that the <kbd>cvs</kbd> executable is compatible with
  30. the Unix 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" target="_top">bugzilla
  36. report 21657</a> 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 <kbd>-z#</kbd> 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 <kbd>-d</kbd> 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 <kbd>-q</kbd> 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 <kbd>-Q</kbd> on the command line. <em>since
  104. 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 than <q>0</q>.</td>
  140. <td>No; defaults to <q>false</q></td>
  141. </tr>
  142. </table>
  143. <h3>Parameters specified as nested elements</h3>
  144. <h4>module</h4>
  145. <p>Specifies a package/module to work on, unlike the package attribute modules specified using this
  146. attribute can contain spaces in their name.</p>
  147. <table class="attr">
  148. <tr>
  149. <th>Attribute</th>
  150. <th>Description</th>
  151. <th>Required</th>
  152. </tr>
  153. <tr>
  154. <td>name</td>
  155. <td>The module's/package's name.</td>
  156. <td>Yes</td>
  157. </tr>
  158. </table>
  159. <h3>Examples</h3>
  160. <pre>
  161. &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
  162. package=&quot;ant&quot;
  163. dest=&quot;${ws.dir}&quot;/&gt;</pre>
  164. <p>checks out the package/module <samp>ant</samp> from the CVS repository pointed to by
  165. the <var>cvsRoot</var> attribute, and stores the files in <samp>${ws.dir}</samp>.</p>
  166. <pre>&lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
  167. <p>updates the package/module that has previously been checked out into <samp>${ws.dir}</samp>.</p>
  168. <pre>&lt;cvs command=&quot;-q diff -u -N&quot; output=&quot;patch.txt&quot;/&gt;</pre>
  169. <p>silently (<kbd>-q</kbd>) creates a file called <samp>patch.txt</samp> which contains a unified
  170. (<kbd>-u</kbd>) diff which includes new files added via <kbd>cvs add</kbd> (<kbd>-N</kbd>) and
  171. can be used as input to <kbd>patch</kbd>. The equivalent, using <code>&lt;commandline&gt;</code>
  172. elements, is:</p>
  173. <pre>
  174. &lt;cvs output=&quot;patch&quot;&gt;
  175. &lt;commandline&gt;
  176. &lt;argument value=&quot;-q&quot;/&gt;
  177. &lt;argument value=&quot;diff&quot;/&gt;
  178. &lt;argument value=&quot;-u&quot;/&gt;
  179. &lt;argument value=&quot;-N&quot;/&gt;
  180. &lt;/commandline&gt;
  181. &lt;/cvs&gt;</pre>
  182. <p>or:</p>
  183. <pre>
  184. &lt;cvs output=&quot;patch&quot;&gt;
  185. &lt;commandline&gt;
  186. &lt;argument line=&quot;-q diff -u -N&quot;/&gt;
  187. &lt;/commandline&gt;
  188. &lt;/cvs&gt;</pre>
  189. <p>You may include as many <code>&lt;commandline&gt;</code> elements as you like. Each will inherit
  190. the <var>failonerror</var>, <var>compression</var>, and other &quot;global&quot; parameters from
  191. the <code>&lt;cvs&gt;</code> element.</p>
  192. <pre> &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
  193. <p>Updates from the head of repository ignoring sticky bits (<kbd>-A</kbd>) and creating any new
  194. directories as necessary (<kbd>-d</kbd>).</p>
  195. <p>Note: the text of the command is passed to <kbd>cvs</kbd> &quot;as-is&quot; so any cvs options
  196. should appear before the command, and any command options should appear after the command as in the
  197. diff example above. See <a href="http://cvsbook.red-bean.com/cvsbook.html" target="_top">the CVS
  198. book</a> for details, specifically
  199. the <a href="http://cvsbook.red-bean.com/cvsbook.html#Commands%20And%20Options" target="_top">Guide
  200. to CVS commands</a></p>
  201. </body>
  202. </html>