##// END OF EJS Templates
convert: p4 use absolute_import
timeless -
r28371:630f5f04 default
parent child Browse files
Show More
@@ -4,13 +4,18 b''
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 from __future__ import absolute_import
7 8
8 from mercurial import util, error
9 import marshal
10 import re
11
12 from mercurial import (
13 error,
14 util,
15 )
9 16 from mercurial.i18n import _
10 17
11 from common import commit, converter_source, checktool, NoRepo
12 import marshal
13 import re
18 from . import common
14 19
15 20 def loaditer(f):
16 21 "Yield the dictionary objects generated by p4"
@@ -37,17 +42,18 b' def decodefilename(filename):'
37 42 filename = filename.replace(k, v)
38 43 return filename
39 44
40 class p4_source(converter_source):
45 class p4_source(common.converter_source):
41 46 def __init__(self, ui, path, revs=None):
42 47 # avoid import cycle
43 import convcmd
48 from . import convcmd
44 49
45 50 super(p4_source, self).__init__(ui, path, revs=revs)
46 51
47 52 if "/" in path and not path.startswith('//'):
48 raise NoRepo(_('%s does not look like a P4 repository') % path)
53 raise common.NoRepo(_('%s does not look like a P4 repository') %
54 path)
49 55
50 checktool('p4', abort=False)
56 common.checktool('p4', abort=False)
51 57
52 58 self.p4changes = {}
53 59 self.heads = {}
@@ -142,10 +148,10 b' class p4_source(converter_source):'
142 148 parents = []
143 149
144 150 date = (int(d["time"]), 0) # timezone not set
145 c = commit(author=self.recode(d["user"]),
146 date=util.datestr(date, '%Y-%m-%d %H:%M:%S %1%2'),
147 parents=parents, desc=desc, branch=None,
148 extra={"p4": change})
151 c = common.commit(author=self.recode(d["user"]),
152 date=util.datestr(date, '%Y-%m-%d %H:%M:%S %1%2'),
153 parents=parents, desc=desc, branch=None,
154 extra={"p4": change})
149 155
150 156 files = []
151 157 copies = {}
@@ -30,7 +30,6 b''
30 30 hgext/convert/convcmd.py not using absolute_import
31 31 hgext/convert/cvs.py not using absolute_import
32 32 hgext/convert/monotone.py not using absolute_import
33 hgext/convert/p4.py not using absolute_import
34 33 hgext/convert/subversion.py not using absolute_import
35 34 hgext/convert/transport.py not using absolute_import
36 35 hgext/eol.py not using absolute_import
General Comments 0
You need to be logged in to leave comments. Login now