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

Java RepositoryLocation类代码示例

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

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



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


示例16: assertHistory

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

  final TFSChangeList childChangelist;
  if (parentChangeCommitted != null) {
    if (originalStateCommited) {
      Assert.assertEquals(childChangeCommitted != null ? 4 : 3, historyList.size());
    }
    else {
      Assert.assertEquals(childChangeCommitted != null ? 3 : 2, historyList.size());
    }
    childChangelist = childChangeCommitted != null ? historyList.get(parentThenChild ? 0 : 1) : null;

    TFSChangeList parentChangelist = historyList.get(parentThenChild ? 1 : 0);
    Assert.assertEquals(PARENT_CHANGES_COMMIT_COMMENT, parentChangelist.getComment());
    assertUserNameEqual(parentChangelist.getCommitterName());
    ChangeHelper.assertContains(Collections.singletonList(parentChangeCommitted), parentChangelist.getChanges());
  }
  else {
    Assert.assertEquals(originalStateCommited ? 3 : 2, historyList.size());
    childChangelist = historyList.get(0);
  }

  if (childChangeCommitted != null) {
    Assert.assertEquals(CHILD_CHANGES_COMMIT_COMMENT, childChangelist.getComment());
    assertUserNameEqual(childChangelist.getCommitterName());
    ChangeHelper.assertContains(Collections.singletonList(childChangeCommitted), childChangelist.getChanges());
  }
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:35,代码来源:ParentChildChangeTestCase.java


示例17: update

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public void update(final AnActionEvent e) {
  Project project = e.getData(PlatformDataKeys.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:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:ClearCommittedAction.java


示例18: add

import com.intellij.openapi.vcs.RepositoryLocation; //导入依赖的package包/类
public void add(final RepositoryLocation location, final List<CommittedChangeList> lists) {
  myInLocations.add(location);
  Collections.sort(lists, new Comparator<CommittedChangeList>() {
    public int compare(final CommittedChangeList o1, final CommittedChangeList o2) {
      final long num1 = myVcsPartner.getNumber(o1);
      final long num2 = myVcsPartner.getNumber(o2);
      return num1 == num2 ? 0 : (num1 < num2) ? -1 : 1;
    }
  });
  myInLists.put(location.toPresentableString(), lists);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:CommittedListsSequencesZipper.java


示例19: 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 CommittedChangesListener() {
    public void changesLoaded(final RepositoryLocation location, final List<CommittedChangeList> changes) {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        public void run() {
          myMap.clear();
          setRefreshTime(System.currentTimeMillis());
        }
      });
    }

    @Override
    public void changesCleared() {
    }

    @Override
    public void presentationChanged() {
    }

    public void incomingChangesUpdated(@Nullable final List<CommittedChangeList> receivedChanges) {
    }

    public void refreshErrorStatusChanged(@Nullable final VcsException lastError) {
    }
  });
  Disposer.register(myProject, this);
  setRefreshTime(0);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:LoadedRevisionsCache.java


示例20: RootsAndBranches

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

  myDataLoader = new WcInfoLoader(myProject, myLocation);

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

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

  myPanel = new JPanel(new GridBagLayout());
  myFromHereDirection = true;
  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);
  setDirectionToPanels();

  myStrategy = new MergePanelFiltering(getPanel());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:RootsAndBranches.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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