本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNLogClient类的典型用法代码示例。如果您正苦于以下问题:Java SVNLogClient类的具体用法?Java SVNLogClient怎么用?Java SVNLogClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNLogClient类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNLogClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logFileSystem
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的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;
}
示例2: annotate
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@Override
public void annotate(@NotNull SvnTarget target,
@NotNull SVNRevision startRevision,
@NotNull SVNRevision endRevision,
boolean includeMergedRevisions,
@Nullable DiffOptions diffOptions,
@Nullable AnnotationConsumer handler) throws VcsException {
try {
SVNLogClient client = myVcs.getSvnKitManager().createLogClient();
client.setDiffOptions(toDiffOptions(diffOptions));
if (target.isFile()) {
client
.doAnnotate(target.getFile(), target.getPegRevision(), startRevision, endRevision, true, includeMergedRevisions,
toAnnotateHandler(handler), null);
}
else {
client
.doAnnotate(target.getURL(), target.getPegRevision(), startRevision, endRevision, true, includeMergedRevisions,
toAnnotateHandler(handler), null);
}
}
catch (SVNException e) {
throw new VcsException(e);
}
}
示例3: list
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@Override
public void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
@Nullable Depth depth,
@Nullable DirectoryEntryConsumer handler) throws VcsException {
assertUrl(target);
SVNLogClient client = getLogClient();
ISVNDirEntryHandler wrappedHandler = wrapHandler(handler);
client.setIgnoreExternals(true);
try {
if (target.isFile()) {
client.doList(target.getFile(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
}
else {
client.doList(target.getURL(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
}
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
示例4: doLog
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@Override
public void doLog(@NotNull SvnTarget target,
@NotNull SVNRevision startRevision,
@NotNull SVNRevision endRevision,
boolean stopOnCopy,
boolean discoverChangedPaths,
boolean includeMergedRevisions,
long limit,
@Nullable String[] revisionProperties,
@Nullable LogEntryConsumer handler) throws VcsException {
try {
SVNLogClient client = myVcs.getSvnKitManager().createLogClient();
if (target.isFile()) {
client.doLog(new File[]{target.getFile()}, startRevision, endRevision, target.getPegRevision(), stopOnCopy, discoverChangedPaths,
includeMergedRevisions, limit, revisionProperties, toHandler(handler));
}
else {
client.doLog(target.getURL(), ArrayUtil.EMPTY_STRING_ARRAY, target.getPegRevision(), startRevision, endRevision, stopOnCopy,
discoverChangedPaths, includeMergedRevisions, limit, revisionProperties, toHandler(handler));
}
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
示例5: blame
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
private static void blame(SVNClientManager clientManager, InputFile inputFile, BlameOutput output) {
String filename = inputFile.relativePath();
LOG.debug("Process file {}", filename);
AnnotationHandler handler = new AnnotationHandler();
try {
if (!checkStatus(clientManager, inputFile)) {
return;
}
SVNLogClient logClient = clientManager.getLogClient();
logClient.setDiffOptions(new SVNDiffOptions(true, true, true));
logClient.doAnnotate(inputFile.file(), SVNRevision.UNDEFINED, SVNRevision.create(1), SVNRevision.BASE, true, true, handler, null);
} catch (SVNException e) {
throw new IllegalStateException("Error when executing blame for file " + filename, e);
}
List<BlameLine> lines = handler.getLines();
if (lines.size() == inputFile.lines() - 1) {
// SONARPLUGINS-3097 SVN do not report blame on last empty line
lines.add(lines.get(lines.size() - 1));
}
output.blameResult(inputFile, lines);
}
示例6: getCommits
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@Override
public List<Commit> getCommits() {
System.out.println("Getting commit log...");
ISVNAuthenticationManager authManager = SVNWCUtil
.createDefaultAuthenticationManager("guest", "");
svn_client.setAuthenticationManager(authManager);
SVNLogClient log_client = svn_client.getLogClient();
try {
log_client.doLog(SVN_url, new String[] { "" },
SVNRevision.UNDEFINED, revision_range.getStartRevision(),
revision_range.getEndRevision(), false, true, 0,
log_handler);
} catch (SVNException e) {
e.printStackTrace();
}
return log_handler.getCommits();
}
示例7: getChildrenAsChanges
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@NotNull
private Collection<Change> getChildrenAsChanges(final String path, final boolean isBefore, final Set<Pair<Boolean, String>> duplicateControl)
throws SVNException {
final List<Change> result = new ArrayList<Change>();
final SVNLogClient client = myVcs.createLogClient();
final long revision = getRevision(isBefore);
client.doList(myRepository.getLocation().appendPath(path, true), SVNRevision.create(revision), SVNRevision.create(revision),
true, new ISVNDirEntryHandler() {
public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException {
final String childPath = path + '/' + dirEntry.getRelativePath();
if (! duplicateControl.contains(new Pair<Boolean, String>(isBefore, childPath))) {
final ContentRevision contentRevision = createRevision(childPath, isBefore, SVNNodeKind.DIR.equals(dirEntry.getKind()));
result.add(new Change(isBefore ? contentRevision : null, isBefore ? null : contentRevision));
}
}
});
return result;
}
示例8: loadRevisions
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的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()));
}
}
});
}
示例9: getLatestVersion
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@Override
public String getLatestVersion() throws StoreException {
return getSvnCore().doWithClientAndRepository(new SvnPersisterCore.SvnOperation<String>() {
@Override
public String execute(final SVNRepository repo, final SVNClientManager clientManager) throws Exception {
final String[] targetPaths = {};
final SVNRevision svnRevision = SVNRevision.HEAD;
final SVNLogClient logClient = clientManager.getLogClient();
final FilterableSVNLogEntryHandler handler = new FilterableSVNLogEntryHandler();
// In order to get history is "descending" order, the startRevision should be the one closer to HEAD
logClient.doLog(svnUrl, targetPaths, /* pegRevision */ SVNRevision.HEAD, svnRevision, SVNRevision.create(1),
/* stopOnCopy */ false, /* discoverChangedPaths */ false, /* includeMergedRevisions */ false,
/* limit */ 1,
new String[]{SVNRevisionProperty.LOG}, handler);
final SVNLogEntry entry = handler.getLogEntries().size() > 0 ? handler.getLogEntries().get(0) : null;
return entry == null ? "-1" : String.valueOf(entry.getRevision());
}
@Override
public StoreException handleException(final Exception e) throws StoreException {
throw new StoreException.ReadException("Unable to get latest revision", e);
}
});
}
示例10: getMostRecentLogEntry
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
/**
* Returns the most recent log entry startRevision.
* startRevision should not be HEAD because the path @HEAD could be deleted.
*
* @param path
* @param startRevision
* @return
* @throws SVNException
*/
private SVNLogEntry getMostRecentLogEntry(final SVNClientManager clientManager, final String path, final SVNRevision startRevision) throws SVNException {
final String[] targetPaths = {path};
final SVNLogClient logClient = clientManager.getLogClient();
final FilterableSVNLogEntryHandler handler = new FilterableSVNLogEntryHandler();
final int limit = 1;
// In order to get history is "descending" order, the startRevision should be the one closer to HEAD
// The [email protected] could be deleted - must use 'pegRevision' to get history at a deleted path
logClient.doLog(svnUrl, targetPaths,
/* pegRevision */ startRevision,
/* startRevision */ startRevision,
/* endRevision */ SVNRevision.create(1),
/* stopOnCopy */ false,
/* discoverChangedPaths */ false,
/* includeMergedRevisions */ false,
limit,
new String[]{SVNRevisionProperty.AUTHOR}, handler);
if (handler.getLogEntries().isEmpty()) {
return null;
} else {
return handler.getLogEntries().get(0);
}
}
示例11: log
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的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;
}
示例12: doLog
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的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);
}
示例13: getLogClient
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@NotNull
private SVNLogClient getLogClient() {
ISVNAuthenticationManager authManager = myIsActive
? myVcs.getSvnConfiguration().getInteractiveManager(myVcs)
: myVcs.getSvnConfiguration().getPassiveAuthenticationManager(myVcs.getProject());
return myVcs.getSvnKitManager().createLogClient(authManager);
}
示例14: changelog
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的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 );
}
示例15: getLastTag
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
public static String getLastTag(String urlSvn, String username, String password) throws SVNException
{
final List<Tag> tags = new ArrayList<Tag>();
//SVNClientManager svnClientManager = SVNClientManager.newInstance();
// SVNRepository svnRepository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(
// urlSvn));
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(username, password);
//svnRepository.setAuthenticationManager(authManager);
SVNClientManager ourClientManager = SVNClientManager.newInstance();
ourClientManager.setAuthenticationManager(authManager);
SVNLogClient svnLogClient = ourClientManager.getLogClient();
svnLogClient.doList(SVNURL.parseURIEncoded(urlSvn), SVNRevision.HEAD,
SVNRevision.HEAD,
false,
SVNDepth.IMMEDIATES,
SVNDirEntry.DIRENT_ALL,
new ISVNDirEntryHandler()
{
private Logger logger = Logger.getLogger("fabriccontroller");
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException
{
if (dirEntry.getRelativePath() == null || dirEntry.getRelativePath().equals(""))
return;
logger.info("tag: " +
dirEntry.getRelativePath() + " - " + dirEntry.getDate() + " - " +
dirEntry.getRevision());
tags.add(new Tag(dirEntry.getRelativePath(), dirEntry.getDate(),
dirEntry.getRevision(), dirEntry.getName()));
}
});
Collections.sort(tags, new Tag.TagComparator());
return tags.get(0).getName();
}