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


Java RepositoryLocation类代码示例

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


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

示例1: LoadedRevisionsCache

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
private LoadedRevisionsCache(final Project project) {
  myProject = project;
  myMap = (ApplicationManager.getApplication().isUnitTestMode()) ? new HashMap<String, Bunch>() : new SoftHashMap<String, Bunch>();

  myConnection = project.getMessageBus().connect();
  myConnection.subscribe(CommittedChangesCache.COMMITTED_TOPIC, new CommittedChangesAdapter() {

    @Override
    public void changesLoaded(final RepositoryLocation location, final List<CommittedChangeList> changes) {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        public void run() {
          myMap.clear();
          setRefreshTime(System.currentTimeMillis());
        }
      });
    }
  });
  Disposer.register(myProject, this);
  setRefreshTime(0);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:LoadedRevisionsCache.java

示例2: add

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public void add(@NotNull final RepositoryLocation location) {
  for (int i = 0; i < myLocations.size(); i++) {
    final RepositoryLocation t = myLocations.get(i);
    if (t.getKey().compareTo(location.getKey()) >= 0) {
      myLocations.add(i, location);
      return;
    }
  }
  myLocations.add(location);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RepositoryLocationGroup.java

示例3: getKey

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public String getKey() {
  final StringBuilder sb = new StringBuilder(myPresentableString);
  // they are ordered
  for (RepositoryLocation location : myLocations) {
    sb.append(location.getKey());
  }
  return sb.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RepositoryLocationGroup.java

示例4: update

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public void update(final AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project != null) {
    CommittedChangesPanel panel = ChangesViewContentManager.getInstance(project).getActiveComponent(CommittedChangesPanel.class);
    RepositoryLocation rl = panel == null ? null : panel.getRepositoryLocation();
    e.getPresentation().setVisible(rl == null);
    e.getPresentation().setEnabled(panel != null && (! panel.isInLoad()));
  }
  else {
    e.getPresentation().setVisible(false);
    e.getPresentation().setEnabled(false);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ClearCommittedAction.java

示例5: execute

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
@NotNull
public List<CommittedChangeList> execute() {
  Pair<List<RepositoryLocationGroup>, List<RepositoryLocation>> groupingResult = myVcsPartner.groupLocations(myInLocations);
  List<CommittedChangeList> result = ContainerUtil.newArrayList();

  result.addAll(ContainerUtil.flatten(collectChangeLists(groupingResult.getSecond())));
  for (RepositoryLocationGroup group : groupingResult.getFirst()) {
    result.addAll(mergeLocationGroupChangeLists(group));
  }

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

示例6: collectChangeLists

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
@NotNull
private List<List<CommittedChangeList>> collectChangeLists(@NotNull List<RepositoryLocation> locations) {
  List<List<CommittedChangeList>> result = ContainerUtil.newArrayListWithCapacity(locations.size());

  for (RepositoryLocation location : locations) {
    result.add(myInLists.get(location.toPresentableString()));
  }

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

示例7: groupLocations

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public Pair<List<RepositoryLocationGroup>, List<RepositoryLocation>> groupLocations(final List<RepositoryLocation> in) {
  final List<RepositoryLocationGroup> groups = new ArrayList<RepositoryLocationGroup>();
  final List<RepositoryLocation> singles = new ArrayList<RepositoryLocation>();

  final MultiMap<SVNURL, RepositoryLocation> map = new MultiMap<SVNURL, RepositoryLocation>();

  for (RepositoryLocation location : in) {
    final SvnRepositoryLocation svnLocation = (SvnRepositoryLocation) location;
    final String url = svnLocation.getURL();

    final SVNURL root = SvnUtil.getRepositoryRoot(myVcs, url);
    if (root == null) {
      // should not occur
      LOG.info("repository root not found for location:"+ location.toPresentableString());
      singles.add(location);
    } else {
      map.putValue(root, svnLocation);
    }
  }

  final Set<SVNURL> keys = map.keySet();
  for (SVNURL key : keys) {
    final Collection<RepositoryLocation> repositoryLocations = map.get(key);
    if (repositoryLocations.size() == 1) {
      singles.add(repositoryLocations.iterator().next());
    } else {
      final SvnRepositoryLocationGroup group = new SvnRepositoryLocationGroup(key, repositoryLocations);
      groups.add(group);
    }
  }
  return Pair.create(groups, singles);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SvnCommittedListsZipper.java

示例8: SvnRepositoryLocationGroup

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public SvnRepositoryLocationGroup(@NotNull final SVNURL url, final Collection<RepositoryLocation> locations) {
  super(url.toString());
  myUrl = url;
  for (RepositoryLocation location : locations) {
    add(location);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:SvnRepositoryLocationGroup.java

示例9: RootsAndBranches

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public RootsAndBranches(@NotNull SvnVcs vcs, @NotNull DecoratorManager manager, final RepositoryLocation location) {
  myVcs = vcs;
  myProject = vcs.getProject();
  myManager = manager;
  myLocation = location;

  myDataLoader = new WcInfoLoader(myVcs, myLocation);

  myMergePanels = new HashMap<String, SvnMergeInfoRootPanelManual>();
  myHolders = new HashMap<String, MergeInfoHolder>();

  myFilterMerged = new FilterOutMerged();
  myFilterNotMerged = new FilterOutNotMerged();
  myFilterAlien = new FilterOutAlien();
  myIntegrateAction = new IntegrateChangeListsAction(true);
  myUndoIntegrateChangeListsAction = new IntegrateChangeListsAction(false);

  myPanel = new JPanel(new GridBagLayout());
  createToolbar();
  final GridBagConstraints gb =
    new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 0, 0);
  gb.insets = new Insets(20, 1, 1, 1);
  myPanel.add(new JLabel("Loading..."), gb);
  
  myPanel.setPreferredSize(new Dimension(200, 60));

  myManager.install(this);

  myStrategy = new MergePanelFiltering(getPanel());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:RootsAndBranches.java

示例10: getCommittedChanges

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public List<TFSChangeList> getCommittedChanges(final ChangeBrowserSettings settings,
                                               final RepositoryLocation location,
                                               final int maxCount) throws VcsException {
    final List<TFSChangeList> result = new ArrayList<TFSChangeList>();
    loadCommittedChanges(settings, location, maxCount, new AsynchConsumer<CommittedChangeList>() {
        public void finished() {
        }

        public void consume(final CommittedChangeList committedChangeList) {
            result.add((TFSChangeList) committedChangeList);
        }
    });
    return result;
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:15,代码来源:TFSCommittedChangesProvider.java

示例11: testGetLocationFor

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
@Test
public void testGetLocationFor() {
    final RepositoryLocation repositoryLocation = committedChangesProvider.getLocationFor(mockRoot);
    assertEquals(SERVER_URL, repositoryLocation.getKey());
    assertEquals(mockWorkspace, ((TFSRepositoryLocation) repositoryLocation).getWorkspace());
    assertEquals(mockVirtualFile, ((TFSRepositoryLocation) repositoryLocation).getRoot());
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:8,代码来源:TFSCommittedChangesProviderTest.java

示例12: testLoadCommittedChanges_FoundChanges

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
@Test
public void testLoadCommittedChanges_FoundChanges() throws Exception {
    final List<ChangeSet> changeSetList = ImmutableList.of(mockChangeSet1, mockChangeSet2, mockChangeSet3);
    when(CommandUtils.getHistoryCommand(any(ServerContext.class), eq(LOCAL_ROOT_PATH), eq("C30~C50"),
            eq(20), eq(true), eq(USER_ME))).thenReturn(changeSetList);
    final RepositoryLocation repositoryLocation = new TFSRepositoryLocation(mockWorkspace, mockVirtualFile);
    committedChangesProvider.loadCommittedChanges(mockChangeBrowserSettings, repositoryLocation, 20, mockAsynchConsumer);
    verify(mockAsynchConsumer, times(3)).consume(any(TFSChangeList.class));
    verify(mockTFSChangeListBuilder).createChangeList(eq(mockChangeSet1), eq(40), eq("2016-07-11T12:00:00.000-0400"));
    verify(mockTFSChangeListBuilder).createChangeList(eq(mockChangeSet2), eq(31), eq("2016-06-23T04:30:00.00-0400"));
    verify(mockTFSChangeListBuilder).createChangeList(eq(mockChangeSet3), eq(0), eq(StringUtils.EMPTY));
    verify(mockAsynchConsumer).finished();
    verifyNoMoreInteractions(mockAsynchConsumer);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:15,代码来源:TFSCommittedChangesProviderTest.java

示例13: testLoadCommittedChanges_NoChanges

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
@Test
public void testLoadCommittedChanges_NoChanges() throws Exception {
    final List<ChangeSet> changeSetList = Collections.EMPTY_LIST;
    when(CommandUtils.getHistoryCommand(any(ServerContext.class), eq(LOCAL_ROOT_PATH), eq("C30~C50"),
            eq(20), eq(true), eq(USER_ME))).thenReturn(changeSetList);
    final RepositoryLocation repositoryLocation = new TFSRepositoryLocation(mockWorkspace, mockVirtualFile);
    committedChangesProvider.loadCommittedChanges(mockChangeBrowserSettings, repositoryLocation, 20, mockAsynchConsumer);
    verify(mockAsynchConsumer).finished();
    verifyNoMoreInteractions(mockAsynchConsumer);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:11,代码来源:TFSCommittedChangesProviderTest.java

示例14: testAnnotations

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
@Test
public void testAnnotations() throws VcsException, IOException {
  final String[] contents = {"", "1\r1\r1\r1\r1\n", "\r\n2\r\n2\n2\r\n1\r1\n2\n1\r\n\r", "\r\n\n2\r\n2\n2\r\n1\r1\r\n3\r3\n\r\n"};
  final int[] expectedRevisions = {2, 3, 2, 2, 2, 1, 1, 3, 3, 2};

  FilePath file = getChildPath(mySandboxRoot, "file.txt");
  createFileInCommand(file, contents[0]);
  commit();

  for (int i = 1; i < contents.length; i++) {
    editFiles(file);
    setFileContent(file, contents[i]);
    commit();
  }

  VirtualFile vf = file.getVirtualFile();
  final FileAnnotation fileAnnotation = createTestAnnotation(getVcs().getAnnotationProvider(), vf);
  Assert.assertEquals(fileAnnotation.getAnnotatedContent(), contents[contents.length - 1]);

  LineAnnotationAspect[] aspects = fileAnnotation.getAspects();
  Assert.assertEquals(aspects.length, 3);

  final RepositoryLocation location = getVcs().getCommittedChangesProvider().getLocationFor(file);
  final List<TFSChangeList> historyList =
    getVcs().getCommittedChangesProvider().getCommittedChanges(new ChangeBrowserSettings(), location, 0);

  for (int line = 0; line < expectedRevisions.length; line++) {
    Assert.assertEquals(aspects[0].getValue(line),
                        String.valueOf(historyList.get(contents.length - 1 - expectedRevisions[line]).getNumber()));
  }
  Assert.assertEquals(aspects[0].getValue(expectedRevisions.length), "");
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:33,代码来源:TestAnnotation.java

示例15: assertHistory

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
private void assertHistory(Change change, boolean originalStateCommited) throws VcsException {
  final RepositoryLocation location = getVcs().getCommittedChangesProvider().getLocationFor(TfsFileUtil.getFilePath(mySandboxRoot));
  final List<TFSChangeList> historyList =
    getVcs().getCommittedChangesProvider().getCommittedChanges(new ChangeBrowserSettings(), location, 0);

  Assert.assertEquals(originalStateCommited ? 3 : 2, historyList.size());
  TFSChangeList changelist = historyList.get(0);

  Assert.assertEquals(CHILD_CHANGE_COMMIT_COMMENT, changelist.getComment());
  assertUserNameEqual(changelist.getCommitterName());
  ChangeHelper.assertContains(Collections.singletonList(change), changelist.getChanges());
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:13,代码来源:SingleChangeTestCase.java


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