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