summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-12 15:27:45 (EDT)
committerChris Aniszczyk2011-04-12 22:57:47 (EDT)
commit75045fcbd780e5fe5f841013f45d7ce0aadfc342 (patch)
treedda5c21fa3cc355c1011b5129fdda2b6f300f69e
parent3f9c2502fd7cf0161f73d445910b0d5ba5067ef8 (diff)
downloadegit-github-75045fcbd780e5fe5f841013f45d7ce0aadfc342.zip
egit-github-75045fcbd780e5fe5f841013f45d7ce0aadfc342.tar.gz
egit-github-75045fcbd780e5fe5f841013f45d7ce0aadfc342.tar.bz2
Refresh labels and milestones in update of repository configrefs/changes/79/3079/3
Change-Id: I55be774f3a172d74639883215b773dfe6e1de53e Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubRepositoryConnector.java19
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Messages.java12
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/messages.properties4
3 files changed, 30 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubRepositoryConnector.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubRepositoryConnector.java
index f07b300..b36ab66 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubRepositoryConnector.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubRepositoryConnector.java
@@ -27,6 +27,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.mylyn.commons.net.Policy;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
@@ -227,7 +228,7 @@ public class GitHubRepositoryConnector extends AbstractRepositoryConnector {
*/
@Override
public String getLabel() {
- return "GitHub Issues";
+ return Messages.GitHubRepositoryConnector_LabelConnector;
}
/**
@@ -245,7 +246,7 @@ public class GitHubRepositoryConnector extends AbstractRepositoryConnector {
IStatus result = Status.OK_STATUS;
List<String> statuses = QueryUtils.getAttributes(IssueService.FILTER_STATE, query);
- monitor.beginTask("Querying repository...", statuses.size());
+ monitor.beginTask(Messages.GitHubRepositoryConnector_TaskQuerying, statuses.size());
try {
String user = GitHub.computeTaskRepositoryUser(repository.getUrl());
String project = GitHub.computeTaskRepositoryProject(repository
@@ -330,7 +331,7 @@ public class GitHubRepositoryConnector extends AbstractRepositoryConnector {
@Override
public String getRepositoryUrlFromTaskUrl(String taskFullUrl) {
if (taskFullUrl != null) {
- Matcher matcher = Pattern.compile("(http://.+?)/issues/issue/([^/]+)").matcher(taskFullUrl);
+ Matcher matcher = Pattern.compile("(http://.+?)/issues/issue/([^/]+)").matcher(taskFullUrl); //$NON-NLS-1$
if (matcher.matches()) {
return matcher.group(1);
}
@@ -341,7 +342,7 @@ public class GitHubRepositoryConnector extends AbstractRepositoryConnector {
@Override
public String getTaskIdFromTaskUrl(String taskFullUrl) {
if (taskFullUrl != null) {
- Matcher matcher = Pattern.compile(".+?/issues/issue/([^/]+)").matcher(taskFullUrl);
+ Matcher matcher = Pattern.compile(".+?/issues/issue/([^/]+)").matcher(taskFullUrl); //$NON-NLS-1$
if (matcher.matches()) {
return matcher.group(1);
}
@@ -351,12 +352,20 @@ public class GitHubRepositoryConnector extends AbstractRepositoryConnector {
@Override
public String getTaskUrl(String repositoryUrl, String taskId) {
- return repositoryUrl+"/issues/issue/"+taskId;
+ return repositoryUrl+"/issues/issue/"+taskId; //$NON-NLS-1$
}
@Override
public void updateRepositoryConfiguration(TaskRepository taskRepository,
IProgressMonitor monitor) throws CoreException {
+ monitor = Policy.monitorFor(monitor);
+ monitor.beginTask("", 2); //$NON-NLS-1$
+ monitor.setTaskName(Messages.GitHubRepositoryConnector_TaskUpdatingLabels);
+ refreshLabels(taskRepository);
+ monitor.worked(1);
+ monitor.setTaskName(Messages.GitHubRepositoryConnector_TaskUpdatingMilestones);
+ refreshMilestones(taskRepository);
+ monitor.done();
}
@Override
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Messages.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Messages.java
index b86705e..052fbe1 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Messages.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Messages.java
@@ -20,6 +20,18 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.mylyn.github.internal.messages"; //$NON-NLS-1$
/** */
+ public static String GitHubRepositoryConnector_LabelConnector;
+
+ /** */
+ public static String GitHubRepositoryConnector_TaskQuerying;
+
+ /** */
+ public static String GitHubRepositoryConnector_TaskUpdatingLabels;
+
+ /** */
+ public static String GitHubRepositoryConnector_TaskUpdatingMilestones;
+
+ /** */
public static String GitHubTaskAttributes_LabekSummary;
/** */
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/messages.properties b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/messages.properties
index 29eaa58..8ecbd90 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/messages.properties
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/messages.properties
@@ -1,3 +1,7 @@
+GitHubRepositoryConnector_LabelConnector=GitHub Issues
+GitHubRepositoryConnector_TaskQuerying=Querying repository...
+GitHubRepositoryConnector_TaskUpdatingLabels=Updating labels
+GitHubRepositoryConnector_TaskUpdatingMilestones=Updating milestones
GitHubTaskAttributes_LabekSummary=Summary
GitHubTaskAttributes_LabelAssignee=Assignee:
GitHubTaskAttributes_LabelAssigneeGravatar=Assignee