##// END OF EJS Templates
changegroup: use progress helper...
Martin von Zweigbergk -
r38429:1c5c4a5d default
parent child Browse files
Show More
@@ -516,7 +516,6 b' class cg1packer(object):'
516 reorder = stringutil.parsebool(reorder)
516 reorder = stringutil.parsebool(reorder)
517 self._repo = repo
517 self._repo = repo
518 self._reorder = reorder
518 self._reorder = reorder
519 self._progress = repo.ui.progress
520 if self._repo.ui.verbose and not self._repo.ui.debugflag:
519 if self._repo.ui.verbose and not self._repo.ui.debugflag:
521 self._verbosenote = self._repo.ui.note
520 self._verbosenote = self._repo.ui.note
522 else:
521 else:
@@ -565,18 +564,20 b' class cg1packer(object):'
565 revs.insert(0, p)
564 revs.insert(0, p)
566
565
567 # build deltas
566 # build deltas
568 total = len(revs) - 1
567 progress = None
569 msgbundling = _('bundling')
568 if units is not None:
569 progress = self._repo.ui.makeprogress(_('bundling'), unit=units,
570 total=(len(revs) - 1))
570 for r in xrange(len(revs) - 1):
571 for r in xrange(len(revs) - 1):
571 if units is not None:
572 if progress:
572 self._progress(msgbundling, r + 1, unit=units, total=total)
573 progress.update(r + 1)
573 prev, curr = revs[r], revs[r + 1]
574 prev, curr = revs[r], revs[r + 1]
574 linknode = lookup(revlog.node(curr))
575 linknode = lookup(revlog.node(curr))
575 for c in self.revchunk(revlog, curr, prev, linknode):
576 for c in self.revchunk(revlog, curr, prev, linknode):
576 yield c
577 yield c
577
578
578 if units is not None:
579 if progress:
579 self._progress(msgbundling, None)
580 progress.complete()
580 yield self.close()
581 yield self.close()
581
582
582 # filter any nodes that claim to be part of the known set
583 # filter any nodes that claim to be part of the known set
@@ -742,12 +743,8 b' class cg1packer(object):'
742 # The 'source' parameter is useful for extensions
743 # The 'source' parameter is useful for extensions
743 def generatefiles(self, changedfiles, linknodes, commonrevs, source):
744 def generatefiles(self, changedfiles, linknodes, commonrevs, source):
744 repo = self._repo
745 repo = self._repo
745 progress = self._progress
746 progress = repo.ui.makeprogress(_('bundling'), unit=_('files'),
746 msgbundling = _('bundling')
747 total=len(changedfiles))
747
748 total = len(changedfiles)
749 # for progress output
750 msgfiles = _('files')
751 for i, fname in enumerate(sorted(changedfiles)):
748 for i, fname in enumerate(sorted(changedfiles)):
752 filerevlog = repo.file(fname)
749 filerevlog = repo.file(fname)
753 if not filerevlog:
750 if not filerevlog:
@@ -762,8 +759,7 b' class cg1packer(object):'
762
759
763 filenodes = self.prune(filerevlog, linkrevnodes, commonrevs)
760 filenodes = self.prune(filerevlog, linkrevnodes, commonrevs)
764 if filenodes:
761 if filenodes:
765 progress(msgbundling, i + 1, item=fname, unit=msgfiles,
762 progress.update(i + 1, item=fname)
766 total=total)
767 h = self.fileheader(fname)
763 h = self.fileheader(fname)
768 size = len(h)
764 size = len(h)
769 yield h
765 yield h
@@ -771,7 +767,7 b' class cg1packer(object):'
771 size += len(chunk)
767 size += len(chunk)
772 yield chunk
768 yield chunk
773 self._verbosenote(_('%8.i %s\n') % (size, fname))
769 self._verbosenote(_('%8.i %s\n') % (size, fname))
774 progress(msgbundling, None)
770 progress.complete()
775
771
776 def deltaparent(self, revlog, rev, p1, p2, prev):
772 def deltaparent(self, revlog, rev, p1, p2, prev):
777 if not revlog.candelta(prev, rev):
773 if not revlog.candelta(prev, rev):
General Comments 0
You need to be logged in to leave comments. Login now