Patchwork [02,of,19] revlog: clarify the comment attached to delta reuse

login
register
mail settings
Submitter Boris Feld
Date Sept. 8, 2018, 10:56 a.m.
Message ID <2d50819efa01dbb1ba0e.1536404216@localhost.localdomain>
Download mbox | patch
Permalink /patch/34424/
State Accepted
Headers show

Comments

Boris Feld - Sept. 8, 2018, 10:56 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1536089308 -7200
#      Tue Sep 04 21:28:28 2018 +0200
# Node ID 2d50819efa01dbb1ba0e14e30486490cb90c002a
# Parent  bdcfd96d87254a508e85a6eb502ffe4c57845bc8
# EXP-Topic sparse-snapshot
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2d50819efa01
revlog: clarify the comment attached to delta reuse

The previous version was a bit complicated and referred to a deprecated
configuration option.

Patch

diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py
+++ b/mercurial/revlogutils/deltas.py
@@ -621,10 +621,12 @@  def _rawgroups(revlog, p1, p2, cachedelt
     curr = len(revlog)
     prev = curr - 1
 
-    # This condition is true most of the time when processing
-    # changegroup data into a generaldelta repo. The only time it
-    # isn't true is if this is the first revision in a delta chain
-    # or if ``format.generaldelta=true`` disabled ``lazydeltabase``.
+    # First we try to reuse a the delta contained in the bundle.
+    # (or from the source revlog)
+    #
+    # This logic only applies to general delta repositories and can be disabled
+    # through configuration. Disabling reuse of source delta is useful when
+    # we want to make sure we recomputed "optimal" deltas.
     if cachedelta and gdelta and revlog._lazydeltabase:
         # Assume what we received from the server is a good choice
         # build delta will reuse the cache