Mercurial > public > mercurial-scm > hg
comparison doc/check-seclevel.py @ 28965:98153441c8cc
py3: make check-seclevel use absolute_import
Also fixed direct symbol imports even the tests were not complaining.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 17 Apr 2016 00:14:42 +0530 |
parents | 1b8c7d59be43 |
children | d83ca854fa21 |
comparison
equal
deleted
inserted
replaced
28964:9dcc9ed26d33 | 28965:98153441c8cc |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # checkseclevel - checking section title levels in each online help document | 3 # checkseclevel - checking section title levels in each online help document |
4 | 4 |
5 import sys, os | 5 from __future__ import absolute_import |
6 | |
6 import optparse | 7 import optparse |
8 import os | |
9 import sys | |
7 | 10 |
8 # import from the live mercurial repo | 11 # import from the live mercurial repo |
9 os.environ['HGMODULEPOLICY'] = 'py' | 12 os.environ['HGMODULEPOLICY'] = 'py' |
10 sys.path.insert(0, "..") | 13 sys.path.insert(0, "..") |
11 from mercurial import demandimport; demandimport.enable() | 14 from mercurial import demandimport; demandimport.enable() |
12 from mercurial.commands import table | 15 from mercurial import ( |
13 from mercurial.help import helptable | 16 commands, |
14 from mercurial import extensions | 17 extensions, |
15 from mercurial import minirst | 18 help, |
16 from mercurial import ui as uimod | 19 minirst, |
20 ui as uimod, | |
21 ) | |
22 | |
23 table = commands.table | |
24 helptable = help.helptable | |
17 | 25 |
18 level2mark = ['"', '=', '-', '.', '#'] | 26 level2mark = ['"', '=', '-', '.', '#'] |
19 reservedmarks = ['"'] | 27 reservedmarks = ['"'] |
20 | 28 |
21 mark2level = {} | 29 mark2level = {} |