##// END OF EJS Templates
storage: introduce a `revlog.reuse-external-delta` config...
marmoute -
r41985:688fc33e default
parent child Browse files
Show More
@@ -983,6 +983,9 b" coreconfigitem('storage', 'revlog.optimi"
983 default=True,
983 default=True,
984 alias=[('format', 'aggressivemergedeltas')],
984 alias=[('format', 'aggressivemergedeltas')],
985 )
985 )
986 coreconfigitem('storage', 'revlog.reuse-external-delta',
987 default=True,
988 )
986 coreconfigitem('storage', 'revlog.reuse-external-delta-parent',
989 coreconfigitem('storage', 'revlog.reuse-external-delta-parent',
987 default=None,
990 default=None,
988 )
991 )
@@ -1865,6 +1865,22 b' category impact performance and reposito'
1865 considered. Even when disabled, the existing delta from the source will be
1865 considered. Even when disabled, the existing delta from the source will be
1866 reused if the same delta parent is selected.
1866 reused if the same delta parent is selected.
1867
1867
1868 ``revlog.reuse-external-delta``
1869 Control the reuse of delta from external source.
1870 (typically: apply bundle from `hg pull` or `hg push`).
1871
1872 New revisions are usually provided as a delta against another revision. By
1873 default, Mercurial will not recompute the same delta again, trusting
1874 externally provided deltas. There have been rare cases of small adjustment
1875 to the diffing algorithm in the past. So in some rare case, recomputing
1876 delta provided by ancient clients can provides better results. Disabling
1877 this option means going through a full delta recomputation for all incoming
1878 revisions. It means a large increase in CPU usage and will slow operations
1879 down.
1880
1881 This option is enabled by default. When disabled, it also disables the
1882 related ``storage.revlog.reuse-external-delta-parent`` option.
1883
1868 ``server``
1884 ``server``
1869 ----------
1885 ----------
1870
1886
@@ -752,10 +752,14 b' def resolverevlogstorevfsoptions(ui, req'
752 b'revlog.optimize-delta-parent-choice')
752 b'revlog.optimize-delta-parent-choice')
753 options[b'deltabothparents'] = deltabothparents
753 options[b'deltabothparents'] = deltabothparents
754
754
755 lazydelta = ui.configbool(b'storage', b'revlog.reuse-external-delta')
756 lazydeltabase = False
757 if lazydelta:
755 lazydeltabase = ui.configbool(b'storage',
758 lazydeltabase = ui.configbool(b'storage',
756 b'revlog.reuse-external-delta-parent')
759 b'revlog.reuse-external-delta-parent')
757 if lazydeltabase is None:
760 if lazydeltabase is None:
758 lazydeltabase = not scmutil.gddeltaconfig(ui)
761 lazydeltabase = not scmutil.gddeltaconfig(ui)
762 options[b'lazydelta'] = lazydelta
759 options[b'lazydeltabase'] = lazydeltabase
763 options[b'lazydeltabase'] = lazydeltabase
760
764
761 chainspan = ui.configbytes(b'experimental', b'maxdeltachainspan')
765 chainspan = ui.configbytes(b'experimental', b'maxdeltachainspan')
@@ -410,6 +410,9 b' class revlog(object):'
410 self._maxchainlen = opts['maxchainlen']
410 self._maxchainlen = opts['maxchainlen']
411 if 'deltabothparents' in opts:
411 if 'deltabothparents' in opts:
412 self._deltabothparents = opts['deltabothparents']
412 self._deltabothparents = opts['deltabothparents']
413 self._lazydelta = bool(opts.get('lazydelta', True))
414 self._lazydeltabase = False
415 if self._lazydelta:
413 self._lazydeltabase = bool(opts.get('lazydeltabase', False))
416 self._lazydeltabase = bool(opts.get('lazydeltabase', False))
414 if 'compengine' in opts:
417 if 'compengine' in opts:
415 self._compengine = opts['compengine']
418 self._compengine = opts['compengine']
@@ -916,7 +916,7 b' class deltacomputer(object):'
916 and currentbase != base
916 and currentbase != base
917 and self.revlog.length(currentbase) == 0):
917 and self.revlog.length(currentbase) == 0):
918 currentbase = self.revlog.deltaparent(currentbase)
918 currentbase = self.revlog.deltaparent(currentbase)
919 if currentbase == base:
919 if self.revlog._lazydelta and currentbase == base:
920 delta = revinfo.cachedelta[1]
920 delta = revinfo.cachedelta[1]
921 if delta is None:
921 if delta is None:
922 delta = self._builddeltadiff(base, revinfo, fh)
922 delta = self._builddeltadiff(base, revinfo, fh)
@@ -40,7 +40,7 b' repeatedly while some of it changes rare'
40 > maxchainlen = 15
40 > maxchainlen = 15
41 > [storage]
41 > [storage]
42 > revlog.optimize-delta-parent-choice = yes
42 > revlog.optimize-delta-parent-choice = yes
43 > revlog.reuse-external-delta-parent = no
43 > revlog.reuse-external-delta = no
44 > EOF
44 > EOF
45 $ hg init sparse-repo
45 $ hg init sparse-repo
46 $ cd sparse-repo
46 $ cd sparse-repo
General Comments 0
You need to be logged in to leave comments. Login now