Codota Logo
Change.getAfterRevision
Code IndexAdd Codota to your IDE (free)

How to use
getAfterRevision
method
in
com.intellij.openapi.vcs.changes.Change

Best Java code snippets using com.intellij.openapi.vcs.changes.Change.getAfterRevision (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: uwolfer/gerrit-intellij-plugin

private Change buildCommitMsgChange() {
  Change baseChange = Iterables.find(changesProvider.provide(base), COMMIT_MSG_CHANGE_PREDICATE);
  ContentRevision baseRevision = baseChange.getAfterRevision();
  Change change = Iterables.find(changesProvider.provide(commit), COMMIT_MSG_CHANGE_PREDICATE);
  ContentRevision revision = change.getAfterRevision();
  return new Change(baseRevision, revision);
}
origin: groboclown/p4ic4idea

  private void addChange(@Nullable String changeListName, @NotNull Change change) {
    addedChanges.put(changeListName, change);
    if (change.getBeforeRevision() != null) {
      addedChangedFiles.put(changeListName, change.getBeforeRevision().getFile());
    }
    if (change.getAfterRevision() != null) {
      addedChangedFiles.put(changeListName, change.getAfterRevision().getFile());
    }
  }
}
origin: groboclown/p4ic4idea

private Collection<FilePath> getAffectedFiles(ClientConfigRoot clientConfigRoot, Collection<Change> changes) {
  Set<FilePath> ret = new HashSet<>();
  for (Change change : changes) {
    for (ContentRevision cr : Arrays.asList(change.getBeforeRevision(), change.getAfterRevision())) {
      if (cr != null) {
        FilePath file = cr.getFile();
        if (!ret.contains(file) && FileTreeUtil.isSameOrUnder(clientConfigRoot.getClientRootDir(), file)) {
          ret.add(cr.getFile());
        }
      }
    }
  }
  return ret;
}
origin: groboclown/p4ic4idea

private List<FilePath> getPathsFromChanges(final Collection<Change> changes) {
  final List<FilePath> paths = new ArrayList<>();
  for (Change change : changes) {
    if ((change.getBeforeRevision() != null) && (isUnderVcs(change.getBeforeRevision().getFile()))) {
      FilePath path = change.getBeforeRevision().getFile();
      if (!paths.contains(path)) {
        paths.add(path);
      }
    }
    if ((change.getAfterRevision() != null) && (isUnderVcs(change.getAfterRevision().getFile()))) {
      final FilePath path = change.getAfterRevision().getFile();
      if (!paths.contains(path)) {
        paths.add(path);
      }
    }
  }
  return paths;
}
origin: groboclown/p4ic4idea

@NotNull
private static Map<ClientConfigRoot, List<FilePath>> mapChangedFilesByRoot(@NotNull ProjectConfigRegistry registry,
    @NotNull Collection<Change> changes) {
  Map<ClientConfigRoot, List<FilePath>> ret = new HashMap<>();
  for (Change change : changes) {
    {
      ContentRevision before = change.getBeforeRevision();
      if (before != null) {
        ClientConfigRoot root = registry.getClientFor(before.getFile());
        List<FilePath> paths = ret.computeIfAbsent(root, k -> new ArrayList<>());
        paths.add(before.getFile());
      }
    }
    {
      ContentRevision after = change.getAfterRevision();
      if (after != null) {
        ClientConfigRoot root = registry.getClientFor(after.getFile());
        List<FilePath> paths = ret.computeIfAbsent(root, k -> new ArrayList<>());
        paths.add(after.getFile());
      }
    }
  }
  return ret;
}
origin: groboclown/p4ic4idea

private List<ServerConfig> getConfigsForChanges(Collection<Change> changes) {
  ProjectConfigRegistry registry = ProjectConfigRegistry.getInstance(project);
  if (registry == null) {
    return Collections.emptyList();
  }
  List<FilePath> files = new ArrayList<>(changes.size() * 2);
  for (Change change : changes) {
    ContentRevision before = change.getBeforeRevision();
    if (before != null) {
      files.add(before.getFile());
    }
    ContentRevision after = change.getAfterRevision();
    if (after != null) {
      files.add(after.getFile());
    }
  }
  Set<ServerConfig> configs = new HashSet<>();
  for (FilePath file : files) {
    ClientConfigRoot config = registry.getClientFor(file);
    if (config != null) {
      configs.add(config.getServerConfig());
    }
  }
  return new ArrayList<>(configs);
}
origin: groboclown/p4ic4idea

  files.add(c.getBeforeRevision().getFile());
if (c.getAfterRevision() != null) {
  files.add(c.getAfterRevision().getFile());
origin: uwolfer/gerrit-intellij-plugin

  @Override
  public boolean apply(Change change) {
    String commitMsgFile = "/COMMIT_MSG";
    ContentRevision afterRevision = change.getAfterRevision();
    if (afterRevision != null) {
      return commitMsgFile.equals(PathUtils.ensureSlashSeparators(afterRevision.getFile().getPath()));
    }
    ContentRevision beforeRevision = change.getBeforeRevision();
    if (beforeRevision != null) {
      return commitMsgFile.equals(PathUtils.ensureSlashSeparators(beforeRevision.getFile().getPath()));
    }
    throw new IllegalStateException("Change should have at least one ContentRevision set.");
  }
};
origin: uwolfer/gerrit-intellij-plugin

private String getAffectedFilePath(Change change) {
  ContentRevision afterRevision = change.getAfterRevision();
  if (afterRevision != null) {
    return afterRevision.getFile().getPath();
  }
  ContentRevision beforeRevision = change.getBeforeRevision();
  if (beforeRevision != null) {
    return beforeRevision.getFile().getPath();
  }
  return null;
}
origin: Microsoft/azure-devops-intellij

  private void setupRollbackChanges() {
    Change change1 = mock(Change.class);
    Change change2 = mock(Change.class);
    Change change3 = mock(Change.class);
    changes = ImmutableList.of(change1, change2, change3);
    ContentRevision contentRevision1 = mock(ContentRevision.class);
    ContentRevision contentRevision2 = mock(ContentRevision.class);
    ContentRevision contentRevision3 = mock(ContentRevision.class);

    when(change1.getType()).thenReturn(Change.Type.DELETED);
    when(change2.getType()).thenReturn(Change.Type.MODIFICATION);
    when(change3.getType()).thenReturn(Change.Type.NEW);

    when(contentRevision1.getFile()).thenReturn(filePath1);
    when(contentRevision2.getFile()).thenReturn(filePath2);
    when(contentRevision3.getFile()).thenReturn(filePath3);

    when(change1.getBeforeRevision()).thenReturn(contentRevision1);
    when(change2.getAfterRevision()).thenReturn(contentRevision2);
    when(change3.getAfterRevision()).thenReturn(contentRevision3);
  }
}
origin: Microsoft/azure-devops-intellij

private void setupCommit() {
  Change change1 = mock(Change.class);
  Change change2 = mock(Change.class);
  Change change3 = mock(Change.class);
  ContentRevision contentRevision1 = mock(ContentRevision.class);
  ContentRevision contentRevision2 = mock(ContentRevision.class);
  ContentRevision contentRevision3 = mock(ContentRevision.class);
  changes = ImmutableList.of(change1, change2, change3);
  FilePath filePath1 = mock(FilePath.class);
  when(filePath1.getPath()).thenReturn("/path/to/file1");
  when(contentRevision1.getFile()).thenReturn(filePath1);
  FilePath filePath2 = mock(FilePath.class);
  when(filePath2.getPath()).thenReturn("/path/to/file2");
  when(contentRevision2.getFile()).thenReturn(filePath2);
  FilePath filePath3 = mock(FilePath.class);
  when(filePath3.getPath()).thenReturn("/path/to/file3");
  when(contentRevision3.getFile()).thenReturn(filePath3);
  when(change1.getBeforeRevision()).thenReturn(contentRevision1);
  when(change2.getBeforeRevision()).thenReturn(null);
  when(change3.getBeforeRevision()).thenReturn(null);
  when(change1.getAfterRevision()).thenReturn(null);
  when(change2.getAfterRevision()).thenReturn(contentRevision2);
  when(change3.getAfterRevision()).thenReturn(contentRevision3);
}
origin: groboclown/p4ic4idea

writeContentRevision(change.getAfterRevision(), dataOutput);
origin: groboclown/p4ic4idea

for (Change change: changes) {
  if (change != null) {
    if (change.getAfterRevision() != null) {
      paths.add(change.getAfterRevision().getFile());
origin: groboclown/p4ic4idea

if (change.getAfterRevision() != null) {
  VirtualFile vf = change.getAfterRevision().getFile().getVirtualFile();
  if (vf != null) {
    LocalChangeList after = ChangeListManager.getInstance(project).getChangeList(vf);
        LOG.debug("Moving file " + vf + " off of 'after' IDE change list " + after);
      builder.removeRegisteredChangeFor(change.getAfterRevision().getFile());
origin: Microsoft/azure-devops-intellij

assertEquals(addedFilePath1, changesList.get(0).getAfterRevision().getFile());
assertEquals(addedFilePath2, changesList.get(1).getAfterRevision().getFile());
assertEquals(addedFilePath3, changesList.get(2).getAfterRevision().getFile());
assertNull(changesList.get(3).getAfterRevision());
assertNull(changesList.get(4).getAfterRevision());
assertEquals(renamedFilePath1, changesList.get(5).getAfterRevision().getFile());
assertEquals(editedFilePath1, changesList.get(6).getAfterRevision().getFile());
assertEquals(editedFilePath2, changesList.get(7).getAfterRevision().getFile());
assertEquals(editedFilePath3, changesList.get(8).getAfterRevision().getFile());
origin: Microsoft/azure-devops-intellij

assertEquals(file1.getPath(), changes.get(0).getAfterRevision().getFile().getPath());
assertEquals(file2.getPath(), changes.get(1).getAfterRevision().getFile().getPath());
assertEquals(file3.getPath(), changes.get(2).getAfterRevision().getFile().getPath());
assertEquals(file8.getPath(), changes.get(3).getAfterRevision().getFile().getPath());
assertNull(changes.get(4).getAfterRevision());
assertNull(changes.get(5).getAfterRevision());
assertEquals(file6.getPath(), changes.get(6).getAfterRevision().getFile().getPath());
assertEquals(file7.getPath(), changes.get(7).getAfterRevision().getFile().getPath());
assertEquals(file9.getPath(), changes.get(8).getAfterRevision().getFile().getPath());
origin: groboclown/p4ic4idea

assertEquals(LocalChangeList.DEFAULT_NAME, change.getKey());
assertNull(change.getValue().getBeforeRevision());
assertNotNull(change.getValue().getAfterRevision());
assertEquals(addedFile, change.getValue().getAfterRevision().getFile());
com.intellij.openapi.vcs.changesChangegetAfterRevision

Popular methods of Change

  • getBeforeRevision
  • <init>
  • getVirtualFile
  • getType

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now