Mercurial > hg
comparison mercurial/streamclone.py @ 40398:0ac794e0e285
streamclone: include obsstore file into stream bundle if client can read it
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 05 Oct 2018 23:27:17 +0800 |
parents | f0e8f27768eb |
children | 9aeb9e2d28a7 |
comparison
equal
deleted
inserted
replaced
40397:36b134c436b8 | 40398:0ac794e0e285 |
---|---|
530 progress.update(seen) | 530 progress.update(seen) |
531 yield chunk | 531 yield chunk |
532 finally: | 532 finally: |
533 fp.close() | 533 fp.close() |
534 | 534 |
535 def generatev2(repo, includes, excludes): | 535 def generatev2(repo, includes, excludes, includeobsmarkers): |
536 """Emit content for version 2 of a streaming clone. | 536 """Emit content for version 2 of a streaming clone. |
537 | 537 |
538 the data stream consists the following entries: | 538 the data stream consists the following entries: |
539 1) A char representing the file destination (eg: store or cache) | 539 1) A char representing the file destination (eg: store or cache) |
540 2) A varint containing the length of the filename | 540 2) A varint containing the length of the filename |
565 totalfilesize += size | 565 totalfilesize += size |
566 for name in _walkstreamfullstorefiles(repo): | 566 for name in _walkstreamfullstorefiles(repo): |
567 if repo.svfs.exists(name): | 567 if repo.svfs.exists(name): |
568 totalfilesize += repo.svfs.lstat(name).st_size | 568 totalfilesize += repo.svfs.lstat(name).st_size |
569 entries.append((_srcstore, name, _filefull, None)) | 569 entries.append((_srcstore, name, _filefull, None)) |
570 if includeobsmarkers and repo.svfs.exists('obsstore'): | |
571 totalfilesize += repo.svfs.lstat('obsstore').st_size | |
572 entries.append((_srcstore, 'obsstore', _filefull, None)) | |
570 for name in cacheutil.cachetocopy(repo): | 573 for name in cacheutil.cachetocopy(repo): |
571 if repo.cachevfs.exists(name): | 574 if repo.cachevfs.exists(name): |
572 totalfilesize += repo.cachevfs.lstat(name).st_size | 575 totalfilesize += repo.cachevfs.lstat(name).st_size |
573 entries.append((_srccache, name, _filefull, None)) | 576 entries.append((_srccache, name, _filefull, None)) |
574 | 577 |