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


Java ChangeSet类代码示例

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


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

示例1: ChangeRevision

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
public ChangeRevision(LocalHistoryFacade facade, RootEntry r, @NotNull String entryPath, ChangeSet changeSet, boolean before) {
  myFacade = facade;
  myRoot = r;
  myEntryPath = entryPath;
  myBefore = before;

  myTimestamp = changeSet.getTimestamp();
  myChangeToRevert = before ? changeSet.getFirstChange() : changeSet.getLastChange();

  myId = changeSet.getId();
  myLabel = changeSet.getLabel();
  myLabelColor = changeSet.getLabelColor();
  myName = changeSet.getName();

  List<String> allAffectedFiles = changeSet.getAffectedPaths();
  List<String> someAffectedFiles = new SmartList<String>();
  for (String each : allAffectedFiles.subList(0, Math.min(3, allAffectedFiles.size()))) {
    someAffectedFiles.add(Paths.getNameOf(each));
  }
  myAffectedFiles = Pair.create(someAffectedFiles, allAffectedFiles.size());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ChangeRevision.java

示例2: writeNextSet

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
public synchronized void writeNextSet(ChangeSet changeSet) {
  if (isCompletelyBroken) return;

  try {
    AbstractStorage.StorageDataOutput out = myStorage.writeStream(myStorage.createNextRecord(), true);
    try {
      changeSet.write(out);
    }
    finally {
      out.close();
    }
    myStorage.setLastId(myLastId);
    myStorage.force();
  }
  catch (IOException e) {
    handleError(e, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ChangeListStorageImpl.java

示例3: purge

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
public synchronized void purge(long period, int intervalBetweenActivities, Consumer<ChangeSet> processor) {
  if (isCompletelyBroken) return;

  TIntHashSet recursionGuard = new TIntHashSet(1000);

  try {
    int firstObsoleteId = findFirstObsoleteBlock(period, intervalBetweenActivities, recursionGuard);
    if (firstObsoleteId == 0) return;

    int eachBlockId = firstObsoleteId;

    while (eachBlockId != 0) {
      processor.consume(doReadBlock(eachBlockId).changeSet);
      eachBlockId = doReadPrevSafely(eachBlockId, recursionGuard);
    }
    myStorage.deleteRecordsUpTo(firstObsoleteId);
    myStorage.force();
  }
  catch (IOException e) {
    handleError(e, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ChangeListStorageImpl.java

示例4: testStop

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
@Test
public void testStop() throws Exception {
  createFile("f.txt");
  createFile("dir");

  TestVisitor visitor = new TestVisitor() {
    int count = 0;

    @Override
    public void begin(ChangeSet c) throws ChangeVisitor.StopVisitingException {
      if (++count == 2) stop();
      super.begin(c);
    }
  };

  assertVisitorLog("begin create end finished ", visitor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VisitingTest.java

示例5: ChangeRevision

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
public ChangeRevision(LocalHistoryFacade facade, RootEntry r, @Nonnull String entryPath, ChangeSet changeSet, boolean before) {
  myFacade = facade;
  myRoot = r;
  myEntryPath = entryPath;
  myBefore = before;

  myTimestamp = changeSet.getTimestamp();
  myChangeToRevert = before ? changeSet.getFirstChange() : changeSet.getLastChange();

  myId = changeSet.getId();
  myLabel = changeSet.getLabel();
  myLabelColor = changeSet.getLabelColor();
  myName = changeSet.getName();

  List<String> allAffectedFiles = changeSet.getAffectedPaths();
  List<String> someAffectedFiles = new SmartList<>();
  for (String each : allAffectedFiles.subList(0, Math.min(3, allAffectedFiles.size()))) {
    someAffectedFiles.add(Paths.getNameOf(each));
  }
  myAffectedFiles = Pair.create(someAffectedFiles, allAffectedFiles.size());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:ChangeRevision.java

示例6: getChangesInTests

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
@TestOnly
public List<ChangeSet> getChangesInTests() {
  List<ChangeSet> result = new ArrayList<ChangeSet>();
  for (ChangeSet each : iterChanges()) {
    result.add(each);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ChangeList.java

示例7: accept

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
public void accept(ChangeVisitor v) {
  try {
    for (ChangeSet change : iterChanges()) {
      change.accept(v);
    }
  }
  catch (ChangeVisitor.StopVisitingException e) {
  }
  v.finished();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ChangeList.java

示例8: purgeObsolete

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
public synchronized void purgeObsolete(long period) {
  myStorage.purge(period, myIntervalBetweenActivities, new Consumer<ChangeSet>() {
    public void consume(ChangeSet changeSet) {
      for (Content each : changeSet.getContentsToPurge()) {
        each.release();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ChangeList.java

示例9: process

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
protected void process() {
  Pair<String, List<ChangeSet>> pathAndChanges = collectChanges();

  List<ChangeSet> changes = pathAndChanges.second;
  if (changes.isEmpty()) {
    nothingToVisit();
    return;
  }

  for (ChangeSet c : changes) {
    visit(c);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ChangeSetsProcessor.java

示例10: doReadBlock

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
@NotNull
private ChangeSetHolder doReadBlock(int id) throws IOException {
  DataInputStream in = myStorage.readStream(id);
  try {
    return new ChangeSetHolder(id, new ChangeSet(in));
  }
  finally {
    in.close();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ChangeListStorageImpl.java

示例11: collectChanges

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
@Override
protected Pair<String, List<ChangeSet>> collectChanges() {
  final List<ChangeSet> result = new ArrayList<ChangeSet>();

  myVcs.accept(new ChangeVisitor() {
    @Override
    public void begin(ChangeSet c) throws StopVisitingException {
      if (c.affectsPath(myPath)) result.add(c);
    }
  });

  return Pair.create(myPath, result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ByteContentRetriever.java

示例12: recordContentAndTimestamp

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
private void recordContentAndTimestamp(ChangeSet c) {
  // todo what if the path is being changed during changes?
  for (Change each : c.getChanges()) {
    if (!(each instanceof ContentChange)) continue;
    ContentChange cc = (ContentChange)each;
    if (!cc.affectsPath(myPath)) continue;

    myCurrentFileTimestamp = cc.getOldTimestamp();
    myCurrentFileContent = cc.getOldContent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ByteContentRetriever.java

示例13: collectChanges

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
@Override
protected Pair<String, List<ChangeSet>> collectChanges() {
  // todo optimize to not collect all change sets + do not process changes twice
  ChangeCollectingVisitor v = new ChangeCollectingVisitor(myPath, myProjectId, myPattern);
  myFacade.accept(v);
  return Pair.create(v.getPath(), v.getChanges());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RevisionsCollector.java

示例14: assertRemainedChangesTimestamps

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
private void assertRemainedChangesTimestamps(long... tt) {
  assertEquals(tt.length, getVcs().getChangeListInTests().getChangesInTests().size());
  for (int i = 0; i < tt.length; i++) {
    long t = tt[i];
    ChangeSet c = getVcs().getChangeListInTests().getChangesInTests().get(i);
    assertEquals(t, c.getTimestamp());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PurgingTest.java

示例15: testAfterRevisionForRootEntry

import com.intellij.history.core.changes.ChangeSet; //导入依赖的package包/类
@Test
public void testAfterRevisionForRootEntry() {
  RootEntry root = new RootEntry();
  LocalHistoryFacade facade = new InMemoryLocalHistoryFacade();

  ChangeSet cs = addChangeSet(facade, createFile(root, "f1"));
  addChangeSet(facade, createFile(root, "f2"));

  Revision r = new ChangeRevision(facade, root, "", cs, false);
  RootEntry e = (RootEntry)r.findEntry();

  assertEquals(e.getClass(), RootEntry.class);
  assertNotNull(e.findEntry("f1"));
  assertNull(e.findEntry("f2"));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RevisionsTest.java


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