• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SVNWCClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNWCClient的典型用法代码示例。如果您正苦于以下问题:Java SVNWCClient类的具体用法?Java SVNWCClient怎么用?Java SVNWCClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SVNWCClient类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNWCClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SvnKitAddClient.java


示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:SvnEditFileProvider.java


示例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 = "";
  }

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:MergeRootInfo.java


示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:SvnUpdateEnvironment.java


示例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 = "";
  }

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:UpdateRootInfo.java


示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ShareProjectAction.java


示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:AbstractShowPropertiesDiffAction.java


示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:PropertiesComponent.java


示例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("");
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:SetPropertyDialog.java


示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:GatheringChangelistBuilder.java


示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:IntegratedSelectedOptionsDialog.java


示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:LatestExistentSearcher.java


示例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);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:SvnEditCommitMessageAction.java


示例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;
}
 
开发者ID:fstltna,项目名称:ThudNG2,代码行数:11,代码来源:MySVNInfo.java


示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SvnKitUpgradeClient.java


示例16: cleanupIfNecessary

import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
private static void cleanupIfNecessary(@NotNull File path,
                                       @NotNull WorkingCopyFormat format,
                                       @NotNull SVNWCClient client,
                                       @Nullable ProgressTracker handler) throws SVNException, VcsException {
  // cleanup is executed only for SVNKit as it could handle both 1.6 and 1.7 formats
  if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(format)) {
    // fake event indicating cleanup start
    callHandler(handler, createEvent(path, EventAction.UPDATE_STARTED));
    client.doCleanup(path);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SvnKitUpgradeClient.java


示例17: revert

import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
@Override
public void revert(@NotNull Collection<File> paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
  SVNWCClient client = myVcs.getSvnKitManager().createWCClient();

  client.setEventHandler(toEventHandler(handler));
  try {
    client.doRevert(ArrayUtil.toObjectArray(paths, File.class), toDepth(depth), null);
  }
  catch (SVNException e) {
    throw new VcsException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnKitRevertClient.java


示例18: delete

import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
@Override
public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ProgressTracker handler) throws VcsException {
  SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
  client.setEventHandler(toEventHandler(handler));

  try {
    client.doDelete(path, force, dryRun);
  }
  catch (SVNException e) {
    throw new VcsException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnKitDeleteClient.java


示例19: cleanup

import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
@Override
public void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException {
  SVNWCClient client = myVcs.getSvnKitManager().createWCClient();

  client.setEventHandler(toEventHandler(handler));
  try {
    client.doCleanup(path);
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnKitCleanupClient.java


示例20: getClient

import org.tmatesoft.svn.core.wc.SVNWCClient; //导入依赖的package包/类
@NotNull
private SVNWCClient getClient(@Nullable ProgressTracker handler) {
  SVNWCClient client = myVcs.getSvnKitManager().createWCClient();

  client.setEventHandler(toEventHandler(handler));

  return client;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SvnKitLockClient.java



注:本文中的org.tmatesoft.svn.core.wc.SVNWCClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PopulatorGrass类代码示例发布时间:2022-05-22
下一篇:
Java Bridge类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap