diff --git a/hgext/fetch.py b/hgext/fetch.py --- a/hgext/fetch.py +++ b/hgext/fetch.py @@ -7,12 +7,23 @@ '''pull, update and merge in one command (DEPRECATED)''' +from __future__ import absolute_import + from mercurial.i18n import _ -from mercurial.node import short -from mercurial import commands, cmdutil, hg, util, error -from mercurial.lock import release -from mercurial import exchange +from mercurial.node import ( + short, +) +from mercurial import ( + cmdutil, + commands, + error, + exchange, + hg, + lock, + util, +) +release = lock.release cmdtable = {} command = cmdutil.command(cmdtable) # Note for extension authors: ONLY specify testedwith = 'internal' for 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 @@ -3,7 +3,6 @@ $ cd "$TESTDIR"/.. $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py - hgext/fetch.py not using absolute_import hgext/fsmonitor/pywatchman/__init__.py not using absolute_import hgext/fsmonitor/pywatchman/__init__.py requires print_function hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import @@ -72,7 +71,7 @@ hgext/eol.py: error importing: 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) hgext/extdiff.py: error importing module: invalid syntax (archival.py, line *) (line *) (glob) hgext/factotum.py: error importing: No module named 'cStringIO' (error at __init__.py:*) (glob) - hgext/fetch.py: error importing module: invalid syntax (commands.py, line *) (line *) (glob) + hgext/fetch.py: error importing: 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob) hgext/fsmonitor/watchmanclient.py: error importing module: Parent module 'hgext.fsmonitor' not loaded, cannot perform relative import (line *) (glob) hgext/gpg.py: error importing module: invalid syntax (commands.py, line *) (line *) (glob) hgext/graphlog.py: error importing: 'dict' object has no attribute 'iteritems' (error at revset.py:*) (glob)