summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDariusz Luksza2010-08-15 07:51:22 (EDT)
committer Chris Aniszczyk2010-08-16 11:38:11 (EDT)
commit7580eab6612456d54708691dd326507554312fb0 (patch)
treee753634f8c91d2d1d381cc6025afe1d6190602ac
parent0c431606da7a7b7f6179c76426c75367d29be6f5 (diff)
downloadegit-7580eab6612456d54708691dd326507554312fb0.zip
egit-7580eab6612456d54708691dd326507554312fb0.tar.gz
egit-7580eab6612456d54708691dd326507554312fb0.tar.bz2
Exclude repository node on single repo synchronizationrefs/changes/07/1307/2
This is a usability improvement. When synchronization is performed on single repository, the 'repository node' in 'Git Change Set' is omitted. In case of synchronization multiple repositories at once 'repository node' will be included for each repository that is synchronized. Change-Id: I4586c3891c58ee5f8a60c14f4204117d11b742ae Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java22
2 files changed, 22 insertions, 8 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
index ddd8564..a300beb 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/dto/GitSynchronizeDataSet.java
@@ -62,6 +62,14 @@ public class GitSynchronizeDataSet implements Iterable<GitSynchronizeData> {
}
/**
+ * @return number of {@link GitSynchronizeData} that are included in this
+ * set
+ */
+ public int size() {
+ return gsd.size();
+ }
+
+ /**
* @param projectName
* @return <code>null</code> if project does not have corresponding data
*/
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java
index 0e5fde4..b1a2888 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/model/GitModelRoot.java
@@ -40,17 +40,23 @@ public class GitModelRoot {
/**
* @return children
*/
- public GitModelRepository[] getChildren() {
- List<GitModelRepository> restult = new ArrayList<GitModelRepository>();
- for (GitSynchronizeData data : gsds) {
- try {
- restult.add(new GitModelRepository(data));
- } catch (IOException e) {
+ public GitModelObject[] getChildren() {
+ List<GitModelObject> restult = new ArrayList<GitModelObject>();
+ try {
+ if (gsds.size() == 1) {
+ GitSynchronizeData gsd = gsds.iterator().next();
+ GitModelRepository repoModel = new GitModelRepository(gsd);
+
+ for (GitModelObject obj : repoModel.getChildren())
+ restult.add(obj);
+ } else
+ for (GitSynchronizeData data : gsds)
+ restult.add(new GitModelRepository(data));
+ } catch (IOException e) {
Activator.logError(e.getMessage(), e);
- }
}
- return restult.toArray(new GitModelRepository[restult.size()]);
+ return restult.toArray(new GitModelObject[restult.size()]);
}
}