comparison docs/conf.py @ 5661:4b6b559b92c8 stable

docs: make docs/conf.py compatible with Python 3
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 06 Jul 2020 00:17:44 +0800
parents 034873ca0f88
children c77bbd1adeee
comparison
equal deleted inserted replaced
5660:9d6c3e227455 5661:4b6b559b92c8
13 from docutils.parsers.rst import Directive 13 from docutils.parsers.rst import Directive
14 14
15 from mercurial import ( 15 from mercurial import (
16 commands, 16 commands,
17 extensions as hgext, 17 extensions as hgext,
18 pycompat,
18 ui as uimod, 19 ui as uimod,
19 ) 20 )
20 21
21 extensions = ["sphinx.ext.graphviz"] 22 extensions = ["sphinx.ext.graphviz"]
22 23
152 if not hasattr(ui, 'disablepager'): 153 if not hasattr(ui, 'disablepager'):
153 return [] 154 return []
154 ui.disablepager() 155 ui.disablepager()
155 rootdir = abspath(dirname(dirname(__file__))) 156 rootdir = abspath(dirname(dirname(__file__)))
156 evolvepath = join(rootdir, 'hgext3rd', 'evolve') 157 evolvepath = join(rootdir, 'hgext3rd', 'evolve')
157 ui.setconfig('extensions', 'evolve', evolvepath) 158 ui.setconfig(b'extensions', b'evolve', pycompat.bytestr(evolvepath))
158 hgext.loadall(ui) 159 hgext.loadall(ui)
159 ui.pushbuffer() 160 ui.pushbuffer()
160 commands.help_(ui, self.content[0].encode('utf-8')) 161 commands.help_(ui, self.content[0].encode('utf-8'))
161 return [nodes.literal_block(text=ui.popbuffer().decode('utf-8'))] 162 return [nodes.literal_block(text=ui.popbuffer().decode('utf-8'))]
162 163