From fe0c0ca7279e35904c488dea57345e1d4f13f895 Mon Sep 17 00:00:00 2001 From: Rohit Sarkar Date: Sat, 1 Aug 2020 11:54:15 +0530 Subject: management: introduce replacerelations command The replacerelations script is used to ingest relations into Patchwork's patch database. A patch groups file is taken as input, which on each line contains a space separated list of patchwork ids denoting a relation. All the existing relations in Patchwork's database are removed and the relations read from the patch groups file are ingested. Signed-off-by: Rohit Sarkar [dja: pep8, drop relations directory as empty dirs don't get stored by git, comment about how lines are generated.] Signed-off-by: Daniel Axtens --- docs/deployment/management.rst | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'docs/deployment') diff --git a/docs/deployment/management.rst b/docs/deployment/management.rst index 9c57f19..dcee9ff 100644 --- a/docs/deployment/management.rst +++ b/docs/deployment/management.rst @@ -116,6 +116,43 @@ the :ref:`deployment installation guide `. input mbox filename. If not supplied, a patch will be read from ``stdin``. +replacerelations +~~~~~~~~~~~~~~~~ + +.. program:: manage.py replacerelations + +Parse a patch groups file and store any relation found + +.. code-block:: shell + + ./manage.py replacerelations + +This is a script used to ingest relations into Patchwork. + +A patch groups file contains on each line a list of space separated patch IDs +of patches that form a relation. + +For example, consider the contents of a sample patch groups file:: + + 1 3 5 + 2 + 7 10 11 12 + +In this case the script will identify 2 relations, (1, 3, 5) and +(7, 10, 11, 12). The single patch ID "2" on the second line is ignored as a +relation always consists of more than 1 patch. + +Further, if a patch ID in the patch groups file does not exist in the database +of the Patchwork instance, that patch ID will be silently ignored while forming +the relations. + +Running this script will remove all existing relations and replace them with +the relations found in the file. + +.. option:: infile + + input patch groups file. + rehash ~~~~~~ -- cgit v1.2.3