[PATCH 2 of 6] debugdeltachain: r.start and r.length can be retrieved outside the loop

Paul Morelle paul.morelle at octobus.net
Mon May 21 17:47:54 EDT 2018


# HG changeset patch
# User Paul Morelle <paul.morelle at octobus.net>
# Date 1524117426 -7200
#      Thu Apr 19 07:57:06 2018 +0200
# Node ID 3eb11b8fe014f5698a3c857ee670a7892f06fc56
# Parent  054469518b3480201e7f8ada16957027009e9f64
# EXP-Topic semi-snapshots
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 3eb11b8fe014
debugdeltachain: r.start and r.length can be retrieved outside the loop

diff -r 054469518b34 -r 3eb11b8fe014 mercurial/debugcommands.py
--- 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


More information about the Mercurial-devel mailing list