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 9.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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><a name="cvs">Cvs</a></h2>
  23. <h3>Description</h3>
  24. <p>Handles packages/modules retrieved from a
  25. <a href="http://www.nongnu.org/cvs/" target="_top">CVS</a> repository.</p>
  26. <p><b>Important:</b> This task needs &quot;<code>cvs</code>&quot; on the path. If it isn't, you will get
  27. 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>
  28. from the command line in the target directory in which you are working.
  29. Also note that this task assumes that the cvs exceutable is compatible
  30. with the Unix version from cvshome.org, this is not completely true
  31. for certain other cvs clients - like CVSNT for example - and some
  32. operation may fail when using such an incompatible client.
  33. </p>
  34. <p><b>CVSNT Note</b>: CVSNT prefers users to store the passwords
  35. inside the registry. If the <a href="cvspass.html">cvspass task</a>
  36. and the passfile attribute don't seem to work for you, the most likely
  37. reason is that CVSNT ignores your .cvspass file completely. See <a
  38. href="http://issues.apache.org/bugzilla/show_bug.cgi?id=21657#c5">bugzilla
  39. report 21657</a> for recommended workarounds.</p>
  40. <h3>Parameters</h3>
  41. <table border="1" cellpadding="2" cellspacing="0">
  42. <tr>
  43. <td valign="top"><b>Attribute</b></td>
  44. <td valign="top"><b>Description</b></td>
  45. <td align="center" valign="top"><b>Required</b></td>
  46. </tr>
  47. <tr>
  48. <td valign="top">command</td>
  49. <td valign="top">the CVS command to execute.</td>
  50. <td align="center" valign="top">No, default &quot;checkout&quot;.</td>
  51. </tr>
  52. <tr>
  53. <td valign="top">compression</td>
  54. <td valign="top"><code>true</code> or <code>false</code> - if set
  55. to true, this is the same as <code>compressionlevel=&quot;3&quot;</code></td>
  56. <td align="center" valign="top">No. Defaults to false.</td>
  57. </tr>
  58. <tr>
  59. <td valign="top">compressionlevel</td>
  60. <td valign="top">A number between 1 and 9 (corresponding to
  61. possible values for CVS' <code>-z#</code> argument). Any
  62. other value is treated as <code>compression=&quot;false&quot;</code></td>
  63. <td align="center" valign="top">No. Defaults to no compression.</td>
  64. </tr>
  65. <tr>
  66. <td valign="top">cvsRoot</td>
  67. <td valign="top">the <code>CVSROOT</code> variable.</td>
  68. <td align="center" valign="top">No</td>
  69. </tr>
  70. <tr>
  71. <td valign="top">cvsRsh</td>
  72. <td valign="top">the <code>CVS_RSH</code> variable.</td>
  73. <td align="center" valign="top">No</td>
  74. </tr>
  75. <tr>
  76. <td valign="top">dest</td>
  77. <td valign="top">the directory where the checked out files should
  78. be placed. Note that this is different from CVS's <code>-d</code> command line
  79. switch as Ant will never shorten pathnames to avoid empty
  80. directories.</td>
  81. <td align="center" valign="top">No, default is project's basedir.</td>
  82. </tr>
  83. <tr>
  84. <td valign="top">package</td>
  85. <td valign="top">the package/module to check out. <b>Note:</b>
  86. multiple attributes can be split using spaces. Use a nested
  87. &lt;module&gt; element if you want to specify a module with
  88. spaces in its name.</td>
  89. <td align="center" valign="top">No</td>
  90. </tr>
  91. <tr>
  92. <td valign="top">tag</td>
  93. <td valign="top">the tag of the package/module to check out.</td>
  94. <td align="center" valign="top">No</td>
  95. </tr>
  96. <tr>
  97. <td valign="top">date</td>
  98. <td valign="top">Use the most recent revision no later than the given date</td>
  99. <td align="center" valign="top">No</td>
  100. </tr>
  101. <tr>
  102. <td valign="top">quiet</td>
  103. <td valign="top">suppress informational messages. This is the same as <code>-q</code> on the command line.</td>
  104. <td align="center" valign="top">No, default &quot;false&quot;</td>
  105. </tr>
  106. <tr>
  107. <td valign="top">reallyquiet</td>
  108. <td valign="top">suppress all messages. This is the same as
  109. <code>-Q</code> on the command line. <em>since Ant 1.6</em>.</td>
  110. <td align="center" valign="top">No, default &quot;false&quot;</td>
  111. </tr>
  112. <tr>
  113. <td valign="top">noexec</td>
  114. <td valign="top">report only, don't change any files.</td>
  115. <td align="center" valign="top">No, default to &quot;false&quot;</td>
  116. </tr>
  117. <tr>
  118. <td valign="top">output</td>
  119. <td valign="top">the file to direct standard output from the command.</td>
  120. <td align="center" valign="top">No, default output to ANT Log as <code>MSG_INFO</code>.</td>
  121. </tr>
  122. <tr>
  123. <td valign="top">error</td>
  124. <td valign="top">the file to direct standard error from the command.</td>
  125. <td align="center" valign="top">No, default error to ANT Log as <code>MSG_WARN</code>.</td>
  126. </tr>
  127. <tr>
  128. <td valign="top">append</td>
  129. <td valign="top">whether to append output/error when redirecting to a file.</td>
  130. <td align="center" valign="top">No, default to &quot;false&quot;.</td>
  131. </tr>
  132. <tr>
  133. <td valign="top">port</td>
  134. <td valign="top">Port used by CVS to communicate with the server.</td>
  135. <td align="center" valign="top">No, default port <code>2401</code>.</td>
  136. </tr>
  137. <tr>
  138. <td valign="top">passfile</td>
  139. <td valign="top">Password file to read passwords from.</td>
  140. <td align="center" valign="top">No, default file <code>~/.cvspass</code>.</td>
  141. </tr>
  142. <tr>
  143. <td valign="top">failonerror</td>
  144. <td valign="top">Stop the build process if the command exits with a
  145. return code other than <code>0</code>. Defaults to &quot;false&quot;</td>
  146. <td align="center" valign="top">No</td>
  147. </tr>
  148. </table>
  149. <h3>Parameters specified as nested elements</h3>
  150. <h4>module</h4>
  151. <p>Specifies a package/module to work on, unlike the package attribute
  152. modules specified using this attribute can contain spaces in their
  153. name.</p>
  154. <table border="1" cellpadding="2" cellspacing="0">
  155. <tr>
  156. <td valign="top"><b>Attribute</b></td>
  157. <td valign="top"><b>Description</b></td>
  158. <td align="center" valign="top"><b>Required</b></td>
  159. </tr>
  160. <tr>
  161. <td valign="top">name</td>
  162. <td valign="top">The module's/package's name.</td>
  163. <td align="center" valign="top">Yes.</td>
  164. </tr>
  165. </table>
  166. <h3>Examples</h3>
  167. <pre> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
  168. package=&quot;ant&quot;
  169. dest=&quot;${ws.dir}&quot;
  170. /&gt;</pre>
  171. <p>checks out the package/module &quot;ant&quot; from the CVS
  172. repository pointed to by the <code>cvsRoot</code> attribute, and stores the files in &quot;<code>${ws.dir}</code>&quot;.</p>
  173. <pre> &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
  174. <p>updates the package/module that has previously been checked out into
  175. &quot;<code>${ws.dir}</code>&quot;.</p>
  176. <pre> &lt;cvs command=&quot;-q diff -u -N&quot; output=&quot;patch.txt&quot;/&gt;</pre>
  177. <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.
  178. The equivalent, using <code>&lt;commandline&gt;</code> elements, is:
  179. </p>
  180. <pre>
  181. &lt;cvs output=&quot;patch&quot;&gt;
  182. &lt;commandline&gt;
  183. &lt;argument value=&quot;-q&quot;/&gt;
  184. &lt;argument value=&quot;diff&quot;/&gt;
  185. &lt;argument value=&quot;-u&quot;/&gt;
  186. &lt;argument value=&quot;-N&quot;/&gt;
  187. &lt;/commandline&gt;
  188. &lt;/cvs&gt;
  189. </pre>
  190. or:
  191. <pre>
  192. &lt;cvs output=&quot;patch&quot;&gt;
  193. &lt;commandline&gt;
  194. &lt;argument line=&quot;-q diff -u -N&quot;/&gt;
  195. &lt;/commandline&gt;
  196. &lt;/cvs&gt;
  197. </pre>
  198. <p>
  199. You may include as many <code>&lt;commandline&gt;</code> elements as you like.
  200. Each will inherit the <code>failonerror</code>, <code>compression</code>, and other &quot;global&quot; parameters
  201. from the <code>&lt;cvs&gt;</code> element.
  202. </p>
  203. <pre> &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
  204. <p>Updates from the head of repository ignoring sticky bits (<code>-A</code>) and creating any new directories as necessary (<code>-d</code>).</p>
  205. <p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any cvs options should appear
  206. before the command, and any command options should appear after the command as in the diff example
  207. above. See <a href="http://ximbiot.com/cvs/wiki/index.php?title=Category:User_Documentation" target="_top">the cvs manual</a> for details,
  208. specifically the <a href="http://ximbiot.com/cvs/wiki/index.php?title=CVS--Concurrent_Versions_System_v1.12.12.1:_Guide_to_CVS_commands#SEC116" target="_top">Guide to CVS commands</a></p>
  209. </body>
  210. </html>