Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (16 lines) |
Status | Author | Revision | |
---|---|---|---|
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Accepted | indygreg | ||
Needs Revision | indygreg | ||
Needs Revision | indygreg | ||
Needs Revision | indygreg | ||
Accepted | indygreg | ||
Needs Revision | indygreg | ||
Closed | indygreg |
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts) | r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts) | ||||
index = r.index | index = r.index | ||||
generaldelta = r.version & revlog.FLAG_GENERALDELTA | generaldelta = r.version & revlog.FLAG_GENERALDELTA | ||||
withsparseread = getattr(r, '_withsparseread', False) | withsparseread = getattr(r, '_withsparseread', False) | ||||
def revinfo(rev): | def revinfo(rev): | ||||
e = index[rev] | e = index[rev] | ||||
compsize = e[1] | compsize = e.chunklength | ||||
uncompsize = e[2] | uncompsize = e.rawlength | ||||
chainsize = 0 | chainsize = 0 | ||||
if generaldelta: | if generaldelta: | ||||
if e[3] == e[5]: | if e.baserev == e.p1rev: | ||||
deltatype = 'p1' | deltatype = 'p1' | ||||
elif e[3] == e[6]: | elif e.baserev == e.p2rev: | ||||
deltatype = 'p2' | deltatype = 'p2' | ||||
elif e[3] == rev - 1: | elif e.baserev == rev - 1: | ||||
deltatype = 'prev' | deltatype = 'prev' | ||||
elif e[3] == rev: | elif e.baserev == rev: | ||||
deltatype = 'base' | deltatype = 'base' | ||||
else: | else: | ||||
deltatype = 'other' | deltatype = 'other' | ||||
else: | else: | ||||
if e[3] == rev: | if e.baserev == rev: | ||||
deltatype = 'base' | deltatype = 'base' | ||||
else: | else: | ||||
deltatype = 'prev' | deltatype = 'prev' | ||||
chain = r._deltachain(rev)[0] | chain = r._deltachain(rev)[0] | ||||
for iterrev in chain: | for iterrev in chain: | ||||
e = index[iterrev] | e = index[iterrev] | ||||
chainsize += e[1] | chainsize += e.chunklength | ||||
return compsize, uncompsize, deltatype, chain, chainsize | return compsize, uncompsize, deltatype, chain, chainsize | ||||
fm = ui.formatter('debugdeltachain', opts) | fm = ui.formatter('debugdeltachain', opts) | ||||
fm.plain(' rev chain# chainlen prev delta ' | fm.plain(' rev chain# chainlen prev delta ' | ||||
'size rawsize chainsize ratio lindist extradist ' | 'size rawsize chainsize ratio lindist extradist ' | ||||
'extraratio') | 'extraratio') |