From bc614bcd9356ed25e959b2f4fdf19551f0727c08 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 Jan 2014 17:33:55 +0100 Subject: [PATCH] Closes #1283: Fix a bug in the detection of changed files that would try to access doctrees of deleted documents. --- CHANGES | 3 +++ sphinx/builders/__init__.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 3862281c1..0ff050036 100644 --- a/CHANGES +++ b/CHANGES @@ -113,6 +113,9 @@ Bugs fixed * #1300: Fix references not working in translated documents in some instances. +* #1283: Fix a bug in the detection of changed files that would try to access + doctrees of deleted documents. + Documentation ------------- diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index c153d1210..f1280a0b2 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -265,6 +265,12 @@ class Builder(object): self.info(bold('no targets are out of date.')) return + # filter "docnames" (list of outdated files) by the updated + # found_docs of the environment; this will remove docs that + # have since been removed + if docnames != ['__all__']: + docnames = set(docnames) & self.env.found_docs + # another indirection to support builders that don't build # files individually self.write(docnames, list(updated_docnames), method) @@ -289,6 +295,7 @@ class Builder(object): docnames = set(build_docnames) | set(updated_docnames) else: docnames = set(build_docnames) + self.app.debug('docnames to write: %s', ', '.join(sorted(docnames))) # add all toctree-containing files that may have changed for docname in list(docnames):