getpelican/pelican — pull request #943 by Rogdham (2013-06-22 14:12:47+00:00)
Title: Deliberate overriding and overwrite detection. Fixes #938

# Overview

This PR is composed of two separate commits:
- the fist one is to add the missing test which did not warn about recession when the overwrite detection was implemented
- the second one is to fix the actual bug

Note that the tests after the first commit are supposed to fail, but should be fixed by the second.

Follow more details from the commit messages. See also #938 for more informations about that bug.

# “Add test” commit

Deliberate overriding via `save_as` metadata should be allowed, even after the
overwrite detection feature. This commit is to add tests for deliberate
overriding. As a result, the relevant tests *should fail* after this commit.

Overriding feature introduced by d0e9c52
Overwrite detection introduced by ff7410c

# “Fix bug” commit

Make deliberate overriding (*) works with overwrites detection.

(*) first introduced by d0e9c52

The following are decided to be deliberate override:
- articles using the `save_as` metadata
- pages using the `save_as` metadata
- template pages (always)

Pelican now exits in the following 2 cases:
- at least 2 not deliberate writes to the same file name (behaviour introduced
by the overwrite detection feature ff7410c)
- at least 2 deliberate writes to the same file name (new behaviour)

Also added info logging when deliberate overrides are performed.