本文整理汇总了Java中org.jetbrains.idea.svn.SvnUtil类的典型用法代码示例。如果您正苦于以下问题:Java SvnUtil类的具体用法?Java SvnUtil怎么用?Java SvnUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SvnUtil类属于org.jetbrains.idea.svn包,在下文中一共展示了SvnUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateInfo
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Override
protected void updateInfo(Attributes attributes, SvnInfoStructure structure) throws SAXException {
final String kind = attributes.getValue("kind");
assertSAX(! StringUtil.isEmptyOrSpaces(kind));
structure.myKind = NodeKind.from(kind);
if (myBase != null) {
final String path = attributes.getValue("path");
assertSAX(!StringUtil.isEmptyOrSpaces(path));
structure.myFile = SvnUtil.resolvePath(myBase, path);
}
final String revision = attributes.getValue("revision");
assertSAX(! StringUtil.isEmptyOrSpaces(revision));
try {
final long number = Long.parseLong(revision);
structure.myRevision = number;
} catch (NumberFormatException e) {
structure.myRevision = -1;
//throw new SAXException(e);
}
}
示例2: checkPath
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
public SvnMergeInfoCache.MergeCheckResult checkPath(@NotNull String repositoryRelativePath, long revisionNumber) {
String sourceRelativePath =
SVNPathUtil.getRelativePath(myMergeContext.getRepositoryRelativeSourcePath(), SvnUtil.ensureStartSlash(repositoryRelativePath));
SvnMergeInfoCache.MergeCheckResult result;
if (sourceRelativePath == null) {
// TODO: SVNPathUtil.getRelativePath() is @NotNull - probably we need to check also isEmpty() here?
result = SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
}
else {
InfoProcessor processor = new InfoProcessor(sourceRelativePath, myMergeContext.getRepositoryRelativeSourcePath(), revisionNumber);
synchronized (myMergeInfoLock) {
myMergeInfoMap.getSimiliar(toKey(sourceRelativePath), processor);
}
result = SvnMergeInfoCache.MergeCheckResult.getInstance(processor.isMerged());
}
return result;
}
示例3: parseForPath
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private File parseForPath(@NotNull String line) {
File result = null;
int start = line.indexOf('\'');
if (start != -1) {
int end = line.indexOf('\'', start + 1);
if (end != -1) {
String path = line.substring(start + 1, end);
result = SvnUtil.resolvePath(myBase, path);
}
}
return result;
}
示例4: cleanup
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private void cleanup(@NotNull CommandExecutor executor, @NotNull File workingDirectory) throws SvnBindException {
if (executor.getCommandName().isWriteable()) {
File wcRoot = SvnUtil.getWorkingCopyRootNew(workingDirectory);
// not all commands require cleanup - for instance, some commands operate only with repository - like "svn info <url>"
// TODO: check if we could "configure" commands (or make command to explicitly ask) if cleanup is required - not to search
// TODO: working copy root each time
if (wcRoot != null) {
Command cleanupCommand = new Command(SvnCommandName.cleanup);
cleanupCommand.setWorkingDirectory(wcRoot);
newExecutor(cleanupCommand).run();
} else {
LOG.info("Could not execute cleanup for command " + executor.getCommandText());
}
}
}
示例5: serializeUrl
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private static String serializeUrl(final String url, final Ref<Boolean> withUserInfo) {
if (Boolean.FALSE.equals(withUserInfo.get())) {
return url;
}
try {
final SVNURL svnurl = SVNURL.parseURIEncoded(url);
if (withUserInfo.isNull()) {
final String userInfo = svnurl.getUserInfo();
withUserInfo.set((userInfo != null) && (userInfo.length() > 0));
}
if (withUserInfo.get()) {
return SVNURL.create(svnurl.getProtocol(), null, svnurl.getHost(), SvnUtil.resolvePort(svnurl), svnurl.getURIEncodedPath(), true)
.toString();
}
}
catch (SVNException e) {
//
}
return url;
}
示例6: openDialog
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private static SelectLocationDialog openDialog(Project project,
String url,
String dstLabel,
String dstName,
boolean showFiles,
boolean allowActions,
String errorMessage) {
try {
SVNURL svnUrl = SvnUtil.createUrl(url);
final SVNURL repositoryUrl = initRoot(project, svnUrl);
if (repositoryUrl == null) {
Messages.showErrorDialog(project, "Can not detect repository root for URL: " + url,
SvnBundle.message("dialog.title.select.repository.location"));
return null;
}
SelectLocationDialog dialog = new SelectLocationDialog(project, repositoryUrl, dstLabel, dstName, showFiles, allowActions);
dialog.show();
return dialog;
}
catch (SvnBindException e) {
Messages.showErrorDialog(project, errorMessage != null ? errorMessage : e.getMessage(),
SvnBundle.message("dialog.title.select.repository.location"));
return null;
}
}
示例7: initRoot
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private static SVNURL initRoot(final Project project, final SVNURL url) throws SvnBindException {
final Ref<SVNURL> result = new Ref<SVNURL>();
final Ref<SvnBindException> excRef = new Ref<SvnBindException>();
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
public void run() {
try {
result.set(SvnUtil.getRepositoryRoot(SvnVcs.getInstance(project), url));
} catch (SvnBindException e) {
excRef.set(e);
}
}
}, "Detecting repository root", true, project);
if (! excRef.isNull()) {
throw excRef.get();
}
return result.get();
}
示例8: refreshChangeListsFindConflicts
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private void refreshChangeListsFindConflicts(final UpdatedFiles updatedFiles) {
UpdateFilesHelper.iterateFileGroupFiles(updatedFiles,
new UpdateFilesHelper.Callback() {
public void onFile(final String filePath, final String groupId) {
final VirtualFile vf = SvnUtil.getVirtualFile(filePath);
if (vf != null) {
// refresh base directory so that conflict files should be detected
// file itself is already refreshed
vf.getParent().refresh(false, false);
myDirtyScopeManager.fileDirty(vf);
}
if (FileGroup.MERGED_WITH_CONFLICT_ID.equals(groupId)) {
myConflictedVirtualFiles.add(vf);
}
}
});
}
示例9: createInfo
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private WCInfoWithBranches createInfo(@NotNull WCInfo info) {
if (!info.getFormat().supportsMergeInfo()) {
return null;
}
final String url = info.getUrl().toString();
if (myLocation != null && !myLocation.toPresentableString().startsWith(url) && !url.startsWith(myLocation.toPresentableString())) {
return null;
}
if (!SvnUtil.checkRepositoryVersion15(myVcs, url)) {
return null;
}
// check of WC version
RootUrlInfo rootForUrl = myVcs.getSvnFileUrlMapping().getWcRootForUrl(url);
return rootForUrl != null ? createInfoWithBranches(info, rootForUrl) : null;
}
示例10: handleEvent
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void handleEvent(SVNEvent event, double p) {
final String path = SvnUtil.getPathForProgress(event);
if (path == null) {
return;
}
if (event.getAction() == SVNEventAction.COMMIT_ADDED) {
myProgress.setText2(SvnBundle.message("progress.text2.adding", path));
}
else if (event.getAction() == SVNEventAction.COMMIT_DELETED) {
myProgress.setText2(SvnBundle.message("progress.text2.deleting", path));
}
else if (event.getAction() == SVNEventAction.COMMIT_MODIFIED) {
myProgress.setText2(SvnBundle.message("progress.text2.sending", path));
}
else if (event.getAction() == SVNEventAction.COMMIT_REPLACED) {
myProgress.setText2(SvnBundle.message("progress.text2.replacing", path));
}
else if (event.getAction() == SVNEventAction.COMMIT_DELTA_SENT) {
myProgress.setText2(SvnBundle.message("progress.text2.transmitting.delta", path));
}
}
示例11: run
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Override
public void run(ContinuationContext context) {
try {
final List<TaskDescriptor> tasks = new LinkedList<TaskDescriptor>();
final boolean supportsMergeinfo = myWcInfo.getFormat().supportsMergeInfo() &&
SvnUtil.doesRepositorySupportMergeInfo(myVcs, SVNURL.parseURIEncoded(mySourceUrl));
if (! supportsMergeinfo) {
insertMergeAll(tasks);
} else {
tasks.add(new MergeAllOrSelectedChooser());
}
context.next(tasks);
}
catch (SVNException e) {
finishWithError(context, e.getMessage(), true);
}
}
示例12: checkForOutsideCopies
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void checkForOutsideCopies() {
boolean canceled = false;
for (Iterator<WCInfo> iterator = myWcInfos.iterator(); iterator.hasNext();) {
final WCInfo wcInfo = iterator.next();
if (! wcInfo.isIsWcRoot()) {
File path = new File(wcInfo.getPath());
path = SvnUtil.getWorkingCopyRoot(path);
int result = Messages.showYesNoCancelDialog(SvnBundle.message("upgrade.format.clarify.for.outside.copies.text", path),
SvnBundle.message("action.change.wcopy.format.task.title"),
Messages.getWarningIcon());
if (DialogWrapper.CANCEL_EXIT_CODE == result) {
canceled = true;
break;
} else if (DialogWrapper.OK_EXIT_CODE != result) {
// no - for this copy only. maybe other
iterator.remove();
}
}
}
if (canceled) {
myWcInfos.clear();
}
}
示例13: SvnRepositoryContentRevision
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
SvnRepositoryContentRevision(final SvnVcs vcs, final String repositoryRoot, final String path, @Nullable final FilePath localPath,
final long revision) {
myVcs = vcs;
myPath = path;
myRepositoryRoot = repositoryRoot;
if (localPath != null) {
myFilePath = localPath;
}
else {
FilePath local;
try {
final String fullPath = SvnUtil.appendMultiParts(repositoryRoot, myPath);
local = VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(fullPath, false);
}
catch (SVNException e) {
// todo what to do safely?
local = VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(repositoryRoot, false);
}
myFilePath = local;
}
myRevision = revision;
}
示例14: run
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
final SVNWCClient client = myVcs.createWCClient();
final String url = myLocation.getURL();
final SVNURL root;
try {
root = SvnUtil.getRepositoryRoot(myVcs, SVNURL.parseURIEncoded(url), true);
if (root == null) {
myException = new VcsException("Can not determine repository root for URL: " + url);
return;
}
client.doSetRevisionProperty(root, SVNRevision.create(myNumber), "svn:log",
SVNPropertyValue.create(myNewMessage), false, null);
}
catch (SVNException e) {
myException = new VcsException(e);
}
}
示例15: statusFor
import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
public FileStatus statusFor(@NotNull SvnVcs svn, @NotNull Project project, @NotNull VirtualFile vFile) {
File currentFile = VfsUtilCore.virtualToIoFile(vFile);
SVNURL fileUrl = SvnUtil.getUrl(svn, currentFile);
if (fileUrl != null) {
Info info = svn.getInfo(vFile);
if (info != null) {
SvnConfiguration svnConfig = SvnConfiguration.getInstance(project);
Optional<FileStatus> status;
if (svnConfig.isCommandLine()) {
status = statusForCli(project, fileUrl, currentFile);
} else {
status = statusForSvnKit(info, svn, fileUrl, currentFile);
}
if (status.isPresent()) {
return status.get();
}
} else {
return new FileStatus(fileUrl);
}
}
return FileStatus.EMPTY;
}