当前位置: 首页>>代码示例>>Java>>正文


Java SvnVcs类代码示例

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


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


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