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

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