mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2329: Refresh environment forcely if source directory has changed
This commit is contained in:
parent
6101cb4ab6
commit
39bef55fd5
1
CHANGES
1
CHANGES
@ -21,6 +21,7 @@ Bugs fixed
|
|||||||
* #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts
|
* #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts
|
||||||
* #2324: Print a hint how to increase the recursion limit when it is hit.
|
* #2324: Print a hint how to increase the recursion limit when it is hit.
|
||||||
* #1565: Revert new warning; the new warning will be triggered from version 1.4 on.
|
* #1565: Revert new warning; the new warning will be triggered from version 1.4 on.
|
||||||
|
* #2329: Refresh environment forcely if source directory has changed.
|
||||||
|
|
||||||
|
|
||||||
Release 1.3.5 (released Jan 24, 2016)
|
Release 1.3.5 (released Jan 24, 2016)
|
||||||
|
@ -221,7 +221,7 @@ class Sphinx(object):
|
|||||||
try:
|
try:
|
||||||
self.info(bold('loading pickled environment... '), nonl=True)
|
self.info(bold('loading pickled environment... '), nonl=True)
|
||||||
self.env = BuildEnvironment.frompickle(
|
self.env = BuildEnvironment.frompickle(
|
||||||
self.config, path.join(self.doctreedir, ENV_PICKLE_FILENAME))
|
self.srcdir, self.config, path.join(self.doctreedir, ENV_PICKLE_FILENAME))
|
||||||
self.env.domains = {}
|
self.env.domains = {}
|
||||||
for domain in self.domains.keys():
|
for domain in self.domains.keys():
|
||||||
# this can raise if the data version doesn't fit
|
# this can raise if the data version doesn't fit
|
||||||
|
@ -101,7 +101,7 @@ class BuildEnvironment:
|
|||||||
# --------- ENVIRONMENT PERSISTENCE ----------------------------------------
|
# --------- ENVIRONMENT PERSISTENCE ----------------------------------------
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def frompickle(config, filename):
|
def frompickle(srcdir, config, filename):
|
||||||
picklefile = open(filename, 'rb')
|
picklefile = open(filename, 'rb')
|
||||||
try:
|
try:
|
||||||
env = pickle.load(picklefile)
|
env = pickle.load(picklefile)
|
||||||
@ -109,6 +109,8 @@ class BuildEnvironment:
|
|||||||
picklefile.close()
|
picklefile.close()
|
||||||
if env.version != ENV_VERSION:
|
if env.version != ENV_VERSION:
|
||||||
raise IOError('build environment version not current')
|
raise IOError('build environment version not current')
|
||||||
|
if env.srcdir != srcdir:
|
||||||
|
raise IOError('source directory has changed')
|
||||||
env.config.values = config.values
|
env.config.values = config.values
|
||||||
return env
|
return env
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user