Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Luksza2012-04-01 00:14:18 +0000
committerMatthias Sohn2012-04-01 00:14:18 +0000
commitdf7527930d3ff1b4529e7716a27e33d2f3d6bde2 (patch)
tree1e0ba01c843a0cf45b4b23406b28b428711432b1 /org.eclipse.egit.mylyn.ui
parent8cae7599c35267c85a7fdef0b9ce0b8e2c9239c9 (diff)
downloadegit-df7527930d3ff1b4529e7716a27e33d2f3d6bde2.tar.gz
egit-df7527930d3ff1b4529e7716a27e33d2f3d6bde2.tar.xz
egit-df7527930d3ff1b4529e7716a27e33d2f3d6bde2.zip
[sync] New 'Git Commit Model' implementation
New less memory consuming implementation of 'Git Commit Model'. It uses cache providers added earlier for retrieving data from repository instead of calculating changes in every model object. This is only beginning of rewriting 'Git Commit Model'. Next commits will ensure that cache objects are created only once and completely destroyed after synchronization. Change-Id: I6a5b9c05bc210ebf3627fa24745f7d3d48a74e06 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.mylyn.ui')
-rw-r--r--org.eclipse.egit.mylyn.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java11
2 files changed, 11 insertions, 1 deletions
diff --git a/org.eclipse.egit.mylyn.ui/META-INF/MANIFEST.MF b/org.eclipse.egit.mylyn.ui/META-INF/MANIFEST.MF
index 798e16ad04..7b3b69cd9c 100644
--- a/org.eclipse.egit.mylyn.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.mylyn.ui/META-INF/MANIFEST.MF
@@ -26,6 +26,7 @@ Bundle-Localization: plugin
Export-Package: org.eclipse.egit.internal.mylyn.ui;version="2.0.0";x-friends:="org.eclipse.egit.ui.test",
org.eclipse.egit.internal.mylyn.ui.commit;version="2.0.0";x-internal:=true
Import-Package: org.eclipse.egit.core;version="[2.0.0,2.1.0)",
+ org.eclipse.egit.core.synchronize;version="[2.0.0,2.1.0)",
org.eclipse.egit.ui;version="[2.0.0,2.1.0)",
org.eclipse.egit.ui.internal.commit;version="[2.0.0,2.1.0)",
org.eclipse.egit.ui.internal.synchronize.model;version="[2.0.0,2.1.0)",
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
index e9f0c2e97a..f201fdab91 100644
--- a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/TaskReferenceFactory.java
@@ -24,6 +24,8 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.internal.mylyn.ui.EGitMylynUI;
import org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit;
+import org.eclipse.egit.ui.internal.synchronize.model.GitModelRepository;
+import org.eclipse.jgit.lib.AbbreviatedObjectId;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
@@ -119,7 +121,14 @@ public class TaskReferenceFactory implements IAdapterFactory {
commit = (RevCommit) element;
else if (element instanceof GitModelCommit) {
GitModelCommit modelCommit = (GitModelCommit) element;
- commit = modelCommit.getBaseCommit();
+ if (!(modelCommit.getParent() instanceof GitModelRepository))
+ return null; // should never happen
+
+ GitModelRepository parent = (GitModelRepository) modelCommit.getParent();
+ Repository repo = parent.getRepository();
+ AbbreviatedObjectId id = modelCommit.getCachedCommitObj().getId();
+
+ commit = new RevWalk(repo).lookupCommit(id.toObjectId());
}
return commit;
}

Back to the top