Show More
@@ -103,6 +103,7 b' from .utils import (' | |||||
103 | ) |
|
103 | ) | |
104 |
|
104 | |||
105 | from .revlogutils import ( |
|
105 | from .revlogutils import ( | |
|
106 | constants as revlog_constants, | |||
106 | deltas as deltautil, |
|
107 | deltas as deltautil, | |
107 | nodemap, |
|
108 | nodemap, | |
108 | rewrite, |
|
109 | rewrite, | |
@@ -796,25 +797,29 b' def debugdeltachain(ui, repo, file_=None' | |||||
796 |
|
797 | |||
797 | def revinfo(rev): |
|
798 | def revinfo(rev): | |
798 | e = index[rev] |
|
799 | e = index[rev] | |
799 | compsize = e[1] |
|
800 | compsize = e[revlog_constants.ENTRY_DATA_COMPRESSED_LENGTH] | |
800 | uncompsize = e[2] |
|
801 | uncompsize = e[revlog_constants.ENTRY_DATA_UNCOMPRESSED_LENGTH] | |
801 | chainsize = 0 |
|
802 | chainsize = 0 | |
802 |
|
803 | |||
|
804 | base = e[revlog_constants.ENTRY_DELTA_BASE] | |||
|
805 | p1 = e[revlog_constants.ENTRY_PARENT_1] | |||
|
806 | p2 = e[revlog_constants.ENTRY_PARENT_2] | |||
|
807 | ||||
803 | if generaldelta: |
|
808 | if generaldelta: | |
804 |
if e |
|
809 | if base == p1: | |
805 | deltatype = b'p1' |
|
810 | deltatype = b'p1' | |
806 |
elif e |
|
811 | elif base == p2: | |
807 | deltatype = b'p2' |
|
812 | deltatype = b'p2' | |
808 |
elif e |
|
813 | elif base == rev: | |
809 | deltatype = b'base' |
|
814 | deltatype = b'base' | |
810 | elif r.issnapshot(rev): |
|
815 | elif r.issnapshot(rev): | |
811 | deltatype = b'snap' |
|
816 | deltatype = b'snap' | |
812 |
elif e |
|
817 | elif base == rev - 1: | |
813 | deltatype = b'prev' |
|
818 | deltatype = b'prev' | |
814 | else: |
|
819 | else: | |
815 | deltatype = b'other' |
|
820 | deltatype = b'other' | |
816 | else: |
|
821 | else: | |
817 |
if e |
|
822 | if base == rev: | |
818 | deltatype = b'base' |
|
823 | deltatype = b'base' | |
819 | else: |
|
824 | else: | |
820 | deltatype = b'prev' |
|
825 | deltatype = b'prev' | |
@@ -822,7 +827,7 b' def debugdeltachain(ui, repo, file_=None' | |||||
822 | chain = r._deltachain(rev)[0] |
|
827 | chain = r._deltachain(rev)[0] | |
823 | for iterrev in chain: |
|
828 | for iterrev in chain: | |
824 | e = index[iterrev] |
|
829 | e = index[iterrev] | |
825 | chainsize += e[1] |
|
830 | chainsize += e[revlog_constants.ENTRY_DATA_COMPRESSED_LENGTH] | |
826 |
|
831 | |||
827 | return compsize, uncompsize, deltatype, chain, chainsize |
|
832 | return compsize, uncompsize, deltatype, chain, chainsize | |
828 |
|
833 |
General Comments 0
You need to be logged in to leave comments.
Login now