mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1074: Add environment version info to the generated search index to avoid compatibility issues.
This commit is contained in:
parent
e3a27b76f2
commit
a37e4d2afd
3
CHANGES
3
CHANGES
@ -1,6 +1,9 @@
|
||||
Release 1.2 (in development)
|
||||
============================
|
||||
|
||||
* #1074: Add environment version info to the generated search index to avoid
|
||||
compatibility issues with old builds.
|
||||
|
||||
* #1110: Added a new configuration value :confval:`texinfo_no_detailmenu` for
|
||||
controlling whether the Texinfo writer generates a ``@detailmenu`` in the
|
||||
"Top" node's menu.
|
||||
|
@ -191,7 +191,8 @@ class IndexBuilder(object):
|
||||
format = self.formats[format]
|
||||
frozen = format.load(stream)
|
||||
# if an old index is present, we treat it as not existing.
|
||||
if not isinstance(frozen, dict):
|
||||
if not isinstance(frozen, dict) or \
|
||||
frozen.get('envversion') != self.env.version:
|
||||
raise ValueError('old format')
|
||||
index2fn = frozen['filenames']
|
||||
self._titles = dict(zip(index2fn, frozen['titles']))
|
||||
@ -275,7 +276,7 @@ class IndexBuilder(object):
|
||||
objnames = self._objnames
|
||||
return dict(filenames=filenames, titles=titles, terms=terms,
|
||||
objects=objects, objtypes=objtypes, objnames=objnames,
|
||||
titleterms=title_terms)
|
||||
titleterms=title_terms, envversion=self.env.version)
|
||||
|
||||
def prune(self, filenames):
|
||||
"""Remove data for all filenames not in the list."""
|
||||
|
Loading…
Reference in New Issue
Block a user