use of org.tmatesoft.svn.core.io.SVNRepository in project Gargoyle by callakrsos.
the class SVNList method listEntry.
/**
* 메타정보를 포함하는 리소스 탐색.
* 데이터를 바로 처리하기위한 handler 처리 .
* @작성자 : KYJ
* @작성일 : 2017. 1. 3.
* @param relativePath
* 탐색할 상대경로
* @param handler
* @throws Exception
*/
public void listEntry(String relativePath, ScmDirHandler<SVNDirEntry> handler) throws Exception {
try {
SVNRepository repository = getRepository();
SVNURL location = repository.getLocation();
List<SVNDirEntry> list = new ArrayList<>();
/*
* @param path a directory path
* @param revision a revision number
* @param includeCommitMessages if <span class="javakeyword">true</span> then
* dir entries (<b>SVNDirEntry</b> objects) will be supplied
* with commit log messages, otherwise not
* @param entries a collection that receives fetched dir entries
*/
repository.getDir(relativePath, /* relativePath */
-1, true, list);
Iterator<SVNDirEntry> iterator = list.iterator();
while (iterator.hasNext()) {
SVNDirEntry entry = iterator.next();
/*
* @param protocol a protocol component
* @param userInfo a user info component
* @param host a host component
* @param port a port number
* @param path a path component
* @param uriEncoded <span class="javakeyword">true</span> if
*/
/*
* 2016-12-14
* VisualSVN과의 호환성을 위해 상대경로를 만드는 URL로직을 추가한다.
* Root경로를 확인하려면
*
* SVNDirEntry클래스의 .getRepositoryRoot()를 확인해보면된다.
* by kyj.
*/
SVNURL url = SVNURL.create(location.getProtocol(), location.getUserInfo(), location.getHost(), location.getPort(), getJavaSVNManager().relativePath(entry.getURL()), true);
if (entry.getKind() == SVNNodeKind.DIR) {
if (handler.test(entry)) {
handler.accept(entry);
//만들어진 상대경로
listEntry(url.getPath(), handler);
}
} else {
//만들어진 상대경로
entry = new SVNDirEntry(url, entry.getRepositoryRoot(), entry.getName(), entry.getKind(), entry.getSize(), entry.hasProperties(), entry.getRevision(), entry.getDate(), entry.getAuthor(), entry.getCommitMessage());
handler.accept(entry);
}
}
// if (parseLong != -1)
// resultList.addAll(list.stream().filter(v -> parseLong <= v.getRevision()).collect(Collectors.toList()));
// else
// resultList.addAll(list);
// return resultList;
} catch (SVNException e) {
throw e;
}
}
use of org.tmatesoft.svn.core.io.SVNRepository in project Gargoyle by callakrsos.
the class SVNLog method getAllLogs.
public Collection<SVNLogEntry> getAllLogs(String relativePath, long startRevision, long endRevision) throws SVNException {
SVNRepository repository = getRepository();
@SuppressWarnings("unchecked") Collection<SVNLogEntry> logEntries = repository.log(new String[] { relativePath }, null, startRevision, endRevision, true, true);
return logEntries;
}
use of org.tmatesoft.svn.core.io.SVNRepository in project intellij-community by JetBrains.
the class PrimitivePool method createRepository.
@Override
public SVNRepository createRepository(SVNURL url, boolean mayReuse) throws SVNException {
final SVNRepository repos = SVNRepositoryFactory.create(url, this);
repos.setAuthenticationManager(myManager);
repos.setTunnelProvider(myTunnelProvider);
repos.setDebugLog(new ProxySvnLog(SVNDebugLog.getDefaultLog()));
repos.setCanceller(new SvnKitProgressCanceller());
return repos;
}
use of org.tmatesoft.svn.core.io.SVNRepository in project intellij-community by JetBrains.
the class SvnKitManager method createRepository.
@NotNull
public SVNRepository createRepository(@NotNull SVNURL url) throws SVNException {
SVNRepository repository = SVNRepositoryFactory.create(url);
repository.setAuthenticationManager(getAuthenticationManager());
repository.setTunnelProvider(getSvnOptions());
return repository;
}
use of org.tmatesoft.svn.core.io.SVNRepository in project sling by apache.
the class SvnChangeLogFinder method getChanges.
public List<String> getChanges(String first, String second) throws SVNException {
SVNURL svnUrl = SVNURL.parseURIEncoded(SLING_SVN_REPO_BASE);
List<String> changes = new ArrayList<>();
SVNClientManager manager = SVNClientManager.newInstance();
SVNRepository repo = manager.getRepositoryPool().createRepository(svnUrl, true);
SVNRevision from = SVNRevision.create(getRevision(first, repo));
SVNRevision to = SVNRevision.create(getRevision(second, repo));
repo.log(new String[] { "tags/" + second }, from.getNumber(), to.getNumber(), false, false, (e) -> changes.add(e.getMessage()));
return changes;
}
Aggregations