0

有人可以告诉我如何找出 svn 标签的分支吗?如果有任何工作代码可以让我获得某些标签的分支,那会很棒吗?谢谢。

到目前为止,我使用此命令行命令在控制台上查看它

svn log -v -l 2 "标签路径"

4

1 回答 1

1

解决。

ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {
                @Override
                public void handleLogEntry(SVNLogEntry arg0) throws     SVNException {
                    Map<String, SVNLogEntryPath> map = arg0.getChangedPaths();
                    for (Map.Entry<String, SVNLogEntryPath> entry: map.entrySet()) {
                        SVNLogEntryPath svnLogEntryPath = entry.getValue();
                         System.out.println(Calendar.getInstance().getTime());
                        System.out.println("Path : " + svnLogEntryPath.getPath());
                        System.out.println("Kind : " + svnLogEntryPath.getKind());
                        System.out.println("Type : " + svnLogEntryPath.getType());
                        System.out.println("Copy Path : " + svnLogEntryPath.getCopyPath()); // gives the tag's branch
                        System.out.println("Branch : " + svnLogEntryPath.getCopyPath().substring(svnLogEntryPath.getCopyPath().lastIndexOf('/')+1)); // gives the tag's branch
                        System.out.println("Copy Revision : " + svnLogEntryPath.getCopyRevision());

                        System.out.println("------------------------");
                    }   
                }
            }; 
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(userName, password);

boolean readonly = true;
            ISVNOptions options = SVNWCUtil.createDefaultOptions(readonly);

            // Get log client
            SVNLogClient logClient = new SVNLogClient(authManager, options);

String[] paths = { pathToTag};

logClient.doLog(svnurl, paths, SVNRevision.HEAD, startRevision, SVNRevision.HEAD, true, true, 2, handler);
于 2013-05-22T04:46:23.993 回答