Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2007-06-25 19:59:16 -0400
committerspingel2007-06-25 19:59:16 -0400
commit133df02e12aa06318d60d90eb865385428a18dcb (patch)
tree083aeb8fb8805037bb481bdef07e18a0f6679992
parenta4d1a12a18c05c94c86292c7357d704b41a3d39b (diff)
downloadorg.eclipse.mylyn.tasks-133df02e12aa06318d60d90eb865385428a18dcb.tar.gz
org.eclipse.mylyn.tasks-133df02e12aa06318d60d90eb865385428a18dcb.tar.xz
org.eclipse.mylyn.tasks-133df02e12aa06318d60d90eb865385428a18dcb.zip
Complete - bug 187323: Investigate traffic utilization of automatic updates
https://bugs.eclipse.org/bugs/show_bug.cgi?id=187323
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/ITracClient.java2
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java11
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracWebClient.java4
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracXmlRpcClient.java6
4 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/ITracClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/ITracClient.java
index 5bf39f461..934afb101 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/ITracClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/ITracClient.java
@@ -189,4 +189,6 @@ public interface ITracClient {
void setProxy(Proxy proxy);
+ Date getTicketLastChanged(Integer id) throws TracException;
+
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java
index 62b656a67..309908c5b 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracRepositoryConnector.java
@@ -180,6 +180,17 @@ public class TracRepositoryConnector extends AbstractRepositoryConnector {
return false;
}
+ if (ids.size() == 1) {
+ // getChangedTickets() is expected to always return at least one ticket because
+ // the repository synchronization timestamp is set to the most recent modification date
+ Integer id = ids.iterator().next();
+ Date lastChanged = client.getTicketLastChanged(id);
+ if (since.equals(lastChanged)) {
+ // repository didn't actually change
+ return false;
+ }
+ }
+
for (AbstractTask task : tasks) {
Integer id = getTicketId(task.getTaskId());
if (ids.contains(id)) {
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracWebClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracWebClient.java
index a49d8ac37..9d16ac4e1 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracWebClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracWebClient.java
@@ -699,4 +699,8 @@ public class TracWebClient extends AbstractTracClient {
}
+ public Date getTicketLastChanged(Integer id) {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracXmlRpcClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracXmlRpcClient.java
index 0818811d2..aabf52984 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracXmlRpcClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracXmlRpcClient.java
@@ -640,4 +640,10 @@ public class TracXmlRpcClient extends AbstractTracClient {
}
}
+
+ public Date getTicketLastChanged(Integer id) throws TracException {
+ Object[] result = (Object[]) call("ticket.get", id);
+ return parseDate(result[2]);
+ }
+
} \ No newline at end of file

Back to the top