summaryrefslogtreecommitdiff
path: root/docs/deployment
diff options
context:
space:
mode:
authorRohit Sarkar <rohitsarkar5398@gmail.com>2020-08-01 11:54:15 +0530
committerDaniel Axtens <dja@axtens.net>2020-08-10 11:44:40 +1000
commitfe0c0ca7279e35904c488dea57345e1d4f13f895 (patch)
treeb8729932c03925beaed944463c2046de152663ac /docs/deployment
parent8abd63eb75617ffff14205376ca6283c8f5e0ba2 (diff)
downloadpatchwork-fe0c0ca7279e35904c488dea57345e1d4f13f895.tar
patchwork-fe0c0ca7279e35904c488dea57345e1d4f13f895.tar.gz
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 <rohitsarkar5398@gmail.com> [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 <dja@axtens.net>
Diffstat (limited to 'docs/deployment')
-rw-r--r--docs/deployment/management.rst37
1 files changed, 37 insertions, 0 deletions
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 <deployment-parsemail>`.
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 <infile>
+
+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
~~~~~~