本文整理汇总了Java中org.tmatesoft.svn.core.ISVNLogEntryHandler类的典型用法代码示例。如果您正苦于以下问题:Java ISVNLogEntryHandler类的具体用法?Java ISVNLogEntryHandler怎么用?Java ISVNLogEntryHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISVNLogEntryHandler类属于org.tmatesoft.svn.core包,在下文中一共展示了ISVNLogEntryHandler类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: logFileSystem
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
/********************************
* 작성일 : 2016. 7. 13. 작성자 : KYJ
*
*
* @param path
* @param startRevision
* @param endDate
* @param exceptionHandler
* @return
********************************/
public List<SVNLogEntry> logFileSystem(File[] path, long startRevision, Date endDate, Consumer<Exception> exceptionHandler) {
SVNLogClient logClient = getSvnManager().getLogClient();
List<SVNLogEntry> result = new ArrayList<>();
try {
ISVNLogEntryHandler handler = logEntry -> {
LOGGER.debug("path :: {} rivision :: {} date :: {} author :: {} message :: {} ", path, logEntry.getRevision(),
logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
result.add(logEntry);
};
doLog(path, startRevision, endDate, logClient, handler);
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
if (exceptionHandler != null)
exceptionHandler.accept(e);
}
return result;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:31,代码来源:SVNLog.java
示例2: loadRevisions
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
private void loadRevisions(final SVNRevision fromIncluding, final SVNRevision toIncluding, final String author, final int maxCount,
final List<CommittedChangeList> result,
final boolean includingYoungest, final boolean includeOldest) throws SVNException {
SVNLogClient logger = myVcs.createLogClient();
logger.doLog(myRepositoryRoot, new String[]{myRelative}, SVNRevision.UNDEFINED, fromIncluding, toIncluding, true, true, maxCount,
new ISVNLogEntryHandler() {
public void handleLogEntry(SVNLogEntry logEntry) {
if (myProject.isDisposed()) throw new ProcessCanceledException();
final ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText2(SvnBundle.message("progress.text2.processing.revision", logEntry.getRevision()));
progress.checkCanceled();
}
if ((! includingYoungest) && (logEntry.getRevision() == fromIncluding.getNumber())) {
return;
}
if ((! includeOldest) && (logEntry.getRevision() == toIncluding.getNumber())) {
return;
}
if (author == null || author.equalsIgnoreCase(logEntry.getAuthor())) {
result.add(new SvnChangeList(myVcs, myLocation, logEntry, myRepositoryRoot.toString()));
}
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:SvnLogUtil.java
示例3: retrieveRevisions
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@Cacheable("svnRevisions")
public Revisions retrieveRevisions(ScmConnectionSettings connectionSettings, int numberOfCommits) throws SVNException {
log.info("Retrieve revisions on last {} commits for {}", numberOfCommits, connectionSettings);
final SVNRepository repository = SvnRepositoryFactory.create(connectionSettings);
final Multimap<String, SvnFileRevision> revisions = ArrayListMultimap.create();
repository.log(null, repository.getLatestRevision(), 0L, true, true, numberOfCommits, new ISVNLogEntryHandler() {
@Override
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
log.debug("Process revision {}", logEntry.getRevision());
for (SVNLogEntryPath logEntryPath : logEntry.getChangedPaths().values()) {
if (logEntryPath.getCopyPath() != null) {
revisions.put(logEntryPath.getPath(), new SvnFileRevision(logEntry.getRevision(), logEntryPath.getCopyPath(), logEntryPath.getPath()));
} else {
revisions.put(logEntryPath.getPath(), new SvnFileRevision(logEntry.getRevision(), logEntryPath.getPath(), logEntryPath.getPath()));
}
}
}
});
log.info("Found {} changes for last {} commits with connection {}", revisions.values().size(), numberOfCommits, connectionSettings);
return new Revisions(revisions);
}
开发者ID:CodeQInvest,项目名称:codeq-invest,代码行数:29,代码来源:DefaultSvnRevisionsRetriever.java
示例4: log
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
public List<SVNLogEntry> log(String path, long startRevision, Date endDate, Consumer<Exception> exceptionHandler) {
SVNLogClient logClient = getSvnManager().getLogClient();
List<SVNLogEntry> result = new ArrayList<>();
try {
ISVNLogEntryHandler handler = logEntry -> {
// System.out.println(logEntry.getChangedPaths());
LOGGER.debug("path :: {} rivision :: {} date :: {} author :: {} message :: {} ", path, logEntry.getRevision(),
logEntry.getDate(), logEntry.getAuthor(), logEntry.getMessage());
// LOGGER.debug("rivision :: " + logEntry.getRevision());
// LOGGER.debug("date :: " + logEntry.getDate());
// LOGGER.debug("author :: " + logEntry.getAuthor());
// LOGGER.debug("message :: " + logEntry.getMessage());
// LOGGER.debug("properties :: " + logEntry.getRevisionProperties());
result.add(logEntry);
};
logServer(path, startRevision, endDate, logClient, handler);
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
if (exceptionHandler != null)
exceptionHandler.accept(e);
}
return result;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:29,代码来源:SVNLog.java
示例5: doLog
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
private void doLog(File[] path, long startRevision, Date endDate, SVNLogClient logClient, ISVNLogEntryHandler handler)
throws SVNException {
/*
* * @param paths
* an array of Working Copy paths, should not be <span
* class="javakeyword">null</span>
* @param pegRevision
* a revision in which <code>path</code> is first looked up in
* the repository
* @param startRevision
* a revision for an operation to start from (including this
* revision)
* @param endRevision
* a revision for an operation to stop at (including this
* revision)
* @param stopOnCopy
* <span class="javakeyword">true</span> not to cross copies
* while traversing history, otherwise copies history will be
* also included into processing
* @param discoverChangedPaths
* <span class="javakeyword">true</span> to report of all changed
* paths for every revision being processed (those paths will be
* available by calling
* {@link org.tmatesoft.svn.core.SVNLogEntry#getChangedPaths()})
* @param limit
* a maximum number of log entries to be processed
* @param handler
* a caller's log entry handler
* @throws SVNException
* if one of the following is true:
* <ul>
* <li>a path is not under version control <li>can not obtain a
* URL of a WC path - there's no such entry in the Working Copy
* <li><code>paths</code> contain entries that belong to
* different repositories
*/
logClient.doLog(path, SVNRevision.HEAD, SVNRevision.create(startRevision), SVNRevision.create(endDate), true, false, 1000L,
handler);
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:41,代码来源:SVNLog.java
示例6: changelog
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
public static void changelog( SVNClientManager clientManager, SVNURL svnUrl, SVNRevision startRevision,
SVNRevision endRevision, boolean stopOnCopy, boolean reportPaths,
ISVNLogEntryHandler handler )
throws SVNException
{
SVNLogClient logClient = clientManager.getLogClient();
logClient.doLog( svnUrl, null, startRevision, startRevision, endRevision, stopOnCopy, reportPaths,
MAX_LOG_ENTRIES, handler );
}
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:11,代码来源:SvnJavaUtil.java
示例7: log
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
public List<ChangeInfo> log(final String path, final long limit, final LogEntryFilter logEntryFilter, final boolean stopOnCopy, final long startRevision, final long endRevision) throws PageStoreAuthenticationException, PageStoreException {
return execute(new SVNAction<List<ChangeInfo>>() {
public List<ChangeInfo> perform(final BasicSVNOperations operations, final SVNRepository repository) throws SVNException, PageStoreException {
final List<ChangeInfo> entries = new LinkedList<ChangeInfo>();
// Start and end reversed to get newest changes first.
SVNRepository repos = getSVNReposForRevision(_repository, endRevision);
try {
final String[] rootPath = {repos.getRepositoryPath("")};
repos.log(new String[] { path }, endRevision, startRevision, true, stopOnCopy, limit, new ISVNLogEntryHandler() {
public void handleLogEntry(final SVNLogEntry logEntry) throws SVNException {
// Has the wiki root been renamed? If so then follow the rename.
if (logEntry.getChangedPaths().containsKey(rootPath[0])) {
SVNLogEntryPath changedPath = (SVNLogEntryPath) logEntry.getChangedPaths().get(rootPath[0]);
if (changedPath.getCopyPath() != null) {
rootPath[0] = changedPath.getCopyPath();
}
}
entries.addAll(logEntryToChangeInfos(rootPath[0], path, logEntry, logEntryFilter));
}
});
return entries;
}
finally {
repos.closeSession();
}
}
});
}
开发者ID:CoreFiling,项目名称:reviki,代码行数:29,代码来源:RepositoryBasicSVNOperations.java
示例8: logServer
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
private void logServer(String path, long startRevision, Date endDate, SVNLogClient logClient, ISVNLogEntryHandler handler)
throws SVNException {
logClient.doLog(getSvnURL(), new String[] { path }, SVNRevision.create(startRevision), SVNRevision.create(endDate),
SVNRevision.HEAD, true, false, 1000L, handler);
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:6,代码来源:SVNLog.java
示例9: log
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
void log(SVNRepository repository, SVNURL url, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision stopRevision,
boolean stopOnCopy, boolean discoverChangedPaths, long limit, boolean includeMergedRevisions,
ISVNLogEntryHandler isvnLogEntryHandler);
开发者ID:nemerosa,项目名称:ontrack,代码行数:4,代码来源:SVNClient.java
示例10: loadRevisions
import org.tmatesoft.svn.core.ISVNLogEntryHandler; //导入依赖的package包/类
@Nullable
public static SvnChangeList loadRevisions(final Project project, final SvnFileRevision svnRevision, @Nullable final VirtualFile file, boolean underProgress) {
final Ref<SvnChangeList> result = new Ref<SvnChangeList>();
final SvnRevisionNumber number = ((SvnRevisionNumber)svnRevision.getRevisionNumber());
final SVNRevision targetRevision = ((SvnRevisionNumber)svnRevision.getRevisionNumber()).getRevision();
final SvnVcs vcs = SvnVcs.getInstance(project);
try {
final Exception[] ex = new Exception[1];
final String url = svnRevision.getURL();
final SVNLogEntry[] logEntry = new SVNLogEntry[1];
final SvnRepositoryLocation location = new SvnRepositoryLocation(url);
final SVNLogClient client = vcs.createLogClient();
final SVNURL repositoryUrl;
if ((file != null) && file.isInLocalFileSystem()) {
final SvnFileUrlMapping urlMapping = vcs.getSvnFileUrlMapping();
final RootUrlInfo wcRoot = urlMapping.getWcRootForFilePath(new File(file.getPath()));
if (wcRoot == null) {
return null;
}
repositoryUrl = wcRoot.getRepositoryUrlUrl();
} else {
final SVNInfo svnInfo = vcs.createWCClient().doInfo(SVNURL.parseURIEncoded(url), SVNRevision.HEAD, SVNRevision.HEAD);
repositoryUrl = svnInfo.getRepositoryRootURL();
if (repositoryUrl == null) {
Messages.showErrorDialog(SvnBundle.message("message.text.cannot.load.version", number, "Cannot get repository url"),
SvnBundle.message("message.title.error.fetching.affected.paths"));
return null;
}
}
final Runnable process = new Runnable() {
public void run() {
try {
ProgressManager.getInstance().getProgressIndicator().setText(SvnBundle.message("progress.text.loading.log"));
client.doLog(repositoryUrl, null, targetRevision, targetRevision, targetRevision, false, true, 0, new ISVNLogEntryHandler() {
public void handleLogEntry(final SVNLogEntry currentLogEntry) throws SVNException {
logEntry[0] = currentLogEntry;
}
});
if (logEntry[0] == null) {
throw new VcsException(SvnBundle.message("exception.text.cannot.load.version", number));
}
ProgressManager.getInstance().getProgressIndicator().setText(SvnBundle.message("progress.text.processing.changes"));
result.set(new SvnChangeList(vcs, location, logEntry[0], repositoryUrl.toString()));
}
catch (Exception e) {
ex[0] = e;
}
}
};
if (underProgress) {
ProgressManager.getInstance().runProcessWithProgressSynchronously(process, getTitle(targetRevision.getNumber()), false, project);
} else {
process.run();
}
if (ex[0] != null) throw ex[0];
}
catch (Exception e1) {
final BufferExposingByteArrayOutputStream baos = new BufferExposingByteArrayOutputStream();
e1.printStackTrace(new PrintStream(baos));
LOG.info("For url: " + svnRevision.getURL() + "Exception: " + new String(baos.getInternalBuffer(), 0, baos.size()));
Messages.showErrorDialog(SvnBundle.message("message.text.cannot.load.version", number, e1.getLocalizedMessage()),
SvnBundle.message("message.title.error.fetching.affected.paths"));
return null;
}
return result.get();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:75,代码来源:ShowAllSubmittedFilesAction.java
注:本文中的org.tmatesoft.svn.core.ISVNLogEntryHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论