Patchwork [8,of,8] convert: monotone use absolute_import

login
register
mail settings
Submitter timeless@mozdev.org
Date March 2, 2016, 3:51 p.m.
Message ID <bbffbe8f64061517bc72.1456933918@waste.org>
Download mbox | patch
Permalink /patch/13546/
State Superseded
Headers show

Comments

timeless@mozdev.org - March 2, 2016, 3:51 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1456933834 0
#      Wed Mar 02 15:50:34 2016 +0000
# Node ID bbffbe8f64061517bc72512d4cbcdbb1e95d1068
# Parent  6ff6ca04d1ecdb6835501f553f3559aef6c9bdd7
convert: monotone use absolute_import

Patch

diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py
--- a/hgext/convert/monotone.py
+++ b/hgext/convert/monotone.py
@@ -5,28 +5,34 @@ 
 #
 # 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
 
-import os, re
-from mercurial import util, error
-from common import NoRepo, commit, converter_source, checktool
-from common import commandline
+import os
+import re
+
+from mercurial import (
+    error,
+    util,
+)
 from mercurial.i18n import _
 
-class monotone_source(converter_source, commandline):
+from . import common
+
+class monotone_source(common.converter_source, common.commandline):
     def __init__(self, ui, path=None, revs=None):
-        converter_source.__init__(self, ui, path, revs)
+        common.converter_source.__init__(self, ui, path, revs)
         if revs and len(revs) > 1:
             raise error.Abort(_('monotone source does not support specifying '
                                'multiple revs'))
-        commandline.__init__(self, ui, 'mtn')
+        common.commandline.__init__(self, ui, 'mtn')
 
         self.ui = ui
         self.path = path
         self.automatestdio = False
         self.revs = revs
 
-        norepo = NoRepo(_("%s does not look like a monotone repository")
-                        % path)
+        norepo = common.NoRepo(_("%s does not look like a monotone repository")
+                             % path)
         if not os.path.exists(os.path.join(path, '_MTN')):
             # Could be a monotone repository (SQLite db file)
             try:
@@ -69,7 +75,7 @@ 
         self.files = None
         self.dirs  = None
 
-        checktool('mtn', abort=False)
+        common.checktool('mtn', abort=False)
 
     def mtnrun(self, *args, **kwargs):
         if self.automatestdio:
@@ -302,7 +308,7 @@ 
         certs = self.mtngetcerts(rev)
         if certs.get('suspend') == certs["branch"]:
             extra['close'] = 1
-        return commit(
+        return common.commit(
             author=certs["author"],
             date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
             desc=certs["changelog"],
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
@@ -38,7 +38,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/monotone.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