changeset 25989:2cc4e8385661

ui: use absolute_import And we have no more ambiguous mixed imports \o/
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Aug 2015 18:25:41 -0700
parents 83f220c7d6f0
children c3efcdba08ea
files mercurial/ui.py tests/test-module-imports.t
diffstat 2 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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]