Mercurial > hg
changeset 25932:d491f289045f
dispatch: use absolute_import
A mixed, ambiguous import has been removed!
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 08 Aug 2015 14:42:48 -0700 |
parents | a0847285d207 |
children | 1fc6c02782ab |
files | mercurial/dispatch.py tests/test-module-imports.t |
diffstat | 2 files changed, 32 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dispatch.py Sat Aug 08 14:30:39 2015 -0700 +++ b/mercurial/dispatch.py Sat Aug 08 14:42:48 2015 -0700 @@ -5,13 +5,37 @@ # 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 _ -import os, sys, atexit, signal, pdb, socket, errno, shlex, time, traceback, re +from __future__ import absolute_import + +import atexit import difflib -import util, commands, hg, fancyopts, extensions, hook, error -import cmdutil, encoding -import ui as uimod -import demandimport +import errno +import os +import pdb +import re +import shlex +import signal +import socket +import sys +import time +import traceback + + +from .i18n import _ + +from . import ( + cmdutil, + commands, + demandimport, + encoding, + error, + extensions, + fancyopts, + hg, + hook, + ui as uimod, + util, +) class request(object): def __init__(self, args, ui=None, repo=None, fin=None, fout=None, @@ -909,7 +933,7 @@ format = 'text' try: - from mercurial import lsprof + from . import lsprof except ImportError: raise util.Abort(_( 'lsprof not available - install from ' @@ -922,7 +946,7 @@ p.disable() if format == 'kcachegrind': - import lsprofcalltree + from . import lsprofcalltree calltree = lsprofcalltree.KCacheGrind(p) calltree.output(fp) else:
--- a/tests/test-module-imports.t Sat Aug 08 14:30:39 2015 -0700 +++ b/tests/test-module-imports.t Sat Aug 08 14:42:48 2015 -0700 @@ -112,9 +112,6 @@ these may expose other cycles. $ hg locate 'mercurial/**.py' 'hgext/**.py' | sed 's-\\-/-g' | python "$import_checker" - - mercurial/dispatch.py mixed imports - stdlib: commands - relative: error, extensions, fancyopts, hg, hook, util mercurial/fileset.py mixed imports stdlib: parser relative: error, merge, util