changeset 50648:5d210ff4b657 stable

delta-find: move the `gather_debug` logic in a property This will make it simpler to get be reused in multiple places.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Jun 2023 01:11:47 +0200
parents 7c5edf6fbf01
children c84cc0ac77e4
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Thu Jun 08 01:07:00 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Thu Jun 08 01:11:47 2023 +0200
@@ -1091,6 +1091,10 @@
         self._debug_info = debug_info
         self._snapshot_cache = SnapshotCache()
 
+    @property
+    def _gather_debug(self):
+        return self._write_debug is not None or self._debug_info is not None
+
     def buildtext(self, revinfo, fh):
         """Builds a fulltext version of a revision
 
@@ -1265,10 +1269,8 @@
         if revinfo.flags & REVIDX_RAWTEXT_CHANGING_FLAGS:
             return self._fullsnapshotinfo(fh, revinfo, target_rev)
 
-        gather_debug = (
-            self._write_debug is not None or self._debug_info is not None
-        )
         debug_search = self._write_debug is not None and self._debug_search
+        gather_debug = self._gather_debug
 
         if gather_debug:
             start = util.timer()