changeset 28408:4ac63ed377ba

convert: subversion use absolute_import
author timeless <timeless@mozdev.org>
date Wed, 02 Mar 2016 16:13:05 +0000
parents 63da8bd0c65e
children c43c5e7167a2
files hgext/convert/subversion.py tests/test-check-py3-compat.t
diffstat 2 files changed, 34 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Tue Mar 08 20:34:59 2016 +0000
+++ b/hgext/convert/subversion.py	Wed Mar 02 16:13:05 2016 +0000
@@ -1,28 +1,52 @@
 # Subversion 1.4/1.5 Python API backend
 #
 # Copyright(C) 2007 Daniel Holth et al
+from __future__ import absolute_import
 
-import os, re, sys, tempfile, urllib, urllib2
+import cPickle as pickle
+import cStringIO
+import os
+import re
+import sys
+import tempfile
+import urllib
+import urllib2
 import xml.dom.minidom
-import cPickle as pickle
 
-from mercurial import strutil, scmutil, util, encoding, error
+from mercurial import (
+    encoding,
+    error,
+    scmutil,
+    strutil,
+    util,
+)
 from mercurial.i18n import _
 
+from . import common
+
+StringIO = cStringIO.StringIO
 propertycache = util.propertycache
 
+commandline = common.commandline
+commit = common.commit
+converter_sink = common.converter_sink
+converter_source = common.converter_source
+decodeargs = common.decodeargs
+encodeargs = common.encodeargs
+makedatetimestamp = common.makedatetimestamp
+mapfile = common.mapfile
+MissingTool = common.MissingTool
+NoRepo = common.NoRepo
+
 # Subversion stuff. Works best with very recent Python SVN bindings
 # e.g. SVN 1.5 or backports. Thanks to the bzr folks for enhancing
 # these bindings.
 
-from cStringIO import StringIO
-
-from common import NoRepo, MissingTool, commit, encodeargs, decodeargs
-from common import commandline, converter_source, converter_sink, mapfile
-from common import makedatetimestamp
-
 try:
-    from svn.core import SubversionException, Pool
+    from svn.core import (
+        Pool,
+        SubversionException,
+    )
     import svn
     import svn.client
     import svn.core
--- a/tests/test-check-py3-compat.t	Tue Mar 08 20:34:59 2016 +0000
+++ b/tests/test-check-py3-compat.t	Wed Mar 02 16:13:05 2016 +0000
@@ -26,7 +26,6 @@
   hgext/convert/common.py not using absolute_import
   hgext/convert/convcmd.py not using absolute_import
   hgext/convert/cvs.py not using absolute_import
-  hgext/convert/subversion.py not using absolute_import
   hgext/convert/transport.py not using absolute_import
   hgext/eol.py not using absolute_import
   hgext/extdiff.py not using absolute_import