[PATCH 1 of 7] convert: subversion use absolute_import

timeless timeless at mozdev.org
Tue Mar 8 23:25:13 EST 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1456935185 0
#      Wed Mar 02 16:13:05 2016 +0000
# Node ID 69670b537474317dbdf4f9d875442e687e82109a
# Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
convert: subversion use absolute_import

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -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
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
@@ -29,7 +29,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


More information about the Mercurial-devel mailing list