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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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">dryrun</td>
  52. <td valign="top">report only, don't change any files.</td>
  53. <td align="center" valign="top">No, default to &quot;false&quot;</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">output</td>
  57. <td valign="top">the file to direct standard output from the command.</td>
  58. <td align="center" valign="top">No, default output to ANT Log as <code>MSG_INFO</code>.</td>
  59. </tr>
  60. <tr>
  61. <td valign="top">error</td>
  62. <td valign="top">the file to direct standard error from the command.</td>
  63. <td align="center" valign="top">No, default error to ANT Log as <code>MSG_WARN</code>.</td>
  64. </tr>
  65. <tr>
  66. <td valign="top">append</td>
  67. <td valign="top">whether to append output/error when redirecting to a file.</td>
  68. <td align="center" valign="top">No, default to &quot;false&quot;.</td>
  69. </tr>
  70. <tr>
  71. <td valign="top">failonerror</td>
  72. <td valign="top">Stop the build process if the command exits with a
  73. return code other than <code>0</code>. Defaults to &quot;false&quot;</td>
  74. <td align="center" valign="top">No</td>
  75. </tr>
  76. </table>
  77. <h3>Examples</h3>
  78. <pre> &lt;svn svnURL=&quot;http://svn.apache.org/repos/asf/httpd/httpd/trunk/&quot;
  79. dest=&quot;${ws.dir}&quot;
  80. /&gt;</pre>
  81. <p>checks out the URL
  82. &quot;http://svn.apache.org/repos/asf/httpd/httpd/trunk/&quot; and
  83. stores the files in &quot;<code>${ws.dir}</code>&quot;.</p>
  84. <pre> &lt;svn dest=&quot;${ws.dir}&quot; command=&quot;update&quot;/&gt;</pre>
  85. <p>updates the working copy that has previously been checked out into
  86. &quot;<code>${ws.dir}</code>&quot;.</p>
  87. <pre> &lt;svn command=&quot;-q diff&quot; output=&quot;patch.txt&quot;/&gt;</pre>
  88. <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.
  89. The equivalent, using <code>&lt;commandline&gt;</code> elements, is:
  90. </p>
  91. <pre>
  92. &lt;svn output=&quot;patch&quot;&gt;
  93. &lt;commandline&gt;
  94. &lt;argument value=&quot;-q&quot;/&gt;
  95. &lt;argument value=&quot;diff&quot;/&gt;
  96. &lt;/commandline&gt;
  97. &lt;/svn&gt;
  98. </pre>
  99. or:
  100. <pre>
  101. &lt;svn output=&quot;patch&quot;&gt;
  102. &lt;commandline&gt;
  103. &lt;argument line=&quot;-q diff -u -N&quot;/&gt;
  104. &lt;/commandline&gt;
  105. &lt;/svn&gt;
  106. </pre>
  107. <p>
  108. You may include as many <code>&lt;commandline&gt;</code> elements as you like.
  109. Each will inherit the <code>failonerror</code> and other &quot;global&quot; parameters
  110. from the <code>&lt;svn&gt;</code> element.
  111. </p>
  112. <pre> &lt;svn command=&quot;update&quot;/&gt;</pre>
  113. <p>Updates from the head of repository creating any new directories as necessary.</p>
  114. <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,
  115. 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>
  116. <hr>
  117. <p align="center">Copyright &copy; 2005 The Apache Software
  118. Foundation. All rights Reserved.</p>
  119. </body>
  120. </html>