如何获得最后SVN的用户名提交使用蚂蚁? [英] How to get the username of the last svn commit using ant?

查看:131
本文介绍了如何获得最后SVN的用户名提交使用蚂蚁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用蚂蚁来获得最新的用户名提交一个svn存储库中。

I would like to use Ant to get the username of the latest commit of a svn repository.

我怎么能做到这一点作为跨平台尽可能?

how can i do this as cross-platform as possible?

谢谢!

推荐答案

所以,这里是榜样svnant

So, here is example for "svnant":

<path id="devlibs.path">
    <fileset dir="devlib" includes="**/*.jar" />
</path>

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="devlibs.path" />

<svnSetting
        id="svn.settings"
        svnkit="false"
        javahl="false"
        username="${svn.username}"
        password="${svn.password}" />

<target name="get-svn-author">
    <svn refid="svn.settings">
        <singleinfo target="${svn.repo.url}" property="author.result" request="author" />
    </svn>

    <echo message="Author of last commit: ${author.result}" />
</target>

您应该把svnant.jar和svnClientAdapter.jar由devlibs.path确定的路径。并以javahl或svnkit你的$ {ANT_HOME} / lib目录规定的其他库。



如果你有SVN库1.6格式,您可以使用(在svnSetting - 块设置为真)svnkit。因为svnkit是一个纯Java的工具包,这是最好的时候,你需要跨平台的解决方案中使用。如果您已经切换到1.7,那么我建议使用SVN命令行客户端(svnSetting在我的示例配置为命令行客户端)。检查大约在哪里可以找到以及如何安装不同的SVN命令行客户信息这个页面(SLIK SVN)。

You should put "svnant.jar" and "svnClientAdapter.jar" to path identified by "devlibs.path". And other libraries required by "javahl" or "svnkit" to your "${ANT_HOME}/lib".

If you have SVN repository with 1.6 format, you could use "svnkit" (set to "true" in "svnSetting"-block). Because "svnkit" is a pure Java-toolkit it's best to use when you need cross-platform solution. If you already switched to 1.7, then I recommend to use SVN command line client ("svnSetting" configured for command line client in my example). Check this page (Slik SVN) for info about where to find and how to install different SVN command line clients.

这篇关于如何获得最后SVN的用户名提交使用蚂蚁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆