Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-05-19 00:42:17 +0000
committerKevin Sawicki2011-05-19 00:42:17 +0000
commite2b833a5c5da6cdee3745b7f9bcd7e37aa8216cb (patch)
tree74ecae53c53560e608170958a5dff01ea4b4a793
parent4e5514a9287cd38c2b692fd5b4c1d31f6170a529 (diff)
downloadegit-github-e2b833a5c5da6cdee3745b7f9bcd7e37aa8216cb.tar.gz
egit-github-e2b833a5c5da6cdee3745b7f9bcd7e37aa8216cb.tar.xz
egit-github-e2b833a5c5da6cdee3745b7f9bcd7e37aa8216cb.zip
Fetch issues comments on synchronize.
Change-Id: I295823850bbc08d5256d1ed47422bf18abb08af7 Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java35
1 files changed, 12 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
index 3473ef35..779778b1 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
@@ -287,6 +287,8 @@ public class IssueConnector extends AbstractRepositoryConnector {
labelsQuery.toString());
}
+ String owner = repo.getOwner();
+ String name = repo.getName();
for (String status : statuses) {
filterData.put(IssueService.FILTER_STATE, status);
List<Issue> issues = service.getIssues(repo.getOwner(),
@@ -294,16 +296,16 @@ public class IssueConnector extends AbstractRepositoryConnector {
// collect task data
for (Issue issue : issues) {
+ List<Comment> comments = null;
+ if (issue.getComments() > 0)
+ comments = service.getComments(owner, name,
+ Integer.toString(issue.getNumber()));
TaskData taskData = taskDataHandler.createTaskData(
- repository, monitor, repo.getOwner(),
- repo.getName(), issue);
- taskData.setPartial(true);
+ repository, monitor, owner, name, issue, comments);
collector.accept(taskData);
}
monitor.worked(1);
}
-
- result = Status.OK_STATUS;
} catch (RequestException e) {
result = GitHub.createErrorStatus(new GitHubException(e));
} catch (IOException e) {
@@ -329,10 +331,8 @@ public class IssueConnector extends AbstractRepositoryConnector {
comments = service.getComments(repo.getOwner(), repo.getName(),
taskId);
}
- TaskData taskData = taskDataHandler.createTaskData(repository,
- monitor, repo.getOwner(), repo.getName(), issue, comments);
-
- return taskData;
+ return taskDataHandler.createTaskData(repository, monitor,
+ repo.getOwner(), repo.getName(), issue, comments);
} catch (IOException e) {
throw new CoreException(GitHub.createErrorStatus(e));
}
@@ -383,20 +383,9 @@ public class IssueConnector extends AbstractRepositoryConnector {
@Override
public boolean hasTaskChanged(TaskRepository repository, ITask task,
TaskData taskData) {
- TaskAttribute modAttribute = taskData.getRoot().getAttribute(
- TaskAttribute.DATE_MODIFICATION);
- if (modAttribute == null)
- return false;
-
- boolean changed = true;
- Date modDate = task.getModificationDate();
- if (modDate != null) {
- Date updateDate = taskData.getAttributeMapper().getDateValue(
- modAttribute);
- if (updateDate != null)
- changed = updateDate.after(modDate);
- }
- return changed;
+ Date dataDate = getTaskMapping(taskData).getModificationDate();
+ Date taskDate = task.getModificationDate();
+ return dataDate == null || !dataDate.equals(taskDate);
}
@Override

Back to the top