Mercurial > hg
changeset 27479:3ce1d50daa99
help: use absolute_import
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Dec 2015 21:33:27 -0800 |
parents | baa9810ee3ec |
children | 509159675cdb |
files | mercurial/help.py tests/test-check-py3-compat.t |
diffstat | 2 files changed, 29 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/help.py Mon Dec 21 20:29:32 2015 -0500 +++ b/mercurial/help.py Mon Dec 21 21:33:27 2015 -0800 @@ -5,14 +5,33 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -from i18n import gettext, _ -import itertools, os, textwrap -import error -import extensions, revset, fileset, templatekw, templatefilters, filemerge -import templater -import encoding, util, minirst -import cmdutil -import hgweb.webcommands as webcommands +from __future__ import absolute_import + +import itertools +import os +import textwrap + +from .i18n import ( + _, + gettext, +) +from . import ( + cmdutil, + encoding, + error, + extensions, + filemerge, + fileset, + minirst, + revset, + templatefilters, + templatekw, + templater, + util, +) +from .hgweb import ( + webcommands, +) _exclkeywords = [ "(DEPRECATED)", @@ -111,7 +130,7 @@ or lowercontains(header) or (callable(doc) and lowercontains(doc(ui)))): results['topics'].append((names[0], header)) - import commands # avoid cycle + from . import commands # avoid cycle for cmd, entry in commands.table.iteritems(): if len(entry) == 3: summary = entry[2] @@ -268,7 +287,7 @@ 'name' is None, describe the commands available. ''' - import commands # avoid cycle + from . import commands # avoid cycle def helpcmd(name, subtopic=None): try:
--- a/tests/test-check-py3-compat.t Mon Dec 21 20:29:32 2015 -0500 +++ b/tests/test-check-py3-compat.t Mon Dec 21 21:33:27 2015 -0800 @@ -105,7 +105,6 @@ mercurial/dirstate.py not using absolute_import mercurial/dispatch.py requires print_function mercurial/exchange.py not using absolute_import - mercurial/help.py not using absolute_import mercurial/httpclient/__init__.py not using absolute_import mercurial/httpclient/_readers.py not using absolute_import mercurial/httpclient/socketutil.py not using absolute_import