py3: make extdiff use absolute_import
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 17 Apr 2016 02:15:05 +0530
changeset 28970 4f86c3bed63b
parent 28969 cca011fd1ea7
child 28971 bacca31f4835
py3: make extdiff use absolute_import
hgext/extdiff.py
tests/test-check-py3-compat.t
--- a/hgext/extdiff.py	Sun Apr 17 02:10:55 2016 +0530
+++ b/hgext/extdiff.py	Sun Apr 17 02:15:05 2016 +0530
@@ -60,11 +60,28 @@
 pretty fast (at least faster than having to compare the entire tree).
 '''
 
+from __future__ import absolute_import
+
+import os
+import re
+import shlex
+import shutil
+import tempfile
 from mercurial.i18n import _
-from mercurial.node import short, nullid
-from mercurial import cmdutil, scmutil, util, commands, encoding, filemerge
-from mercurial import archival, error
-import os, shlex, shutil, tempfile, re
+from mercurial.node import (
+    nullid,
+    short,
+)
+from mercurial import (
+    archival,
+    cmdutil,
+    commands,
+    encoding,
+    error,
+    filemerge,
+    scmutil,
+    util,
+)
 
 cmdtable = {}
 command = cmdutil.command(cmdtable)
--- a/tests/test-check-py3-compat.t	Sun Apr 17 02:10:55 2016 +0530
+++ b/tests/test-check-py3-compat.t	Sun Apr 17 02:15:05 2016 +0530
@@ -3,7 +3,6 @@
   $ cd "$TESTDIR"/..
 
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
-  hgext/extdiff.py not using absolute_import
   hgext/factotum.py not using absolute_import
   hgext/fetch.py not using absolute_import
   hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
@@ -72,7 +71,7 @@
   hgext/convert/subversion.py: error importing module: <ImportError> No module named 'cPickle' (line *) (glob)
   hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *) (glob)
   hgext/eol.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
-  hgext/extdiff.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
+  hgext/extdiff.py: error importing module: <SyntaxError> invalid syntax (archival.py, line *) (line *) (glob)
   hgext/factotum.py: error importing: <ImportError> No module named 'httplib' (error at url.py:*) (glob)
   hgext/fetch.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
   hgext/fsmonitor/watchmanclient.py: error importing module: <SystemError> Parent module 'hgext.fsmonitor' not loaded, cannot perform relative import (line *) (glob)