##// END OF EJS Templates
convert: improve gnu arch source performance and other fixes...
Aleix Conchillo Flaque -
r6049:348132c1 default
parent child Browse files
Show More
@@ -249,7 +249,7 b' class commandline(object):'
249 def runlines(self, cmd, *args, **kwargs):
249 def runlines(self, cmd, *args, **kwargs):
250 fp = self._run(cmd, *args, **kwargs)
250 fp = self._run(cmd, *args, **kwargs)
251 output = fp.readlines()
251 output = fp.readlines()
252 self.ui.debug(output)
252 self.ui.debug(''.join(output))
253 return output, fp.close()
253 return output, fp.close()
254
254
255 def checkexit(self, status, output=''):
255 def checkexit(self, status, output=''):
@@ -267,7 +267,7 b' class commandline(object):'
267
267
268 def runlines0(self, cmd, *args, **kwargs):
268 def runlines0(self, cmd, *args, **kwargs):
269 output, status = self.runlines(cmd, *args, **kwargs)
269 output, status = self.runlines(cmd, *args, **kwargs)
270 self.checkexit(status, output)
270 self.checkexit(status, ''.join(output))
271 return output
271 return output
272
272
273 def getargmax(self):
273 def getargmax(self):
@@ -155,24 +155,24 b' class gnuarch_source(converter_source, c'
155 def _update(self, rev):
155 def _update(self, rev):
156 if rev == 'base-0':
156 if rev == 'base-0':
157 # Initialise 'base-0' revision
157 # Initialise 'base-0' revision
158 self.ui.debug(_('obtaining revision %s...\n' % rev))
158 self._obtainrevision(rev)
159 revision = '%s--%s' % (self.treeversion, rev)
160 output = self._execute('get', revision, self.tmppath)
161 self.ui.debug(_('analysing revision %s...\n' % rev))
162 files = self._readcontents(self.tmppath)
163 self.changes[rev].add_files += files
164 else:
159 else:
165 self.ui.debug(_('applying revision %s...\n' % rev))
160 self.ui.debug(_('applying revision %s...\n' % rev))
166 revision = '%s--%s' % (self.treeversion, rev)
161 revision = '%s--%s' % (self.treeversion, rev)
167 output = self._execute('replay', '-d', self.tmppath, revision)
162 changeset, status = self.runlines('replay', '-d', self.tmppath,
168
163 revision)
169 old_rev = self.parents[rev][0]
164 if status:
170 self.ui.debug(_('computing changeset between %s and %s...\n' \
165 # Something went wrong while merging (baz or tla
171 % (old_rev, rev)))
166 # issue?), get latest revision and try from there
172 rev_a = '%s--%s' % (self.treeversion, old_rev)
167 shutil.rmtree(self.tmppath, ignore_errors=True)
173 rev_b = '%s--%s' % (self.treeversion, rev)
168 self._obtainrevision(rev)
174 delta = self.runlines0('delta', '-n', rev_a, rev_b)
169 else:
175 self._parsedelta(delta, rev)
170 old_rev = self.parents[rev][0]
171 self.ui.debug(_('computing changeset between %s and %s...\n' \
172 % (old_rev, rev)))
173 rev_a = '%s--%s' % (self.treeversion, old_rev)
174 rev_b = '%s--%s' % (self.treeversion, rev)
175 self._parsechangeset(changeset, rev)
176
176
177 def _getfile(self, name, rev):
177 def _getfile(self, name, rev):
178 mode = os.lstat(os.path.join(self.tmppath, name)).st_mode
178 mode = os.lstat(os.path.join(self.tmppath, name)).st_mode
@@ -218,6 +218,15 b' class gnuarch_source(converter_source, c'
218 copies[s] = d
218 copies[s] = d
219 return changes, copies
219 return changes, copies
220
220
221 def _obtainrevision(self, rev):
222 self.ui.debug(_('obtaining revision %s...\n' % rev))
223 revision = '%s--%s' % (self.treeversion, rev)
224 output = self._execute('get', revision, self.tmppath)
225 self.checkexit(output)
226 self.ui.debug(_('analysing revision %s...\n' % rev))
227 files = self._readcontents(self.tmppath)
228 self.changes[rev].add_files += files
229
221 def _parsecatlog(self, data, rev):
230 def _parsecatlog(self, data, rev):
222 summary = []
231 summary = []
223 for l in data:
232 for l in data:
@@ -234,7 +243,7 b' class gnuarch_source(converter_source, c'
234 self.changes[rev].author = l[len('Creator: '):]
243 self.changes[rev].author = l[len('Creator: '):]
235 self.changes[rev].summary = '\n'.join(summary)
244 self.changes[rev].summary = '\n'.join(summary)
236
245
237 def _parsedelta(self, data, rev):
246 def _parsechangeset(self, data, rev):
238 for l in data:
247 for l in data:
239 l = l.strip()
248 l = l.strip()
240 if l.startswith('A') and not l.startswith('A/'):
249 if l.startswith('A') and not l.startswith('A/'):
General Comments 0
You need to be logged in to leave comments. Login now