##// END OF EJS Templates
bundle: move file chunk generation to it's own function...
Durham Goode -
r19334:95a49112 default
parent child Browse files
Show More
@@ -354,14 +354,8 b' class bundle10(object):'
354 354 progress(msgbundling, None)
355 355
356 356 mfs.clear()
357 total = len(changedfiles)
358 # for progress output
359 msgfiles = _('files')
360 for i, fname in enumerate(sorted(changedfiles)):
361 filerevlog = repo.file(fname)
362 if not filerevlog:
363 raise util.Abort(_("empty or missing revlog for %s") % fname)
364 357
358 def linknodes(filerevlog, fname):
365 359 if fastpathlinkrev:
366 360 ln, llr = filerevlog.node, filerevlog.linkrev
367 361 needed = set(cl.rev(x) for x in clnodes)
@@ -371,8 +365,33 b' class bundle10(object):'
371 365 if linkrev in needed:
372 366 yield filerevlog.node(r), cl.node(linkrev)
373 367 fnodes[fname] = dict(genfilenodes())
368 return fnodes.get(fname, {})
374 369
375 linkrevnodes = fnodes.pop(fname, {})
370 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
371 source):
372 yield chunk
373
374 yield self.close()
375 progress(msgbundling, None)
376
377 if clnodes:
378 repo.hook('outgoing', node=hex(clnodes[0]), source=source)
379
380 def generatefiles(self, changedfiles, linknodes, commonrevs, source):
381 repo = self._repo
382 progress = self._progress
383 reorder = self._reorder
384 msgbundling = _('bundling')
385
386 total = len(changedfiles)
387 # for progress output
388 msgfiles = _('files')
389 for i, fname in enumerate(sorted(changedfiles)):
390 filerevlog = repo.file(fname)
391 if not filerevlog:
392 raise util.Abort(_("empty or missing revlog for %s") % fname)
393
394 linkrevnodes = linknodes(filerevlog, fname)
376 395 # Lookup for filenodes, we collected the linkrev nodes above in the
377 396 # fastpath case and with lookupmf in the slowpath case.
378 397 def lookupfilelog(x):
@@ -386,11 +405,6 b' class bundle10(object):'
386 405 for chunk in self.group(filenodes, filerevlog, lookupfilelog,
387 406 reorder=reorder):
388 407 yield chunk
389 yield self.close()
390 progress(msgbundling, None)
391
392 if clnodes:
393 repo.hook('outgoing', node=hex(clnodes[0]), source=source)
394 408
395 409 def revchunk(self, revlog, rev, prev, linknode):
396 410 node = revlog.node(rev)
General Comments 0
You need to be logged in to leave comments. Login now