Patchwork [6,of,7] context: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 23, 2015, 12:31 a.m.
Message ID <f2db4a1eb4b27117adf3.1450830709@7.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/12258/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Gregory Szorc - Dec. 23, 2015, 12:31 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1450763491 28800
#      Mon Dec 21 21:51:31 2015 -0800
# Node ID f2db4a1eb4b27117adf38e00fbd8f1d82ab53f8c
# Parent  2049ead0e389455868f696943385e327f5fa6bb1
context: use absolute_import

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -4,19 +4,39 @@ 
 #
 # 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 os
 import re
+import stat
 
-from node import nullid, nullrev, wdirid, short, hex, bin
-from i18n import _
-import mdiff, error, util, scmutil, subrepo, patch, encoding, phases
-import match as matchmod
-import os, errno, stat
-import obsolete as obsmod
-import repoview
-import fileset
-import revlog
+from .i18n import _
+from .node import (
+    bin,
+    hex,
+    nullid,
+    nullrev,
+    short,
+    wdirid,
+)
+from . import (
+    encoding,
+    error,
+    fileset,
+    match as matchmod,
+    mdiff,
+    obsolete as obsmod,
+    patch,
+    phases,
+    repoview,
+    revlog,
+    scmutil,
+    subrepo,
+    util,
+)
 
 propertycache = util.propertycache
 
 # Phony node value to stand-in for new files in some uses of
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
@@ -99,9 +99,8 @@ 
   i18n/check-translation.py not using absolute_import
   i18n/polib.py not using absolute_import
   mercurial/cmdutil.py not using absolute_import
   mercurial/commands.py not using absolute_import
-  mercurial/context.py not using absolute_import
   mercurial/dispatch.py requires print_function
   mercurial/exchange.py not using absolute_import
   mercurial/httpclient/__init__.py not using absolute_import
   mercurial/httpclient/_readers.py not using absolute_import