use of com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings in project intellij-community by JetBrains.
the class SvnCommittedViewTest method testDelete.
@Test
public void testDelete() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
final VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
final VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");
// r1, addition without history
checkin();
deleteFileInCommand(f11);
checkin();
update();
deleteFileInCommand(d1);
checkin();
final SvnVcs vcs = SvnVcs.getInstance(myProject);
vcs.invokeRefreshSvnRoots();
final CommittedChangesProvider<SvnChangeList, ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
final List<SvnChangeList> changeListList = committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(), new SvnRepositoryLocation(myRepoUrl), 0);
checkList(changeListList, 2, new Data[] { new Data(absPath(f11), FileStatus.DELETED, null) });
checkList(changeListList, 3, new Data[] { new Data(absPath(d1), FileStatus.DELETED, null) });
}
use of com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings in project intellij-community by JetBrains.
the class MergeFromTheirsResolver method loadSvnChangeListsForPatch.
@NotNull
private List<SvnChangeList> loadSvnChangeListsForPatch(@NotNull TreeConflictDescription description) throws VcsException {
long max = description.getSourceRightVersion().getPegRevision();
long min = description.getSourceLeftVersion().getPegRevision();
SvnRepositoryLocation location = new SvnRepositoryLocation(description.getSourceRightVersion().getRepositoryRoot().toString());
ChangeBrowserSettings settings = new ChangeBrowserSettings();
settings.USE_CHANGE_BEFORE_FILTER = settings.USE_CHANGE_AFTER_FILTER = true;
settings.CHANGE_BEFORE = String.valueOf(max);
settings.CHANGE_AFTER = String.valueOf(min);
//noinspection unchecked
List<SvnChangeList> committedChanges = notNull(myVcs.getCachingCommittedChangesProvider()).getCommittedChanges(settings, location, 0);
return filter(committedChanges, changeList -> changeList.getNumber() != min);
}
use of com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings in project intellij-community by JetBrains.
the class MergeCalculatorTask method getChangeListsAfter.
@NotNull
private List<Pair<SvnChangeList, LogHierarchyNode>> getChangeListsAfter(long revision) throws VcsException {
ChangeBrowserSettings settings = new ChangeBrowserSettings();
settings.CHANGE_AFTER = Long.toString(revision);
settings.USE_CHANGE_AFTER_FILTER = true;
return getChangeLists(myMergeContext, settings, revision, -1, Pair::create);
}
use of com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings in project intellij-community by JetBrains.
the class MergeCalculatorTask method loadChangeLists.
@NotNull
public static Pair<List<SvnChangeList>, Boolean> loadChangeLists(@NotNull MergeContext mergeContext, long beforeRevision, int size) throws VcsException {
ChangeBrowserSettings settings = new ChangeBrowserSettings();
if (beforeRevision > 0) {
settings.CHANGE_BEFORE = String.valueOf(beforeRevision);
settings.USE_CHANGE_BEFORE_FILTER = true;
}
List<SvnChangeList> changeLists = getChangeLists(mergeContext, settings, beforeRevision, size, (changeList, tree) -> changeList);
return Pair.create(changeLists.subList(0, min(size, changeLists.size())), changeLists.size() < size + 1);
}
use of com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings in project intellij-community by JetBrains.
the class CommittedChangesCache method initCache.
private List<CommittedChangeList> initCache(final ChangesCacheFile cacheFile) throws VcsException, IOException {
debug("Initializing cache for " + cacheFile.getLocation());
final CachingCommittedChangesProvider provider = cacheFile.getProvider();
final RepositoryLocation location = cacheFile.getLocation();
final ChangeBrowserSettings settings = provider.createDefaultSettings();
int maxCount = 0;
if (isMaxCountSupportedForProject()) {
maxCount = myState.getInitialCount();
} else {
settings.USE_DATE_AFTER_FILTER = true;
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_YEAR, -myState.getInitialDays());
settings.setDateAfter(calendar.getTime());
}
//noinspection unchecked
final List<CommittedChangeList> changes = provider.getCommittedChanges(settings, location, maxCount);
// when initially initializing cache, assume all changelists are locally available
// this sorts changes in chronological order
writeChangesInReadAction(cacheFile, changes);
if (maxCount > 0 && changes.size() < myState.getInitialCount()) {
cacheFile.setHaveCompleteHistory(true);
}
if (changes.size() > 0) {
fireChangesLoaded(location, changes);
}
return changes;
}
Aggregations