From f0db1ff006e042e270e43c245a440aa8459e5cce Mon Sep 17 00:00:00 2001 From: Xyank Date: Fri, 24 Jul 2020 15:19:36 +0530 Subject: [PATCH 1/2] Make task inherit parent task tag and project Any conflicting data in the viewport should override this. --- taskwiki/vwtask.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/taskwiki/vwtask.py b/taskwiki/vwtask.py index 8c3ff1759..a5e175a8a 100644 --- a/taskwiki/vwtask.py +++ b/taskwiki/vwtask.py @@ -165,6 +165,11 @@ def from_line(cls, cache, number): if self.parent: self.parent.add_dependencies |= set([self]) + # Make task inherit parent task tag and project + if self.parent: + self.task['tags'].update(self.parent.task['tags']) + self.task['project'] = self.parent.task['project'] + # For new tasks, apply defaults from above viewport if not self.uuid: self.apply_defaults() From 5740aaa5b2815caf2636f65359171c866ac10052 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Thu, 10 Sep 2020 10:45:19 +0200 Subject: [PATCH 2/2] fixup! Make task inherit parent task tag and project --- taskwiki/vwtask.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/taskwiki/vwtask.py b/taskwiki/vwtask.py index a5e175a8a..98d9987e5 100644 --- a/taskwiki/vwtask.py +++ b/taskwiki/vwtask.py @@ -165,13 +165,12 @@ def from_line(cls, cache, number): if self.parent: self.parent.add_dependencies |= set([self]) - # Make task inherit parent task tag and project - if self.parent: - self.task['tags'].update(self.parent.task['tags']) - self.task['project'] = self.parent.task['project'] - - # For new tasks, apply defaults from above viewport + # For new tasks, apply defaults from parent and above viewport if not self.uuid: + if self.parent: + self['tags'] = self.parent['tags'] + self['project'] = self.parent['project'] + self.apply_defaults() # If -- is in description, assume it's separator for metadata