简体   繁体   English

在使用SVNKIT创建分支的主干中查找修订

[英]Find revision in trunk that a branch was created from using SVNKIT

I trying to get the revision which a branch was created from using svnkit but I don't know how to achieve that. 我试图获得使用svnkit创建的分支的修订版本,但我不知道该如何实现。 That I need is something like that the command line in this question. 我需要的就是这个问题中的命令行

If you have an example code to do this with svnkit, it will be very useful for me. 如果您有使用svnkit进行此操作的示例代码,这对我将非常有用。

thanks! 谢谢!

I FOUND THE SOLUTION 我找到了解决方案

This code fragment is posting on this site . 此代码片段已发布在此站点上 This code returns the revision which a branch was created from. 此代码返回创建分支的修订版本。

final long[] revStart = { -1 }; 

logClient.doLog(SVNURL.parseURIEncoded(
"https://svn.svnkit.com/repos/svnkit/branches/1.2.x"), 
null, SVNRevision.HEAD, SVNRevision.HEAD, SVNRevision.create(1), true, 
false, false, 0, null, new ISVNLogEntryHandler() { 
public void handleLogEntry(SVNLogEntry logEntry) throws 
    SVNException {
       System.out.println(logEntry);
       revStart[0] = logEntry.getRevision();
    }
}); 

System.out.println(revStart[0]); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM