本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNWCClient类的典型用法代码示例。如果您正苦于以下问题:Java SVNWCClient类的具体用法?Java SVNWCClient怎么用?Java SVNWCClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVNWCClient类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNWCClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
/**
* TODO: Implement correct support for includeIgnored parameter. Also check that correct depth will be used for all cases (when another
* TODO: overload of doAdd() is used) as, for instance, SVNDepth.recurseFromDepth(EMPTY) = false, SVNDepth.fromRecursive(false) = FILES.
*/
@Override
public void add(@NotNull File file,
@Nullable Depth depth,
boolean makeParents,
boolean includeIgnored,
boolean force,
@Nullable ProgressTracker handler) throws VcsException {
try {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
client.doAdd(file, force,
false, // directory should already be created
makeParents, // not used but will be passed as makeParents value
Depth.isRecursive(depth));
}
catch (SVNException e) {
throw new VcsException(e);
}
}
示例2: editFiles
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
public void editFiles(VirtualFile[] files) throws VcsException {
File[] ioFiles = new File[files.length];
SVNWCClient client = myVCS.createWCClient();
for (int i = 0; i < files.length; i++) {
ioFiles[i] = new File(files[i].getPath());
try {
SVNPropertyData property = client
.doGetProperty(ioFiles[i], SVNProperty.NEEDS_LOCK, SVNRevision.WORKING, SVNRevision.WORKING);
if (property == null || property.getValue() == null) {
throw new VcsException(SvnBundle.message("exception.text.file.miss.svn", ioFiles[i].getName()));
}
}
catch (SVNException e) {
throw new VcsException(e);
}
}
SvnUtil.doLockFiles(myVCS.getProject(), myVCS, ioFiles);
}
示例3: MergeRootInfo
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
public MergeRootInfo(File file, SvnVcs vcs) {
myRevision1 = SVNRevision.HEAD;
myRevision2 = SVNRevision.HEAD;
try {
SVNWCClient wcClient = vcs.createWCClient();
final SVNURL url = wcClient.doInfo(file, SVNRevision.UNDEFINED).getURL();
myUrl1 = url.toString();
myUrl2 = url.toString();
}
catch (SVNException e) {
myUrl1 = "";
myUrl2 = "";
}
}
示例4: checkAncestry
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private boolean checkAncestry(final File sourceFile, final SVNURL targetUrl, final SVNRevision targetRevision) throws SVNException {
final SVNWCClient client = myVcs.createWCClient();
final SVNInfo sourceSvnInfo = client.doInfo(sourceFile, SVNRevision.UNDEFINED);
final SVNInfo targetSvnInfo = client.doInfo(targetUrl, SVNRevision.UNDEFINED, 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 (DialogWrapper.OK_EXIT_CODE == result);
}
示例5: UpdateRootInfo
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
public UpdateRootInfo(File file, SvnVcs vcs) {
myRevision = SVNRevision.HEAD;
try {
SVNWCClient wcClient = vcs.createWCClient();
SVNInfo info = wcClient.doInfo(file, SVNRevision.UNDEFINED);
if (info != null) {
final SVNURL url = info.getURL();
myUrl = url.toString();
} else {
myUrl = "";
}
}
catch (SVNException e) {
myUrl = "";
}
}
示例6: addRecursively
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private static void addRecursively(final SvnVcs activeVcs, final VirtualFile file) throws SVNException {
final SVNWCClient wcClient = activeVcs.createWCClient();
final SvnExcludingIgnoredOperation operation = new SvnExcludingIgnoredOperation(activeVcs.getProject(), new SvnExcludingIgnoredOperation.Operation() {
public void doOperation(final VirtualFile virtualFile) throws SVNException {
final File ioFile = new File(virtualFile.getPath());
final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.checkCanceled();
indicator.setText(SvnBundle.message("share.or.import.add.progress.text", virtualFile.getPath()));
}
wcClient.doAdd(ioFile, true, false, false, SVNDepth.EMPTY, false, false);
}
}, SVNDepth.INFINITY);
operation.execute(file);
}
示例7: getPropertyList
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
public static String getPropertyList(final SVNURL url, final SVNRevision revision, final SVNWCClient client) throws SVNException {
final StringBuilder sb = new StringBuilder();
final List<SVNPropertyData> lines = new ArrayList<SVNPropertyData>();
final ISVNPropertyHandler propertyHandler = createHandler(revision, lines);
client.doGetProperty(url, null, revision, revision, SVNDepth.EMPTY, propertyHandler);
Collections.sort(lines, new Comparator<SVNPropertyData>() {
public int compare(final SVNPropertyData o1, final SVNPropertyData o2) {
return o1.getName().compareTo(o2.getName());
}
});
for (SVNPropertyData line : lines) {
addPropertyPresentation(line, sb);
}
return sb.toString();
}
示例8: actionPerformed
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
SVNWCClient wcClient = myVcs.createWCClient();
SVNPropertyData propValue = null;
try {
propValue = wcClient.doGetProperty(myFile, SVNProperty.KEYWORDS, SVNRevision.UNDEFINED, SVNRevision.WORKING);
} catch (SVNException e1) {
// show error message
}
SetKeywordsDialog dialog = new SetKeywordsDialog(project,
propValue != null ? SVNPropertyValue.getPropertyAsString(propValue.getValue()) : null);
dialog.show();
if (dialog.isOK()) {
String value = dialog.getKeywords();
try {
wcClient.doSetProperty(myFile, SVNProperty.KEYWORDS, SVNPropertyValue.create(value), false, false, null);
}
catch (SVNException err) {
// show error message
VcsBalloonProblemNotifier.showOverChangesView(myVcs.getProject(), "Can not set property: " + err.getMessage(), MessageType.ERROR);
}
}
setFile(myVcs, myFile);
updateFileStatus(false);
}
示例9: updatePropertyValue
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private void updatePropertyValue(String name) {
if (myFiles.length == 0 || myFiles.length > 1) {
return;
}
File file = myFiles[0];
SVNPropertyData property;
try {
SVNWCClient client = myVCS.createWCClient();
property = client.doGetProperty(file, name, SVNRevision.WORKING, SVNRevision.WORKING);
}
catch (SVNException e) {
property = null;
}
if (property != null) {
myValueText.setText(SVNPropertyValue.getPropertyAsString(property.getValue()));
myValueText.selectAll();
}
else {
myValueText.setText("");
}
}
示例10: mergeinfoChanged
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private boolean mergeinfoChanged(final File file) {
final SVNWCClient client = myVcs.createWCClient();
try {
final SVNPropertyData current = client.doGetProperty(file, "svn:mergeinfo", SVNRevision.UNDEFINED, SVNRevision.WORKING);
final SVNPropertyData base = client.doGetProperty(file, "svn:mergeinfo", SVNRevision.UNDEFINED, SVNRevision.BASE);
if (current != null) {
if (base == null) {
return true;
} else {
final SVNPropertyValue currentValue = current.getValue();
final SVNPropertyValue baseValue = base.getValue();
return ! Comparing.equal(currentValue, baseValue);
}
}
}
catch (SVNException e) {
//
}
return false;
}
示例11: realTargetUrl
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
@Nullable
private static SVNURL realTargetUrl(final SvnVcs vcs, final WorkingCopyInfo info, final String targetBranchUrl) {
final SVNWCClient client = vcs.createWCClient();
try {
final SVNInfo svnInfo = client.doInfo(new File(info.getLocalPath()), SVNRevision.UNDEFINED);
final SVNURL svnurl = svnInfo.getURL();
if ((svnurl != null) && (svnurl.toString().startsWith(targetBranchUrl))) {
return svnurl;
}
}
catch (SVNException e) {
// tracked by return value
}
return null;
}
示例12: detectStartRevision
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private boolean detectStartRevision() {
if (! myStartExistsKnown) {
final SvnFileUrlMapping mapping = myVcs.getSvnFileUrlMapping();
final RootUrlInfo rootUrlInfo = mapping.getWcRootForUrl(myUrl.toString());
if (rootUrlInfo == null) return true;
final VirtualFile vf = rootUrlInfo.getVirtualFile();
if (vf == null) {
return true;
}
final SVNWCClient client = myVcs.createWCClient();
try {
final SVNInfo info = client.doInfo(new File(vf.getPath()), SVNRevision.UNDEFINED);
if ((info == null) || (info.getRevision() == null)) {
return false;
}
myStartNumber = info.getRevision().getNumber();
myStartExistsKnown = true;
}
catch (SVNException e) {
return false;
}
}
return true;
}
示例13: run
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的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);
}
}
示例14: getInfo
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private SVNInfo getInfo () throws SVNException {
if (rootInfo == null) {
final SVNWCClient client = new SVNWCClient (null, null);
rootInfo = client.doInfo(getProject().getBaseDir(),
SVNRevision.WORKING);
}
return rootInfo;
}
示例15: upgrade
import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
@Override
public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
cleanupIfNecessary(path, format, client, handler);
upgrade(path, format, client, handler);
}
catch (SVNException e) {
throw new SvnBindException(e);
}
}