Refactor to store dependencies as individual attributes

This also drops support for the transitional `json.depends.array`
configuration value, which has not been necessary since ~2016.

As with tags, dependencies are stored in both a "combined",
comma-separated format (for compatibility) and in an
attribute-per-dependency format (for the future).
This commit is contained in:
Dustin J. Mitchell 2021-08-15 20:18:02 +00:00 committed by Tomas Babej
parent 413b8d22b7
commit 20af583e21
10 changed files with 131 additions and 123 deletions

View file

@ -146,7 +146,6 @@ class TestExportCommand(TestCase):
self.t(('add', 'everything depends on me task'))
self.t(('add', 'wrong, everything depends on me task'))
self.t('1 modify depends:2,3')
self.t.config('json.depends.array', 'on')
deps = self.export(1)['depends']
self.assertType(deps, list)
@ -155,19 +154,6 @@ class TestExportCommand(TestCase):
for uuid in deps:
self.assertString(uuid, UUID_REGEXP, regexp=True)
def test_export_depends_oldformat(self):
self.t(('add', 'everything depends on me task'))
self.t(('add', 'wrong, everything depends on me task'))
self.t('1 modify depends:2,3')
code, out, err = self.t("rc.json.array=off rc.json.depends.array=off 1 export")
deps = json.loads(out)["depends"]
self.assertString(deps)
self.assertEqual(len(deps.split(",")), 2)
for uuid in deps.split(','):
self.assertString(uuid, UUID_REGEXP, regexp=True)
def test_export_urgency(self):
self.t('add urgent task +urgent')