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.

svn.html 6.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Subversion Task</title>
  5. <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
  6. </head>
  7. <body>
  8. <h2><a name="svn">SVN</a></h2>
  9. <h3>Description</h3>
  10. <p>Handles packages/modules retrieved from a
  11. <a href="http://subversion.tigris.org/" target="_top">Subversion</a> repository.</p>
  12. <p><b>Important:</b> This task needs &quot;<code>svn</code>&quot; on the path. If it isn't, you will get
  13. an error (such as error <code>2</code> on windows). If <code>&lt;svn&gt;</code> doesn't work, try to execute <code>svn.exe</code>
  14. from the command line in the target directory in which you are working.
  15. <h3>Parameters</h3>
  16. <table border="1" cellpadding="2" cellspacing="0">
  17. <tr>
  18. <td valign="top"><b>Attribute</b></td>
  19. <td valign="top"><b>Description</b></td>
  20. <td align="center" valign="top"><b>Required</b></td>
  21. </tr>
  22. <tr>
  23. <td valign="top">subcommand</td>
  24. <td valign="top">the SVN subcommand to execute.</td>
  25. <td align="center" valign="top">No, default &quot;checkout&quot;.</td>
  26. </tr>
  27. <tr>
  28. <td valign="top">svnURL</td>
  29. <td valign="top">the URL the subcommand should apply to.</td>
  30. <td align="center" valign="top">No</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">dest</td>
  34. <td valign="top">the directory where the checked out files should
  35. be placed. Note that this is different from SVN's <code>-d</code> command line
  36. switch as Ant will never shorten pathnames to avoid empty
  37. directories.</td>
  38. <td align="center" valign="top">No, default is project's basedir.</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">revision</td>
  42. <td valign="top">the revision or date of the subcommand should apply to</td>
  43. <td align="center" valign="top">No</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">quiet</td>
  47. <td valign="top">suppress informational messages. This is the same as <code>--quiet</code> on the command line.</td>
  48. <td align="center" valign="top">No, default &quot;false&quot;</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">verbose</td>
  52. <td valign="top">Be verbose. This is the same as <code>--verbose</code> on the command line.</td>
  53. <td align="center" valign="top">No, default &quot;false&quot;</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">dryrun</td>
  57. <td valign="top">report only, don't change any files.</td>
  58. <td align="center" valign="top">No, default to &quot;false&quot;</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">file</td>
  62. <td valign="top">Uses the contents of the file passed as an
  63. argument to this switch for the specified subcommand.</td>
  64. <td align="center" valign="top">No.</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">force</td>
  68. <td valign="top">Forces a particular command or operation to run.</td>
  69. <td align="center" valign="top">No, defaults to false.</td>
  70. </tr>
  71. <tr>
  72. <td valign="top">recursive</td>
  73. <td valign="top">Makes a subcommand recurse into
  74. subdirectories. Most subcommands recurse by default.</td>
  75. <td align="center" valign="top">No.</td>
  76. </tr>
  77. <tr>
  78. <td valign="top">targets</td>
  79. <td valign="top">Tells Subversion to get the list of files that you wish to
  80. operate on from the filename you provide instead of listing all
  81. the files on the command line.</td>
  82. <td align="center" valign="top">No.</td>
  83. </tr>
  84. <tr>
  85. <td valign="top">output</td>
  86. <td valign="top">the file to direct standard output from the command.</td>
  87. <td align="center" valign="top">No, default output to ANT Log as <code>MSG_INFO</code>.</td>
  88. </tr>
  89. <tr>
  90. <td valign="top">error</td>
  91. <td valign="top">the file to direct standard error from the command.</td>
  92. <td align="center" valign="top">No, default error to ANT Log as <code>MSG_WARN</code>.</td>
  93. </tr>
  94. <tr>
  95. <td valign="top">append</td>
  96. <td valign="top">whether to append output/error when redirecting to a file.</td>
  97. <td align="center" valign="top">No, default to &quot;false&quot;.</td>
  98. </tr>
  99. <tr>
  100. <td valign="top">failonerror</td>
  101. <td valign="top">Stop the build process if the command exits with a
  102. return code other than <code>0</code>. Defaults to &quot;false&quot;</td>
  103. <td align="center" valign="top">No</td>
  104. </tr>
  105. </table>
  106. <h3>Examples</h3>
  107. <pre> &lt;svn svnURL=&quot;http://svn.apache.org/repos/asf/httpd/httpd/trunk/&quot;
  108. dest=&quot;${ws.dir}&quot;
  109. /&gt;</pre>
  110. <p>checks out the URL
  111. &quot;http://svn.apache.org/repos/asf/httpd/httpd/trunk/&quot; and
  112. stores the files in &quot;<code>${ws.dir}</code>&quot;.</p>
  113. <pre> &lt;svn dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
  114. <p>updates the working copy that has previously been checked out into
  115. &quot;<code>${ws.dir}</code>&quot;.</p>
  116. <pre> &lt;svn command=&quot;-q diff&quot; output=&quot;patch.txt&quot;/&gt;</pre>
  117. <p>silently (<code>-q</code>) creates a file called <code>patch.txt</code> which contains a unified diff which can be used as input to patch.
  118. The equivalent, using <code>&lt;commandline&gt;</code> elements, is:
  119. </p>
  120. <pre>
  121. &lt;svn output=&quot;patch&quot;&gt;
  122. &lt;commandline&gt;
  123. &lt;argument value=&quot;-q&quot;/&gt;
  124. &lt;argument value=&quot;diff&quot;/&gt;
  125. &lt;/commandline&gt;
  126. &lt;/svn&gt;
  127. </pre>
  128. or:
  129. <pre>
  130. &lt;svn output=&quot;patch&quot;&gt;
  131. &lt;commandline&gt;
  132. &lt;argument line=&quot;-q diff -u -N&quot;/&gt;
  133. &lt;/commandline&gt;
  134. &lt;/svn&gt;
  135. </pre>
  136. <p>
  137. You may include as many <code>&lt;commandline&gt;</code> elements as you like.
  138. Each will inherit the <code>failonerror</code> and other &quot;global&quot; parameters
  139. from the <code>&lt;svn&gt;</code> element.
  140. </p>
  141. <pre> &lt;svn command=&quot;update&quot;/&gt;</pre>
  142. <p>Updates from the head of repository creating any new directories as necessary.</p>
  143. <p>See <a href="http://svnbook.red-bean.com/en/1.1/ch09.html#svn-ch-9-sect-1" target="_top">Version Control with Subversion</a> for details,
  144. specifically the <a href="http://svnbook.red-bean.com/en/1.1/ch09.html#svn-ch-9-sect-1" target="_top">The Subversion Command Line Client: svn</a></p>
  145. <hr>
  146. <p align="center">Copyright &copy; 2005 The Apache Software
  147. Foundation. All rights Reserved.</p>
  148. </body>
  149. </html>