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