ui: use absolute_import
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Aug 2015 18:25:41 -0700
changeset 25989 2cc4e8385661
parent 25988 83f220c7d6f0
child 25990 c3efcdba08ea
ui: use absolute_import And we have no more ambiguous mixed imports \o/
mercurial/ui.py
tests/test-module-imports.t
--- a/mercurial/ui.py	Sat Aug 08 20:13:11 2015 -0700
+++ b/mercurial/ui.py	Sat Aug 08 18:25:41 2015 -0700
@@ -5,11 +5,28 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+from __future__ import absolute_import
+
+import errno
+import getpass
 import inspect
-from i18n import _
-import errno, getpass, os, socket, sys, tempfile, traceback
-import config, scmutil, util, error, formatter, progress
-from node import hex
+import os
+import socket
+import sys
+import tempfile
+import traceback
+
+from .i18n import _
+from .node import hex
+
+from . import (
+    config,
+    error,
+    formatter,
+    progress,
+    scmutil,
+    util,
+)
 
 samplehgrcs = {
     'user':
--- a/tests/test-module-imports.t	Sat Aug 08 20:13:11 2015 -0700
+++ b/tests/test-module-imports.t	Sat Aug 08 18:25:41 2015 -0700
@@ -112,8 +112,5 @@
 these may expose other cycles.
 
   $ hg locate 'mercurial/**.py' 'hgext/**.py' | sed 's-\\-/-g' | python "$import_checker" -
-  mercurial/ui.py mixed imports
-     stdlib:    formatter
-     relative:  config, error, progress, scmutil, util
   Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore
   [1]