##// END OF EJS Templates
convert: gnuarch use absolute_import
timeless -
r28366:4e08b91a default
parent child Browse files
Show More
@@ -5,14 +5,22 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 from common import NoRepo, commandline, commit, converter_source
10 import email
11 import os
12 import shutil
13 import stat
14 import tempfile
15 from mercurial import (
16 encoding,
17 error,
18 util,
19 )
10 from mercurial.i18n import _
20 from mercurial.i18n import _
11 from mercurial import encoding, util, error
21 from . import common
12 import os, shutil, tempfile, stat
13 from email.Parser import Parser
14
22
15 class gnuarch_source(converter_source, commandline):
23 class gnuarch_source(common.converter_source, common.commandline):
16
24
17 class gnuarch_rev(object):
25 class gnuarch_rev(object):
18 def __init__(self, rev):
26 def __init__(self, rev):
@@ -31,7 +39,7 b' class gnuarch_source(converter_source, c'
31 super(gnuarch_source, self).__init__(ui, path, revs=revs)
39 super(gnuarch_source, self).__init__(ui, path, revs=revs)
32
40
33 if not os.path.exists(os.path.join(path, '{arch}')):
41 if not os.path.exists(os.path.join(path, '{arch}')):
34 raise NoRepo(_("%s does not look like a GNU Arch repository")
42 raise common.NoRepo(_("%s does not look like a GNU Arch repository")
35 % path)
43 % path)
36
44
37 # Could use checktool, but we want to check for baz or tla.
45 # Could use checktool, but we want to check for baz or tla.
@@ -44,7 +52,7 b' class gnuarch_source(converter_source, c'
44 else:
52 else:
45 raise error.Abort(_('cannot find a GNU Arch tool'))
53 raise error.Abort(_('cannot find a GNU Arch tool'))
46
54
47 commandline.__init__(self, ui, self.execmd)
55 common.commandline.__init__(self, ui, self.execmd)
48
56
49 self.path = os.path.realpath(path)
57 self.path = os.path.realpath(path)
50 self.tmppath = None
58 self.tmppath = None
@@ -54,7 +62,7 b' class gnuarch_source(converter_source, c'
54 self.changes = {}
62 self.changes = {}
55 self.parents = {}
63 self.parents = {}
56 self.tags = {}
64 self.tags = {}
57 self.catlogparser = Parser()
65 self.catlogparser = email.Parser.Parser()
58 self.encoding = encoding.encoding
66 self.encoding = encoding.encoding
59 self.archives = []
67 self.archives = []
60
68
@@ -175,8 +183,9 b' class gnuarch_source(converter_source, c'
175
183
176 def getcommit(self, rev):
184 def getcommit(self, rev):
177 changes = self.changes[rev]
185 changes = self.changes[rev]
178 return commit(author=changes.author, date=changes.date,
186 return common.commit(author=changes.author, date=changes.date,
179 desc=changes.summary, parents=self.parents[rev], rev=rev)
187 desc=changes.summary, parents=self.parents[rev],
188 rev=rev)
180
189
181 def gettags(self):
190 def gettags(self):
182 return self.tags
191 return self.tags
@@ -32,7 +32,6 b''
32 hgext/convert/cvsps.py not using absolute_import
32 hgext/convert/cvsps.py not using absolute_import
33 hgext/convert/darcs.py not using absolute_import
33 hgext/convert/darcs.py not using absolute_import
34 hgext/convert/filemap.py not using absolute_import
34 hgext/convert/filemap.py not using absolute_import
35 hgext/convert/gnuarch.py not using absolute_import
36 hgext/convert/hg.py not using absolute_import
35 hgext/convert/hg.py not using absolute_import
37 hgext/convert/monotone.py not using absolute_import
36 hgext/convert/monotone.py not using absolute_import
38 hgext/convert/p4.py not using absolute_import
37 hgext/convert/p4.py not using absolute_import
General Comments 0
You need to be logged in to leave comments. Login now