##// END OF EJS Templates
convert: monotone use absolute_import
timeless -
r28372:74d03766 default
parent child Browse files
Show More
@@ -5,28 +5,34 b''
5 5 #
6 6 # This software may be used and distributed according to the terms of the
7 7 # GNU General Public License version 2 or any later version.
8 from __future__ import absolute_import
8 9
9 import os, re
10 from mercurial import util, error
11 from common import NoRepo, commit, converter_source, checktool
12 from common import commandline
10 import os
11 import re
12
13 from mercurial import (
14 error,
15 util,
16 )
13 17 from mercurial.i18n import _
14 18
15 class monotone_source(converter_source, commandline):
19 from . import common
20
21 class monotone_source(common.converter_source, common.commandline):
16 22 def __init__(self, ui, path=None, revs=None):
17 converter_source.__init__(self, ui, path, revs)
23 common.converter_source.__init__(self, ui, path, revs)
18 24 if revs and len(revs) > 1:
19 25 raise error.Abort(_('monotone source does not support specifying '
20 26 'multiple revs'))
21 commandline.__init__(self, ui, 'mtn')
27 common.commandline.__init__(self, ui, 'mtn')
22 28
23 29 self.ui = ui
24 30 self.path = path
25 31 self.automatestdio = False
26 32 self.revs = revs
27 33
28 norepo = NoRepo(_("%s does not look like a monotone repository")
29 % path)
34 norepo = common.NoRepo(_("%s does not look like a monotone repository")
35 % path)
30 36 if not os.path.exists(os.path.join(path, '_MTN')):
31 37 # Could be a monotone repository (SQLite db file)
32 38 try:
@@ -69,7 +75,7 b' class monotone_source(converter_source, '
69 75 self.files = None
70 76 self.dirs = None
71 77
72 checktool('mtn', abort=False)
78 common.checktool('mtn', abort=False)
73 79
74 80 def mtnrun(self, *args, **kwargs):
75 81 if self.automatestdio:
@@ -302,7 +308,7 b' class monotone_source(converter_source, '
302 308 certs = self.mtngetcerts(rev)
303 309 if certs.get('suspend') == certs["branch"]:
304 310 extra['close'] = 1
305 return commit(
311 return common.commit(
306 312 author=certs["author"],
307 313 date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
308 314 desc=certs["changelog"],
@@ -29,7 +29,6 b''
29 29 hgext/convert/common.py not using absolute_import
30 30 hgext/convert/convcmd.py not using absolute_import
31 31 hgext/convert/cvs.py not using absolute_import
32 hgext/convert/monotone.py not using absolute_import
33 32 hgext/convert/subversion.py not using absolute_import
34 33 hgext/convert/transport.py not using absolute_import
35 34 hgext/eol.py not using absolute_import
General Comments 0
You need to be logged in to leave comments. Login now