Patchwork [2,of,7] convert: convcmd use absolute_import

login
register
mail settings
Submitter timeless@mozdev.org
Date March 9, 2016, 4:25 a.m.
Message ID <4a018b83a1400b622d21.1457497514@waste.org>
Download mbox | patch
Permalink /patch/13705/
State Accepted
Headers show

Comments

timeless@mozdev.org - March 9, 2016, 4:25 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1456935808 0
#      Wed Mar 02 16:23:28 2016 +0000
# Node ID 4a018b83a1400b622d21df3092b186dced9f0a81
# Parent  69670b537474317dbdf4f9d875442e687e82109a
convert: convcmd use absolute_import

Patch

diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py
--- a/hgext/convert/convcmd.py
+++ b/hgext/convert/convcmd.py
@@ -4,23 +4,51 @@ 
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
+from __future__ import absolute_import
 
-from common import NoRepo, MissingTool, SKIPREV, mapfile
-from cvs import convert_cvs
-from darcs import darcs_source
-from git import convert_git
-from hg import mercurial_source, mercurial_sink
-from subversion import svn_source, svn_sink
-from monotone import monotone_source
-from gnuarch import gnuarch_source
-from bzr import bzr_source
-from p4 import p4_source
-import filemap
+import os
+import shlex
+import shutil
 
-import os, shutil, shlex
-from mercurial import hg, util, encoding, error
+from mercurial import (
+    encoding,
+    error,
+    hg,
+    util,
+)
 from mercurial.i18n import _
 
+from . import (
+    bzr,
+    common,
+    cvs,
+    darcs,
+    filemap,
+    git,
+    gnuarch,
+    hg as hgconvert,
+    monotone,
+    p4,
+    subversion,
+)
+
+mapfile = common.mapfile
+MissingTool = common.MissingTool
+NoRepo = common.NoRepo
+SKIPREV = common.SKIPREV
+
+bzr_source = bzr.bzr_source
+convert_cvs = cvs.convert_cvs
+convert_git = git.convert_git
+darcs_source = darcs.darcs_source
+gnuarch_source = gnuarch.gnuarch_source
+mercurial_sink = hgconvert.mercurial_sink
+mercurial_source = hgconvert.mercurial_source
+monotone_source = monotone.monotone_source
+p4_source = p4.p4_source
+svn_sink = subversion.svn_sink
+svn_source = subversion.svn_source
+
 orig_encoding = 'ascii'
 
 def recode(s):
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
@@ -27,7 +27,6 @@ 
   hgext/convert/__init__.py not using absolute_import
   hgext/convert/bzr.py not using absolute_import
   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/transport.py not using absolute_import
   hgext/eol.py not using absolute_import