From 56bbdd3881b352ee68d42fce435826057729ca68 Mon Sep 17 00:00:00 2001 From: Kosta Harlan Date: Thu, 11 Apr 2013 09:18:31 -0400 Subject: [PATCH] Ignore annotations for task updates. Call task_done in users primary TW database when completing a task, as task merge wont get them. --- bugwarrior/db.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bugwarrior/db.py b/bugwarrior/db.py index a35bc29a1..e70234b03 100644 --- a/bugwarrior/db.py +++ b/bugwarrior/db.py @@ -74,6 +74,14 @@ def synchronize(issues, conf): id, task = tw.get_task(description=upstream_issue['description']) for key in upstream_issue: if key not in task: + if experimental is True and "annotation_" in key: + # TaskWarrior doesn't currently (2.2.0) allow for setting + # the annotation entry key. This means that each annotation + # key will always be updated to the current date and time, + # which in turn means BW will always think a task has been + # updated. Until this is resolved in 2.3.0, ignore + # annotation updates in experimental mode. + continue log.name('db').info( "Updating {0} on {1}", key, @@ -94,6 +102,11 @@ def synchronize(issues, conf): send_notification(task, 'Completed', conf) tw.task_done(uuid=task['uuid']) + if experimental is True: + # `task merge` only updates/adds tasks, it won't delete them, so + # call task_done() on the primary TW task database. + tw_done = TaskWarriorExperimental() + tw_done.task_done(uuid=task['uuid']) # Merge tasks with users local DB if experimental is True: