##// END OF EJS Templates
convert: parse perforce data on-demand...
David Soria Parra -
r30632:1d0e4832 default
parent child Browse files
Show More
@@ -56,13 +56,8 b' class p4_source(common.converter_source)'
56 common.checktool('p4', abort=False)
56 common.checktool('p4', abort=False)
57
57
58 self.revmap = {}
58 self.revmap = {}
59 self.heads = []
60 self.changeset = {}
61 self.files = {}
62 self.copies = {}
63 self.encoding = self.ui.config('convert', 'p4.encoding',
59 self.encoding = self.ui.config('convert', 'p4.encoding',
64 default=convcmd.orig_encoding)
60 default=convcmd.orig_encoding)
65 self.depotname = {} # mapping from local name to depot name
66 self.re_type = re.compile(
61 self.re_type = re.compile(
67 "([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)"
62 "([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)"
68 "(\+\w+)?$")
63 "(\+\w+)?$")
@@ -74,7 +69,6 b' class p4_source(common.converter_source)'
74 if revs and len(revs) > 1:
69 if revs and len(revs) > 1:
75 raise error.Abort(_("p4 source does not support specifying "
70 raise error.Abort(_("p4 source does not support specifying "
76 "multiple revisions"))
71 "multiple revisions"))
77 self._parse_once(ui, path)
78
72
79 def setrevmap(self, revmap):
73 def setrevmap(self, revmap):
80 """Sets the parsed revmap dictionary.
74 """Sets the parsed revmap dictionary.
@@ -240,13 +234,29 b' class p4_source(common.converter_source)'
240 'depotname': depotname,
234 'depotname': depotname,
241 }
235 }
242
236
243 def _parse_once(self, ui, path):
237 @util.propertycache
244 d = self._parse(ui, path)
238 def _parse_once(self):
245 self.changeset = d['changeset']
239 return self._parse(self.ui, self.path)
246 self.heads = d['heads']
240
247 self.files = d['files']
241 @util.propertycache
248 self.copies = d['copies']
242 def copies(self):
249 self.depotname = d['depotname']
243 return self._parse_once['copies']
244
245 @util.propertycache
246 def files(self):
247 return self._parse_once['files']
248
249 @util.propertycache
250 def changeset(self):
251 return self._parse_once['changeset']
252
253 @util.propertycache
254 def heads(self):
255 return self._parse_once['heads']
256
257 @util.propertycache
258 def depotname(self):
259 return self._parse_once['depotname']
250
260
251 def getheads(self):
261 def getheads(self):
252 return self.heads
262 return self.heads
@@ -307,11 +307,11 b' check keywords in p4'
307 convert
307 convert
308 $ hg convert -s p4 $DEPOTPATH dst
308 $ hg convert -s p4 $DEPOTPATH dst
309 initializing destination dst repository
309 initializing destination dst repository
310 scanning source...
310 reading p4 views
311 reading p4 views
311 collecting p4 changelists
312 collecting p4 changelists
312 1 initial
313 1 initial
313 2 keywords
314 2 keywords
314 scanning source...
315 sorting...
315 sorting...
316 converting...
316 converting...
317 1 initial
317 1 initial
@@ -67,12 +67,12 b' change some files'
67 convert
67 convert
68 $ hg convert -s p4 $DEPOTPATH dst
68 $ hg convert -s p4 $DEPOTPATH dst
69 initializing destination dst repository
69 initializing destination dst repository
70 scanning source...
70 reading p4 views
71 reading p4 views
71 collecting p4 changelists
72 collecting p4 changelists
72 1 initial
73 1 initial
73 2 change a
74 2 change a
74 3 change b/c
75 3 change b/c
75 scanning source...
76 sorting...
76 sorting...
77 converting...
77 converting...
78 2 initial
78 2 initial
@@ -98,13 +98,10 b' change some files'
98
98
99 convert again
99 convert again
100 $ hg convert -s p4 $DEPOTPATH dst
100 $ hg convert -s p4 $DEPOTPATH dst
101 scanning source...
101 reading p4 views
102 reading p4 views
102 collecting p4 changelists
103 collecting p4 changelists
103 1 initial
104 2 change a
105 3 change b/c
106 4 change a b/c
104 4 change a b/c
107 scanning source...
108 sorting...
105 sorting...
109 converting...
106 converting...
110 0 change a b/c
107 0 change a b/c
@@ -130,14 +127,10 b' interesting names'
130
127
131 convert again
128 convert again
132 $ hg convert -s p4 $DEPOTPATH dst
129 $ hg convert -s p4 $DEPOTPATH dst
130 scanning source...
133 reading p4 views
131 reading p4 views
134 collecting p4 changelists
132 collecting p4 changelists
135 1 initial
136 2 change a
137 3 change b/c
138 4 change a b/c
139 5 add d e f
133 5 add d e f
140 scanning source...
141 sorting...
134 sorting...
142 converting...
135 converting...
143 0 add d e f
136 0 add d e f
General Comments 0
You need to be logged in to leave comments. Login now