本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNLogClient类的典型用法代码示例。如果您正苦于以下问题:Java SVNLogClient类的具体用法?Java SVNLogClient怎么用?Java SVNLogClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNLogClient类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNLogClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:31,代码来源:SVNLog.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitAnnotateClient.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnKitBrowseClient.java
示例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);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitHistoryClient.java
示例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);
}
开发者ID:SonarSource,项目名称:sonar-scm-svn,代码行数:25,代码来源:SvnBlameCommand.java
示例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();
}
开发者ID:aserg-ufmg,项目名称:ModularityCheck,代码行数:18,代码来源:SVNManager.java
示例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;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:SvnChangeList.java
示例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()));
}
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:SvnLogUtil.java
示例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);
}
});
}
开发者ID:indeedeng,项目名称:proctor,代码行数:26,代码来源:SvnProctor.java
示例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);
}
}
开发者ID:indeedeng,项目名称:proctor,代码行数:34,代码来源:SvnPersisterCoreImpl.java
示例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;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:29,代码来源:SVNLog.java
示例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);
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:41,代码来源:SVNLog.java
示例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);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SvnKitBrowseClient.java
示例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 );
}
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:11,代码来源:SvnJavaUtil.java
示例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();
}
开发者ID:csipiemonte,项目名称:yucca-fabriccontroller,代码行数:38,代码来源:UtilClass.java
示例16: action
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
@Override
public void action(SVNInfo info) {
final String us = info.getUsername();
final String pw = info.getPassword();
try {
// create a SVN client manager instance
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager cm = newInstance(options, us, pw);
// create a SVNLogClient instance
SVNLogClient client = cm.getLogClient();
// list the SVN entries
ISVNDirEntryHandler handler = new MuteSVNDirEntryHandler();
SVNURL svnUrl = SVNURL.parseURIEncoded(info.getUrl());
while (!svnUrl.getPath().endsWith(info.getProjectName())) {
svnUrl = svnUrl.removePathTail();
}
svnUrl = svnUrl.appendPath(getSvnFolder(), true);
client.doList(svnUrl, HEAD, HEAD, false, SVNDepth.UNKNOWN,
SVNDirEntry.DIRENT_TIME, handler);
} catch (SVNException e) {
throw new InvalidUserDataException(e);
}
}
开发者ID:christian-weber,项目名称:gradle-release-plugin,代码行数:34,代码来源:VerifySvnFolderReleaseAction.java
示例17: tryStepByStep
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
private FilePath tryStepByStep(final SvnRepositoryLocation svnRepositoryLocation,
final SvnChangeList[] result,
SVNLogClient logger,
final SVNRevision revisionBefore, final SVNInfo info, SVNURL svnurl) throws VcsException {
final String repositoryRoot = info.getRepositoryRootURL().toString();
try {
final RenameContext renameContext = new RenameContext(info);
logger.doLog(svnurl, null, SVNRevision.UNDEFINED, SVNRevision.HEAD, revisionBefore,
false, true, false, 0, null,
new ISVNLogEntryHandler() {
public void handleLogEntry(SVNLogEntry logEntry) {
if (myProject.isDisposed()) throw new ProcessCanceledException();
if (logEntry.getDate() == null) {
// do not add lists without info - this situation is possible for lists where there are paths that user has no rights to observe
return;
}
renameContext.accept(logEntry);
if (logEntry.getRevision() == revisionBefore.getNumber()) {
result[0] = new SvnChangeList(myVcs, svnRepositoryLocation, logEntry, repositoryRoot);
}
}
});
return renameContext.getFilePath(myVcs);
}
catch (SVNException e) {
LOG.info(e);
throw new VcsException(e);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:SvnCommittedChangesProvider.java
示例18: tryExactHit
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
private void tryExactHit(final SvnRepositoryLocation location,
final SvnChangeList[] result,
SVNLogClient logger,
SVNRevision revisionBefore,
final SVNURL repositoryUrl, SVNURL svnurl) throws VcsException {
try {
logger.doLog(svnurl, null, SVNRevision.UNDEFINED, revisionBefore, revisionBefore,
false, true, false, 1, null,
new ISVNLogEntryHandler() {
public void handleLogEntry(SVNLogEntry logEntry) {
if (myProject.isDisposed()) throw new ProcessCanceledException();
if (logEntry.getDate() == null) {
// do not add lists without info - this situation is possible for lists where there are paths that user has no rights to observe
return;
}
result[0] = new SvnChangeList(myVcs, location, logEntry, repositoryUrl.toString());
}
});
}
catch (SVNException e) {
LOG.info(e);
if (SVNErrorCode.FS_CATEGORY == e.getErrorMessage().getErrorCode().getCategory()) {
// pass to step by step looking for revision
return;
}
throw new VcsException(e);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:SvnCommittedChangesProvider.java
示例19: getSVNLogs
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
private List<Revision> getSVNLogs(final SVNClientManager clientManager,
final String[] paths,
final SVNRevision startRevision,
final int start, final int limit) throws StoreException.ReadException {
try {
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, paths, /* pegRevision */ SVNRevision.HEAD, startRevision, SVNRevision.create(1),
/* stopOnCopy */ false, /* discoverChangedPaths */ false, /* includeMergedRevisions */ false,
/* limit */ start + limit,
new String[]{SVNRevisionProperty.LOG, SVNRevisionProperty.AUTHOR, SVNRevisionProperty.DATE}, handler);
final List<SVNLogEntry> entries = handler.getLogEntries();
final List<Revision> revisions;
if (entries.size() <= start) {
revisions = Collections.emptyList();
} else {
final int end = Math.min(start + limit, entries.size());
revisions = Lists.newArrayListWithCapacity(end - start);
for (int i = 0; i < end - start; i++) {
final SVNLogEntry entry = entries.get(start + i);
revisions.add(new Revision(String.valueOf(entry.getRevision()), entry.getAuthor(), entry.getDate(), entry.getMessage()));
}
}
return revisions;
} catch (final SVNException e) {
throw new StoreException.ReadException("Unable to get older revisions");
}
}
开发者ID:indeedeng,项目名称:proctor,代码行数:35,代码来源:SvnProctor.java
示例20: showLog
import org.tmatesoft.svn.core.wc.SVNLogClient; //导入依赖的package包/类
/**
* 显示svn日志
*/
public void showLog() {
long time = System.currentTimeMillis();
String userName = svnName.getText();
String password = new String(svnPassword.getPassword());
String pathStr = path.getText();
String begin = beginDate.getText();
String end = endDate.getText();
try {
if (userName == null || userName.isEmpty()) {
throw new Exception("svn用户名不能为空!");
}
if (password.isEmpty()) {
throw new Exception("svn密码不能为空!");
}
if (pathStr == null || pathStr.isEmpty()) {
throw new Exception("项目路径不能为空!");
}
saveProperties();
DefaultSVNOptions options = new DefaultSVNOptions();
manager = SVNClientManager.newInstance(options, userName, password); //如果需要用户名密码
SVNLogClient logClient = manager.getLogClient();
detailData.clear();
logs.clear();
((DefaultTableModel) logTable.getModel()).setRowCount(0);
((DefaultTableModel) detailTable.getModel()).setRowCount(0);
sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
begin += " 00:00:00";
end += " 23:59:59";
String[] strs = pathStr.split(";");
for (String string : strs) {
File proj = new File(string);
DirEntryHandler handler = new DirEntryHandler(proj.getName()); // 在svn
logClient.doLog(new File[]{proj}, SVNRevision.UNDEFINED, SVNRevision.create(sdf.parse(begin)), SVNRevision.create(sdf.parse(end)), false, true, 1000, handler); // 列出当前svn地址的目录,对每个文件进行处理
}
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(this, ex.getLocalizedMessage());
} finally {
LOGGER.log(Level.INFO, "\u65e5\u5fd7\u52a0\u8f7d\u5b8c\u6210\uff0c\u7528\u65f6{0}\u6beb\u79d2", (System.currentTimeMillis() - time));
}
}
开发者ID:ajtdnyy,项目名称:PackagePlugin,代码行数:46,代码来源:MainFrame.java
注:本文中的org.tmatesoft.svn.core.wc.SVNLogClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论