Show More
@@ -1293,6 +1293,12 b' class progress(object):' | |||
|
1293 | 1293 | self.unit = unit |
|
1294 | 1294 | self.total = total |
|
1295 | 1295 | |
|
1296 | def __enter__(self): | |
|
1297 | pass | |
|
1298 | ||
|
1299 | def __exit__(self, exc_type, exc_value, exc_tb): | |
|
1300 | self.complete() | |
|
1301 | ||
|
1296 | 1302 | def update(self, pos, item="", total=None): |
|
1297 | 1303 | if total: |
|
1298 | 1304 | self.total = total |
@@ -495,38 +495,35 b' def _emit2(repo, entries, totalfilesize)' | |||
|
495 | 495 | progress = repo.ui.makeprogress(_('bundle'), total=totalfilesize, |
|
496 | 496 | unit=_('bytes')) |
|
497 | 497 | progress.update(0) |
|
498 | with maketempcopies() as copy: | |
|
499 | try: | |
|
500 | # copy is delayed until we are in the try | |
|
501 | entries = [_filterfull(e, copy, vfsmap) for e in entries] | |
|
502 | yield None # this release the lock on the repository | |
|
503 | seen = 0 | |
|
498 | with maketempcopies() as copy, progress: | |
|
499 | # copy is delayed until we are in the try | |
|
500 | entries = [_filterfull(e, copy, vfsmap) for e in entries] | |
|
501 | yield None # this release the lock on the repository | |
|
502 | seen = 0 | |
|
504 | 503 | |
|
505 |
|
|
|
506 |
|
|
|
507 |
|
|
|
508 |
|
|
|
509 |
|
|
|
510 |
|
|
|
511 |
|
|
|
512 |
|
|
|
513 |
|
|
|
514 |
|
|
|
515 |
|
|
|
516 |
|
|
|
517 |
|
|
|
518 |
|
|
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
|
526 |
|
|
|
527 |
|
|
|
528 | finally: | |
|
529 | progress.complete() | |
|
504 | for src, name, ftype, data in entries: | |
|
505 | vfs = vfsmap[src] | |
|
506 | yield src | |
|
507 | yield util.uvarintencode(len(name)) | |
|
508 | if ftype == _fileappend: | |
|
509 | fp = vfs(name) | |
|
510 | size = data | |
|
511 | elif ftype == _filefull: | |
|
512 | fp = open(data, 'rb') | |
|
513 | size = util.fstat(fp).st_size | |
|
514 | try: | |
|
515 | yield util.uvarintencode(size) | |
|
516 | yield name | |
|
517 | if size <= 65536: | |
|
518 | chunks = (fp.read(size),) | |
|
519 | else: | |
|
520 | chunks = util.filechunkiter(fp, limit=size) | |
|
521 | for chunk in chunks: | |
|
522 | seen += len(chunk) | |
|
523 | progress.update(seen) | |
|
524 | yield chunk | |
|
525 | finally: | |
|
526 | fp.close() | |
|
530 | 527 | |
|
531 | 528 | def generatev2(repo): |
|
532 | 529 | """Emit content for version 2 of a streaming clone. |
General Comments 0
You need to be logged in to leave comments.
Login now