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

Java SvnVcs类代码示例

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

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



SvnVcs类属于org.jetbrains.idea.svn包,在下文中一共展示了SvnVcs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isEnabledImpl

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
private boolean isEnabledImpl(final SvnVcs vcs, final VirtualFile file) {
  final ChangeListManager clManager = ChangeListManager.getInstance(vcs.getProject());

  if (SvnStatusUtil.isIgnoredInAnySense(clManager, file)) {
    myAllCanBeIgnored = false;
    return myAllAreIgnored | myAllCanBeIgnored;
  } else if (clManager.isUnversioned(file)) {
    // check parent
    final VirtualFile parent = file.getParent();
    if (parent != null) {
      if ((! SvnStatusUtil.isIgnoredInAnySense(clManager, parent)) && (! clManager.isUnversioned(parent))) {
        myAllAreIgnored = false;
        return myAllAreIgnored | myAllCanBeIgnored;
      }
    }
  }
  myAllCanBeIgnored = false;
  myAllAreIgnored = false;
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IgnoreGroupHelperAction.java


示例2: addToExternalProperty

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public static boolean addToExternalProperty(@NotNull SvnVcs vcs, @NotNull File ioFile, String target, String url)
  throws SVNException, VcsException {
  ClientFactory factory = vcs.getFactory(ioFile);
  PropertyValue propertyValue = factory.createPropertyClient().getProperty(SvnTarget.fromFile(ioFile), SvnPropertyKeys.SVN_EXTERNALS,
                                                                            false, SVNRevision.UNDEFINED);
  String newValue;
  if (propertyValue != null && !StringUtil.isEmptyOrSpaces(propertyValue.toString())) {
    Map<String, String> externalsMap = ExternalsDefinitionParser.parseExternalsProperty(propertyValue.toString());
    String externalsForTarget = externalsMap.get(target);

    if (externalsForTarget != null) {
      AbstractVcsHelper.getInstance(vcs.getProject()).showError(
        new VcsException("Selected destination conflicts with existing: " + externalsForTarget), "Create External");
      return true;
    }
    final String string = createExternalDefinitionString(url, target);
    newValue = propertyValue.toString().trim() + "\n" + string;
  } else {
    newValue = createExternalDefinitionString(url, target);
  }
  factory.createPropertyClient().setProperty(ioFile, SvnPropertyKeys.SVN_EXTERNALS, PropertyValue.create(newValue), Depth.EMPTY, false);
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CreateExternalAction.java


示例3: SvnFileRevision

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public SvnFileRevision(SvnVcs vcs,
                       SVNRevision pegRevision,
                       LogEntry logEntry,
                       String url,
                       String copyFromPath) {
  final SVNRevision revision = SVNRevision.create(logEntry.getRevision());
  myRevisionNumber = new SvnRevisionNumber(revision);
  myPegRevision = pegRevision;
  myRevision = revision;
  myAuthor = logEntry.getAuthor();
  myDate = logEntry.getDate();
  myCommitMessage = logEntry.getMessage();
  myCopyFromPath = copyFromPath;
  myVCS = vcs;
  myURL = url;
  myMergeSources = new ArrayList<SvnFileRevision>();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SvnFileRevision.java


示例4: doMkdir

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
protected static void doMkdir(final SVNURL url, final String comment, final Project project) {
  final Ref<Exception> exception = new Ref<Exception>();
  Runnable command = new Runnable() {
    public void run() {
      ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
      if (progress != null) {
        progress.setText(SvnBundle.message("progress.text.browser.creating", url.toString()));
      }
      SvnVcs vcs = SvnVcs.getInstance(project);
      SvnTarget target = SvnTarget.fromURL(url);
      try {
        vcs.getFactoryFromSettings().createBrowseClient().createDirectory(target, comment, false);
      }
      catch (VcsException e) {
        exception.set(e);
      }
    }
  };
  ProgressManager.getInstance().runProcessWithProgressSynchronously(command, SvnBundle.message("progress.text.create.remote.folder"), false, project);
  if (!exception.isNull()) {
    Messages.showErrorDialog(exception.get().getMessage(), SvnBundle.message("message.text.error"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:RepositoryBrowserDialog.java


示例5: execute

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
protected void execute(Project project,
                     final SvnVcs activeVcs,
                     final VirtualFile file,
                     DataContext context,
                     AbstractVcsHelper helper) throws VcsException {
  if (file.isDirectory()) {
    perform(project, activeVcs, file, context);
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      public void run() {
        file.refresh(false, true);
      }
    });

    doVcsRefresh(project, file);
  }
  else {
    perform(project, activeVcs, file, context);
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      public void run() {
        file.refresh(false, true);
      }
    });
    doVcsRefresh(project, file);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:BasicAction.java


示例6: update

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public void update(final AnActionEvent e) {
  final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  final Presentation presentation = e.getPresentation();

  if (project == null) {
    presentation.setEnabled(false);
    presentation.setVisible(false);
    return;
  }

  presentation.setText(SvnBundle.message("configure.branches.item"));
  presentation.setDescription(SvnBundle.message("configure.branches.item"));
  presentation.setIcon(SvnIcons.ConfigureBranches);

  presentation.setVisible(true);
  
  final ChangeList[] cls = e.getData(VcsDataKeys.CHANGE_LISTS);
  presentation.setEnabled((cls != null) && (cls.length > 0) &&
                          (SvnVcs.getInstance(project).getName().equals(((CommittedChangeList) cls[0]).getVcs().getName())) &&
                          (((SvnChangeList) cls[0]).getRoot() != null));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ConfigureBranchesAction.java


示例7: getState

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public ConfigurationBean getState() {
  final ConfigurationBean result = new ConfigurationBean();
  result.myVersion = myConfigurationBean.myVersion;
  final UrlSerializationHelper helper = new UrlSerializationHelper(SvnVcs.getInstance(myProject));

  for (VirtualFile root : myBunch.getMapCopy().keySet()) {
    final String key = root.getPath();
    final SvnBranchConfigurationNew configOrig = myBunch.getConfig(root);
    final SvnBranchConfiguration configuration =
      new SvnBranchConfiguration(configOrig.getTrunkUrl(), configOrig.getBranchUrls(), configOrig.isUserinfoInUrl());

    result.myConfigurationMap.put(key, helper.prepareForSerialization(configuration));
  }
  result.mySupportsUserInfoFilter = true;
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SvnBranchConfigurationManager.java


示例8: initRoot

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SelectLocationDialog.java


示例9: testRollbackRenameDir

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Test
public void testRollbackRenameDir() throws Exception {
  final VirtualFile child = prepareDirectoriesForRename();
  renameFileInCommand(child, "newchild");

  final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
  changeListManager.ensureUpToDate(false);
  final Change change = changeListManager.getChange(myWorkingCopyDir.findChild("newchild"));
  Assert.assertNotNull(change);

  final List<VcsException> exceptions = new ArrayList<VcsException>();
  SvnVcs.getInstance(myProject).getRollbackEnvironment().rollbackChanges(Collections.singletonList(change), exceptions,
                                                                         RollbackProgressListener.EMPTY);
  Assert.assertTrue(exceptions.isEmpty());
  Assert.assertFalse(new File(myWorkingCopyDir.getPath(), "newchild").exists());
  Assert.assertTrue(new File(myWorkingCopyDir.getPath(), "child").exists());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SvnRenameTest.java


示例10: getState

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public MergeCheckResult getState(@NotNull WCInfoWithBranches info,
                                 @NotNull SvnChangeList list,
                                 @NotNull WCInfoWithBranches.Branch selectedBranch,
                                 final String branchPath) {
  MyCurrentUrlData rootMapping = myCurrentUrlMapping.get(info.getRootUrl());
  BranchInfo mergeChecker = null;
  if (rootMapping == null) {
    rootMapping = new MyCurrentUrlData();
    myCurrentUrlMapping.put(info.getRootUrl(), rootMapping);
  } else {
    mergeChecker = rootMapping.getBranchInfo(branchPath);
  }
  if (mergeChecker == null) {
    mergeChecker = new BranchInfo(SvnVcs.getInstance(myProject), info, selectedBranch);
    rootMapping.addBranchInfo(branchPath, mergeChecker);
  }

  return mergeChecker.checkList(list, branchPath);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnMergeInfoCache.java


示例11: isEnabled

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
private boolean isEnabled(AnActionEvent e) {
  final DataContext dc = e.getDataContext();
  final Project project = CommonDataKeys.PROJECT.getData(dc);
  if (project == null || project.isDefault()) return false;
  final VirtualFile[] files = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(SvnVcs.getInstance(project));
  return files != null && files.length > 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MergeFromAction.java


示例12: getDefaultConfiguration

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@NotNull
private static SvnBranchConfigurationNew getDefaultConfiguration(@NotNull SvnVcs vcs, @NotNull SVNURL url)
  throws SVNException, VcsException {
  SvnBranchConfigurationNew result = new SvnBranchConfigurationNew();
  result.setTrunkUrl(url.toString());

  SVNURL branchLocationsParent = getBranchLocationsParent(url);
  if (branchLocationsParent != null) {
    SvnTarget target = SvnTarget.fromURL(branchLocationsParent);

    vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, createHandler(result, target.getURL()));
  }

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


示例13: setUp

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
  //System.setProperty(FileWatcher.PROPERTY_WATCHER_DISABLED, "false");
  super.setUp();

  clManager = (ChangeListManagerImpl) ChangeListManager.getInstance(myProject);
  myVcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);

  enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
  enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
  myVcs = SvnVcs.getInstance(myProject);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SvnExternalCommitNoticedTest.java


示例14: setUp

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
  super.setUp();
  myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
  myChangeListManager = ChangeListManager.getInstance(myProject);

  myVcs = SvnVcs.getInstance(myProject);

  enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
  enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnRollbackTest.java


示例15: isEnabled

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
protected boolean isEnabled(final Project project, final SvnVcs vcs, final VirtualFile file) {
  final boolean result = isEnabledImpl(vcs, file);
  if (result) {
    myListener.onFileEnabled(file);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:IgnoreGroupHelperAction.java


示例16: testMoveDirChangeFile

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Test
public void testMoveDirChangeFile() throws Exception {
  enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
  enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);

  VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
  VirtualFile d2 = createDirInCommand(myWorkingCopyDir, "d2");

  VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
  VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");

  // r1, addition without history
  checkin();

  final String oldPath = absPath(d1);
  final String oldF11Path = new File(f11.getPath()).getAbsolutePath();
  moveFileInCommand(d1, d2);
  VcsTestUtil.editFileInCommand(myProject, f11, "new");

  Thread.sleep(100);

  checkin();

  final SvnVcs vcs = SvnVcs.getInstance(myProject);
  vcs.invokeRefreshSvnRoots();
  final CommittedChangesProvider<SvnChangeList,ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
  final List<SvnChangeList> changeListList =
    committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(),
                                                 new SvnRepositoryLocation(myRepoUrl), 0);
  checkList(changeListList, 2, new Data[] {new Data(absPath(d1), FileStatus.MODIFIED, "- moved from .." + File.separatorChar + "d1"),
    new Data(absPath(f11), FileStatus.MODIFIED, "- moved from " + oldF11Path)});
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SvnCommittedViewTest.java


示例17: doCheckIgnoreProperty

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public static void doCheckIgnoreProperty(final SvnVcs activeVcs, final Project project, final VirtualFile[] file,
      final IgnoreInfoGetter getter, final String extensionPattern, final Ref<Boolean> filesOk, final Ref<Boolean> extensionOk) {
  final IgnorePropertyChecker checker = new IgnorePropertyChecker(activeVcs, project, extensionPattern);
  try {
    checker.execute(file, getter);
  } catch (VcsException e) {
    // ignore - actually never thrown inside
  }
  filesOk.set(checker.filesOk());
  extensionOk.set(checker.extensionOk());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SvnPropertyService.java


示例18: run

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public void run(@NotNull final ProgressIndicator indicator) {
  ProjectLevelVcsManager.getInstanceChecked(myProject).startBackgroundVcsOperation();
  indicator.setIndeterminate(true);
  final boolean supportsChangelists = myNewFormat.supportsChangelists();
  if (supportsChangelists) {
    myBeforeChangeLists = ChangeListManager.getInstance(myProject).getChangeListsCopy();
  }

  try {
    for (WCInfo wcInfo : myWcInfos) {
      File path = new File(wcInfo.getPath());
      if (! wcInfo.isIsWcRoot()) {
        path = SvnUtil.getWorkingCopyRoot(path);
      }
      try {
        String cleanupMessage = SvnBundle.message("action.Subversion.cleanup.progress.text", path.getAbsolutePath());
        String upgradeMessage =
          SvnBundle.message("action.change.wcopy.format.task.progress.text", path.getAbsolutePath(), wcInfo.getFormat(), myNewFormat);
        ProgressTracker handler = createUpgradeHandler(indicator, cleanupMessage, upgradeMessage);

        getFactory(path, myNewFormat).createUpgradeClient().upgrade(path, myNewFormat, handler);
      } catch (Throwable e) {
        myExceptions.add(e);
      }
    }
  }
  finally {
    ProjectLevelVcsManager.getInstance(myProject).stopBackgroundVcsOperation();

    // to map to native
    if (supportsChangelists) {
      SvnVcs.getInstance(myProject).processChangeLists(myBeforeChangeLists);
    }

    ApplicationManager.getApplication().getMessageBus().syncPublisher(SvnVcs.WC_CONVERTED).run();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:SvnFormatWorker.java


示例19: update

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  final VcsKey vcsKey = e.getData(VcsDataKeys.VCS);
  final boolean isSvn = SvnVcs.getKey().equals(vcsKey);
  e.getPresentation().setVisible(isSvn);
  final VcsFileRevision revision = e.getData(VcsDataKeys.VCS_FILE_REVISION);
  e.getPresentation().setEnabled(isSvn && revision != null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SvnEditCommitMessageFromFileHistoryAction.java


示例20: SetPropertyDialog

import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public SetPropertyDialog(Project project, File[] files, String name, boolean allowRecursion) {
  super(project, true);
  myFiles = files;
  myPropertyName = name;
  myIsRecursionAllowed = allowRecursion;
  myVCS = SvnVcs.getInstance(project);
  setResizable(true);
  setTitle(SvnBundle.message("dialog.title.set.property"));
  getHelpAction().setEnabled(true);
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:SetPropertyDialog.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java AbstractProviderConfigBeanDefinitionParser类代码示例发布时间:2022-05-22
下一篇:
Java Attribute类代码示例发布时间: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