Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Karena2015-01-20 17:51:54 +0000
committerAndrey Loskutov2015-08-23 20:19:26 +0000
commitb9dad5fadac493446990048db3c679687eb329fd (patch)
treeeba6dfe4acff54a09040bf0482077881c5ad9abc
parent148548b5a317010401a3eba151cf04ead862046b (diff)
downloadegit-b9dad5fadac493446990048db3c679687eb329fd.tar.gz
egit-b9dad5fadac493446990048db3c679687eb329fd.tar.xz
egit-b9dad5fadac493446990048db3c679687eb329fd.zip
Show that there are changes in "Git Repositories" view
Equal to the modification of a file, where the sign '>' is added to the filename, the same character is added, when a file in a repository gets changed. It's very usefull when you work with many repositories. Change-Id: I5fe30cb738c0ec5334430fc710d2d826deaebff1 Signed-off-by: Peter Karena <peter.karena@arcor.de>
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java12
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java8
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabels.java20
4 files changed, 33 insertions, 10 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
index 85c921494e..77ec5cf2f2 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
@@ -94,8 +94,7 @@ public class GitRepositoriesViewFetchAndPushTest extends
Activator.getDefault().getRepositoryUtil().addConfiguredRepository(
clonedRepositoryFile);
shareProjects(clonedRepositoryFile);
- SWTBotTree tree = getOrOpenView().bot().tree();
- tree.select(0);
+
Repository repository = lookupRepository(clonedRepositoryFile);
// add the configuration for push
@@ -109,6 +108,9 @@ public class GitRepositoriesViewFetchAndPushTest extends
new Git(repository).branchRename().setOldName(currentBranch)
.setNewName("" + System.currentTimeMillis()).call();
+ SWTBotTree tree = getOrOpenView().bot().tree();
+ tree.select(0);
+
TestUtil.waitForJobs(50, 5000);
selectNode(tree, useRemote, false);
@@ -154,9 +156,11 @@ public class GitRepositoriesViewFetchAndPushTest extends
objectIdBefore = objectIdBefore.substring(0, 7);
touchAndSubmit(null);
- selectNode(tree, useRemote, false);
+ SWTBotTree updatedTree = getOrOpenView().bot().tree();
+ updatedTree.select(0);
+ selectNode(updatedTree, useRemote, false);
- runPush(tree);
+ runPush(updatedTree);
confirmed = bot.shell(dialogTitle);
treeItems = confirmed.bot().tree().getAllItems();
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
index 155fd1843e..d47ecb4bc5 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTest.java
@@ -419,19 +419,19 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
SWTBotTree tree = getOrOpenView().bot().tree();
myRepoViewUtil.getRootItem(tree, repositoryFile).select();
// the selection should be root
- assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
+ assertTrue(tree.selection().get(0, 0).contains(REPO1));
SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
getProjectItem(projectExplorerTree, PROJ1).select();
// the selection should be still be root
- assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
+ assertTrue(tree.selection().get(0, 0).contains(REPO1));
// activate the link with selection
toggleLinkWithSelection();
// the selection should be still be root
- assertTrue(tree.selection().get(0, 0).startsWith(REPO1));
+ assertTrue(tree.selection().get(0, 0).contains(REPO1));
// select again the project
projectExplorerTree = TestUtil.getExplorerTree();
@@ -664,4 +664,4 @@ public class GitRepositoriesViewTest extends GitRepositoriesViewTestBase {
item = item.getNode(node).expand();
return item;
}
-} \ No newline at end of file
+}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
index 389cbea014..9b9089dce1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
@@ -99,8 +99,7 @@ public abstract class GitRepositoriesViewTestBase extends
final SWTBotTreeItem[] items = tree.getAllItems();
boolean found = false;
for (SWTBotTreeItem item : items) {
- if (item.getText().startsWith(
- repositoryDir.getParentFile().getName())) {
+ if (item.getText().contains(repositoryDir.getParentFile().getName())) {
found = true;
break;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabels.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabels.java
index d53bcf6e06..6fa96fddc1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabels.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitLabels.java
@@ -13,6 +13,8 @@ package org.eclipse.egit.ui.internal;
import java.io.IOException;
import org.eclipse.egit.core.RepositoryUtil;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry;
+import org.eclipse.egit.core.internal.indexdiff.IndexDiffData;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.clone.ProjectRecord;
import org.eclipse.egit.ui.internal.repository.tree.RefNode;
@@ -96,6 +98,24 @@ public class GitLabels {
.getRepositoryUtil();
StyledString string = new StyledString();
+
+ IndexDiffCacheEntry entry = org.eclipse.egit.core.Activator
+ .getDefault().getIndexDiffCache()
+ .getIndexDiffCacheEntry(repository);
+ if (entry != null) {
+ IndexDiffData indexDiffData = entry.getIndexDiff();
+ if (indexDiffData != null
+ && (!indexDiffData.getAdded().isEmpty()
+ || !indexDiffData.getChanged().isEmpty()
+ || !indexDiffData.getRemoved().isEmpty()
+ || !indexDiffData.getUntracked().isEmpty()
+ || !indexDiffData.getModified().isEmpty() || !indexDiffData
+ .getMissing().isEmpty())) {
+ string.append('>');
+ string.append(' ');
+ }
+ }
+
string.append(repositoryUtil.getRepositoryName(repository));
String branch = repositoryUtil.getShortBranch(repository);

Back to the top