diff options
author | Kevin Sawicki | 2011-04-12 19:27:45 +0000 |
---|---|---|
committer | Chris Aniszczyk | 2011-04-13 02:57:47 +0000 |
commit | 75045fcbd780e5fe5f841013f45d7ce0aadfc342 (patch) | |
tree | dda5c21fa3cc355c1011b5129fdda2b6f300f69e | |
parent | 3f9c2502fd7cf0161f73d445910b0d5ba5067ef8 (diff) | |
download | egit-github-75045fcbd780e5fe5f841013f45d7ce0aadfc342.tar.gz egit-github-75045fcbd780e5fe5f841013f45d7ce0aadfc342.tar.xz egit-github-75045fcbd780e5fe5f841013f45d7ce0aadfc342.zip |
Refresh labels and milestones in update of repository config
Change-Id: I55be774f3a172d74639883215b773dfe6e1de53e
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
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 f07b3006..b36ab669 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 b86705ea..052fbe1b 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 29eaa585..8ecbd90f 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 |