changeset 29127:fa161ac73b24

py3: make hgext/mq.py use absolute_import
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 06 May 2016 21:54:31 +0530
parents 7dd5d19c9773
children e521cb13d354
files hgext/mq.py tests/test-check-py3-compat.t
diffstat 2 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Fri May 06 21:52:26 2016 +0530
+++ b/hgext/mq.py	Fri May 06 21:54:31 2016 +0530
@@ -62,19 +62,39 @@
 in the strip extension.
 '''
 
+from __future__ import absolute_import
+
+import errno
+import os
+import re
+import shutil
 from mercurial.i18n import _
-from mercurial.node import bin, hex, short, nullid, nullrev
-from mercurial.lock import release
-from mercurial import commands, cmdutil, hg, scmutil, util, revset
-from mercurial import dispatch
-from mercurial import extensions, error, phases
-from mercurial import patch as patchmod
-from mercurial import lock as lockmod
-from mercurial import localrepo
-from mercurial import registrar
-from mercurial import subrepo
-import os, re, errno, shutil
-
+from mercurial.node import (
+    bin,
+    hex,
+    nullid,
+    nullrev,
+    short,
+)
+from mercurial import (
+    cmdutil,
+    commands,
+    dispatch,
+    error,
+    extensions,
+    hg,
+    localrepo,
+    lock as lockmod,
+    patch as patchmod,
+    phases,
+    registrar,
+    revset,
+    scmutil,
+    subrepo,
+    util,
+)
+
+release = lockmod.release
 seriesopts = [('s', 'summary', None, _('print first line of patch header'))]
 
 cmdtable = {}
--- a/tests/test-check-py3-compat.t	Fri May 06 21:52:26 2016 +0530
+++ b/tests/test-check-py3-compat.t	Fri May 06 21:54:31 2016 +0530
@@ -21,7 +21,6 @@
   hgext/largefiles/reposetup.py not using absolute_import
   hgext/largefiles/uisetup.py not using absolute_import
   hgext/largefiles/wirestore.py not using absolute_import
-  hgext/mq.py not using absolute_import
   hgext/rebase.py not using absolute_import
   hgext/share.py not using absolute_import
   hgext/win32text.py not using absolute_import
@@ -85,7 +84,7 @@
   hgext/largefiles/reposetup.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
   hgext/largefiles/uisetup.py: error importing module: <SyntaxError> invalid syntax (archival.py, line *) (line *) (glob)
   hgext/largefiles/wirestore.py: error importing module: <ImportError> No module named 'lfutil' (line *) (glob)
-  hgext/mq.py: error importing module: <SyntaxError> invalid syntax (commands.py, line *) (line *) (glob)
+  hgext/mq.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
   hgext/notify.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
   hgext/pager.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)
   hgext/patchbomb.py: error importing: <AttributeError> 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)