Show More
@@ -803,11 +803,12 b' def debugdeltachain(ui, repo, file_=None' | |||
|
803 | 803 | # security to avoid crash on corrupted revlogs |
|
804 | 804 | total_revs = len(index) |
|
805 | 805 | |
|
806 | chain_size_cache = {} | |
|
807 | ||
|
806 | 808 | def revinfo(rev): |
|
807 | 809 | e = index[rev] |
|
808 | 810 | compsize = e[revlog_constants.ENTRY_DATA_COMPRESSED_LENGTH] |
|
809 | 811 | uncompsize = e[revlog_constants.ENTRY_DATA_UNCOMPRESSED_LENGTH] |
|
810 | chainsize = 0 | |
|
811 | 812 | |
|
812 | 813 | base = e[revlog_constants.ENTRY_DELTA_BASE] |
|
813 | 814 | p1 = e[revlog_constants.ENTRY_PARENT_1] |
@@ -870,11 +871,17 b' def debugdeltachain(ui, repo, file_=None' | |||
|
870 | 871 | deltatype = b'prev' |
|
871 | 872 | |
|
872 | 873 | chain = r._deltachain(rev)[0] |
|
873 | for iterrev in chain: | |
|
874 | e = index[iterrev] | |
|
875 | chainsize += e[revlog_constants.ENTRY_DATA_COMPRESSED_LENGTH] | |
|
876 | ||
|
877 | return p1, p2, compsize, uncompsize, deltatype, chain, chainsize | |
|
874 | chain_size = 0 | |
|
875 | for iter_rev in reversed(chain): | |
|
876 | cached = chain_size_cache.get(iter_rev) | |
|
877 | if cached is not None: | |
|
878 | chain_size += cached | |
|
879 | break | |
|
880 | e = index[iter_rev] | |
|
881 | chain_size += e[revlog_constants.ENTRY_DATA_COMPRESSED_LENGTH] | |
|
882 | chain_size_cache[rev] = chain_size | |
|
883 | ||
|
884 | return p1, p2, compsize, uncompsize, deltatype, chain, chain_size | |
|
878 | 885 | |
|
879 | 886 | fm = ui.formatter(b'debugdeltachain', opts) |
|
880 | 887 |
General Comments 0
You need to be logged in to leave comments.
Login now