##// END OF EJS Templates
revlog: remove legacy usage of `_generaldelta`...
marmoute -
r51939:f636103c default
parent child Browse files
Show More
@@ -805,7 +805,7 b' def debugdeltachain(ui, repo, file_=None'
805 index = r.index
805 index = r.index
806 start = r.start
806 start = r.start
807 length = r.length
807 length = r.length
808 generaldelta = r._generaldelta
808 generaldelta = r.delta_config.general_delta
809 withsparseread = getattr(r, '_withsparseread', False)
809 withsparseread = getattr(r, '_withsparseread', False)
810
810
811 # security to avoid crash on corrupted revlogs
811 # security to avoid crash on corrupted revlogs
@@ -873,7 +873,7 b' class revlog:'
873 self.nullid = self.nodeconstants.nullid
873 self.nullid = self.nodeconstants.nullid
874
874
875 # sparse-revlog can't be on without general-delta (issue6056)
875 # sparse-revlog can't be on without general-delta (issue6056)
876 if not self._generaldelta:
876 if not self.delta_config.general_delta:
877 self.delta_config.sparse_revlog = False
877 self.delta_config.sparse_revlog = False
878
878
879 self._storedeltachains = True
879 self._storedeltachains = True
@@ -1253,7 +1253,7 b' class revlog:'
1253 if rev in chaininfocache:
1253 if rev in chaininfocache:
1254 return chaininfocache[rev]
1254 return chaininfocache[rev]
1255 index = self.index
1255 index = self.index
1256 generaldelta = self._generaldelta
1256 generaldelta = self.delta_config.general_delta
1257 iterrev = rev
1257 iterrev = rev
1258 e = index[iterrev]
1258 e = index[iterrev]
1259 clen = 0
1259 clen = 0
@@ -1289,9 +1289,10 b' class revlog:'
1289 revs in ascending order and ``stopped`` is a bool indicating whether
1289 revs in ascending order and ``stopped`` is a bool indicating whether
1290 ``stoprev`` was hit.
1290 ``stoprev`` was hit.
1291 """
1291 """
1292 generaldelta = self.delta_config.general_delta
1292 # Try C implementation.
1293 # Try C implementation.
1293 try:
1294 try:
1294 return self.index.deltachain(rev, stoprev, self._generaldelta)
1295 return self.index.deltachain(rev, stoprev, generaldelta)
1295 except AttributeError:
1296 except AttributeError:
1296 pass
1297 pass
1297
1298
@@ -1299,7 +1300,6 b' class revlog:'
1299
1300
1300 # Alias to prevent attribute lookup in tight loop.
1301 # Alias to prevent attribute lookup in tight loop.
1301 index = self.index
1302 index = self.index
1302 generaldelta = self._generaldelta
1303
1303
1304 iterrev = rev
1304 iterrev = rev
1305 e = index[iterrev]
1305 e = index[iterrev]
@@ -2062,7 +2062,7 b' class revlog:'
2062 base = self.index[rev][3]
2062 base = self.index[rev][3]
2063 if base == rev:
2063 if base == rev:
2064 return nullrev
2064 return nullrev
2065 elif self._generaldelta:
2065 elif self.delta_config.general_delta:
2066 return base
2066 return base
2067 else:
2067 else:
2068 return rev - 1
2068 return rev - 1
@@ -2786,7 +2786,10 b' class revlog:'
2786 # If the cached delta has no information about how it should be
2786 # If the cached delta has no information about how it should be
2787 # reused, add the default reuse instruction according to the
2787 # reused, add the default reuse instruction according to the
2788 # revlog's configuration.
2788 # revlog's configuration.
2789 if self._generaldelta and self._lazydeltabase:
2789 if (
2790 self.delta_config.general_delta
2791 and self.delta_config.lazy_delta_base
2792 ):
2790 delta_base_reuse = DELTA_BASE_REUSE_TRY
2793 delta_base_reuse = DELTA_BASE_REUSE_TRY
2791 else:
2794 else:
2792 delta_base_reuse = DELTA_BASE_REUSE_NO
2795 delta_base_reuse = DELTA_BASE_REUSE_NO
@@ -3004,7 +3007,10 b' class revlog:'
3004 # read the default delta-base reuse policy from revlog config if the
3007 # read the default delta-base reuse policy from revlog config if the
3005 # group did not specify one.
3008 # group did not specify one.
3006 if delta_base_reuse_policy is None:
3009 if delta_base_reuse_policy is None:
3007 if self._generaldelta and self._lazydeltabase:
3010 if (
3011 self.delta_config.general_delta
3012 and self.delta_config.lazy_delta_base
3013 ):
3008 delta_base_reuse_policy = DELTA_BASE_REUSE_TRY
3014 delta_base_reuse_policy = DELTA_BASE_REUSE_TRY
3009 else:
3015 else:
3010 delta_base_reuse_policy = DELTA_BASE_REUSE_NO
3016 delta_base_reuse_policy = DELTA_BASE_REUSE_NO
@@ -3251,7 +3257,7 b' class revlog:'
3251 b'unhandled value for nodesorder: %s' % nodesorder
3257 b'unhandled value for nodesorder: %s' % nodesorder
3252 )
3258 )
3253
3259
3254 if nodesorder is None and not self._generaldelta:
3260 if nodesorder is None and not self.delta_config.general_delta:
3255 nodesorder = b'storage'
3261 nodesorder = b'storage'
3256
3262
3257 if (
3263 if (
@@ -597,7 +597,7 b' def is_good_delta_info(revlog, deltainfo'
597 assert (
597 assert (
598 revinfo.cachedelta is None
598 revinfo.cachedelta is None
599 or revinfo.cachedelta[2] != DELTA_BASE_REUSE_FORCE
599 or revinfo.cachedelta[2] != DELTA_BASE_REUSE_FORCE
600 or not revlog._generaldelta
600 or not revlog.delta_config.general_delta
601 )
601 )
602
602
603 # - 'deltainfo.distance' is the distance from the base revision --
603 # - 'deltainfo.distance' is the distance from the base revision --
@@ -695,7 +695,7 b' def _candidategroups('
695 if target_rev is None:
695 if target_rev is None:
696 target_rev = len(revlog)
696 target_rev = len(revlog)
697
697
698 if not revlog._generaldelta:
698 if not revlog.delta_config.general_delta:
699 # before general delta, there is only one possible delta base
699 # before general delta, there is only one possible delta base
700 yield (target_rev - 1,)
700 yield (target_rev - 1,)
701 yield None
701 yield None
@@ -707,7 +707,7 b' def _candidategroups('
707 assert (
707 assert (
708 cachedelta is None
708 cachedelta is None
709 or cachedelta[2] != DELTA_BASE_REUSE_FORCE
709 or cachedelta[2] != DELTA_BASE_REUSE_FORCE
710 or not revlog._generaldelta
710 or not revlog.delta_config.general_delta
711 )
711 )
712
712
713 deltalength = revlog.length
713 deltalength = revlog.length
@@ -908,7 +908,7 b' def _rawgroups(revlog, p1, p2, cachedelt'
908 The group order aims at providing fast or small candidates first.
908 The group order aims at providing fast or small candidates first.
909 """
909 """
910 # Why search for delta base if we cannot use a delta base ?
910 # Why search for delta base if we cannot use a delta base ?
911 assert revlog._generaldelta
911 assert revlog.delta_config.general_delta
912 # also see issue6056
912 # also see issue6056
913 sparse = revlog._sparserevlog
913 sparse = revlog._sparserevlog
914 curr = len(revlog)
914 curr = len(revlog)
@@ -1140,7 +1140,7 b' class deltacomputer:'
1140 # can we use the cached delta?
1140 # can we use the cached delta?
1141 revlog = self.revlog
1141 revlog = self.revlog
1142 chainbase = revlog.chainbase(base)
1142 chainbase = revlog.chainbase(base)
1143 if revlog._generaldelta:
1143 if revlog.delta_config.general_delta:
1144 deltabase = base
1144 deltabase = base
1145 else:
1145 else:
1146 if target_rev is not None and base != target_rev - 1:
1146 if target_rev is not None and base != target_rev - 1:
@@ -1317,7 +1317,7 b' class deltacomputer:'
1317
1317
1318 # If this source delta are to be forcibly reuse, let us comply early.
1318 # If this source delta are to be forcibly reuse, let us comply early.
1319 if (
1319 if (
1320 revlog._generaldelta
1320 revlog.delta_config.general_delta
1321 and revinfo.cachedelta is not None
1321 and revinfo.cachedelta is not None
1322 and revinfo.cachedelta[2] == DELTA_BASE_REUSE_FORCE
1322 and revinfo.cachedelta[2] == DELTA_BASE_REUSE_FORCE
1323 ):
1323 ):
@@ -75,7 +75,7 b' def v1_censor(rl, tr, censornode, tombst'
75 )
75 )
76 newrl._format_version = rl._format_version
76 newrl._format_version = rl._format_version
77 newrl._format_flags = rl._format_flags
77 newrl._format_flags = rl._format_flags
78 newrl.delta_config.general_delta = rl._generaldelta
78 newrl.delta_config.general_delta = rl.delta_config.general_delta
79 newrl._parse_index = rl._parse_index
79 newrl._parse_index = rl._parse_index
80
80
81 for rev in rl.revs():
81 for rev in rl.revs():
@@ -12,7 +12,7 b''
12 #
12 #
13 # if deltainfo is None:
13 # if deltainfo is None:
14 # - deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
14 # - deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
15 # + if revlog._generaldelta:
15 # + if revlog.delta_config.general_delta:
16 # + deltainfo = self._builddeltainfo(revinfo, nullrev, fh)
16 # + deltainfo = self._builddeltainfo(revinfo, nullrev, fh)
17 # + else:
17 # + else:
18 # + deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
18 # + deltainfo = self._fullsnapshotinfo(fh, revinfo, target_rev)
General Comments 0
You need to be logged in to leave comments. Login now