use of com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings in project intellij-community by JetBrains.
the class HgBrowseChangesTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
myVcs = HgVcs.getInstance(myProject);
assert myVcs != null;
mySettings = new ChangeBrowserSettings();
cd(myRepository);
touch("f2.txt");
hg("add");
hg("commit -m add");
java.util.Calendar now = java.util.Calendar.getInstance();
now.add(YEAR, 1);
dateBefore = ChangeBrowserSettings.DATE_FORMAT.format(now.getTime());
now.set(YEAR, 1970);
dateAfter = ChangeBrowserSettings.DATE_FORMAT.format(now.getTime());
}
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 HgCachingCommittedChangesProvider method getOneList.
@Override
public Pair<CommittedChangeList, FilePath> getOneList(VirtualFile file, VcsRevisionNumber number) throws VcsException {
final ChangeBrowserSettings settings = createDefaultSettings();
settings.USE_CHANGE_AFTER_FILTER = true;
settings.USE_CHANGE_BEFORE_FILTER = true;
settings.CHANGE_AFTER = number.asString();
settings.CHANGE_BEFORE = number.asString();
// todo implement in proper way
VirtualFile localVirtualFile = HgUtil.convertToLocalVirtualFile(file);
if (localVirtualFile == null) {
return null;
}
final FilePath filePath = VcsUtil.getFilePath(localVirtualFile);
final CommittedChangeList list = getCommittedChangesForRevision(getLocationFor(filePath), number.asString());
if (list != null) {
return new Pair<>(list, filePath);
}
return null;
}
Aggregations