Patchwork [5,of,5] exchange: use absolute_import

login
register
mail settings
Submitter Gregory Szorc
Date Dec. 23, 2015, 8:46 p.m.
Message ID <3b0cc4c7edf49b27cc82.1450903607@7.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/12318/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Gregory Szorc - Dec. 23, 2015, 8:46 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1450902728 28800
#      Wed Dec 23 12:32:08 2015 -0800
# Node ID 3b0cc4c7edf49b27cc8293f86ec012e30d2bf6fd
# Parent  68143ddd76a2ae848aba52b59cc8514c5094342f
exchange: use absolute_import

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -4,18 +4,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 _
-from node import hex, nullid
-import errno, urllib, urllib2
-import util, scmutil, changegroup, base85, error
-import discovery, phases, obsolete, bookmarks as bookmod, bundle2, pushkey
-import lock as lockmod
-import streamclone
-import sslutil
-import tags
-import url as urlmod
+from __future__ import absolute_import
+
+import errno
+import urllib
+import urllib2
+
+from .i18n import _
+from .node import (
+    hex,
+    nullid,
+)
+from . import (
+    base85,
+    bookmarks as bookmod,
+    bundle2,
+    changegroup,
+    discovery,
+    error,
+    lock as lockmod,
+    obsolete,
+    phases,
+    pushkey,
+    scmutil,
+    sslutil,
+    streamclone,
+    tags,
+    url as urlmod,
+    util,
+)
 
 # Maps bundle compression human names to internal representation.
 _bundlespeccompressions = {'none': None,
                            'bzip2': 'BZ',
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
@@ -100,9 +100,8 @@ 
   i18n/polib.py not using absolute_import
   mercurial/cmdutil.py not using absolute_import
   mercurial/commands.py not using absolute_import
   mercurial/dispatch.py requires print_function
-  mercurial/exchange.py not using absolute_import
   mercurial/keepalive.py requires print_function
   mercurial/lsprof.py requires print_function
   mercurial/lsprofcalltree.py requires print_function
   mercurial/mail.py requires print_function