【发布时间】:2014-07-31 14:59:26
【问题描述】:
有没有办法在不查看整个输出的情况下从 ant 运行 svn status 命令? 我目前正在使用以下内容:
<svn><status path="." revisionProperty="build.number" /></svn>
底线,我正试图悄悄地获取 svn 修订号,但由于某种原因我不能使用“信息”标签(我得到“svn 不支持嵌套信息元素”)。
【问题讨论】:
有没有办法在不查看整个输出的情况下从 ant 运行 svn status 命令? 我目前正在使用以下内容:
<svn><status path="." revisionProperty="build.number" /></svn>
底线,我正试图悄悄地获取 svn 修订号,但由于某种原因我不能使用“信息”标签(我得到“svn 不支持嵌套信息元素”)。
【问题讨论】:
我认为您正在寻找wcVersion ant 任务:
<!-- Install the SVN Tasks -->
<path id="svnant.classpath">
<fileset dir="${svnant.dir}">
<include name="*.jar" />
</fileset>
</path>
<!-- Retrieve info about the Working Copy's SVN Repo -->
<svn>
<wcVersion path="${workingcopy.dir}" />
</svn>
<echo>Working Copy ${workingcopy.dir} is linked to SVN Repo: ${repository.url}</echo>
【讨论】:
<svn svnkit="true">
<wcVersion path="." prefix="svn.wcv." processUnversioned="true" />
<status path="${basedir}" revisionProperty="svn.revision" textStatusProperty="svn.textStatus"
propStatusProperty="snv.propStatus" lastChangedRevisionProperty="svn.lastCommitRevision"
lastCommitAuthorProperty="svn.lastCommitAuthor" />
</svn>
为我工作
【讨论】: