summaryrefslogtreecommitdiff
path: root/sphinx/environment/managers/toctree.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/environment/managers/toctree.py')
-rw-r--r--sphinx/environment/managers/toctree.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sphinx/environment/managers/toctree.py b/sphinx/environment/managers/toctree.py
index 1df3f0999..8f247c986 100644
--- a/sphinx/environment/managers/toctree.py
+++ b/sphinx/environment/managers/toctree.py
@@ -483,10 +483,14 @@ class Toctree(EnvironmentManager):
if depth == 0:
return
for (title, ref) in toctreenode['entries']:
- if url_re.match(ref) or ref == 'self' or ref in assigned:
+ if url_re.match(ref) or ref == 'self':
# don't mess with those
continue
- if ref in self.tocs:
+ elif ref in assigned:
+ logger.warning('%s is already assigned section numbers '
+ '(nested numbered toctree?)', ref,
+ location=toctreenode, type='toc', subtype='secnum')
+ elif ref in self.tocs:
secnums = self.toc_secnumbers[ref] = {}
assigned.add(ref)
_walk_toc(self.tocs[ref], secnums, depth,