# HG changeset patch # User Gregory Szorc # Date 2015-12-22 05:33:27 # Node ID 3ce1d50daa99d5e23e6fd0de4cfa6bad4fca769a # Parent baa9810ee3ec760aa0a4536197592f10283da6ad help: use absolute_import diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -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 @@ def topicmatch(ui, kw): 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 @@ def help_(ui, name, unknowncmd=False, fu 'name' is None, describe the commands available. ''' - import commands # avoid cycle + from . import commands # avoid cycle def helpcmd(name, subtopic=None): try: diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -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