Mercurial > hg
comparison doc/gendoc.py @ 28966:ea1fab5293ca
py3: make gendoc use absolute_import
Fixed direct imports even the tests were not complaining.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 17 Apr 2016 00:20:44 +0530 |
parents | 512f883c234c |
children | 7b52cb384c38 |
comparison
equal
deleted
inserted
replaced
28965:98153441c8cc | 28966:ea1fab5293ca |
---|---|
2 """usage: %s DOC ... | 2 """usage: %s DOC ... |
3 | 3 |
4 where DOC is the name of a document | 4 where DOC is the name of a document |
5 """ | 5 """ |
6 | 6 |
7 import os, sys, textwrap | 7 from __future__ import absolute_import |
8 | |
9 import os | |
10 import sys | |
11 import textwrap | |
8 | 12 |
9 # This script is executed during installs and may not have C extensions | 13 # This script is executed during installs and may not have C extensions |
10 # available. Relax C module requirements. | 14 # available. Relax C module requirements. |
11 os.environ['HGMODULEPOLICY'] = 'allow' | 15 os.environ['HGMODULEPOLICY'] = 'allow' |
12 # import from the live mercurial repo | 16 # import from the live mercurial repo |
13 sys.path.insert(0, "..") | 17 sys.path.insert(0, "..") |
14 from mercurial import demandimport; demandimport.enable() | 18 from mercurial import demandimport; demandimport.enable() |
15 from mercurial import minirst | 19 from mercurial import ( |
16 from mercurial.commands import table, globalopts | 20 commands, |
17 from mercurial.i18n import gettext, _ | 21 extensions, |
18 from mercurial.help import helptable, loaddoc | 22 help, |
19 from mercurial import extensions | 23 minirst, |
20 from mercurial import ui as uimod | 24 ui as uimod, |
25 ) | |
26 from mercurial.i18n import ( | |
27 gettext, | |
28 _, | |
29 ) | |
30 | |
31 table = commands.table | |
32 globalopts = commands.globalopts | |
33 helptable = help.helptable | |
34 loaddoc = help.loaddoc | |
21 | 35 |
22 def get_desc(docstr): | 36 def get_desc(docstr): |
23 if not docstr: | 37 if not docstr: |
24 return "", "" | 38 return "", "" |
25 # sanitize | 39 # sanitize |