mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GitLogRecord: fix revisions creation params
Create multiple content revision with the correct (this) revision, not by taking the first of parents.
This commit is contained in:
@@ -116,17 +116,17 @@ public class GitContentRevision implements ContentRevision {
|
||||
return myFile.hashCode() + myRevision.hashCode();
|
||||
}
|
||||
|
||||
public static ContentRevision createMultipleParentsRevision(Project project,
|
||||
final FilePath file,
|
||||
final List<GitRevisionNumber> revisions) throws VcsException {
|
||||
final GitContentRevision contentRevision = createRevisionImpl(file, revisions.get(0), project, null);
|
||||
if (revisions.size() == 1) {
|
||||
public static ContentRevision createMultipleParentsRevision(@NotNull Project project, @NotNull final FilePath file,
|
||||
@NotNull GitRevisionNumber currentRevision,
|
||||
@NotNull final List<GitRevisionNumber> parentRevisions) throws VcsException {
|
||||
final GitContentRevision contentRevision = createRevisionImpl(file, currentRevision, project, null);
|
||||
if (parentRevisions.size() == 1) {
|
||||
return contentRevision;
|
||||
} else {
|
||||
if (contentRevision instanceof GitBinaryContentRevision) {
|
||||
return new GitBinaryMultipleContentsRevision(file, revisions, (GitBinaryContentRevision) contentRevision);
|
||||
return new GitBinaryMultipleContentsRevision(file, parentRevisions, (GitBinaryContentRevision) contentRevision);
|
||||
} else {
|
||||
return new GitMultipleContentsRevision(file, revisions, contentRevision);
|
||||
return new GitMultipleContentsRevision(file, parentRevisions, contentRevision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,13 +224,14 @@ class GitLogRecord {
|
||||
status = FileStatus.MODIFIED;
|
||||
}
|
||||
final FilePath filePath = GitContentRevision.createPath(vcsRoot, path, false, true, true);
|
||||
before = GitContentRevision.createMultipleParentsRevision(project, filePath, parentRevisions);
|
||||
before = GitContentRevision.createMultipleParentsRevision(project, filePath, (GitRevisionNumber)thisRevision, parentRevisions);
|
||||
after = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, false, false, true);
|
||||
break;
|
||||
case DELETED:
|
||||
status = FileStatus.DELETED;
|
||||
final FilePath filePathDeleted = GitContentRevision.createPath(vcsRoot, path, true, true, true);
|
||||
before = GitContentRevision.createMultipleParentsRevision(project, filePathDeleted, parentRevisions);
|
||||
before = GitContentRevision.createMultipleParentsRevision(project, filePathDeleted,
|
||||
(GitRevisionNumber)thisRevision, parentRevisions);
|
||||
after = null;
|
||||
break;
|
||||
case RENAMED:
|
||||
@@ -238,13 +239,14 @@ class GitLogRecord {
|
||||
String secondPath = statusInfo.getSecondPath();
|
||||
final FilePath filePathAfterRename = GitContentRevision.createPath(vcsRoot, secondPath == null ? path : secondPath,
|
||||
false, false, true);
|
||||
after = GitContentRevision.createMultipleParentsRevision(project, filePathAfterRename, parentRevisions);
|
||||
before = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, true, true, true);
|
||||
after = GitContentRevision.createMultipleParentsRevision(project, filePathAfterRename,
|
||||
(GitRevisionNumber)thisRevision, parentRevisions);
|
||||
before = GitContentRevision.createRevision(vcsRoot, path, parentRevisions.get(0), project, true, true, true);
|
||||
break;
|
||||
case TYPE_CHANGED:
|
||||
status = FileStatus.MODIFIED;
|
||||
final FilePath filePath2 = GitContentRevision.createPath(vcsRoot, path, false, true, true);
|
||||
before = GitContentRevision.createMultipleParentsRevision(project, filePath2, parentRevisions);
|
||||
before = GitContentRevision.createMultipleParentsRevision(project, filePath2, (GitRevisionNumber)thisRevision, parentRevisions);
|
||||
after = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, false, false, true);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user