Skip to content
Permalink
Browse files

give meaningful error if two posts conflict (Fix #1749)

  • Loading branch information
ralsina committed May 23, 2015
1 parent 708c176 commit 22065e2b33dd4140d1135161ff82ac8f9fefdd02
Showing with 17 additions and 2 deletions.
  1. +1 −0 CHANGES.txt
  2. +16 −2 nikola/nikola.py
@@ -14,6 +14,7 @@ Features
Bugfixes
--------

* Better error if two posts/pages output conflict (Issue #1749)
* Scanning of posts refactored out of core (Issue #1700)
* github_deploy records lastdeploy timestamp like regular deploy
* Use a global directory for gallery images, ignoring translations (Issue #1726)
@@ -1463,8 +1463,22 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
self.pages.append(post)

for lang in self.config['TRANSLATIONS'].keys():
self.post_per_file[post.destination_path(lang=lang)] = post
self.post_per_file[post.destination_path(lang=lang, extension=post.source_ext())] = post
dest = post.destination_path(lang=lang)
src_dest = post.destination_path(lang=lang, extension=post.source_ext())
if dest in self.post_per_file:
utils.LOGGER.error('Two posts are trying to generate {0}: {1} and {2}'.format(
dest,
self.post_per_file[dest].source_path,
post.source_path))
sys.exit(1)
if (src_dest in self.post_per_file) and self.config['COPY_SOURCES']:
utils.LOGGER.error('Two posts are trying to generate {0}: {1} and {2}'.format(
src_dest,
self.post_per_file[dest].source_path,
post.source_path))
sys.exit(1)
self.post_per_file[dest] = post
self.post_per_file[src_dest] = post

# Sort everything.

0 comments on commit 22065e2

Please sign in to comment.
You can’t perform that action at this time.