]> git.ozlabs.org Git - patchwork/commitdiff
Add patch tag infrastructure
authorJeremy Kerr <jk@ozlabs.org>
Wed, 27 May 2015 01:56:36 +0000 (09:56 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 28 May 2015 01:05:45 +0000 (09:05 +0800)
This change add patch 'tags', eg 'Acked-by' / 'Reviewed-by', etc., to
patchwork.

Tag parsing is implemented in the patch parser's extract_tags function,
which returns a Counter object of the tags in a comment. These are
stored in the PatchTag (keyed to Tag) objects associated with each
patch.

We need to ensure that the main patch lists do not cause per-patch
queries on the Patch.tags ManyToManyField (this would result in ~500
queries per page), so we introduce a new QuerySet (and Manager) for
Patch, adding a with_tag_counts() method to populate the tag counts in a
single query.

As users may be migrating from previous patchwork versions (ie, with no
tag counts in the database), we add a 'retag' management command.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

No differences found