##// END OF EJS Templates
bundle-ng: simplify bundle10.generate...
Sune Foldager -
r19206:6308896b default
parent child Browse files
Show More
@@ -245,8 +245,6 b' class bundle10(object):'
245 245 self._repo = repo
246 246 self._reorder = reorder
247 247 self.count = [0, 0]
248 def start(self, lookup):
249 self._lookup = lookup
250 248 def close(self):
251 249 return closechunk()
252 250
@@ -340,17 +338,29 b' class bundle10(object):'
340 338 unit=_files, total=count[1])
341 339 return fstate[1][x]
342 340
343 self.start(lookup)
341 self._lookup = lookup
342
343 count[:] = [0, len(clnodes)]
344 for chunk in self.group(clnodes, cl, reorder=reorder):
345 yield chunk
346 progress(_bundling, None)
344 347
345 def getmfnodes():
346 for f in changedfiles:
347 fnodes[f] = {}
348 count[:] = [0, len(mfs)]
349 return prune(mf, mfs)
350 def getfiles():
351 mfs.clear()
352 return changedfiles
353 def getfilenodes(fname, filerevlog):
348 for f in changedfiles:
349 fnodes[f] = {}
350 count[:] = [0, len(mfs)]
351 mfnodes = prune(mf, mfs)
352 for chunk in self.group(mfnodes, mf, reorder=reorder):
353 yield chunk
354 progress(_bundling, None)
355
356 mfs.clear()
357 count[:] = [0, len(changedfiles)]
358 for fname in sorted(changedfiles):
359 filerevlog = repo.file(fname)
360 if not len(filerevlog):
361 raise util.Abort(_("empty or missing revlog for %s")
362 % fname)
363
354 364 if fastpathlinkrev:
355 365 ln, llr = filerevlog.node, filerevlog.linkrev
356 366 def genfilenodes():
@@ -361,30 +371,11 b' class bundle10(object):'
361 371 fnodes[fname] = dict(genfilenodes())
362 372 fstate[0] = fname
363 373 fstate[1] = fnodes.pop(fname, {})
364 return prune(filerevlog, fstate[1])
365
366
367 count[:] = [0, len(clnodes)]
368 for chunk in self.group(clnodes, cl, reorder=reorder):
369 yield chunk
370 progress(_bundling, None)
371
372 for chunk in self.group(getmfnodes(), mf, reorder=reorder):
373 yield chunk
374 progress(_bundling, None)
375
376 changedfiles = getfiles()
377 count[:] = [0, len(changedfiles)]
378 for fname in sorted(changedfiles):
379 filerevlog = repo.file(fname)
380 if not len(filerevlog):
381 raise util.Abort(_("empty or missing revlog for %s")
382 % fname)
383 nodelist = getfilenodes(fname, filerevlog)
384 if nodelist:
374 filenodes = prune(filerevlog, fstate[1])
375 if filenodes:
385 376 count[0] += 1
386 377 yield self.fileheader(fname)
387 for chunk in self.group(nodelist, filerevlog, reorder):
378 for chunk in self.group(filenodes, filerevlog, reorder):
388 379 yield chunk
389 380 yield self.close()
390 381 progress(_bundling, None)
General Comments 0
You need to be logged in to leave comments. Login now