use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class SvnLogUtil method loadInterval.
public List<CommittedChangeList> loadInterval(final SVNRevision fromIncluding, final SVNRevision toIncluding, final int maxCount, final boolean includingYoungest, final boolean includeOldest) throws VcsException {
final List<CommittedChangeList> result = new ArrayList<>();
LogEntryConsumer handler = createLogHandler(fromIncluding, toIncluding, includingYoungest, includeOldest, result);
SvnTarget target = SvnTarget.fromURL(myLocation.toSvnUrl());
myVcs.getFactory(target).createHistoryClient().doLog(target, fromIncluding, toIncluding, true, true, false, maxCount, null, handler);
return result;
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class Merger method getInfo.
@Nullable
public String getInfo() {
String result = null;
if (myMergeChunk != null) {
// TODO: Use values from SvnBundle
StringBuilder builder = new StringBuilder("Changelist(s) :");
for (CommittedChangeList list : myMergeChunk.changeLists()) {
final String nextComment = list.getComment().trim().replace('\n', '|');
builder.append("\n").append(list.getNumber()).append(" (").append(nextComment).append(")");
}
builder.append(" merging faced problems");
result = builder.toString();
}
return result;
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class Merger method getSkippedMessage.
@Nullable
public static String getSkippedMessage(@NotNull List<CommittedChangeList> changeLists) {
String result = null;
if (!changeLists.isEmpty()) {
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < changeLists.size(); i++) {
CommittedChangeList list = changeLists.get(i);
if (i != 0) {
sb.append(',');
}
sb.append(list.getNumber()).append(" (").append(list.getComment().replace('\n', '|')).append(')');
}
result = SvnBundle.message("action.Subversion.integrate.changes.warning.skipped.lists.text", sb.toString());
}
return result;
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class GitCommittedChangeListProvider method getOneList.
@Override
public Pair<CommittedChangeList, FilePath> getOneList(final VirtualFile file, final VcsRevisionNumber number) throws VcsException {
FilePath filePath = VcsUtil.getFilePath(file);
final List<GitHeavyCommit> gitCommits = GitHistoryUtils.commitsDetails(myProject, filePath, new SymbolicRefs(), Collections.singletonList(number.asString()));
if (gitCommits.size() != 1) {
return null;
}
final GitHeavyCommit gitCommit = gitCommits.get(0);
CommittedChangeList commit = new GitCommittedChangeList(gitCommit.getDescription() + " (" + gitCommit.getShortHash().getString() + ")", gitCommit.getDescription(), gitCommit.getAuthor(), (GitRevisionNumber) number, new Date(gitCommit.getAuthorTime()), gitCommit.getChanges(), assertNotNull(GitVcs.getInstance(myProject)), true);
final Collection<Change> changes = commit.getChanges();
if (changes.size() == 1) {
Change change = changes.iterator().next();
return Pair.create(commit, ChangesUtil.getFilePath(change));
}
for (Change change : changes) {
if (change.getAfterRevision() != null && FileUtil.filesEqual(filePath.getIOFile(), change.getAfterRevision().getFile().getIOFile())) {
return Pair.create(commit, filePath);
}
}
final String afterTime = "--after=" + GitUtil.gitTime(gitCommit.getDate());
final List<VcsFileRevision> history = GitHistoryUtils.history(myProject, filePath, (VirtualFile) null, afterTime);
if (history.isEmpty()) {
return Pair.create(commit, filePath);
}
return Pair.create(commit, ((GitFileRevision) history.get(history.size() - 1)).getPath());
}
use of com.intellij.openapi.vcs.versionBrowser.CommittedChangeList in project intellij-community by JetBrains.
the class SvnCachingRevisionsTest method createCommittedIterator.
private Iterator<ChangesBunch> createCommittedIterator(final int bunchSize, final List<Long> revisions) {
final List<ChangesBunch> list = new ArrayList<>();
for (int i = revisions.size() - 1; i >= 0; i -= bunchSize) {
final int j = (bunchSize > i) ? -1 : (i - bunchSize);
final List<CommittedChangeList> subList = new ArrayList<>();
for (int k = i; k > j; --k) {
subList.add(createList(revisions.get(k)));
}
list.add(new ChangesBunch(subList, (j != -1)));
if (j == -1) {
break;
}
}
return list.iterator();
}
Aggregations