本文整理汇总了Java中org.jetbrains.idea.svn.info.Info类的典型用法代码示例。如果您正苦于以下问题:Java Info类的具体用法?Java Info怎么用?Java Info使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Info类属于org.jetbrains.idea.svn.info包,在下文中一共展示了Info类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doStatus
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Override
public long doStatus(@NotNull final File path,
@Nullable final SVNRevision revision,
@NotNull final Depth depth,
boolean remote,
boolean reportAll,
boolean includeIgnored,
boolean collectParentExternals,
@NotNull final StatusConsumer handler,
@Nullable final Collection changeLists) throws SvnBindException {
File base = CommandUtil.requireExistingParent(path);
final Info infoBase = myFactory.createInfoClient().doInfo(base, revision);
List<String> parameters = new ArrayList<String>();
putParameters(parameters, path, depth, remote, reportAll, includeIgnored, changeLists);
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.st, parameters, null);
parseResult(path, revision, handler, base, infoBase, command);
return 0;
}
示例2: revertFileOrDir
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private void revertFileOrDir(@NotNull FilePath filePath) throws SVNException, VcsException {
File file = filePath.getIOFile();
Info info = mySvnVcs.getInfo(file);
if (info != null) {
if (info.isFile()) {
doRevert(file, false);
}
else if (Info.SCHEDULE_ADD.equals(info.getSchedule()) || is17OrGreaterCopy(file, info)) {
doRevert(file, true);
}
else {
// do update to restore missing directory.
mySvnVcs.getSvnKitManager().createUpdateClient().doUpdate(file, SVNRevision.HEAD, true);
}
}
else {
throw new VcsException("Can not get 'svn info' for " + file.getPath());
}
}
示例3: get
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Nullable
@Override
public Repository get() {
Repository result;
if (myTarget.isURL()) {
// TODO: Also could still execute info when target is url - either to use info for authentication or to just get correct repository
// TODO: url in case of "read" operations are allowed anonymously.
result = new Repository(myTarget.getURL());
}
else {
Info info = myVcs.getInfo(myTarget.getFile());
result = info != null ? new Repository(info.getRepositoryRootURL()) : null;
}
return result;
}
示例4: createInfoHandler
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@NotNull
private static InfoConsumer createInfoHandler(@NotNull final Map<VirtualFile, VcsRevisionNumber> revisionMap,
@NotNull final Map<String, VirtualFile> fileMap) {
return new InfoConsumer() {
@Override
public void consume(Info info) throws SVNException {
if (info != null) {
VirtualFile file = fileMap.get(info.getFile().getAbsolutePath());
if (file != null) {
revisionMap.put(file, getRevision(info));
}
else {
LOG.info("Could not find virtual file for path " + info.getFile().getAbsolutePath());
}
}
}
};
}
示例5: getCurrentRevisionDescription
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Nullable
private VcsRevisionDescription getCurrentRevisionDescription(@NotNull File path) {
final Info svnInfo = myVcs.getInfo(path);
if (svnInfo == null) {
return null;
}
if (svnInfo.getCommittedRevision().equals(SVNRevision.UNDEFINED) &&
!svnInfo.getCopyFromRevision().equals(SVNRevision.UNDEFINED) &&
svnInfo.getCopyFromURL() != null) {
String localPath = myVcs.getSvnFileUrlMapping().getLocalPath(svnInfo.getCopyFromURL().toString());
if (localPath != null) {
return getCurrentRevisionDescription(new File(localPath));
}
}
return new VcsRevisionDescriptionImpl(new SvnRevisionNumber(svnInfo.getCommittedRevision()), svnInfo.getCommittedDate(),
svnInfo.getAuthor(), getCommitMessage(path, svnInfo));
}
示例6: getCommitMessage
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Nullable
private String getCommitMessage(@NotNull File path, @NotNull Info info) {
String result;
try {
PropertyValue property =
myVcs.getFactory(path).createPropertyClient()
.getProperty(SvnTarget.fromFile(path), COMMIT_MESSAGE, true, info.getCommittedRevision());
result = PropertyValue.toString(property);
}
catch (VcsException e) {
LOG.info("Failed to get commit message for file " + path + ", " + info.getCommittedRevision() + ", " + info.getRevision(), e);
result = "";
}
return result;
}
示例7: getLastRevision
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@NotNull
private ItemLatestState getLastRevision(@NotNull File file) {
Status svnStatus = getFileStatus(file, true);
if (svnStatus == null || itemExists(svnStatus) && SVNRevision.UNDEFINED.equals(svnStatus.getRemoteRevision())) {
// IDEADEV-21785 (no idea why this can happen)
final Info info = myVcs.getInfo(file, SVNRevision.HEAD);
if (info == null || info.getURL() == null) {
LOG.info("No SVN status returned for " + file.getPath());
return defaultResult();
}
return createResult(info.getCommittedRevision(), true, false);
}
if (!itemExists(svnStatus)) {
return createResult(getLastExistingRevision(file, svnStatus), false, false);
}
return createResult(ObjectUtils.notNull(svnStatus.getRemoteRevision(), svnStatus.getRevision()), true, false);
}
示例8: checkAncestry
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SvnBindException {
final Info sourceSvnInfo = myVcs.getInfo(sourceFile);
final Info targetSvnInfo = myVcs.getInfo(targetUrl, targetRevision);
if (sourceSvnInfo == null || targetSvnInfo == null) {
// cannot check
return true;
}
final SVNURL copyFromTarget = targetSvnInfo.getCopyFromURL();
final SVNURL copyFromSource = sourceSvnInfo.getCopyFromURL();
if ((copyFromSource != null) || (copyFromTarget != null)) {
if (sourceSvnInfo.getURL().equals(copyFromTarget) || targetUrl.equals(copyFromSource)) {
return true;
}
}
final int result = Messages.showYesNoDialog(myVcs.getProject(), SvnBundle.message("switch.target.not.copy.current"),
SvnBundle.message("switch.target.problem.title"), Messages.getWarningIcon());
return (Messages.YES == result);
}
示例9: checkAlive
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@NotNull
private SvnMergeInfoCache.MergeCheckResult checkAlive(@NotNull SvnChangeList list, @NotNull String branchPath) {
final Info info = myVcs.getInfo(new File(branchPath));
if (info == null || info.getURL() == null || !SVNPathUtil.isAncestor(myBranch.getUrl(), info.getURL().toString())) {
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
final String subPathUnderBranch = SVNPathUtil.getRelativePath(myBranch.getUrl(), info.getURL().toString());
MultiMap<SvnMergeInfoCache.MergeCheckResult, String> result = checkPaths(list, branchPath, subPathUnderBranch);
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS)) {
return SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
if (result.containsKey(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED)) {
myPartlyMerged.put(list.getNumber(), result.get(SvnMergeInfoCache.MergeCheckResult.NOT_MERGED));
return SvnMergeInfoCache.MergeCheckResult.NOT_MERGED;
}
return SvnMergeInfoCache.MergeCheckResult.MERGED;
}
示例10: init
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
protected void init() {
super.init();
SvnVcs vcs = SvnVcs.getInstance(myProject);
String revStr = "";
Info info = vcs.getInfo(mySrcFile);
if (info != null) {
mySrcURL = info.getURL() == null ? null : info.getURL().toString();
revStr = String.valueOf(info.getRevision());
myURL = mySrcURL;
}
if (myURL == null) {
return;
}
myWorkingCopyField.setText(mySrcFile.toString());
myRepositoryField.setText(mySrcURL);
myToURLText.setText(myURL);
myRevisionPanel.setRevisionText(revStr);
updateControls();
myWorkingCopyRadioButton.setSelected(true);
}
示例11: resolveRevisionNumber
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private SVNRevision resolveRevisionNumber(@NotNull File path, @Nullable SVNRevision revision) throws VcsException {
long result = revision != null ? revision.getNumber() : -1;
// base should be resolved manually - could not set revision to BASE to get revision property
if (SVNRevision.BASE.equals(revision)) {
Info info = myVcs.getInfo(path, SVNRevision.BASE);
result = info != null ? info.getRevision().getNumber() : -1;
}
if (result == -1) {
throw new VcsException("Could not determine revision number for file " + path + " and revision " + revision);
}
return SVNRevision.create(result);
}
示例12: list
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
@Override
public void list(@NotNull SvnTarget target,
@Nullable SVNRevision revision,
@Nullable Depth depth,
@Nullable DirectoryEntryConsumer handler) throws VcsException {
assertUrl(target);
List<String> parameters = new ArrayList<String>();
CommandUtil.put(parameters, target);
CommandUtil.put(parameters, revision);
CommandUtil.put(parameters, depth);
parameters.add("--xml");
CommandExecutor command = execute(myVcs, target, SvnCommandName.list, parameters, null);
Info info = myFactory.createInfoClient().doInfo(target, revision);
try {
parseOutput(target.getURL(), command, handler, info != null ? info.getRepositoryRootURL() : null);
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}
示例13: existsInRevision
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private boolean existsInRevision(@NotNull SVNURL url, long revisionNumber) throws SvnBindException {
SVNRevision revision = SVNRevision.create(revisionNumber);
Info info = null;
try {
info = myVcs.getInfo(url, revision, revision);
}
catch (SvnBindException e) {
// throw error if not "does not exist" error code
if (!e.contains(SVNErrorCode.RA_ILLEGAL_URL)) {
throw e;
}
}
return info != null;
}
示例14: doRemoteDetails
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private void doRemoteDetails() throws SVNException, SvnBindException {
for (Pair<Integer, Boolean> idxData : myWithoutDirStatus) {
final Change sourceChange = myDetailedList.get(idxData.first.intValue());
final SvnRepositoryContentRevision revision = (SvnRepositoryContentRevision)
(idxData.second.booleanValue() ? sourceChange.getBeforeRevision() : sourceChange.getAfterRevision());
if (revision == null) {
continue;
}
// TODO: Logic with detecting "isDirectory" status is not clear enough. Why we can't just collect this info from logEntry and
// TODO: if loading from disk - use cached values? Not to invoke separate call here.
SVNRevision beforeRevision = SVNRevision.create(getRevision(idxData.second.booleanValue()));
Info info = myVcs.getInfo(SvnUtil.createUrl(revision.getFullPath()), beforeRevision, beforeRevision);
boolean isDirectory = info != null && info.isDirectory();
Change replacingChange = new Change(createRevision((SvnRepositoryContentRevision)sourceChange.getBeforeRevision(), isDirectory),
createRevision((SvnRepositoryContentRevision)sourceChange.getAfterRevision(), isDirectory));
replacingChange.setIsReplaced(sourceChange.isIsReplaced());
myDetailedList.set(idxData.first.intValue(), replacingChange);
}
myWithoutDirStatus.clear();
}
示例15: loadBackwards
import org.jetbrains.idea.svn.info.Info; //导入依赖的package包/类
private void loadBackwards(SVNURL svnurl) throws SVNException, VcsException {
// this method is called when svnurl does not exist in latest repository revision - thus concrete old revision is used for "info"
// command to get repository url
Info info = myVcs.getInfo(svnurl, myPeg, myPeg);
final SVNURL rootURL = info != null ? info.getRepositoryRootURL() : null;
final String root = rootURL != null ? rootURL.toString() : "";
String relativeUrl = myUrl;
if (myUrl.startsWith(root)) {
relativeUrl = myUrl.substring(root.length());
}
final RepositoryLogEntryHandler repositoryLogEntryHandler =
new RepositoryLogEntryHandler(myVcs, myUrl, SVNRevision.UNDEFINED, relativeUrl,
new ThrowableConsumer<VcsFileRevision, SVNException>() {
@Override
public void consume(VcsFileRevision revision) throws SVNException {
myConsumer.consume(revision);
}
}, rootURL);
repositoryLogEntryHandler.setThrowCancelOnMeetPathCreation(true);
SvnTarget target = SvnTarget.fromURL(rootURL, myFrom);
myVcs.getFactory(target).createHistoryClient()
.doLog(target, myFrom, myTo == null ? SVNRevision.create(1) : myTo, false, true, myShowMergeSources && mySupport15, 1, null,
repositoryLogEntryHandler);
}