mysociety/sayit — pull request #423 by girogiro (2014-11-28 18:44:33+00:00)
Title: Clobbering refinement in AkomaNtoso import

We use a three-level section hierarchy for parliamentary debates: electoral term - session - sitting. There is one AN file per sitting and the files share up to two outer level sections. To import a file into an existing hierarchy and still have an opportunity to replace existing sections I propose the following two changes in AkomaNtoso import.

Clobbering works on all levels of section hierarchy now, not on the top-level section only.

There are three options for clobbering of sections with the same heading:

* `skip` to skip import of a section that already exists,
* `replace` to delete existing section and replace it with the imported one,
* `merge` to append content of the imported section to the existing one.

It might be better also to join respective command-line options into something like `--clobbering` with three allowed values `skip`, `replace` and `merge`. I just added third separate option `--merge-existing` to the existing two in sake of backwards compatibility.