Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/JobFamilies.java5
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java18
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java12
3 files changed, 27 insertions, 8 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/JobFamilies.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/JobFamilies.java
index 2fe4a283a..33befcaa2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/JobFamilies.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/JobFamilies.java
@@ -124,6 +124,11 @@ public class JobFamilies {
public final static Object FORMAT_COMMIT_INFO = new JobFamily();
/**
+ * Commit editor job
+ */
+ public final static Object COMMIT_EDITOR = new JobFamily();
+
+ /**
* Fill tag list
*/
public final static Object FILL_TAG_LIST = new JobFamily(UIIcons.TAGS);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
index 7497d3c6d..532106ef1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
@@ -23,14 +23,18 @@ import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.AdapterUtils;
+import org.eclipse.egit.core.EclipseGitProgressTransformer;
import org.eclipse.egit.core.internal.Utils;
import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.JobFamilies;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.UIUtils;
import org.eclipse.egit.ui.internal.ClipboardUtils;
@@ -634,13 +638,14 @@ public class CommitEditorPage extends FormPage
return Collections.emptyList();
}
if (refs.size() < BRANCH_LIMIT_FOR_SYNC_LOAD) {
- return findBranchesReachableFromCommit(commit, refs);
+ return findBranchesReachableFromCommit(commit, refs,
+ new NullProgressMonitor());
} else {
Job branchRefreshJob = new CommitEditorPageJob(commit) {
@Override
protected IStatus run(IProgressMonitor monitor) {
List<Ref> branches = findBranchesReachableFromCommit(commit,
- refs);
+ refs, monitor);
updateUI(monitor, () -> fillBranches(branches));
return Status.OK_STATUS;
}
@@ -651,10 +656,12 @@ public class CommitEditorPage extends FormPage
}
private List<Ref> findBranchesReachableFromCommit(RepositoryCommit commit,
- List<Ref> refs) {
+ List<Ref> refs, IProgressMonitor monitor) {
+ EclipseGitProgressTransformer progress = new EclipseGitProgressTransformer(
+ SubMonitor.convert(monitor, refs.size()));
try (RevWalk revWalk = new RevWalk(commit.getRepository())) {
return RevWalkUtils.findBranchesReachableFrom(commit.getRevCommit(),
- revWalk, refs);
+ revWalk, refs, progress);
} catch (IOException e) {
Activator.handleError(e.getMessage(), e, false);
return Collections.emptyList();
@@ -713,7 +720,8 @@ public class CommitEditorPage extends FormPage
@Override
public boolean belongsTo(Object family) {
- return CommitEditorPage.this == family;
+ return CommitEditorPage.this == family
+ || JobFamilies.COMMIT_EDITOR == family;
}
protected final void updateUI(IProgressMonitor monitor, Runnable task) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java
index 56a6c9b06..bae488156 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitInfoBuilder.java
@@ -25,6 +25,8 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.egit.core.EclipseGitProgressTransformer;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.internal.CommonUtils;
@@ -120,7 +122,7 @@ public class CommitInfoBuilder {
if(Activator.getDefault().getPreferenceStore().getBoolean(
UIPreferences.HISTORY_SHOW_BRANCH_SEQUENCE)) {
try (RevWalk rw = new RevWalk(db)) {
- List<Ref> branches = getBranches(commit, allRefs, db);
+ List<Ref> branches = getBranches(commit, allRefs, db, monitor);
Collections.sort(branches,
CommonUtils.REF_ASCENDING_COMPARATOR);
if (!branches.isEmpty()) {
@@ -255,18 +257,22 @@ public class CommitInfoBuilder {
* @param commit
* @param allRefs
* @param db
+ * @param monitor
* @return List of heads from those current commit is reachable
* @throws MissingObjectException
* @throws IncorrectObjectTypeException
* @throws IOException
*/
private static List<Ref> getBranches(RevCommit commit,
- Collection<Ref> allRefs, Repository db)
+ Collection<Ref> allRefs, Repository db, IProgressMonitor monitor)
throws MissingObjectException, IncorrectObjectTypeException,
IOException {
+ EclipseGitProgressTransformer progress = new EclipseGitProgressTransformer(
+ SubMonitor.convert(monitor, allRefs.size()));
try (RevWalk revWalk = new RevWalk(db)) {
revWalk.setRetainBody(false);
- return RevWalkUtils.findBranchesReachableFrom(commit, revWalk, allRefs);
+ return RevWalkUtils.findBranchesReachableFrom(commit, revWalk,
+ allRefs, progress);
}
}

Back to the top