changeset 38148:b17fa9041695

debugdeltachain: r.start and r.length can be retrieved outside the loop
author Paul Morelle <paul.morelle@octobus.net>
date Thu, 19 Apr 2018 07:57:06 +0200
parents f79ba1d1b4b1
children bf59f95583c1
files mercurial/debugcommands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Fri May 04 15:00:55 2018 +0200
+++ b/mercurial/debugcommands.py	Thu Apr 19 07:57:06 2018 +0200
@@ -629,6 +629,8 @@
     opts = pycompat.byteskwargs(opts)
     r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts)
     index = r.index
+    start = r.start
+    length = r.length
     generaldelta = r.version & revlog.FLAG_GENERALDELTA
     withsparseread = getattr(r, '_withsparseread', False)
 
@@ -676,8 +678,6 @@
         comp, uncomp, deltatype, chain, chainsize = revinfo(rev)
         chainbase = chain[0]
         chainid = chainbases.setdefault(chainbase, len(chainbases) + 1)
-        start = r.start
-        length = r.length
         basestart = start(chainbase)
         revstart = start(rev)
         lineardist = revstart + comp - basestart