##// END OF EJS Templates
changegroup: don't limit cgv4 to revlogv2 repos...
Raphaël Gomès -
r47842:08e26ef4 default
parent child Browse files
Show More
@@ -1,1944 +1,1947 b''
1 # changegroup.py - Mercurial changegroup manipulation functions
1 # changegroup.py - Mercurial changegroup manipulation functions
2 #
2 #
3 # Copyright 2006 Olivia Mackall <olivia@selenic.com>
3 # Copyright 2006 Olivia Mackall <olivia@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import collections
10 import collections
11 import os
11 import os
12 import struct
12 import struct
13 import weakref
13 import weakref
14
14
15 from .i18n import _
15 from .i18n import _
16 from .node import (
16 from .node import (
17 hex,
17 hex,
18 nullrev,
18 nullrev,
19 short,
19 short,
20 )
20 )
21 from .pycompat import open
21 from .pycompat import open
22
22
23 from . import (
23 from . import (
24 error,
24 error,
25 match as matchmod,
25 match as matchmod,
26 mdiff,
26 mdiff,
27 phases,
27 phases,
28 pycompat,
28 pycompat,
29 requirements,
29 requirements,
30 scmutil,
30 scmutil,
31 util,
31 util,
32 )
32 )
33
33
34 from .interfaces import repository
34 from .interfaces import repository
35 from .revlogutils import sidedata as sidedatamod
35 from .revlogutils import sidedata as sidedatamod
36 from .revlogutils import constants as revlog_constants
36 from .revlogutils import constants as revlog_constants
37
37
38 _CHANGEGROUPV1_DELTA_HEADER = struct.Struct(b"20s20s20s20s")
38 _CHANGEGROUPV1_DELTA_HEADER = struct.Struct(b"20s20s20s20s")
39 _CHANGEGROUPV2_DELTA_HEADER = struct.Struct(b"20s20s20s20s20s")
39 _CHANGEGROUPV2_DELTA_HEADER = struct.Struct(b"20s20s20s20s20s")
40 _CHANGEGROUPV3_DELTA_HEADER = struct.Struct(b">20s20s20s20s20sH")
40 _CHANGEGROUPV3_DELTA_HEADER = struct.Struct(b">20s20s20s20s20sH")
41
41
42 LFS_REQUIREMENT = b'lfs'
42 LFS_REQUIREMENT = b'lfs'
43
43
44 readexactly = util.readexactly
44 readexactly = util.readexactly
45
45
46
46
47 def getchunk(stream):
47 def getchunk(stream):
48 """return the next chunk from stream as a string"""
48 """return the next chunk from stream as a string"""
49 d = readexactly(stream, 4)
49 d = readexactly(stream, 4)
50 l = struct.unpack(b">l", d)[0]
50 l = struct.unpack(b">l", d)[0]
51 if l <= 4:
51 if l <= 4:
52 if l:
52 if l:
53 raise error.Abort(_(b"invalid chunk length %d") % l)
53 raise error.Abort(_(b"invalid chunk length %d") % l)
54 return b""
54 return b""
55 return readexactly(stream, l - 4)
55 return readexactly(stream, l - 4)
56
56
57
57
58 def chunkheader(length):
58 def chunkheader(length):
59 """return a changegroup chunk header (string)"""
59 """return a changegroup chunk header (string)"""
60 return struct.pack(b">l", length + 4)
60 return struct.pack(b">l", length + 4)
61
61
62
62
63 def closechunk():
63 def closechunk():
64 """return a changegroup chunk header (string) for a zero-length chunk"""
64 """return a changegroup chunk header (string) for a zero-length chunk"""
65 return struct.pack(b">l", 0)
65 return struct.pack(b">l", 0)
66
66
67
67
68 def _fileheader(path):
68 def _fileheader(path):
69 """Obtain a changegroup chunk header for a named path."""
69 """Obtain a changegroup chunk header for a named path."""
70 return chunkheader(len(path)) + path
70 return chunkheader(len(path)) + path
71
71
72
72
73 def writechunks(ui, chunks, filename, vfs=None):
73 def writechunks(ui, chunks, filename, vfs=None):
74 """Write chunks to a file and return its filename.
74 """Write chunks to a file and return its filename.
75
75
76 The stream is assumed to be a bundle file.
76 The stream is assumed to be a bundle file.
77 Existing files will not be overwritten.
77 Existing files will not be overwritten.
78 If no filename is specified, a temporary file is created.
78 If no filename is specified, a temporary file is created.
79 """
79 """
80 fh = None
80 fh = None
81 cleanup = None
81 cleanup = None
82 try:
82 try:
83 if filename:
83 if filename:
84 if vfs:
84 if vfs:
85 fh = vfs.open(filename, b"wb")
85 fh = vfs.open(filename, b"wb")
86 else:
86 else:
87 # Increase default buffer size because default is usually
87 # Increase default buffer size because default is usually
88 # small (4k is common on Linux).
88 # small (4k is common on Linux).
89 fh = open(filename, b"wb", 131072)
89 fh = open(filename, b"wb", 131072)
90 else:
90 else:
91 fd, filename = pycompat.mkstemp(prefix=b"hg-bundle-", suffix=b".hg")
91 fd, filename = pycompat.mkstemp(prefix=b"hg-bundle-", suffix=b".hg")
92 fh = os.fdopen(fd, "wb")
92 fh = os.fdopen(fd, "wb")
93 cleanup = filename
93 cleanup = filename
94 for c in chunks:
94 for c in chunks:
95 fh.write(c)
95 fh.write(c)
96 cleanup = None
96 cleanup = None
97 return filename
97 return filename
98 finally:
98 finally:
99 if fh is not None:
99 if fh is not None:
100 fh.close()
100 fh.close()
101 if cleanup is not None:
101 if cleanup is not None:
102 if filename and vfs:
102 if filename and vfs:
103 vfs.unlink(cleanup)
103 vfs.unlink(cleanup)
104 else:
104 else:
105 os.unlink(cleanup)
105 os.unlink(cleanup)
106
106
107
107
108 class cg1unpacker(object):
108 class cg1unpacker(object):
109 """Unpacker for cg1 changegroup streams.
109 """Unpacker for cg1 changegroup streams.
110
110
111 A changegroup unpacker handles the framing of the revision data in
111 A changegroup unpacker handles the framing of the revision data in
112 the wire format. Most consumers will want to use the apply()
112 the wire format. Most consumers will want to use the apply()
113 method to add the changes from the changegroup to a repository.
113 method to add the changes from the changegroup to a repository.
114
114
115 If you're forwarding a changegroup unmodified to another consumer,
115 If you're forwarding a changegroup unmodified to another consumer,
116 use getchunks(), which returns an iterator of changegroup
116 use getchunks(), which returns an iterator of changegroup
117 chunks. This is mostly useful for cases where you need to know the
117 chunks. This is mostly useful for cases where you need to know the
118 data stream has ended by observing the end of the changegroup.
118 data stream has ended by observing the end of the changegroup.
119
119
120 deltachunk() is useful only if you're applying delta data. Most
120 deltachunk() is useful only if you're applying delta data. Most
121 consumers should prefer apply() instead.
121 consumers should prefer apply() instead.
122
122
123 A few other public methods exist. Those are used only for
123 A few other public methods exist. Those are used only for
124 bundlerepo and some debug commands - their use is discouraged.
124 bundlerepo and some debug commands - their use is discouraged.
125 """
125 """
126
126
127 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
127 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
128 deltaheadersize = deltaheader.size
128 deltaheadersize = deltaheader.size
129 version = b'01'
129 version = b'01'
130 _grouplistcount = 1 # One list of files after the manifests
130 _grouplistcount = 1 # One list of files after the manifests
131
131
132 def __init__(self, fh, alg, extras=None):
132 def __init__(self, fh, alg, extras=None):
133 if alg is None:
133 if alg is None:
134 alg = b'UN'
134 alg = b'UN'
135 if alg not in util.compengines.supportedbundletypes:
135 if alg not in util.compengines.supportedbundletypes:
136 raise error.Abort(_(b'unknown stream compression type: %s') % alg)
136 raise error.Abort(_(b'unknown stream compression type: %s') % alg)
137 if alg == b'BZ':
137 if alg == b'BZ':
138 alg = b'_truncatedBZ'
138 alg = b'_truncatedBZ'
139
139
140 compengine = util.compengines.forbundletype(alg)
140 compengine = util.compengines.forbundletype(alg)
141 self._stream = compengine.decompressorreader(fh)
141 self._stream = compengine.decompressorreader(fh)
142 self._type = alg
142 self._type = alg
143 self.extras = extras or {}
143 self.extras = extras or {}
144 self.callback = None
144 self.callback = None
145
145
146 # These methods (compressed, read, seek, tell) all appear to only
146 # These methods (compressed, read, seek, tell) all appear to only
147 # be used by bundlerepo, but it's a little hard to tell.
147 # be used by bundlerepo, but it's a little hard to tell.
148 def compressed(self):
148 def compressed(self):
149 return self._type is not None and self._type != b'UN'
149 return self._type is not None and self._type != b'UN'
150
150
151 def read(self, l):
151 def read(self, l):
152 return self._stream.read(l)
152 return self._stream.read(l)
153
153
154 def seek(self, pos):
154 def seek(self, pos):
155 return self._stream.seek(pos)
155 return self._stream.seek(pos)
156
156
157 def tell(self):
157 def tell(self):
158 return self._stream.tell()
158 return self._stream.tell()
159
159
160 def close(self):
160 def close(self):
161 return self._stream.close()
161 return self._stream.close()
162
162
163 def _chunklength(self):
163 def _chunklength(self):
164 d = readexactly(self._stream, 4)
164 d = readexactly(self._stream, 4)
165 l = struct.unpack(b">l", d)[0]
165 l = struct.unpack(b">l", d)[0]
166 if l <= 4:
166 if l <= 4:
167 if l:
167 if l:
168 raise error.Abort(_(b"invalid chunk length %d") % l)
168 raise error.Abort(_(b"invalid chunk length %d") % l)
169 return 0
169 return 0
170 if self.callback:
170 if self.callback:
171 self.callback()
171 self.callback()
172 return l - 4
172 return l - 4
173
173
174 def changelogheader(self):
174 def changelogheader(self):
175 """v10 does not have a changelog header chunk"""
175 """v10 does not have a changelog header chunk"""
176 return {}
176 return {}
177
177
178 def manifestheader(self):
178 def manifestheader(self):
179 """v10 does not have a manifest header chunk"""
179 """v10 does not have a manifest header chunk"""
180 return {}
180 return {}
181
181
182 def filelogheader(self):
182 def filelogheader(self):
183 """return the header of the filelogs chunk, v10 only has the filename"""
183 """return the header of the filelogs chunk, v10 only has the filename"""
184 l = self._chunklength()
184 l = self._chunklength()
185 if not l:
185 if not l:
186 return {}
186 return {}
187 fname = readexactly(self._stream, l)
187 fname = readexactly(self._stream, l)
188 return {b'filename': fname}
188 return {b'filename': fname}
189
189
190 def _deltaheader(self, headertuple, prevnode):
190 def _deltaheader(self, headertuple, prevnode):
191 node, p1, p2, cs = headertuple
191 node, p1, p2, cs = headertuple
192 if prevnode is None:
192 if prevnode is None:
193 deltabase = p1
193 deltabase = p1
194 else:
194 else:
195 deltabase = prevnode
195 deltabase = prevnode
196 flags = 0
196 flags = 0
197 return node, p1, p2, deltabase, cs, flags
197 return node, p1, p2, deltabase, cs, flags
198
198
199 def deltachunk(self, prevnode):
199 def deltachunk(self, prevnode):
200 l = self._chunklength()
200 l = self._chunklength()
201 if not l:
201 if not l:
202 return {}
202 return {}
203 headerdata = readexactly(self._stream, self.deltaheadersize)
203 headerdata = readexactly(self._stream, self.deltaheadersize)
204 header = self.deltaheader.unpack(headerdata)
204 header = self.deltaheader.unpack(headerdata)
205 delta = readexactly(self._stream, l - self.deltaheadersize)
205 delta = readexactly(self._stream, l - self.deltaheadersize)
206 node, p1, p2, deltabase, cs, flags = self._deltaheader(header, prevnode)
206 node, p1, p2, deltabase, cs, flags = self._deltaheader(header, prevnode)
207 # cg4 forward-compat
207 # cg4 forward-compat
208 sidedata = {}
208 sidedata = {}
209 return (node, p1, p2, cs, deltabase, delta, flags, sidedata)
209 return (node, p1, p2, cs, deltabase, delta, flags, sidedata)
210
210
211 def getchunks(self):
211 def getchunks(self):
212 """returns all the chunks contains in the bundle
212 """returns all the chunks contains in the bundle
213
213
214 Used when you need to forward the binary stream to a file or another
214 Used when you need to forward the binary stream to a file or another
215 network API. To do so, it parse the changegroup data, otherwise it will
215 network API. To do so, it parse the changegroup data, otherwise it will
216 block in case of sshrepo because it don't know the end of the stream.
216 block in case of sshrepo because it don't know the end of the stream.
217 """
217 """
218 # For changegroup 1 and 2, we expect 3 parts: changelog, manifestlog,
218 # For changegroup 1 and 2, we expect 3 parts: changelog, manifestlog,
219 # and a list of filelogs. For changegroup 3, we expect 4 parts:
219 # and a list of filelogs. For changegroup 3, we expect 4 parts:
220 # changelog, manifestlog, a list of tree manifestlogs, and a list of
220 # changelog, manifestlog, a list of tree manifestlogs, and a list of
221 # filelogs.
221 # filelogs.
222 #
222 #
223 # Changelog and manifestlog parts are terminated with empty chunks. The
223 # Changelog and manifestlog parts are terminated with empty chunks. The
224 # tree and file parts are a list of entry sections. Each entry section
224 # tree and file parts are a list of entry sections. Each entry section
225 # is a series of chunks terminating in an empty chunk. The list of these
225 # is a series of chunks terminating in an empty chunk. The list of these
226 # entry sections is terminated in yet another empty chunk, so we know
226 # entry sections is terminated in yet another empty chunk, so we know
227 # we've reached the end of the tree/file list when we reach an empty
227 # we've reached the end of the tree/file list when we reach an empty
228 # chunk that was proceeded by no non-empty chunks.
228 # chunk that was proceeded by no non-empty chunks.
229
229
230 parts = 0
230 parts = 0
231 while parts < 2 + self._grouplistcount:
231 while parts < 2 + self._grouplistcount:
232 noentries = True
232 noentries = True
233 while True:
233 while True:
234 chunk = getchunk(self)
234 chunk = getchunk(self)
235 if not chunk:
235 if not chunk:
236 # The first two empty chunks represent the end of the
236 # The first two empty chunks represent the end of the
237 # changelog and the manifestlog portions. The remaining
237 # changelog and the manifestlog portions. The remaining
238 # empty chunks represent either A) the end of individual
238 # empty chunks represent either A) the end of individual
239 # tree or file entries in the file list, or B) the end of
239 # tree or file entries in the file list, or B) the end of
240 # the entire list. It's the end of the entire list if there
240 # the entire list. It's the end of the entire list if there
241 # were no entries (i.e. noentries is True).
241 # were no entries (i.e. noentries is True).
242 if parts < 2:
242 if parts < 2:
243 parts += 1
243 parts += 1
244 elif noentries:
244 elif noentries:
245 parts += 1
245 parts += 1
246 break
246 break
247 noentries = False
247 noentries = False
248 yield chunkheader(len(chunk))
248 yield chunkheader(len(chunk))
249 pos = 0
249 pos = 0
250 while pos < len(chunk):
250 while pos < len(chunk):
251 next = pos + 2 ** 20
251 next = pos + 2 ** 20
252 yield chunk[pos:next]
252 yield chunk[pos:next]
253 pos = next
253 pos = next
254 yield closechunk()
254 yield closechunk()
255
255
256 def _unpackmanifests(self, repo, revmap, trp, prog, addrevisioncb=None):
256 def _unpackmanifests(self, repo, revmap, trp, prog, addrevisioncb=None):
257 self.callback = prog.increment
257 self.callback = prog.increment
258 # no need to check for empty manifest group here:
258 # no need to check for empty manifest group here:
259 # if the result of the merge of 1 and 2 is the same in 3 and 4,
259 # if the result of the merge of 1 and 2 is the same in 3 and 4,
260 # no new manifest will be created and the manifest group will
260 # no new manifest will be created and the manifest group will
261 # be empty during the pull
261 # be empty during the pull
262 self.manifestheader()
262 self.manifestheader()
263 deltas = self.deltaiter()
263 deltas = self.deltaiter()
264 storage = repo.manifestlog.getstorage(b'')
264 storage = repo.manifestlog.getstorage(b'')
265 storage.addgroup(deltas, revmap, trp, addrevisioncb=addrevisioncb)
265 storage.addgroup(deltas, revmap, trp, addrevisioncb=addrevisioncb)
266 prog.complete()
266 prog.complete()
267 self.callback = None
267 self.callback = None
268
268
269 def apply(
269 def apply(
270 self,
270 self,
271 repo,
271 repo,
272 tr,
272 tr,
273 srctype,
273 srctype,
274 url,
274 url,
275 targetphase=phases.draft,
275 targetphase=phases.draft,
276 expectedtotal=None,
276 expectedtotal=None,
277 sidedata_categories=None,
277 sidedata_categories=None,
278 ):
278 ):
279 """Add the changegroup returned by source.read() to this repo.
279 """Add the changegroup returned by source.read() to this repo.
280 srctype is a string like 'push', 'pull', or 'unbundle'. url is
280 srctype is a string like 'push', 'pull', or 'unbundle'. url is
281 the URL of the repo where this changegroup is coming from.
281 the URL of the repo where this changegroup is coming from.
282
282
283 Return an integer summarizing the change to this repo:
283 Return an integer summarizing the change to this repo:
284 - nothing changed or no source: 0
284 - nothing changed or no source: 0
285 - more heads than before: 1+added heads (2..n)
285 - more heads than before: 1+added heads (2..n)
286 - fewer heads than before: -1-removed heads (-2..-n)
286 - fewer heads than before: -1-removed heads (-2..-n)
287 - number of heads stays the same: 1
287 - number of heads stays the same: 1
288
288
289 `sidedata_categories` is an optional set of the remote's sidedata wanted
289 `sidedata_categories` is an optional set of the remote's sidedata wanted
290 categories.
290 categories.
291 """
291 """
292 repo = repo.unfiltered()
292 repo = repo.unfiltered()
293
293
294 # Only useful if we're adding sidedata categories. If both peers have
294 # Only useful if we're adding sidedata categories. If both peers have
295 # the same categories, then we simply don't do anything.
295 # the same categories, then we simply don't do anything.
296 adding_sidedata = (
296 adding_sidedata = (
297 requirements.REVLOGV2_REQUIREMENT in repo.requirements
297 requirements.REVLOGV2_REQUIREMENT in repo.requirements
298 and self.version == b'04'
298 and self.version == b'04'
299 and srctype == b'pull'
299 and srctype == b'pull'
300 )
300 )
301 if adding_sidedata:
301 if adding_sidedata:
302 sidedata_helpers = get_sidedata_helpers(
302 sidedata_helpers = get_sidedata_helpers(
303 repo,
303 repo,
304 sidedata_categories or set(),
304 sidedata_categories or set(),
305 pull=True,
305 pull=True,
306 )
306 )
307 else:
307 else:
308 sidedata_helpers = None
308 sidedata_helpers = None
309
309
310 def csmap(x):
310 def csmap(x):
311 repo.ui.debug(b"add changeset %s\n" % short(x))
311 repo.ui.debug(b"add changeset %s\n" % short(x))
312 return len(cl)
312 return len(cl)
313
313
314 def revmap(x):
314 def revmap(x):
315 return cl.rev(x)
315 return cl.rev(x)
316
316
317 try:
317 try:
318 # The transaction may already carry source information. In this
318 # The transaction may already carry source information. In this
319 # case we use the top level data. We overwrite the argument
319 # case we use the top level data. We overwrite the argument
320 # because we need to use the top level value (if they exist)
320 # because we need to use the top level value (if they exist)
321 # in this function.
321 # in this function.
322 srctype = tr.hookargs.setdefault(b'source', srctype)
322 srctype = tr.hookargs.setdefault(b'source', srctype)
323 tr.hookargs.setdefault(b'url', url)
323 tr.hookargs.setdefault(b'url', url)
324 repo.hook(
324 repo.hook(
325 b'prechangegroup', throw=True, **pycompat.strkwargs(tr.hookargs)
325 b'prechangegroup', throw=True, **pycompat.strkwargs(tr.hookargs)
326 )
326 )
327
327
328 # write changelog data to temp files so concurrent readers
328 # write changelog data to temp files so concurrent readers
329 # will not see an inconsistent view
329 # will not see an inconsistent view
330 cl = repo.changelog
330 cl = repo.changelog
331 cl.delayupdate(tr)
331 cl.delayupdate(tr)
332 oldheads = set(cl.heads())
332 oldheads = set(cl.heads())
333
333
334 trp = weakref.proxy(tr)
334 trp = weakref.proxy(tr)
335 # pull off the changeset group
335 # pull off the changeset group
336 repo.ui.status(_(b"adding changesets\n"))
336 repo.ui.status(_(b"adding changesets\n"))
337 clstart = len(cl)
337 clstart = len(cl)
338 progress = repo.ui.makeprogress(
338 progress = repo.ui.makeprogress(
339 _(b'changesets'), unit=_(b'chunks'), total=expectedtotal
339 _(b'changesets'), unit=_(b'chunks'), total=expectedtotal
340 )
340 )
341 self.callback = progress.increment
341 self.callback = progress.increment
342
342
343 efilesset = set()
343 efilesset = set()
344 duprevs = []
344 duprevs = []
345
345
346 def ondupchangelog(cl, rev):
346 def ondupchangelog(cl, rev):
347 if rev < clstart:
347 if rev < clstart:
348 duprevs.append(rev)
348 duprevs.append(rev)
349
349
350 def onchangelog(cl, rev):
350 def onchangelog(cl, rev):
351 ctx = cl.changelogrevision(rev)
351 ctx = cl.changelogrevision(rev)
352 efilesset.update(ctx.files)
352 efilesset.update(ctx.files)
353 repo.register_changeset(rev, ctx)
353 repo.register_changeset(rev, ctx)
354
354
355 self.changelogheader()
355 self.changelogheader()
356 deltas = self.deltaiter()
356 deltas = self.deltaiter()
357 if not cl.addgroup(
357 if not cl.addgroup(
358 deltas,
358 deltas,
359 csmap,
359 csmap,
360 trp,
360 trp,
361 alwayscache=True,
361 alwayscache=True,
362 addrevisioncb=onchangelog,
362 addrevisioncb=onchangelog,
363 duplicaterevisioncb=ondupchangelog,
363 duplicaterevisioncb=ondupchangelog,
364 ):
364 ):
365 repo.ui.develwarn(
365 repo.ui.develwarn(
366 b'applied empty changelog from changegroup',
366 b'applied empty changelog from changegroup',
367 config=b'warn-empty-changegroup',
367 config=b'warn-empty-changegroup',
368 )
368 )
369 efiles = len(efilesset)
369 efiles = len(efilesset)
370 clend = len(cl)
370 clend = len(cl)
371 changesets = clend - clstart
371 changesets = clend - clstart
372 progress.complete()
372 progress.complete()
373 del deltas
373 del deltas
374 # TODO Python 2.7 removal
374 # TODO Python 2.7 removal
375 # del efilesset
375 # del efilesset
376 efilesset = None
376 efilesset = None
377 self.callback = None
377 self.callback = None
378
378
379 # Keep track of the (non-changelog) revlogs we've updated and their
379 # Keep track of the (non-changelog) revlogs we've updated and their
380 # range of new revisions for sidedata rewrite.
380 # range of new revisions for sidedata rewrite.
381 # TODO do something more efficient than keeping the reference to
381 # TODO do something more efficient than keeping the reference to
382 # the revlogs, especially memory-wise.
382 # the revlogs, especially memory-wise.
383 touched_manifests = {}
383 touched_manifests = {}
384 touched_filelogs = {}
384 touched_filelogs = {}
385
385
386 # pull off the manifest group
386 # pull off the manifest group
387 repo.ui.status(_(b"adding manifests\n"))
387 repo.ui.status(_(b"adding manifests\n"))
388 # We know that we'll never have more manifests than we had
388 # We know that we'll never have more manifests than we had
389 # changesets.
389 # changesets.
390 progress = repo.ui.makeprogress(
390 progress = repo.ui.makeprogress(
391 _(b'manifests'), unit=_(b'chunks'), total=changesets
391 _(b'manifests'), unit=_(b'chunks'), total=changesets
392 )
392 )
393 on_manifest_rev = None
393 on_manifest_rev = None
394 if sidedata_helpers:
394 if sidedata_helpers:
395 if revlog_constants.KIND_MANIFESTLOG in sidedata_helpers[1]:
395 if revlog_constants.KIND_MANIFESTLOG in sidedata_helpers[1]:
396
396
397 def on_manifest_rev(manifest, rev):
397 def on_manifest_rev(manifest, rev):
398 range = touched_manifests.get(manifest)
398 range = touched_manifests.get(manifest)
399 if not range:
399 if not range:
400 touched_manifests[manifest] = (rev, rev)
400 touched_manifests[manifest] = (rev, rev)
401 else:
401 else:
402 assert rev == range[1] + 1
402 assert rev == range[1] + 1
403 touched_manifests[manifest] = (range[0], rev)
403 touched_manifests[manifest] = (range[0], rev)
404
404
405 self._unpackmanifests(
405 self._unpackmanifests(
406 repo,
406 repo,
407 revmap,
407 revmap,
408 trp,
408 trp,
409 progress,
409 progress,
410 addrevisioncb=on_manifest_rev,
410 addrevisioncb=on_manifest_rev,
411 )
411 )
412
412
413 needfiles = {}
413 needfiles = {}
414 if repo.ui.configbool(b'server', b'validate'):
414 if repo.ui.configbool(b'server', b'validate'):
415 cl = repo.changelog
415 cl = repo.changelog
416 ml = repo.manifestlog
416 ml = repo.manifestlog
417 # validate incoming csets have their manifests
417 # validate incoming csets have their manifests
418 for cset in pycompat.xrange(clstart, clend):
418 for cset in pycompat.xrange(clstart, clend):
419 mfnode = cl.changelogrevision(cset).manifest
419 mfnode = cl.changelogrevision(cset).manifest
420 mfest = ml[mfnode].readdelta()
420 mfest = ml[mfnode].readdelta()
421 # store file nodes we must see
421 # store file nodes we must see
422 for f, n in pycompat.iteritems(mfest):
422 for f, n in pycompat.iteritems(mfest):
423 needfiles.setdefault(f, set()).add(n)
423 needfiles.setdefault(f, set()).add(n)
424
424
425 on_filelog_rev = None
425 on_filelog_rev = None
426 if sidedata_helpers:
426 if sidedata_helpers:
427 if revlog_constants.KIND_FILELOG in sidedata_helpers[1]:
427 if revlog_constants.KIND_FILELOG in sidedata_helpers[1]:
428
428
429 def on_filelog_rev(filelog, rev):
429 def on_filelog_rev(filelog, rev):
430 range = touched_filelogs.get(filelog)
430 range = touched_filelogs.get(filelog)
431 if not range:
431 if not range:
432 touched_filelogs[filelog] = (rev, rev)
432 touched_filelogs[filelog] = (rev, rev)
433 else:
433 else:
434 assert rev == range[1] + 1
434 assert rev == range[1] + 1
435 touched_filelogs[filelog] = (range[0], rev)
435 touched_filelogs[filelog] = (range[0], rev)
436
436
437 # process the files
437 # process the files
438 repo.ui.status(_(b"adding file changes\n"))
438 repo.ui.status(_(b"adding file changes\n"))
439 newrevs, newfiles = _addchangegroupfiles(
439 newrevs, newfiles = _addchangegroupfiles(
440 repo,
440 repo,
441 self,
441 self,
442 revmap,
442 revmap,
443 trp,
443 trp,
444 efiles,
444 efiles,
445 needfiles,
445 needfiles,
446 addrevisioncb=on_filelog_rev,
446 addrevisioncb=on_filelog_rev,
447 )
447 )
448
448
449 if sidedata_helpers:
449 if sidedata_helpers:
450 if revlog_constants.KIND_CHANGELOG in sidedata_helpers[1]:
450 if revlog_constants.KIND_CHANGELOG in sidedata_helpers[1]:
451 cl.rewrite_sidedata(sidedata_helpers, clstart, clend - 1)
451 cl.rewrite_sidedata(sidedata_helpers, clstart, clend - 1)
452 for mf, (startrev, endrev) in touched_manifests.items():
452 for mf, (startrev, endrev) in touched_manifests.items():
453 mf.rewrite_sidedata(sidedata_helpers, startrev, endrev)
453 mf.rewrite_sidedata(sidedata_helpers, startrev, endrev)
454 for fl, (startrev, endrev) in touched_filelogs.items():
454 for fl, (startrev, endrev) in touched_filelogs.items():
455 fl.rewrite_sidedata(sidedata_helpers, startrev, endrev)
455 fl.rewrite_sidedata(sidedata_helpers, startrev, endrev)
456
456
457 # making sure the value exists
457 # making sure the value exists
458 tr.changes.setdefault(b'changegroup-count-changesets', 0)
458 tr.changes.setdefault(b'changegroup-count-changesets', 0)
459 tr.changes.setdefault(b'changegroup-count-revisions', 0)
459 tr.changes.setdefault(b'changegroup-count-revisions', 0)
460 tr.changes.setdefault(b'changegroup-count-files', 0)
460 tr.changes.setdefault(b'changegroup-count-files', 0)
461 tr.changes.setdefault(b'changegroup-count-heads', 0)
461 tr.changes.setdefault(b'changegroup-count-heads', 0)
462
462
463 # some code use bundle operation for internal purpose. They usually
463 # some code use bundle operation for internal purpose. They usually
464 # set `ui.quiet` to do this outside of user sight. Size the report
464 # set `ui.quiet` to do this outside of user sight. Size the report
465 # of such operation now happens at the end of the transaction, that
465 # of such operation now happens at the end of the transaction, that
466 # ui.quiet has not direct effect on the output.
466 # ui.quiet has not direct effect on the output.
467 #
467 #
468 # To preserve this intend use an inelegant hack, we fail to report
468 # To preserve this intend use an inelegant hack, we fail to report
469 # the change if `quiet` is set. We should probably move to
469 # the change if `quiet` is set. We should probably move to
470 # something better, but this is a good first step to allow the "end
470 # something better, but this is a good first step to allow the "end
471 # of transaction report" to pass tests.
471 # of transaction report" to pass tests.
472 if not repo.ui.quiet:
472 if not repo.ui.quiet:
473 tr.changes[b'changegroup-count-changesets'] += changesets
473 tr.changes[b'changegroup-count-changesets'] += changesets
474 tr.changes[b'changegroup-count-revisions'] += newrevs
474 tr.changes[b'changegroup-count-revisions'] += newrevs
475 tr.changes[b'changegroup-count-files'] += newfiles
475 tr.changes[b'changegroup-count-files'] += newfiles
476
476
477 deltaheads = 0
477 deltaheads = 0
478 if oldheads:
478 if oldheads:
479 heads = cl.heads()
479 heads = cl.heads()
480 deltaheads += len(heads) - len(oldheads)
480 deltaheads += len(heads) - len(oldheads)
481 for h in heads:
481 for h in heads:
482 if h not in oldheads and repo[h].closesbranch():
482 if h not in oldheads and repo[h].closesbranch():
483 deltaheads -= 1
483 deltaheads -= 1
484
484
485 # see previous comment about checking ui.quiet
485 # see previous comment about checking ui.quiet
486 if not repo.ui.quiet:
486 if not repo.ui.quiet:
487 tr.changes[b'changegroup-count-heads'] += deltaheads
487 tr.changes[b'changegroup-count-heads'] += deltaheads
488 repo.invalidatevolatilesets()
488 repo.invalidatevolatilesets()
489
489
490 if changesets > 0:
490 if changesets > 0:
491 if b'node' not in tr.hookargs:
491 if b'node' not in tr.hookargs:
492 tr.hookargs[b'node'] = hex(cl.node(clstart))
492 tr.hookargs[b'node'] = hex(cl.node(clstart))
493 tr.hookargs[b'node_last'] = hex(cl.node(clend - 1))
493 tr.hookargs[b'node_last'] = hex(cl.node(clend - 1))
494 hookargs = dict(tr.hookargs)
494 hookargs = dict(tr.hookargs)
495 else:
495 else:
496 hookargs = dict(tr.hookargs)
496 hookargs = dict(tr.hookargs)
497 hookargs[b'node'] = hex(cl.node(clstart))
497 hookargs[b'node'] = hex(cl.node(clstart))
498 hookargs[b'node_last'] = hex(cl.node(clend - 1))
498 hookargs[b'node_last'] = hex(cl.node(clend - 1))
499 repo.hook(
499 repo.hook(
500 b'pretxnchangegroup',
500 b'pretxnchangegroup',
501 throw=True,
501 throw=True,
502 **pycompat.strkwargs(hookargs)
502 **pycompat.strkwargs(hookargs)
503 )
503 )
504
504
505 added = pycompat.xrange(clstart, clend)
505 added = pycompat.xrange(clstart, clend)
506 phaseall = None
506 phaseall = None
507 if srctype in (b'push', b'serve'):
507 if srctype in (b'push', b'serve'):
508 # Old servers can not push the boundary themselves.
508 # Old servers can not push the boundary themselves.
509 # New servers won't push the boundary if changeset already
509 # New servers won't push the boundary if changeset already
510 # exists locally as secret
510 # exists locally as secret
511 #
511 #
512 # We should not use added here but the list of all change in
512 # We should not use added here but the list of all change in
513 # the bundle
513 # the bundle
514 if repo.publishing():
514 if repo.publishing():
515 targetphase = phaseall = phases.public
515 targetphase = phaseall = phases.public
516 else:
516 else:
517 # closer target phase computation
517 # closer target phase computation
518
518
519 # Those changesets have been pushed from the
519 # Those changesets have been pushed from the
520 # outside, their phases are going to be pushed
520 # outside, their phases are going to be pushed
521 # alongside. Therefor `targetphase` is
521 # alongside. Therefor `targetphase` is
522 # ignored.
522 # ignored.
523 targetphase = phaseall = phases.draft
523 targetphase = phaseall = phases.draft
524 if added:
524 if added:
525 phases.registernew(repo, tr, targetphase, added)
525 phases.registernew(repo, tr, targetphase, added)
526 if phaseall is not None:
526 if phaseall is not None:
527 if duprevs:
527 if duprevs:
528 duprevs.extend(added)
528 duprevs.extend(added)
529 else:
529 else:
530 duprevs = added
530 duprevs = added
531 phases.advanceboundary(repo, tr, phaseall, [], revs=duprevs)
531 phases.advanceboundary(repo, tr, phaseall, [], revs=duprevs)
532 duprevs = []
532 duprevs = []
533
533
534 if changesets > 0:
534 if changesets > 0:
535
535
536 def runhooks(unused_success):
536 def runhooks(unused_success):
537 # These hooks run when the lock releases, not when the
537 # These hooks run when the lock releases, not when the
538 # transaction closes. So it's possible for the changelog
538 # transaction closes. So it's possible for the changelog
539 # to have changed since we last saw it.
539 # to have changed since we last saw it.
540 if clstart >= len(repo):
540 if clstart >= len(repo):
541 return
541 return
542
542
543 repo.hook(b"changegroup", **pycompat.strkwargs(hookargs))
543 repo.hook(b"changegroup", **pycompat.strkwargs(hookargs))
544
544
545 for rev in added:
545 for rev in added:
546 args = hookargs.copy()
546 args = hookargs.copy()
547 args[b'node'] = hex(cl.node(rev))
547 args[b'node'] = hex(cl.node(rev))
548 del args[b'node_last']
548 del args[b'node_last']
549 repo.hook(b"incoming", **pycompat.strkwargs(args))
549 repo.hook(b"incoming", **pycompat.strkwargs(args))
550
550
551 newheads = [h for h in repo.heads() if h not in oldheads]
551 newheads = [h for h in repo.heads() if h not in oldheads]
552 repo.ui.log(
552 repo.ui.log(
553 b"incoming",
553 b"incoming",
554 b"%d incoming changes - new heads: %s\n",
554 b"%d incoming changes - new heads: %s\n",
555 len(added),
555 len(added),
556 b', '.join([hex(c[:6]) for c in newheads]),
556 b', '.join([hex(c[:6]) for c in newheads]),
557 )
557 )
558
558
559 tr.addpostclose(
559 tr.addpostclose(
560 b'changegroup-runhooks-%020i' % clstart,
560 b'changegroup-runhooks-%020i' % clstart,
561 lambda tr: repo._afterlock(runhooks),
561 lambda tr: repo._afterlock(runhooks),
562 )
562 )
563 finally:
563 finally:
564 repo.ui.flush()
564 repo.ui.flush()
565 # never return 0 here:
565 # never return 0 here:
566 if deltaheads < 0:
566 if deltaheads < 0:
567 ret = deltaheads - 1
567 ret = deltaheads - 1
568 else:
568 else:
569 ret = deltaheads + 1
569 ret = deltaheads + 1
570 return ret
570 return ret
571
571
572 def deltaiter(self):
572 def deltaiter(self):
573 """
573 """
574 returns an iterator of the deltas in this changegroup
574 returns an iterator of the deltas in this changegroup
575
575
576 Useful for passing to the underlying storage system to be stored.
576 Useful for passing to the underlying storage system to be stored.
577 """
577 """
578 chain = None
578 chain = None
579 for chunkdata in iter(lambda: self.deltachunk(chain), {}):
579 for chunkdata in iter(lambda: self.deltachunk(chain), {}):
580 # Chunkdata: (node, p1, p2, cs, deltabase, delta, flags, sidedata)
580 # Chunkdata: (node, p1, p2, cs, deltabase, delta, flags, sidedata)
581 yield chunkdata
581 yield chunkdata
582 chain = chunkdata[0]
582 chain = chunkdata[0]
583
583
584
584
585 class cg2unpacker(cg1unpacker):
585 class cg2unpacker(cg1unpacker):
586 """Unpacker for cg2 streams.
586 """Unpacker for cg2 streams.
587
587
588 cg2 streams add support for generaldelta, so the delta header
588 cg2 streams add support for generaldelta, so the delta header
589 format is slightly different. All other features about the data
589 format is slightly different. All other features about the data
590 remain the same.
590 remain the same.
591 """
591 """
592
592
593 deltaheader = _CHANGEGROUPV2_DELTA_HEADER
593 deltaheader = _CHANGEGROUPV2_DELTA_HEADER
594 deltaheadersize = deltaheader.size
594 deltaheadersize = deltaheader.size
595 version = b'02'
595 version = b'02'
596
596
597 def _deltaheader(self, headertuple, prevnode):
597 def _deltaheader(self, headertuple, prevnode):
598 node, p1, p2, deltabase, cs = headertuple
598 node, p1, p2, deltabase, cs = headertuple
599 flags = 0
599 flags = 0
600 return node, p1, p2, deltabase, cs, flags
600 return node, p1, p2, deltabase, cs, flags
601
601
602
602
603 class cg3unpacker(cg2unpacker):
603 class cg3unpacker(cg2unpacker):
604 """Unpacker for cg3 streams.
604 """Unpacker for cg3 streams.
605
605
606 cg3 streams add support for exchanging treemanifests and revlog
606 cg3 streams add support for exchanging treemanifests and revlog
607 flags. It adds the revlog flags to the delta header and an empty chunk
607 flags. It adds the revlog flags to the delta header and an empty chunk
608 separating manifests and files.
608 separating manifests and files.
609 """
609 """
610
610
611 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
611 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
612 deltaheadersize = deltaheader.size
612 deltaheadersize = deltaheader.size
613 version = b'03'
613 version = b'03'
614 _grouplistcount = 2 # One list of manifests and one list of files
614 _grouplistcount = 2 # One list of manifests and one list of files
615
615
616 def _deltaheader(self, headertuple, prevnode):
616 def _deltaheader(self, headertuple, prevnode):
617 node, p1, p2, deltabase, cs, flags = headertuple
617 node, p1, p2, deltabase, cs, flags = headertuple
618 return node, p1, p2, deltabase, cs, flags
618 return node, p1, p2, deltabase, cs, flags
619
619
620 def _unpackmanifests(self, repo, revmap, trp, prog, addrevisioncb=None):
620 def _unpackmanifests(self, repo, revmap, trp, prog, addrevisioncb=None):
621 super(cg3unpacker, self)._unpackmanifests(
621 super(cg3unpacker, self)._unpackmanifests(
622 repo, revmap, trp, prog, addrevisioncb=addrevisioncb
622 repo, revmap, trp, prog, addrevisioncb=addrevisioncb
623 )
623 )
624 for chunkdata in iter(self.filelogheader, {}):
624 for chunkdata in iter(self.filelogheader, {}):
625 # If we get here, there are directory manifests in the changegroup
625 # If we get here, there are directory manifests in the changegroup
626 d = chunkdata[b"filename"]
626 d = chunkdata[b"filename"]
627 repo.ui.debug(b"adding %s revisions\n" % d)
627 repo.ui.debug(b"adding %s revisions\n" % d)
628 deltas = self.deltaiter()
628 deltas = self.deltaiter()
629 if not repo.manifestlog.getstorage(d).addgroup(
629 if not repo.manifestlog.getstorage(d).addgroup(
630 deltas, revmap, trp, addrevisioncb=addrevisioncb
630 deltas, revmap, trp, addrevisioncb=addrevisioncb
631 ):
631 ):
632 raise error.Abort(_(b"received dir revlog group is empty"))
632 raise error.Abort(_(b"received dir revlog group is empty"))
633
633
634
634
635 class cg4unpacker(cg3unpacker):
635 class cg4unpacker(cg3unpacker):
636 """Unpacker for cg4 streams.
636 """Unpacker for cg4 streams.
637
637
638 cg4 streams add support for exchanging sidedata.
638 cg4 streams add support for exchanging sidedata.
639 """
639 """
640
640
641 version = b'04'
641 version = b'04'
642
642
643 def deltachunk(self, prevnode):
643 def deltachunk(self, prevnode):
644 res = super(cg4unpacker, self).deltachunk(prevnode)
644 res = super(cg4unpacker, self).deltachunk(prevnode)
645 if not res:
645 if not res:
646 return res
646 return res
647
647
648 (node, p1, p2, cs, deltabase, delta, flags, _sidedata) = res
648 (node, p1, p2, cs, deltabase, delta, flags, _sidedata) = res
649
649
650 sidedata_raw = getchunk(self._stream)
650 sidedata_raw = getchunk(self._stream)
651 sidedata = {}
651 sidedata = {}
652 if len(sidedata_raw) > 0:
652 if len(sidedata_raw) > 0:
653 sidedata = sidedatamod.deserialize_sidedata(sidedata_raw)
653 sidedata = sidedatamod.deserialize_sidedata(sidedata_raw)
654
654
655 return node, p1, p2, cs, deltabase, delta, flags, sidedata
655 return node, p1, p2, cs, deltabase, delta, flags, sidedata
656
656
657
657
658 class headerlessfixup(object):
658 class headerlessfixup(object):
659 def __init__(self, fh, h):
659 def __init__(self, fh, h):
660 self._h = h
660 self._h = h
661 self._fh = fh
661 self._fh = fh
662
662
663 def read(self, n):
663 def read(self, n):
664 if self._h:
664 if self._h:
665 d, self._h = self._h[:n], self._h[n:]
665 d, self._h = self._h[:n], self._h[n:]
666 if len(d) < n:
666 if len(d) < n:
667 d += readexactly(self._fh, n - len(d))
667 d += readexactly(self._fh, n - len(d))
668 return d
668 return d
669 return readexactly(self._fh, n)
669 return readexactly(self._fh, n)
670
670
671
671
672 def _revisiondeltatochunks(repo, delta, headerfn):
672 def _revisiondeltatochunks(repo, delta, headerfn):
673 """Serialize a revisiondelta to changegroup chunks."""
673 """Serialize a revisiondelta to changegroup chunks."""
674
674
675 # The captured revision delta may be encoded as a delta against
675 # The captured revision delta may be encoded as a delta against
676 # a base revision or as a full revision. The changegroup format
676 # a base revision or as a full revision. The changegroup format
677 # requires that everything on the wire be deltas. So for full
677 # requires that everything on the wire be deltas. So for full
678 # revisions, we need to invent a header that says to rewrite
678 # revisions, we need to invent a header that says to rewrite
679 # data.
679 # data.
680
680
681 if delta.delta is not None:
681 if delta.delta is not None:
682 prefix, data = b'', delta.delta
682 prefix, data = b'', delta.delta
683 elif delta.basenode == repo.nullid:
683 elif delta.basenode == repo.nullid:
684 data = delta.revision
684 data = delta.revision
685 prefix = mdiff.trivialdiffheader(len(data))
685 prefix = mdiff.trivialdiffheader(len(data))
686 else:
686 else:
687 data = delta.revision
687 data = delta.revision
688 prefix = mdiff.replacediffheader(delta.baserevisionsize, len(data))
688 prefix = mdiff.replacediffheader(delta.baserevisionsize, len(data))
689
689
690 meta = headerfn(delta)
690 meta = headerfn(delta)
691
691
692 yield chunkheader(len(meta) + len(prefix) + len(data))
692 yield chunkheader(len(meta) + len(prefix) + len(data))
693 yield meta
693 yield meta
694 if prefix:
694 if prefix:
695 yield prefix
695 yield prefix
696 yield data
696 yield data
697
697
698 sidedata = delta.sidedata
698 sidedata = delta.sidedata
699 if sidedata is not None:
699 if sidedata is not None:
700 # Need a separate chunk for sidedata to be able to differentiate
700 # Need a separate chunk for sidedata to be able to differentiate
701 # "raw delta" length and sidedata length
701 # "raw delta" length and sidedata length
702 yield chunkheader(len(sidedata))
702 yield chunkheader(len(sidedata))
703 yield sidedata
703 yield sidedata
704
704
705
705
706 def _sortnodesellipsis(store, nodes, cl, lookup):
706 def _sortnodesellipsis(store, nodes, cl, lookup):
707 """Sort nodes for changegroup generation."""
707 """Sort nodes for changegroup generation."""
708 # Ellipses serving mode.
708 # Ellipses serving mode.
709 #
709 #
710 # In a perfect world, we'd generate better ellipsis-ified graphs
710 # In a perfect world, we'd generate better ellipsis-ified graphs
711 # for non-changelog revlogs. In practice, we haven't started doing
711 # for non-changelog revlogs. In practice, we haven't started doing
712 # that yet, so the resulting DAGs for the manifestlog and filelogs
712 # that yet, so the resulting DAGs for the manifestlog and filelogs
713 # are actually full of bogus parentage on all the ellipsis
713 # are actually full of bogus parentage on all the ellipsis
714 # nodes. This has the side effect that, while the contents are
714 # nodes. This has the side effect that, while the contents are
715 # correct, the individual DAGs might be completely out of whack in
715 # correct, the individual DAGs might be completely out of whack in
716 # a case like 882681bc3166 and its ancestors (back about 10
716 # a case like 882681bc3166 and its ancestors (back about 10
717 # revisions or so) in the main hg repo.
717 # revisions or so) in the main hg repo.
718 #
718 #
719 # The one invariant we *know* holds is that the new (potentially
719 # The one invariant we *know* holds is that the new (potentially
720 # bogus) DAG shape will be valid if we order the nodes in the
720 # bogus) DAG shape will be valid if we order the nodes in the
721 # order that they're introduced in dramatis personae by the
721 # order that they're introduced in dramatis personae by the
722 # changelog, so what we do is we sort the non-changelog histories
722 # changelog, so what we do is we sort the non-changelog histories
723 # by the order in which they are used by the changelog.
723 # by the order in which they are used by the changelog.
724 key = lambda n: cl.rev(lookup(n))
724 key = lambda n: cl.rev(lookup(n))
725 return sorted(nodes, key=key)
725 return sorted(nodes, key=key)
726
726
727
727
728 def _resolvenarrowrevisioninfo(
728 def _resolvenarrowrevisioninfo(
729 cl,
729 cl,
730 store,
730 store,
731 ischangelog,
731 ischangelog,
732 rev,
732 rev,
733 linkrev,
733 linkrev,
734 linknode,
734 linknode,
735 clrevtolocalrev,
735 clrevtolocalrev,
736 fullclnodes,
736 fullclnodes,
737 precomputedellipsis,
737 precomputedellipsis,
738 ):
738 ):
739 linkparents = precomputedellipsis[linkrev]
739 linkparents = precomputedellipsis[linkrev]
740
740
741 def local(clrev):
741 def local(clrev):
742 """Turn a changelog revnum into a local revnum.
742 """Turn a changelog revnum into a local revnum.
743
743
744 The ellipsis dag is stored as revnums on the changelog,
744 The ellipsis dag is stored as revnums on the changelog,
745 but when we're producing ellipsis entries for
745 but when we're producing ellipsis entries for
746 non-changelog revlogs, we need to turn those numbers into
746 non-changelog revlogs, we need to turn those numbers into
747 something local. This does that for us, and during the
747 something local. This does that for us, and during the
748 changelog sending phase will also expand the stored
748 changelog sending phase will also expand the stored
749 mappings as needed.
749 mappings as needed.
750 """
750 """
751 if clrev == nullrev:
751 if clrev == nullrev:
752 return nullrev
752 return nullrev
753
753
754 if ischangelog:
754 if ischangelog:
755 return clrev
755 return clrev
756
756
757 # Walk the ellipsis-ized changelog breadth-first looking for a
757 # Walk the ellipsis-ized changelog breadth-first looking for a
758 # change that has been linked from the current revlog.
758 # change that has been linked from the current revlog.
759 #
759 #
760 # For a flat manifest revlog only a single step should be necessary
760 # For a flat manifest revlog only a single step should be necessary
761 # as all relevant changelog entries are relevant to the flat
761 # as all relevant changelog entries are relevant to the flat
762 # manifest.
762 # manifest.
763 #
763 #
764 # For a filelog or tree manifest dirlog however not every changelog
764 # For a filelog or tree manifest dirlog however not every changelog
765 # entry will have been relevant, so we need to skip some changelog
765 # entry will have been relevant, so we need to skip some changelog
766 # nodes even after ellipsis-izing.
766 # nodes even after ellipsis-izing.
767 walk = [clrev]
767 walk = [clrev]
768 while walk:
768 while walk:
769 p = walk[0]
769 p = walk[0]
770 walk = walk[1:]
770 walk = walk[1:]
771 if p in clrevtolocalrev:
771 if p in clrevtolocalrev:
772 return clrevtolocalrev[p]
772 return clrevtolocalrev[p]
773 elif p in fullclnodes:
773 elif p in fullclnodes:
774 walk.extend([pp for pp in cl.parentrevs(p) if pp != nullrev])
774 walk.extend([pp for pp in cl.parentrevs(p) if pp != nullrev])
775 elif p in precomputedellipsis:
775 elif p in precomputedellipsis:
776 walk.extend(
776 walk.extend(
777 [pp for pp in precomputedellipsis[p] if pp != nullrev]
777 [pp for pp in precomputedellipsis[p] if pp != nullrev]
778 )
778 )
779 else:
779 else:
780 # In this case, we've got an ellipsis with parents
780 # In this case, we've got an ellipsis with parents
781 # outside the current bundle (likely an
781 # outside the current bundle (likely an
782 # incremental pull). We "know" that we can use the
782 # incremental pull). We "know" that we can use the
783 # value of this same revlog at whatever revision
783 # value of this same revlog at whatever revision
784 # is pointed to by linknode. "Know" is in scare
784 # is pointed to by linknode. "Know" is in scare
785 # quotes because I haven't done enough examination
785 # quotes because I haven't done enough examination
786 # of edge cases to convince myself this is really
786 # of edge cases to convince myself this is really
787 # a fact - it works for all the (admittedly
787 # a fact - it works for all the (admittedly
788 # thorough) cases in our testsuite, but I would be
788 # thorough) cases in our testsuite, but I would be
789 # somewhat unsurprised to find a case in the wild
789 # somewhat unsurprised to find a case in the wild
790 # where this breaks down a bit. That said, I don't
790 # where this breaks down a bit. That said, I don't
791 # know if it would hurt anything.
791 # know if it would hurt anything.
792 for i in pycompat.xrange(rev, 0, -1):
792 for i in pycompat.xrange(rev, 0, -1):
793 if store.linkrev(i) == clrev:
793 if store.linkrev(i) == clrev:
794 return i
794 return i
795 # We failed to resolve a parent for this node, so
795 # We failed to resolve a parent for this node, so
796 # we crash the changegroup construction.
796 # we crash the changegroup construction.
797 raise error.Abort(
797 raise error.Abort(
798 b"unable to resolve parent while packing '%s' %r"
798 b"unable to resolve parent while packing '%s' %r"
799 b' for changeset %r' % (store.indexfile, rev, clrev)
799 b' for changeset %r' % (store.indexfile, rev, clrev)
800 )
800 )
801
801
802 return nullrev
802 return nullrev
803
803
804 if not linkparents or (store.parentrevs(rev) == (nullrev, nullrev)):
804 if not linkparents or (store.parentrevs(rev) == (nullrev, nullrev)):
805 p1, p2 = nullrev, nullrev
805 p1, p2 = nullrev, nullrev
806 elif len(linkparents) == 1:
806 elif len(linkparents) == 1:
807 (p1,) = sorted(local(p) for p in linkparents)
807 (p1,) = sorted(local(p) for p in linkparents)
808 p2 = nullrev
808 p2 = nullrev
809 else:
809 else:
810 p1, p2 = sorted(local(p) for p in linkparents)
810 p1, p2 = sorted(local(p) for p in linkparents)
811
811
812 p1node, p2node = store.node(p1), store.node(p2)
812 p1node, p2node = store.node(p1), store.node(p2)
813
813
814 return p1node, p2node, linknode
814 return p1node, p2node, linknode
815
815
816
816
817 def deltagroup(
817 def deltagroup(
818 repo,
818 repo,
819 store,
819 store,
820 nodes,
820 nodes,
821 ischangelog,
821 ischangelog,
822 lookup,
822 lookup,
823 forcedeltaparentprev,
823 forcedeltaparentprev,
824 topic=None,
824 topic=None,
825 ellipses=False,
825 ellipses=False,
826 clrevtolocalrev=None,
826 clrevtolocalrev=None,
827 fullclnodes=None,
827 fullclnodes=None,
828 precomputedellipsis=None,
828 precomputedellipsis=None,
829 sidedata_helpers=None,
829 sidedata_helpers=None,
830 ):
830 ):
831 """Calculate deltas for a set of revisions.
831 """Calculate deltas for a set of revisions.
832
832
833 Is a generator of ``revisiondelta`` instances.
833 Is a generator of ``revisiondelta`` instances.
834
834
835 If topic is not None, progress detail will be generated using this
835 If topic is not None, progress detail will be generated using this
836 topic name (e.g. changesets, manifests, etc).
836 topic name (e.g. changesets, manifests, etc).
837
837
838 See `storageutil.emitrevisions` for the doc on `sidedata_helpers`.
838 See `storageutil.emitrevisions` for the doc on `sidedata_helpers`.
839 """
839 """
840 if not nodes:
840 if not nodes:
841 return
841 return
842
842
843 cl = repo.changelog
843 cl = repo.changelog
844
844
845 if ischangelog:
845 if ischangelog:
846 # `hg log` shows changesets in storage order. To preserve order
846 # `hg log` shows changesets in storage order. To preserve order
847 # across clones, send out changesets in storage order.
847 # across clones, send out changesets in storage order.
848 nodesorder = b'storage'
848 nodesorder = b'storage'
849 elif ellipses:
849 elif ellipses:
850 nodes = _sortnodesellipsis(store, nodes, cl, lookup)
850 nodes = _sortnodesellipsis(store, nodes, cl, lookup)
851 nodesorder = b'nodes'
851 nodesorder = b'nodes'
852 else:
852 else:
853 nodesorder = None
853 nodesorder = None
854
854
855 # Perform ellipses filtering and revision massaging. We do this before
855 # Perform ellipses filtering and revision massaging. We do this before
856 # emitrevisions() because a) filtering out revisions creates less work
856 # emitrevisions() because a) filtering out revisions creates less work
857 # for emitrevisions() b) dropping revisions would break emitrevisions()'s
857 # for emitrevisions() b) dropping revisions would break emitrevisions()'s
858 # assumptions about delta choices and we would possibly send a delta
858 # assumptions about delta choices and we would possibly send a delta
859 # referencing a missing base revision.
859 # referencing a missing base revision.
860 #
860 #
861 # Also, calling lookup() has side-effects with regards to populating
861 # Also, calling lookup() has side-effects with regards to populating
862 # data structures. If we don't call lookup() for each node or if we call
862 # data structures. If we don't call lookup() for each node or if we call
863 # lookup() after the first pass through each node, things can break -
863 # lookup() after the first pass through each node, things can break -
864 # possibly intermittently depending on the python hash seed! For that
864 # possibly intermittently depending on the python hash seed! For that
865 # reason, we store a mapping of all linknodes during the initial node
865 # reason, we store a mapping of all linknodes during the initial node
866 # pass rather than use lookup() on the output side.
866 # pass rather than use lookup() on the output side.
867 if ellipses:
867 if ellipses:
868 filtered = []
868 filtered = []
869 adjustedparents = {}
869 adjustedparents = {}
870 linknodes = {}
870 linknodes = {}
871
871
872 for node in nodes:
872 for node in nodes:
873 rev = store.rev(node)
873 rev = store.rev(node)
874 linknode = lookup(node)
874 linknode = lookup(node)
875 linkrev = cl.rev(linknode)
875 linkrev = cl.rev(linknode)
876 clrevtolocalrev[linkrev] = rev
876 clrevtolocalrev[linkrev] = rev
877
877
878 # If linknode is in fullclnodes, it means the corresponding
878 # If linknode is in fullclnodes, it means the corresponding
879 # changeset was a full changeset and is being sent unaltered.
879 # changeset was a full changeset and is being sent unaltered.
880 if linknode in fullclnodes:
880 if linknode in fullclnodes:
881 linknodes[node] = linknode
881 linknodes[node] = linknode
882
882
883 # If the corresponding changeset wasn't in the set computed
883 # If the corresponding changeset wasn't in the set computed
884 # as relevant to us, it should be dropped outright.
884 # as relevant to us, it should be dropped outright.
885 elif linkrev not in precomputedellipsis:
885 elif linkrev not in precomputedellipsis:
886 continue
886 continue
887
887
888 else:
888 else:
889 # We could probably do this later and avoid the dict
889 # We could probably do this later and avoid the dict
890 # holding state. But it likely doesn't matter.
890 # holding state. But it likely doesn't matter.
891 p1node, p2node, linknode = _resolvenarrowrevisioninfo(
891 p1node, p2node, linknode = _resolvenarrowrevisioninfo(
892 cl,
892 cl,
893 store,
893 store,
894 ischangelog,
894 ischangelog,
895 rev,
895 rev,
896 linkrev,
896 linkrev,
897 linknode,
897 linknode,
898 clrevtolocalrev,
898 clrevtolocalrev,
899 fullclnodes,
899 fullclnodes,
900 precomputedellipsis,
900 precomputedellipsis,
901 )
901 )
902
902
903 adjustedparents[node] = (p1node, p2node)
903 adjustedparents[node] = (p1node, p2node)
904 linknodes[node] = linknode
904 linknodes[node] = linknode
905
905
906 filtered.append(node)
906 filtered.append(node)
907
907
908 nodes = filtered
908 nodes = filtered
909
909
910 # We expect the first pass to be fast, so we only engage the progress
910 # We expect the first pass to be fast, so we only engage the progress
911 # meter for constructing the revision deltas.
911 # meter for constructing the revision deltas.
912 progress = None
912 progress = None
913 if topic is not None:
913 if topic is not None:
914 progress = repo.ui.makeprogress(
914 progress = repo.ui.makeprogress(
915 topic, unit=_(b'chunks'), total=len(nodes)
915 topic, unit=_(b'chunks'), total=len(nodes)
916 )
916 )
917
917
918 configtarget = repo.ui.config(b'devel', b'bundle.delta')
918 configtarget = repo.ui.config(b'devel', b'bundle.delta')
919 if configtarget not in (b'', b'p1', b'full'):
919 if configtarget not in (b'', b'p1', b'full'):
920 msg = _(b"""config "devel.bundle.delta" as unknown value: %s""")
920 msg = _(b"""config "devel.bundle.delta" as unknown value: %s""")
921 repo.ui.warn(msg % configtarget)
921 repo.ui.warn(msg % configtarget)
922
922
923 deltamode = repository.CG_DELTAMODE_STD
923 deltamode = repository.CG_DELTAMODE_STD
924 if forcedeltaparentprev:
924 if forcedeltaparentprev:
925 deltamode = repository.CG_DELTAMODE_PREV
925 deltamode = repository.CG_DELTAMODE_PREV
926 elif configtarget == b'p1':
926 elif configtarget == b'p1':
927 deltamode = repository.CG_DELTAMODE_P1
927 deltamode = repository.CG_DELTAMODE_P1
928 elif configtarget == b'full':
928 elif configtarget == b'full':
929 deltamode = repository.CG_DELTAMODE_FULL
929 deltamode = repository.CG_DELTAMODE_FULL
930
930
931 revisions = store.emitrevisions(
931 revisions = store.emitrevisions(
932 nodes,
932 nodes,
933 nodesorder=nodesorder,
933 nodesorder=nodesorder,
934 revisiondata=True,
934 revisiondata=True,
935 assumehaveparentrevisions=not ellipses,
935 assumehaveparentrevisions=not ellipses,
936 deltamode=deltamode,
936 deltamode=deltamode,
937 sidedata_helpers=sidedata_helpers,
937 sidedata_helpers=sidedata_helpers,
938 )
938 )
939
939
940 for i, revision in enumerate(revisions):
940 for i, revision in enumerate(revisions):
941 if progress:
941 if progress:
942 progress.update(i + 1)
942 progress.update(i + 1)
943
943
944 if ellipses:
944 if ellipses:
945 linknode = linknodes[revision.node]
945 linknode = linknodes[revision.node]
946
946
947 if revision.node in adjustedparents:
947 if revision.node in adjustedparents:
948 p1node, p2node = adjustedparents[revision.node]
948 p1node, p2node = adjustedparents[revision.node]
949 revision.p1node = p1node
949 revision.p1node = p1node
950 revision.p2node = p2node
950 revision.p2node = p2node
951 revision.flags |= repository.REVISION_FLAG_ELLIPSIS
951 revision.flags |= repository.REVISION_FLAG_ELLIPSIS
952
952
953 else:
953 else:
954 linknode = lookup(revision.node)
954 linknode = lookup(revision.node)
955
955
956 revision.linknode = linknode
956 revision.linknode = linknode
957 yield revision
957 yield revision
958
958
959 if progress:
959 if progress:
960 progress.complete()
960 progress.complete()
961
961
962
962
963 class cgpacker(object):
963 class cgpacker(object):
964 def __init__(
964 def __init__(
965 self,
965 self,
966 repo,
966 repo,
967 oldmatcher,
967 oldmatcher,
968 matcher,
968 matcher,
969 version,
969 version,
970 builddeltaheader,
970 builddeltaheader,
971 manifestsend,
971 manifestsend,
972 forcedeltaparentprev=False,
972 forcedeltaparentprev=False,
973 bundlecaps=None,
973 bundlecaps=None,
974 ellipses=False,
974 ellipses=False,
975 shallow=False,
975 shallow=False,
976 ellipsisroots=None,
976 ellipsisroots=None,
977 fullnodes=None,
977 fullnodes=None,
978 remote_sidedata=None,
978 remote_sidedata=None,
979 ):
979 ):
980 """Given a source repo, construct a bundler.
980 """Given a source repo, construct a bundler.
981
981
982 oldmatcher is a matcher that matches on files the client already has.
982 oldmatcher is a matcher that matches on files the client already has.
983 These will not be included in the changegroup.
983 These will not be included in the changegroup.
984
984
985 matcher is a matcher that matches on files to include in the
985 matcher is a matcher that matches on files to include in the
986 changegroup. Used to facilitate sparse changegroups.
986 changegroup. Used to facilitate sparse changegroups.
987
987
988 forcedeltaparentprev indicates whether delta parents must be against
988 forcedeltaparentprev indicates whether delta parents must be against
989 the previous revision in a delta group. This should only be used for
989 the previous revision in a delta group. This should only be used for
990 compatibility with changegroup version 1.
990 compatibility with changegroup version 1.
991
991
992 builddeltaheader is a callable that constructs the header for a group
992 builddeltaheader is a callable that constructs the header for a group
993 delta.
993 delta.
994
994
995 manifestsend is a chunk to send after manifests have been fully emitted.
995 manifestsend is a chunk to send after manifests have been fully emitted.
996
996
997 ellipses indicates whether ellipsis serving mode is enabled.
997 ellipses indicates whether ellipsis serving mode is enabled.
998
998
999 bundlecaps is optional and can be used to specify the set of
999 bundlecaps is optional and can be used to specify the set of
1000 capabilities which can be used to build the bundle. While bundlecaps is
1000 capabilities which can be used to build the bundle. While bundlecaps is
1001 unused in core Mercurial, extensions rely on this feature to communicate
1001 unused in core Mercurial, extensions rely on this feature to communicate
1002 capabilities to customize the changegroup packer.
1002 capabilities to customize the changegroup packer.
1003
1003
1004 shallow indicates whether shallow data might be sent. The packer may
1004 shallow indicates whether shallow data might be sent. The packer may
1005 need to pack file contents not introduced by the changes being packed.
1005 need to pack file contents not introduced by the changes being packed.
1006
1006
1007 fullnodes is the set of changelog nodes which should not be ellipsis
1007 fullnodes is the set of changelog nodes which should not be ellipsis
1008 nodes. We store this rather than the set of nodes that should be
1008 nodes. We store this rather than the set of nodes that should be
1009 ellipsis because for very large histories we expect this to be
1009 ellipsis because for very large histories we expect this to be
1010 significantly smaller.
1010 significantly smaller.
1011
1011
1012 remote_sidedata is the set of sidedata categories wanted by the remote.
1012 remote_sidedata is the set of sidedata categories wanted by the remote.
1013 """
1013 """
1014 assert oldmatcher
1014 assert oldmatcher
1015 assert matcher
1015 assert matcher
1016 self._oldmatcher = oldmatcher
1016 self._oldmatcher = oldmatcher
1017 self._matcher = matcher
1017 self._matcher = matcher
1018
1018
1019 self.version = version
1019 self.version = version
1020 self._forcedeltaparentprev = forcedeltaparentprev
1020 self._forcedeltaparentprev = forcedeltaparentprev
1021 self._builddeltaheader = builddeltaheader
1021 self._builddeltaheader = builddeltaheader
1022 self._manifestsend = manifestsend
1022 self._manifestsend = manifestsend
1023 self._ellipses = ellipses
1023 self._ellipses = ellipses
1024
1024
1025 # Set of capabilities we can use to build the bundle.
1025 # Set of capabilities we can use to build the bundle.
1026 if bundlecaps is None:
1026 if bundlecaps is None:
1027 bundlecaps = set()
1027 bundlecaps = set()
1028 self._bundlecaps = bundlecaps
1028 self._bundlecaps = bundlecaps
1029 if remote_sidedata is None:
1029 if remote_sidedata is None:
1030 remote_sidedata = set()
1030 remote_sidedata = set()
1031 self._remote_sidedata = remote_sidedata
1031 self._remote_sidedata = remote_sidedata
1032 self._isshallow = shallow
1032 self._isshallow = shallow
1033 self._fullclnodes = fullnodes
1033 self._fullclnodes = fullnodes
1034
1034
1035 # Maps ellipsis revs to their roots at the changelog level.
1035 # Maps ellipsis revs to their roots at the changelog level.
1036 self._precomputedellipsis = ellipsisroots
1036 self._precomputedellipsis = ellipsisroots
1037
1037
1038 self._repo = repo
1038 self._repo = repo
1039
1039
1040 if self._repo.ui.verbose and not self._repo.ui.debugflag:
1040 if self._repo.ui.verbose and not self._repo.ui.debugflag:
1041 self._verbosenote = self._repo.ui.note
1041 self._verbosenote = self._repo.ui.note
1042 else:
1042 else:
1043 self._verbosenote = lambda s: None
1043 self._verbosenote = lambda s: None
1044
1044
1045 def generate(
1045 def generate(
1046 self, commonrevs, clnodes, fastpathlinkrev, source, changelog=True
1046 self, commonrevs, clnodes, fastpathlinkrev, source, changelog=True
1047 ):
1047 ):
1048 """Yield a sequence of changegroup byte chunks.
1048 """Yield a sequence of changegroup byte chunks.
1049 If changelog is False, changelog data won't be added to changegroup
1049 If changelog is False, changelog data won't be added to changegroup
1050 """
1050 """
1051
1051
1052 repo = self._repo
1052 repo = self._repo
1053 cl = repo.changelog
1053 cl = repo.changelog
1054
1054
1055 self._verbosenote(_(b'uncompressed size of bundle content:\n'))
1055 self._verbosenote(_(b'uncompressed size of bundle content:\n'))
1056 size = 0
1056 size = 0
1057
1057
1058 sidedata_helpers = None
1058 sidedata_helpers = None
1059 if self.version == b'04':
1059 if self.version == b'04':
1060 remote_sidedata = self._remote_sidedata
1060 remote_sidedata = self._remote_sidedata
1061 if source == b'strip':
1061 if source == b'strip':
1062 # We're our own remote when stripping, get the no-op helpers
1062 # We're our own remote when stripping, get the no-op helpers
1063 # TODO a better approach would be for the strip bundle to
1063 # TODO a better approach would be for the strip bundle to
1064 # correctly advertise its sidedata categories directly.
1064 # correctly advertise its sidedata categories directly.
1065 remote_sidedata = repo._wanted_sidedata
1065 remote_sidedata = repo._wanted_sidedata
1066 sidedata_helpers = get_sidedata_helpers(repo, remote_sidedata)
1066 sidedata_helpers = get_sidedata_helpers(repo, remote_sidedata)
1067
1067
1068 clstate, deltas = self._generatechangelog(
1068 clstate, deltas = self._generatechangelog(
1069 cl,
1069 cl,
1070 clnodes,
1070 clnodes,
1071 generate=changelog,
1071 generate=changelog,
1072 sidedata_helpers=sidedata_helpers,
1072 sidedata_helpers=sidedata_helpers,
1073 )
1073 )
1074 for delta in deltas:
1074 for delta in deltas:
1075 for chunk in _revisiondeltatochunks(
1075 for chunk in _revisiondeltatochunks(
1076 self._repo, delta, self._builddeltaheader
1076 self._repo, delta, self._builddeltaheader
1077 ):
1077 ):
1078 size += len(chunk)
1078 size += len(chunk)
1079 yield chunk
1079 yield chunk
1080
1080
1081 close = closechunk()
1081 close = closechunk()
1082 size += len(close)
1082 size += len(close)
1083 yield closechunk()
1083 yield closechunk()
1084
1084
1085 self._verbosenote(_(b'%8.i (changelog)\n') % size)
1085 self._verbosenote(_(b'%8.i (changelog)\n') % size)
1086
1086
1087 clrevorder = clstate[b'clrevorder']
1087 clrevorder = clstate[b'clrevorder']
1088 manifests = clstate[b'manifests']
1088 manifests = clstate[b'manifests']
1089 changedfiles = clstate[b'changedfiles']
1089 changedfiles = clstate[b'changedfiles']
1090
1090
1091 # We need to make sure that the linkrev in the changegroup refers to
1091 # We need to make sure that the linkrev in the changegroup refers to
1092 # the first changeset that introduced the manifest or file revision.
1092 # the first changeset that introduced the manifest or file revision.
1093 # The fastpath is usually safer than the slowpath, because the filelogs
1093 # The fastpath is usually safer than the slowpath, because the filelogs
1094 # are walked in revlog order.
1094 # are walked in revlog order.
1095 #
1095 #
1096 # When taking the slowpath when the manifest revlog uses generaldelta,
1096 # When taking the slowpath when the manifest revlog uses generaldelta,
1097 # the manifest may be walked in the "wrong" order. Without 'clrevorder',
1097 # the manifest may be walked in the "wrong" order. Without 'clrevorder',
1098 # we would get an incorrect linkrev (see fix in cc0ff93d0c0c).
1098 # we would get an incorrect linkrev (see fix in cc0ff93d0c0c).
1099 #
1099 #
1100 # When taking the fastpath, we are only vulnerable to reordering
1100 # When taking the fastpath, we are only vulnerable to reordering
1101 # of the changelog itself. The changelog never uses generaldelta and is
1101 # of the changelog itself. The changelog never uses generaldelta and is
1102 # never reordered. To handle this case, we simply take the slowpath,
1102 # never reordered. To handle this case, we simply take the slowpath,
1103 # which already has the 'clrevorder' logic. This was also fixed in
1103 # which already has the 'clrevorder' logic. This was also fixed in
1104 # cc0ff93d0c0c.
1104 # cc0ff93d0c0c.
1105
1105
1106 # Treemanifests don't work correctly with fastpathlinkrev
1106 # Treemanifests don't work correctly with fastpathlinkrev
1107 # either, because we don't discover which directory nodes to
1107 # either, because we don't discover which directory nodes to
1108 # send along with files. This could probably be fixed.
1108 # send along with files. This could probably be fixed.
1109 fastpathlinkrev = fastpathlinkrev and not scmutil.istreemanifest(repo)
1109 fastpathlinkrev = fastpathlinkrev and not scmutil.istreemanifest(repo)
1110
1110
1111 fnodes = {} # needed file nodes
1111 fnodes = {} # needed file nodes
1112
1112
1113 size = 0
1113 size = 0
1114 it = self.generatemanifests(
1114 it = self.generatemanifests(
1115 commonrevs,
1115 commonrevs,
1116 clrevorder,
1116 clrevorder,
1117 fastpathlinkrev,
1117 fastpathlinkrev,
1118 manifests,
1118 manifests,
1119 fnodes,
1119 fnodes,
1120 source,
1120 source,
1121 clstate[b'clrevtomanifestrev'],
1121 clstate[b'clrevtomanifestrev'],
1122 sidedata_helpers=sidedata_helpers,
1122 sidedata_helpers=sidedata_helpers,
1123 )
1123 )
1124
1124
1125 for tree, deltas in it:
1125 for tree, deltas in it:
1126 if tree:
1126 if tree:
1127 assert self.version in (b'03', b'04')
1127 assert self.version in (b'03', b'04')
1128 chunk = _fileheader(tree)
1128 chunk = _fileheader(tree)
1129 size += len(chunk)
1129 size += len(chunk)
1130 yield chunk
1130 yield chunk
1131
1131
1132 for delta in deltas:
1132 for delta in deltas:
1133 chunks = _revisiondeltatochunks(
1133 chunks = _revisiondeltatochunks(
1134 self._repo, delta, self._builddeltaheader
1134 self._repo, delta, self._builddeltaheader
1135 )
1135 )
1136 for chunk in chunks:
1136 for chunk in chunks:
1137 size += len(chunk)
1137 size += len(chunk)
1138 yield chunk
1138 yield chunk
1139
1139
1140 close = closechunk()
1140 close = closechunk()
1141 size += len(close)
1141 size += len(close)
1142 yield close
1142 yield close
1143
1143
1144 self._verbosenote(_(b'%8.i (manifests)\n') % size)
1144 self._verbosenote(_(b'%8.i (manifests)\n') % size)
1145 yield self._manifestsend
1145 yield self._manifestsend
1146
1146
1147 mfdicts = None
1147 mfdicts = None
1148 if self._ellipses and self._isshallow:
1148 if self._ellipses and self._isshallow:
1149 mfdicts = [
1149 mfdicts = [
1150 (repo.manifestlog[n].read(), lr)
1150 (repo.manifestlog[n].read(), lr)
1151 for (n, lr) in pycompat.iteritems(manifests)
1151 for (n, lr) in pycompat.iteritems(manifests)
1152 ]
1152 ]
1153
1153
1154 manifests.clear()
1154 manifests.clear()
1155 clrevs = {cl.rev(x) for x in clnodes}
1155 clrevs = {cl.rev(x) for x in clnodes}
1156
1156
1157 it = self.generatefiles(
1157 it = self.generatefiles(
1158 changedfiles,
1158 changedfiles,
1159 commonrevs,
1159 commonrevs,
1160 source,
1160 source,
1161 mfdicts,
1161 mfdicts,
1162 fastpathlinkrev,
1162 fastpathlinkrev,
1163 fnodes,
1163 fnodes,
1164 clrevs,
1164 clrevs,
1165 sidedata_helpers=sidedata_helpers,
1165 sidedata_helpers=sidedata_helpers,
1166 )
1166 )
1167
1167
1168 for path, deltas in it:
1168 for path, deltas in it:
1169 h = _fileheader(path)
1169 h = _fileheader(path)
1170 size = len(h)
1170 size = len(h)
1171 yield h
1171 yield h
1172
1172
1173 for delta in deltas:
1173 for delta in deltas:
1174 chunks = _revisiondeltatochunks(
1174 chunks = _revisiondeltatochunks(
1175 self._repo, delta, self._builddeltaheader
1175 self._repo, delta, self._builddeltaheader
1176 )
1176 )
1177 for chunk in chunks:
1177 for chunk in chunks:
1178 size += len(chunk)
1178 size += len(chunk)
1179 yield chunk
1179 yield chunk
1180
1180
1181 close = closechunk()
1181 close = closechunk()
1182 size += len(close)
1182 size += len(close)
1183 yield close
1183 yield close
1184
1184
1185 self._verbosenote(_(b'%8.i %s\n') % (size, path))
1185 self._verbosenote(_(b'%8.i %s\n') % (size, path))
1186
1186
1187 yield closechunk()
1187 yield closechunk()
1188
1188
1189 if clnodes:
1189 if clnodes:
1190 repo.hook(b'outgoing', node=hex(clnodes[0]), source=source)
1190 repo.hook(b'outgoing', node=hex(clnodes[0]), source=source)
1191
1191
1192 def _generatechangelog(
1192 def _generatechangelog(
1193 self, cl, nodes, generate=True, sidedata_helpers=None
1193 self, cl, nodes, generate=True, sidedata_helpers=None
1194 ):
1194 ):
1195 """Generate data for changelog chunks.
1195 """Generate data for changelog chunks.
1196
1196
1197 Returns a 2-tuple of a dict containing state and an iterable of
1197 Returns a 2-tuple of a dict containing state and an iterable of
1198 byte chunks. The state will not be fully populated until the
1198 byte chunks. The state will not be fully populated until the
1199 chunk stream has been fully consumed.
1199 chunk stream has been fully consumed.
1200
1200
1201 if generate is False, the state will be fully populated and no chunk
1201 if generate is False, the state will be fully populated and no chunk
1202 stream will be yielded
1202 stream will be yielded
1203
1203
1204 See `storageutil.emitrevisions` for the doc on `sidedata_helpers`.
1204 See `storageutil.emitrevisions` for the doc on `sidedata_helpers`.
1205 """
1205 """
1206 clrevorder = {}
1206 clrevorder = {}
1207 manifests = {}
1207 manifests = {}
1208 mfl = self._repo.manifestlog
1208 mfl = self._repo.manifestlog
1209 changedfiles = set()
1209 changedfiles = set()
1210 clrevtomanifestrev = {}
1210 clrevtomanifestrev = {}
1211
1211
1212 state = {
1212 state = {
1213 b'clrevorder': clrevorder,
1213 b'clrevorder': clrevorder,
1214 b'manifests': manifests,
1214 b'manifests': manifests,
1215 b'changedfiles': changedfiles,
1215 b'changedfiles': changedfiles,
1216 b'clrevtomanifestrev': clrevtomanifestrev,
1216 b'clrevtomanifestrev': clrevtomanifestrev,
1217 }
1217 }
1218
1218
1219 if not (generate or self._ellipses):
1219 if not (generate or self._ellipses):
1220 # sort the nodes in storage order
1220 # sort the nodes in storage order
1221 nodes = sorted(nodes, key=cl.rev)
1221 nodes = sorted(nodes, key=cl.rev)
1222 for node in nodes:
1222 for node in nodes:
1223 c = cl.changelogrevision(node)
1223 c = cl.changelogrevision(node)
1224 clrevorder[node] = len(clrevorder)
1224 clrevorder[node] = len(clrevorder)
1225 # record the first changeset introducing this manifest version
1225 # record the first changeset introducing this manifest version
1226 manifests.setdefault(c.manifest, node)
1226 manifests.setdefault(c.manifest, node)
1227 # Record a complete list of potentially-changed files in
1227 # Record a complete list of potentially-changed files in
1228 # this manifest.
1228 # this manifest.
1229 changedfiles.update(c.files)
1229 changedfiles.update(c.files)
1230
1230
1231 return state, ()
1231 return state, ()
1232
1232
1233 # Callback for the changelog, used to collect changed files and
1233 # Callback for the changelog, used to collect changed files and
1234 # manifest nodes.
1234 # manifest nodes.
1235 # Returns the linkrev node (identity in the changelog case).
1235 # Returns the linkrev node (identity in the changelog case).
1236 def lookupcl(x):
1236 def lookupcl(x):
1237 c = cl.changelogrevision(x)
1237 c = cl.changelogrevision(x)
1238 clrevorder[x] = len(clrevorder)
1238 clrevorder[x] = len(clrevorder)
1239
1239
1240 if self._ellipses:
1240 if self._ellipses:
1241 # Only update manifests if x is going to be sent. Otherwise we
1241 # Only update manifests if x is going to be sent. Otherwise we
1242 # end up with bogus linkrevs specified for manifests and
1242 # end up with bogus linkrevs specified for manifests and
1243 # we skip some manifest nodes that we should otherwise
1243 # we skip some manifest nodes that we should otherwise
1244 # have sent.
1244 # have sent.
1245 if (
1245 if (
1246 x in self._fullclnodes
1246 x in self._fullclnodes
1247 or cl.rev(x) in self._precomputedellipsis
1247 or cl.rev(x) in self._precomputedellipsis
1248 ):
1248 ):
1249
1249
1250 manifestnode = c.manifest
1250 manifestnode = c.manifest
1251 # Record the first changeset introducing this manifest
1251 # Record the first changeset introducing this manifest
1252 # version.
1252 # version.
1253 manifests.setdefault(manifestnode, x)
1253 manifests.setdefault(manifestnode, x)
1254 # Set this narrow-specific dict so we have the lowest
1254 # Set this narrow-specific dict so we have the lowest
1255 # manifest revnum to look up for this cl revnum. (Part of
1255 # manifest revnum to look up for this cl revnum. (Part of
1256 # mapping changelog ellipsis parents to manifest ellipsis
1256 # mapping changelog ellipsis parents to manifest ellipsis
1257 # parents)
1257 # parents)
1258 clrevtomanifestrev.setdefault(
1258 clrevtomanifestrev.setdefault(
1259 cl.rev(x), mfl.rev(manifestnode)
1259 cl.rev(x), mfl.rev(manifestnode)
1260 )
1260 )
1261 # We can't trust the changed files list in the changeset if the
1261 # We can't trust the changed files list in the changeset if the
1262 # client requested a shallow clone.
1262 # client requested a shallow clone.
1263 if self._isshallow:
1263 if self._isshallow:
1264 changedfiles.update(mfl[c.manifest].read().keys())
1264 changedfiles.update(mfl[c.manifest].read().keys())
1265 else:
1265 else:
1266 changedfiles.update(c.files)
1266 changedfiles.update(c.files)
1267 else:
1267 else:
1268 # record the first changeset introducing this manifest version
1268 # record the first changeset introducing this manifest version
1269 manifests.setdefault(c.manifest, x)
1269 manifests.setdefault(c.manifest, x)
1270 # Record a complete list of potentially-changed files in
1270 # Record a complete list of potentially-changed files in
1271 # this manifest.
1271 # this manifest.
1272 changedfiles.update(c.files)
1272 changedfiles.update(c.files)
1273
1273
1274 return x
1274 return x
1275
1275
1276 gen = deltagroup(
1276 gen = deltagroup(
1277 self._repo,
1277 self._repo,
1278 cl,
1278 cl,
1279 nodes,
1279 nodes,
1280 True,
1280 True,
1281 lookupcl,
1281 lookupcl,
1282 self._forcedeltaparentprev,
1282 self._forcedeltaparentprev,
1283 ellipses=self._ellipses,
1283 ellipses=self._ellipses,
1284 topic=_(b'changesets'),
1284 topic=_(b'changesets'),
1285 clrevtolocalrev={},
1285 clrevtolocalrev={},
1286 fullclnodes=self._fullclnodes,
1286 fullclnodes=self._fullclnodes,
1287 precomputedellipsis=self._precomputedellipsis,
1287 precomputedellipsis=self._precomputedellipsis,
1288 sidedata_helpers=sidedata_helpers,
1288 sidedata_helpers=sidedata_helpers,
1289 )
1289 )
1290
1290
1291 return state, gen
1291 return state, gen
1292
1292
1293 def generatemanifests(
1293 def generatemanifests(
1294 self,
1294 self,
1295 commonrevs,
1295 commonrevs,
1296 clrevorder,
1296 clrevorder,
1297 fastpathlinkrev,
1297 fastpathlinkrev,
1298 manifests,
1298 manifests,
1299 fnodes,
1299 fnodes,
1300 source,
1300 source,
1301 clrevtolocalrev,
1301 clrevtolocalrev,
1302 sidedata_helpers=None,
1302 sidedata_helpers=None,
1303 ):
1303 ):
1304 """Returns an iterator of changegroup chunks containing manifests.
1304 """Returns an iterator of changegroup chunks containing manifests.
1305
1305
1306 `source` is unused here, but is used by extensions like remotefilelog to
1306 `source` is unused here, but is used by extensions like remotefilelog to
1307 change what is sent based in pulls vs pushes, etc.
1307 change what is sent based in pulls vs pushes, etc.
1308
1308
1309 See `storageutil.emitrevisions` for the doc on `sidedata_helpers`.
1309 See `storageutil.emitrevisions` for the doc on `sidedata_helpers`.
1310 """
1310 """
1311 repo = self._repo
1311 repo = self._repo
1312 mfl = repo.manifestlog
1312 mfl = repo.manifestlog
1313 tmfnodes = {b'': manifests}
1313 tmfnodes = {b'': manifests}
1314
1314
1315 # Callback for the manifest, used to collect linkrevs for filelog
1315 # Callback for the manifest, used to collect linkrevs for filelog
1316 # revisions.
1316 # revisions.
1317 # Returns the linkrev node (collected in lookupcl).
1317 # Returns the linkrev node (collected in lookupcl).
1318 def makelookupmflinknode(tree, nodes):
1318 def makelookupmflinknode(tree, nodes):
1319 if fastpathlinkrev:
1319 if fastpathlinkrev:
1320 assert not tree
1320 assert not tree
1321
1321
1322 # pytype: disable=unsupported-operands
1322 # pytype: disable=unsupported-operands
1323 return manifests.__getitem__
1323 return manifests.__getitem__
1324 # pytype: enable=unsupported-operands
1324 # pytype: enable=unsupported-operands
1325
1325
1326 def lookupmflinknode(x):
1326 def lookupmflinknode(x):
1327 """Callback for looking up the linknode for manifests.
1327 """Callback for looking up the linknode for manifests.
1328
1328
1329 Returns the linkrev node for the specified manifest.
1329 Returns the linkrev node for the specified manifest.
1330
1330
1331 SIDE EFFECT:
1331 SIDE EFFECT:
1332
1332
1333 1) fclnodes gets populated with the list of relevant
1333 1) fclnodes gets populated with the list of relevant
1334 file nodes if we're not using fastpathlinkrev
1334 file nodes if we're not using fastpathlinkrev
1335 2) When treemanifests are in use, collects treemanifest nodes
1335 2) When treemanifests are in use, collects treemanifest nodes
1336 to send
1336 to send
1337
1337
1338 Note that this means manifests must be completely sent to
1338 Note that this means manifests must be completely sent to
1339 the client before you can trust the list of files and
1339 the client before you can trust the list of files and
1340 treemanifests to send.
1340 treemanifests to send.
1341 """
1341 """
1342 clnode = nodes[x]
1342 clnode = nodes[x]
1343 mdata = mfl.get(tree, x).readfast(shallow=True)
1343 mdata = mfl.get(tree, x).readfast(shallow=True)
1344 for p, n, fl in mdata.iterentries():
1344 for p, n, fl in mdata.iterentries():
1345 if fl == b't': # subdirectory manifest
1345 if fl == b't': # subdirectory manifest
1346 subtree = tree + p + b'/'
1346 subtree = tree + p + b'/'
1347 tmfclnodes = tmfnodes.setdefault(subtree, {})
1347 tmfclnodes = tmfnodes.setdefault(subtree, {})
1348 tmfclnode = tmfclnodes.setdefault(n, clnode)
1348 tmfclnode = tmfclnodes.setdefault(n, clnode)
1349 if clrevorder[clnode] < clrevorder[tmfclnode]:
1349 if clrevorder[clnode] < clrevorder[tmfclnode]:
1350 tmfclnodes[n] = clnode
1350 tmfclnodes[n] = clnode
1351 else:
1351 else:
1352 f = tree + p
1352 f = tree + p
1353 fclnodes = fnodes.setdefault(f, {})
1353 fclnodes = fnodes.setdefault(f, {})
1354 fclnode = fclnodes.setdefault(n, clnode)
1354 fclnode = fclnodes.setdefault(n, clnode)
1355 if clrevorder[clnode] < clrevorder[fclnode]:
1355 if clrevorder[clnode] < clrevorder[fclnode]:
1356 fclnodes[n] = clnode
1356 fclnodes[n] = clnode
1357 return clnode
1357 return clnode
1358
1358
1359 return lookupmflinknode
1359 return lookupmflinknode
1360
1360
1361 while tmfnodes:
1361 while tmfnodes:
1362 tree, nodes = tmfnodes.popitem()
1362 tree, nodes = tmfnodes.popitem()
1363
1363
1364 should_visit = self._matcher.visitdir(tree[:-1])
1364 should_visit = self._matcher.visitdir(tree[:-1])
1365 if tree and not should_visit:
1365 if tree and not should_visit:
1366 continue
1366 continue
1367
1367
1368 store = mfl.getstorage(tree)
1368 store = mfl.getstorage(tree)
1369
1369
1370 if not should_visit:
1370 if not should_visit:
1371 # No nodes to send because this directory is out of
1371 # No nodes to send because this directory is out of
1372 # the client's view of the repository (probably
1372 # the client's view of the repository (probably
1373 # because of narrow clones). Do this even for the root
1373 # because of narrow clones). Do this even for the root
1374 # directory (tree=='')
1374 # directory (tree=='')
1375 prunednodes = []
1375 prunednodes = []
1376 else:
1376 else:
1377 # Avoid sending any manifest nodes we can prove the
1377 # Avoid sending any manifest nodes we can prove the
1378 # client already has by checking linkrevs. See the
1378 # client already has by checking linkrevs. See the
1379 # related comment in generatefiles().
1379 # related comment in generatefiles().
1380 prunednodes = self._prunemanifests(store, nodes, commonrevs)
1380 prunednodes = self._prunemanifests(store, nodes, commonrevs)
1381
1381
1382 if tree and not prunednodes:
1382 if tree and not prunednodes:
1383 continue
1383 continue
1384
1384
1385 lookupfn = makelookupmflinknode(tree, nodes)
1385 lookupfn = makelookupmflinknode(tree, nodes)
1386
1386
1387 deltas = deltagroup(
1387 deltas = deltagroup(
1388 self._repo,
1388 self._repo,
1389 store,
1389 store,
1390 prunednodes,
1390 prunednodes,
1391 False,
1391 False,
1392 lookupfn,
1392 lookupfn,
1393 self._forcedeltaparentprev,
1393 self._forcedeltaparentprev,
1394 ellipses=self._ellipses,
1394 ellipses=self._ellipses,
1395 topic=_(b'manifests'),
1395 topic=_(b'manifests'),
1396 clrevtolocalrev=clrevtolocalrev,
1396 clrevtolocalrev=clrevtolocalrev,
1397 fullclnodes=self._fullclnodes,
1397 fullclnodes=self._fullclnodes,
1398 precomputedellipsis=self._precomputedellipsis,
1398 precomputedellipsis=self._precomputedellipsis,
1399 sidedata_helpers=sidedata_helpers,
1399 sidedata_helpers=sidedata_helpers,
1400 )
1400 )
1401
1401
1402 if not self._oldmatcher.visitdir(store.tree[:-1]):
1402 if not self._oldmatcher.visitdir(store.tree[:-1]):
1403 yield tree, deltas
1403 yield tree, deltas
1404 else:
1404 else:
1405 # 'deltas' is a generator and we need to consume it even if
1405 # 'deltas' is a generator and we need to consume it even if
1406 # we are not going to send it because a side-effect is that
1406 # we are not going to send it because a side-effect is that
1407 # it updates tmdnodes (via lookupfn)
1407 # it updates tmdnodes (via lookupfn)
1408 for d in deltas:
1408 for d in deltas:
1409 pass
1409 pass
1410 if not tree:
1410 if not tree:
1411 yield tree, []
1411 yield tree, []
1412
1412
1413 def _prunemanifests(self, store, nodes, commonrevs):
1413 def _prunemanifests(self, store, nodes, commonrevs):
1414 if not self._ellipses:
1414 if not self._ellipses:
1415 # In non-ellipses case and large repositories, it is better to
1415 # In non-ellipses case and large repositories, it is better to
1416 # prevent calling of store.rev and store.linkrev on a lot of
1416 # prevent calling of store.rev and store.linkrev on a lot of
1417 # nodes as compared to sending some extra data
1417 # nodes as compared to sending some extra data
1418 return nodes.copy()
1418 return nodes.copy()
1419 # This is split out as a separate method to allow filtering
1419 # This is split out as a separate method to allow filtering
1420 # commonrevs in extension code.
1420 # commonrevs in extension code.
1421 #
1421 #
1422 # TODO(augie): this shouldn't be required, instead we should
1422 # TODO(augie): this shouldn't be required, instead we should
1423 # make filtering of revisions to send delegated to the store
1423 # make filtering of revisions to send delegated to the store
1424 # layer.
1424 # layer.
1425 frev, flr = store.rev, store.linkrev
1425 frev, flr = store.rev, store.linkrev
1426 return [n for n in nodes if flr(frev(n)) not in commonrevs]
1426 return [n for n in nodes if flr(frev(n)) not in commonrevs]
1427
1427
1428 # The 'source' parameter is useful for extensions
1428 # The 'source' parameter is useful for extensions
1429 def generatefiles(
1429 def generatefiles(
1430 self,
1430 self,
1431 changedfiles,
1431 changedfiles,
1432 commonrevs,
1432 commonrevs,
1433 source,
1433 source,
1434 mfdicts,
1434 mfdicts,
1435 fastpathlinkrev,
1435 fastpathlinkrev,
1436 fnodes,
1436 fnodes,
1437 clrevs,
1437 clrevs,
1438 sidedata_helpers=None,
1438 sidedata_helpers=None,
1439 ):
1439 ):
1440 changedfiles = [
1440 changedfiles = [
1441 f
1441 f
1442 for f in changedfiles
1442 for f in changedfiles
1443 if self._matcher(f) and not self._oldmatcher(f)
1443 if self._matcher(f) and not self._oldmatcher(f)
1444 ]
1444 ]
1445
1445
1446 if not fastpathlinkrev:
1446 if not fastpathlinkrev:
1447
1447
1448 def normallinknodes(unused, fname):
1448 def normallinknodes(unused, fname):
1449 return fnodes.get(fname, {})
1449 return fnodes.get(fname, {})
1450
1450
1451 else:
1451 else:
1452 cln = self._repo.changelog.node
1452 cln = self._repo.changelog.node
1453
1453
1454 def normallinknodes(store, fname):
1454 def normallinknodes(store, fname):
1455 flinkrev = store.linkrev
1455 flinkrev = store.linkrev
1456 fnode = store.node
1456 fnode = store.node
1457 revs = ((r, flinkrev(r)) for r in store)
1457 revs = ((r, flinkrev(r)) for r in store)
1458 return {fnode(r): cln(lr) for r, lr in revs if lr in clrevs}
1458 return {fnode(r): cln(lr) for r, lr in revs if lr in clrevs}
1459
1459
1460 clrevtolocalrev = {}
1460 clrevtolocalrev = {}
1461
1461
1462 if self._isshallow:
1462 if self._isshallow:
1463 # In a shallow clone, the linknodes callback needs to also include
1463 # In a shallow clone, the linknodes callback needs to also include
1464 # those file nodes that are in the manifests we sent but weren't
1464 # those file nodes that are in the manifests we sent but weren't
1465 # introduced by those manifests.
1465 # introduced by those manifests.
1466 commonctxs = [self._repo[c] for c in commonrevs]
1466 commonctxs = [self._repo[c] for c in commonrevs]
1467 clrev = self._repo.changelog.rev
1467 clrev = self._repo.changelog.rev
1468
1468
1469 def linknodes(flog, fname):
1469 def linknodes(flog, fname):
1470 for c in commonctxs:
1470 for c in commonctxs:
1471 try:
1471 try:
1472 fnode = c.filenode(fname)
1472 fnode = c.filenode(fname)
1473 clrevtolocalrev[c.rev()] = flog.rev(fnode)
1473 clrevtolocalrev[c.rev()] = flog.rev(fnode)
1474 except error.ManifestLookupError:
1474 except error.ManifestLookupError:
1475 pass
1475 pass
1476 links = normallinknodes(flog, fname)
1476 links = normallinknodes(flog, fname)
1477 if len(links) != len(mfdicts):
1477 if len(links) != len(mfdicts):
1478 for mf, lr in mfdicts:
1478 for mf, lr in mfdicts:
1479 fnode = mf.get(fname, None)
1479 fnode = mf.get(fname, None)
1480 if fnode in links:
1480 if fnode in links:
1481 links[fnode] = min(links[fnode], lr, key=clrev)
1481 links[fnode] = min(links[fnode], lr, key=clrev)
1482 elif fnode:
1482 elif fnode:
1483 links[fnode] = lr
1483 links[fnode] = lr
1484 return links
1484 return links
1485
1485
1486 else:
1486 else:
1487 linknodes = normallinknodes
1487 linknodes = normallinknodes
1488
1488
1489 repo = self._repo
1489 repo = self._repo
1490 progress = repo.ui.makeprogress(
1490 progress = repo.ui.makeprogress(
1491 _(b'files'), unit=_(b'files'), total=len(changedfiles)
1491 _(b'files'), unit=_(b'files'), total=len(changedfiles)
1492 )
1492 )
1493 for i, fname in enumerate(sorted(changedfiles)):
1493 for i, fname in enumerate(sorted(changedfiles)):
1494 filerevlog = repo.file(fname)
1494 filerevlog = repo.file(fname)
1495 if not filerevlog:
1495 if not filerevlog:
1496 raise error.Abort(
1496 raise error.Abort(
1497 _(b"empty or missing file data for %s") % fname
1497 _(b"empty or missing file data for %s") % fname
1498 )
1498 )
1499
1499
1500 clrevtolocalrev.clear()
1500 clrevtolocalrev.clear()
1501
1501
1502 linkrevnodes = linknodes(filerevlog, fname)
1502 linkrevnodes = linknodes(filerevlog, fname)
1503 # Lookup for filenodes, we collected the linkrev nodes above in the
1503 # Lookup for filenodes, we collected the linkrev nodes above in the
1504 # fastpath case and with lookupmf in the slowpath case.
1504 # fastpath case and with lookupmf in the slowpath case.
1505 def lookupfilelog(x):
1505 def lookupfilelog(x):
1506 return linkrevnodes[x]
1506 return linkrevnodes[x]
1507
1507
1508 frev, flr = filerevlog.rev, filerevlog.linkrev
1508 frev, flr = filerevlog.rev, filerevlog.linkrev
1509 # Skip sending any filenode we know the client already
1509 # Skip sending any filenode we know the client already
1510 # has. This avoids over-sending files relatively
1510 # has. This avoids over-sending files relatively
1511 # inexpensively, so it's not a problem if we under-filter
1511 # inexpensively, so it's not a problem if we under-filter
1512 # here.
1512 # here.
1513 filenodes = [
1513 filenodes = [
1514 n for n in linkrevnodes if flr(frev(n)) not in commonrevs
1514 n for n in linkrevnodes if flr(frev(n)) not in commonrevs
1515 ]
1515 ]
1516
1516
1517 if not filenodes:
1517 if not filenodes:
1518 continue
1518 continue
1519
1519
1520 progress.update(i + 1, item=fname)
1520 progress.update(i + 1, item=fname)
1521
1521
1522 deltas = deltagroup(
1522 deltas = deltagroup(
1523 self._repo,
1523 self._repo,
1524 filerevlog,
1524 filerevlog,
1525 filenodes,
1525 filenodes,
1526 False,
1526 False,
1527 lookupfilelog,
1527 lookupfilelog,
1528 self._forcedeltaparentprev,
1528 self._forcedeltaparentprev,
1529 ellipses=self._ellipses,
1529 ellipses=self._ellipses,
1530 clrevtolocalrev=clrevtolocalrev,
1530 clrevtolocalrev=clrevtolocalrev,
1531 fullclnodes=self._fullclnodes,
1531 fullclnodes=self._fullclnodes,
1532 precomputedellipsis=self._precomputedellipsis,
1532 precomputedellipsis=self._precomputedellipsis,
1533 sidedata_helpers=sidedata_helpers,
1533 sidedata_helpers=sidedata_helpers,
1534 )
1534 )
1535
1535
1536 yield fname, deltas
1536 yield fname, deltas
1537
1537
1538 progress.complete()
1538 progress.complete()
1539
1539
1540
1540
1541 def _makecg1packer(
1541 def _makecg1packer(
1542 repo,
1542 repo,
1543 oldmatcher,
1543 oldmatcher,
1544 matcher,
1544 matcher,
1545 bundlecaps,
1545 bundlecaps,
1546 ellipses=False,
1546 ellipses=False,
1547 shallow=False,
1547 shallow=False,
1548 ellipsisroots=None,
1548 ellipsisroots=None,
1549 fullnodes=None,
1549 fullnodes=None,
1550 remote_sidedata=None,
1550 remote_sidedata=None,
1551 ):
1551 ):
1552 builddeltaheader = lambda d: _CHANGEGROUPV1_DELTA_HEADER.pack(
1552 builddeltaheader = lambda d: _CHANGEGROUPV1_DELTA_HEADER.pack(
1553 d.node, d.p1node, d.p2node, d.linknode
1553 d.node, d.p1node, d.p2node, d.linknode
1554 )
1554 )
1555
1555
1556 return cgpacker(
1556 return cgpacker(
1557 repo,
1557 repo,
1558 oldmatcher,
1558 oldmatcher,
1559 matcher,
1559 matcher,
1560 b'01',
1560 b'01',
1561 builddeltaheader=builddeltaheader,
1561 builddeltaheader=builddeltaheader,
1562 manifestsend=b'',
1562 manifestsend=b'',
1563 forcedeltaparentprev=True,
1563 forcedeltaparentprev=True,
1564 bundlecaps=bundlecaps,
1564 bundlecaps=bundlecaps,
1565 ellipses=ellipses,
1565 ellipses=ellipses,
1566 shallow=shallow,
1566 shallow=shallow,
1567 ellipsisroots=ellipsisroots,
1567 ellipsisroots=ellipsisroots,
1568 fullnodes=fullnodes,
1568 fullnodes=fullnodes,
1569 )
1569 )
1570
1570
1571
1571
1572 def _makecg2packer(
1572 def _makecg2packer(
1573 repo,
1573 repo,
1574 oldmatcher,
1574 oldmatcher,
1575 matcher,
1575 matcher,
1576 bundlecaps,
1576 bundlecaps,
1577 ellipses=False,
1577 ellipses=False,
1578 shallow=False,
1578 shallow=False,
1579 ellipsisroots=None,
1579 ellipsisroots=None,
1580 fullnodes=None,
1580 fullnodes=None,
1581 remote_sidedata=None,
1581 remote_sidedata=None,
1582 ):
1582 ):
1583 builddeltaheader = lambda d: _CHANGEGROUPV2_DELTA_HEADER.pack(
1583 builddeltaheader = lambda d: _CHANGEGROUPV2_DELTA_HEADER.pack(
1584 d.node, d.p1node, d.p2node, d.basenode, d.linknode
1584 d.node, d.p1node, d.p2node, d.basenode, d.linknode
1585 )
1585 )
1586
1586
1587 return cgpacker(
1587 return cgpacker(
1588 repo,
1588 repo,
1589 oldmatcher,
1589 oldmatcher,
1590 matcher,
1590 matcher,
1591 b'02',
1591 b'02',
1592 builddeltaheader=builddeltaheader,
1592 builddeltaheader=builddeltaheader,
1593 manifestsend=b'',
1593 manifestsend=b'',
1594 bundlecaps=bundlecaps,
1594 bundlecaps=bundlecaps,
1595 ellipses=ellipses,
1595 ellipses=ellipses,
1596 shallow=shallow,
1596 shallow=shallow,
1597 ellipsisroots=ellipsisroots,
1597 ellipsisroots=ellipsisroots,
1598 fullnodes=fullnodes,
1598 fullnodes=fullnodes,
1599 )
1599 )
1600
1600
1601
1601
1602 def _makecg3packer(
1602 def _makecg3packer(
1603 repo,
1603 repo,
1604 oldmatcher,
1604 oldmatcher,
1605 matcher,
1605 matcher,
1606 bundlecaps,
1606 bundlecaps,
1607 ellipses=False,
1607 ellipses=False,
1608 shallow=False,
1608 shallow=False,
1609 ellipsisroots=None,
1609 ellipsisroots=None,
1610 fullnodes=None,
1610 fullnodes=None,
1611 remote_sidedata=None,
1611 remote_sidedata=None,
1612 ):
1612 ):
1613 builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack(
1613 builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack(
1614 d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags
1614 d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags
1615 )
1615 )
1616
1616
1617 return cgpacker(
1617 return cgpacker(
1618 repo,
1618 repo,
1619 oldmatcher,
1619 oldmatcher,
1620 matcher,
1620 matcher,
1621 b'03',
1621 b'03',
1622 builddeltaheader=builddeltaheader,
1622 builddeltaheader=builddeltaheader,
1623 manifestsend=closechunk(),
1623 manifestsend=closechunk(),
1624 bundlecaps=bundlecaps,
1624 bundlecaps=bundlecaps,
1625 ellipses=ellipses,
1625 ellipses=ellipses,
1626 shallow=shallow,
1626 shallow=shallow,
1627 ellipsisroots=ellipsisroots,
1627 ellipsisroots=ellipsisroots,
1628 fullnodes=fullnodes,
1628 fullnodes=fullnodes,
1629 )
1629 )
1630
1630
1631
1631
1632 def _makecg4packer(
1632 def _makecg4packer(
1633 repo,
1633 repo,
1634 oldmatcher,
1634 oldmatcher,
1635 matcher,
1635 matcher,
1636 bundlecaps,
1636 bundlecaps,
1637 ellipses=False,
1637 ellipses=False,
1638 shallow=False,
1638 shallow=False,
1639 ellipsisroots=None,
1639 ellipsisroots=None,
1640 fullnodes=None,
1640 fullnodes=None,
1641 remote_sidedata=None,
1641 remote_sidedata=None,
1642 ):
1642 ):
1643 # Same header func as cg3. Sidedata is in a separate chunk from the delta to
1643 # Same header func as cg3. Sidedata is in a separate chunk from the delta to
1644 # differenciate "raw delta" and sidedata.
1644 # differenciate "raw delta" and sidedata.
1645 builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack(
1645 builddeltaheader = lambda d: _CHANGEGROUPV3_DELTA_HEADER.pack(
1646 d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags
1646 d.node, d.p1node, d.p2node, d.basenode, d.linknode, d.flags
1647 )
1647 )
1648
1648
1649 return cgpacker(
1649 return cgpacker(
1650 repo,
1650 repo,
1651 oldmatcher,
1651 oldmatcher,
1652 matcher,
1652 matcher,
1653 b'04',
1653 b'04',
1654 builddeltaheader=builddeltaheader,
1654 builddeltaheader=builddeltaheader,
1655 manifestsend=closechunk(),
1655 manifestsend=closechunk(),
1656 bundlecaps=bundlecaps,
1656 bundlecaps=bundlecaps,
1657 ellipses=ellipses,
1657 ellipses=ellipses,
1658 shallow=shallow,
1658 shallow=shallow,
1659 ellipsisroots=ellipsisroots,
1659 ellipsisroots=ellipsisroots,
1660 fullnodes=fullnodes,
1660 fullnodes=fullnodes,
1661 remote_sidedata=remote_sidedata,
1661 remote_sidedata=remote_sidedata,
1662 )
1662 )
1663
1663
1664
1664
1665 _packermap = {
1665 _packermap = {
1666 b'01': (_makecg1packer, cg1unpacker),
1666 b'01': (_makecg1packer, cg1unpacker),
1667 # cg2 adds support for exchanging generaldelta
1667 # cg2 adds support for exchanging generaldelta
1668 b'02': (_makecg2packer, cg2unpacker),
1668 b'02': (_makecg2packer, cg2unpacker),
1669 # cg3 adds support for exchanging revlog flags and treemanifests
1669 # cg3 adds support for exchanging revlog flags and treemanifests
1670 b'03': (_makecg3packer, cg3unpacker),
1670 b'03': (_makecg3packer, cg3unpacker),
1671 # ch4 adds support for exchanging sidedata
1671 # ch4 adds support for exchanging sidedata
1672 b'04': (_makecg4packer, cg4unpacker),
1672 b'04': (_makecg4packer, cg4unpacker),
1673 }
1673 }
1674
1674
1675
1675
1676 def allsupportedversions(repo):
1676 def allsupportedversions(repo):
1677 versions = set(_packermap.keys())
1677 versions = set(_packermap.keys())
1678 needv03 = False
1678 needv03 = False
1679 if (
1679 if (
1680 repo.ui.configbool(b'experimental', b'changegroup3')
1680 repo.ui.configbool(b'experimental', b'changegroup3')
1681 or repo.ui.configbool(b'experimental', b'treemanifest')
1681 or repo.ui.configbool(b'experimental', b'treemanifest')
1682 or scmutil.istreemanifest(repo)
1682 or scmutil.istreemanifest(repo)
1683 ):
1683 ):
1684 # we keep version 03 because we need to to exchange treemanifest data
1684 # we keep version 03 because we need to to exchange treemanifest data
1685 #
1685 #
1686 # we also keep vresion 01 and 02, because it is possible for repo to
1686 # we also keep vresion 01 and 02, because it is possible for repo to
1687 # contains both normal and tree manifest at the same time. so using
1687 # contains both normal and tree manifest at the same time. so using
1688 # older version to pull data is viable
1688 # older version to pull data is viable
1689 #
1689 #
1690 # (or even to push subset of history)
1690 # (or even to push subset of history)
1691 needv03 = True
1691 needv03 = True
1692 has_revlogv2 = requirements.REVLOGV2_REQUIREMENT in repo.requirements
1693 if not has_revlogv2:
1694 versions.discard(b'04')
1695 if not needv03:
1692 if not needv03:
1696 versions.discard(b'03')
1693 versions.discard(b'03')
1694 want_v4 = (
1695 repo.ui.configbool(b'experimental', b'changegroup4')
1696 or requirements.REVLOGV2_REQUIREMENT in repo.requirements
1697 )
1698 if not want_v4:
1699 versions.discard(b'04')
1697 return versions
1700 return versions
1698
1701
1699
1702
1700 # Changegroup versions that can be applied to the repo
1703 # Changegroup versions that can be applied to the repo
1701 def supportedincomingversions(repo):
1704 def supportedincomingversions(repo):
1702 return allsupportedversions(repo)
1705 return allsupportedversions(repo)
1703
1706
1704
1707
1705 # Changegroup versions that can be created from the repo
1708 # Changegroup versions that can be created from the repo
1706 def supportedoutgoingversions(repo):
1709 def supportedoutgoingversions(repo):
1707 versions = allsupportedversions(repo)
1710 versions = allsupportedversions(repo)
1708 if scmutil.istreemanifest(repo):
1711 if scmutil.istreemanifest(repo):
1709 # Versions 01 and 02 support only flat manifests and it's just too
1712 # Versions 01 and 02 support only flat manifests and it's just too
1710 # expensive to convert between the flat manifest and tree manifest on
1713 # expensive to convert between the flat manifest and tree manifest on
1711 # the fly. Since tree manifests are hashed differently, all of history
1714 # the fly. Since tree manifests are hashed differently, all of history
1712 # would have to be converted. Instead, we simply don't even pretend to
1715 # would have to be converted. Instead, we simply don't even pretend to
1713 # support versions 01 and 02.
1716 # support versions 01 and 02.
1714 versions.discard(b'01')
1717 versions.discard(b'01')
1715 versions.discard(b'02')
1718 versions.discard(b'02')
1716 if requirements.NARROW_REQUIREMENT in repo.requirements:
1719 if requirements.NARROW_REQUIREMENT in repo.requirements:
1717 # Versions 01 and 02 don't support revlog flags, and we need to
1720 # Versions 01 and 02 don't support revlog flags, and we need to
1718 # support that for stripping and unbundling to work.
1721 # support that for stripping and unbundling to work.
1719 versions.discard(b'01')
1722 versions.discard(b'01')
1720 versions.discard(b'02')
1723 versions.discard(b'02')
1721 if LFS_REQUIREMENT in repo.requirements:
1724 if LFS_REQUIREMENT in repo.requirements:
1722 # Versions 01 and 02 don't support revlog flags, and we need to
1725 # Versions 01 and 02 don't support revlog flags, and we need to
1723 # mark LFS entries with REVIDX_EXTSTORED.
1726 # mark LFS entries with REVIDX_EXTSTORED.
1724 versions.discard(b'01')
1727 versions.discard(b'01')
1725 versions.discard(b'02')
1728 versions.discard(b'02')
1726
1729
1727 return versions
1730 return versions
1728
1731
1729
1732
1730 def localversion(repo):
1733 def localversion(repo):
1731 # Finds the best version to use for bundles that are meant to be used
1734 # Finds the best version to use for bundles that are meant to be used
1732 # locally, such as those from strip and shelve, and temporary bundles.
1735 # locally, such as those from strip and shelve, and temporary bundles.
1733 return max(supportedoutgoingversions(repo))
1736 return max(supportedoutgoingversions(repo))
1734
1737
1735
1738
1736 def safeversion(repo):
1739 def safeversion(repo):
1737 # Finds the smallest version that it's safe to assume clients of the repo
1740 # Finds the smallest version that it's safe to assume clients of the repo
1738 # will support. For example, all hg versions that support generaldelta also
1741 # will support. For example, all hg versions that support generaldelta also
1739 # support changegroup 02.
1742 # support changegroup 02.
1740 versions = supportedoutgoingversions(repo)
1743 versions = supportedoutgoingversions(repo)
1741 if requirements.GENERALDELTA_REQUIREMENT in repo.requirements:
1744 if requirements.GENERALDELTA_REQUIREMENT in repo.requirements:
1742 versions.discard(b'01')
1745 versions.discard(b'01')
1743 assert versions
1746 assert versions
1744 return min(versions)
1747 return min(versions)
1745
1748
1746
1749
1747 def getbundler(
1750 def getbundler(
1748 version,
1751 version,
1749 repo,
1752 repo,
1750 bundlecaps=None,
1753 bundlecaps=None,
1751 oldmatcher=None,
1754 oldmatcher=None,
1752 matcher=None,
1755 matcher=None,
1753 ellipses=False,
1756 ellipses=False,
1754 shallow=False,
1757 shallow=False,
1755 ellipsisroots=None,
1758 ellipsisroots=None,
1756 fullnodes=None,
1759 fullnodes=None,
1757 remote_sidedata=None,
1760 remote_sidedata=None,
1758 ):
1761 ):
1759 assert version in supportedoutgoingversions(repo)
1762 assert version in supportedoutgoingversions(repo)
1760
1763
1761 if matcher is None:
1764 if matcher is None:
1762 matcher = matchmod.always()
1765 matcher = matchmod.always()
1763 if oldmatcher is None:
1766 if oldmatcher is None:
1764 oldmatcher = matchmod.never()
1767 oldmatcher = matchmod.never()
1765
1768
1766 if version == b'01' and not matcher.always():
1769 if version == b'01' and not matcher.always():
1767 raise error.ProgrammingError(
1770 raise error.ProgrammingError(
1768 b'version 01 changegroups do not support sparse file matchers'
1771 b'version 01 changegroups do not support sparse file matchers'
1769 )
1772 )
1770
1773
1771 if ellipses and version in (b'01', b'02'):
1774 if ellipses and version in (b'01', b'02'):
1772 raise error.Abort(
1775 raise error.Abort(
1773 _(
1776 _(
1774 b'ellipsis nodes require at least cg3 on client and server, '
1777 b'ellipsis nodes require at least cg3 on client and server, '
1775 b'but negotiated version %s'
1778 b'but negotiated version %s'
1776 )
1779 )
1777 % version
1780 % version
1778 )
1781 )
1779
1782
1780 # Requested files could include files not in the local store. So
1783 # Requested files could include files not in the local store. So
1781 # filter those out.
1784 # filter those out.
1782 matcher = repo.narrowmatch(matcher)
1785 matcher = repo.narrowmatch(matcher)
1783
1786
1784 fn = _packermap[version][0]
1787 fn = _packermap[version][0]
1785 return fn(
1788 return fn(
1786 repo,
1789 repo,
1787 oldmatcher,
1790 oldmatcher,
1788 matcher,
1791 matcher,
1789 bundlecaps,
1792 bundlecaps,
1790 ellipses=ellipses,
1793 ellipses=ellipses,
1791 shallow=shallow,
1794 shallow=shallow,
1792 ellipsisroots=ellipsisroots,
1795 ellipsisroots=ellipsisroots,
1793 fullnodes=fullnodes,
1796 fullnodes=fullnodes,
1794 remote_sidedata=remote_sidedata,
1797 remote_sidedata=remote_sidedata,
1795 )
1798 )
1796
1799
1797
1800
1798 def getunbundler(version, fh, alg, extras=None):
1801 def getunbundler(version, fh, alg, extras=None):
1799 return _packermap[version][1](fh, alg, extras=extras)
1802 return _packermap[version][1](fh, alg, extras=extras)
1800
1803
1801
1804
1802 def _changegroupinfo(repo, nodes, source):
1805 def _changegroupinfo(repo, nodes, source):
1803 if repo.ui.verbose or source == b'bundle':
1806 if repo.ui.verbose or source == b'bundle':
1804 repo.ui.status(_(b"%d changesets found\n") % len(nodes))
1807 repo.ui.status(_(b"%d changesets found\n") % len(nodes))
1805 if repo.ui.debugflag:
1808 if repo.ui.debugflag:
1806 repo.ui.debug(b"list of changesets:\n")
1809 repo.ui.debug(b"list of changesets:\n")
1807 for node in nodes:
1810 for node in nodes:
1808 repo.ui.debug(b"%s\n" % hex(node))
1811 repo.ui.debug(b"%s\n" % hex(node))
1809
1812
1810
1813
1811 def makechangegroup(
1814 def makechangegroup(
1812 repo, outgoing, version, source, fastpath=False, bundlecaps=None
1815 repo, outgoing, version, source, fastpath=False, bundlecaps=None
1813 ):
1816 ):
1814 cgstream = makestream(
1817 cgstream = makestream(
1815 repo,
1818 repo,
1816 outgoing,
1819 outgoing,
1817 version,
1820 version,
1818 source,
1821 source,
1819 fastpath=fastpath,
1822 fastpath=fastpath,
1820 bundlecaps=bundlecaps,
1823 bundlecaps=bundlecaps,
1821 )
1824 )
1822 return getunbundler(
1825 return getunbundler(
1823 version,
1826 version,
1824 util.chunkbuffer(cgstream),
1827 util.chunkbuffer(cgstream),
1825 None,
1828 None,
1826 {b'clcount': len(outgoing.missing)},
1829 {b'clcount': len(outgoing.missing)},
1827 )
1830 )
1828
1831
1829
1832
1830 def makestream(
1833 def makestream(
1831 repo,
1834 repo,
1832 outgoing,
1835 outgoing,
1833 version,
1836 version,
1834 source,
1837 source,
1835 fastpath=False,
1838 fastpath=False,
1836 bundlecaps=None,
1839 bundlecaps=None,
1837 matcher=None,
1840 matcher=None,
1838 remote_sidedata=None,
1841 remote_sidedata=None,
1839 ):
1842 ):
1840 bundler = getbundler(
1843 bundler = getbundler(
1841 version,
1844 version,
1842 repo,
1845 repo,
1843 bundlecaps=bundlecaps,
1846 bundlecaps=bundlecaps,
1844 matcher=matcher,
1847 matcher=matcher,
1845 remote_sidedata=remote_sidedata,
1848 remote_sidedata=remote_sidedata,
1846 )
1849 )
1847
1850
1848 repo = repo.unfiltered()
1851 repo = repo.unfiltered()
1849 commonrevs = outgoing.common
1852 commonrevs = outgoing.common
1850 csets = outgoing.missing
1853 csets = outgoing.missing
1851 heads = outgoing.ancestorsof
1854 heads = outgoing.ancestorsof
1852 # We go through the fast path if we get told to, or if all (unfiltered
1855 # We go through the fast path if we get told to, or if all (unfiltered
1853 # heads have been requested (since we then know there all linkrevs will
1856 # heads have been requested (since we then know there all linkrevs will
1854 # be pulled by the client).
1857 # be pulled by the client).
1855 heads.sort()
1858 heads.sort()
1856 fastpathlinkrev = fastpath or (
1859 fastpathlinkrev = fastpath or (
1857 repo.filtername is None and heads == sorted(repo.heads())
1860 repo.filtername is None and heads == sorted(repo.heads())
1858 )
1861 )
1859
1862
1860 repo.hook(b'preoutgoing', throw=True, source=source)
1863 repo.hook(b'preoutgoing', throw=True, source=source)
1861 _changegroupinfo(repo, csets, source)
1864 _changegroupinfo(repo, csets, source)
1862 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
1865 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
1863
1866
1864
1867
1865 def _addchangegroupfiles(
1868 def _addchangegroupfiles(
1866 repo,
1869 repo,
1867 source,
1870 source,
1868 revmap,
1871 revmap,
1869 trp,
1872 trp,
1870 expectedfiles,
1873 expectedfiles,
1871 needfiles,
1874 needfiles,
1872 addrevisioncb=None,
1875 addrevisioncb=None,
1873 ):
1876 ):
1874 revisions = 0
1877 revisions = 0
1875 files = 0
1878 files = 0
1876 progress = repo.ui.makeprogress(
1879 progress = repo.ui.makeprogress(
1877 _(b'files'), unit=_(b'files'), total=expectedfiles
1880 _(b'files'), unit=_(b'files'), total=expectedfiles
1878 )
1881 )
1879 for chunkdata in iter(source.filelogheader, {}):
1882 for chunkdata in iter(source.filelogheader, {}):
1880 files += 1
1883 files += 1
1881 f = chunkdata[b"filename"]
1884 f = chunkdata[b"filename"]
1882 repo.ui.debug(b"adding %s revisions\n" % f)
1885 repo.ui.debug(b"adding %s revisions\n" % f)
1883 progress.increment()
1886 progress.increment()
1884 fl = repo.file(f)
1887 fl = repo.file(f)
1885 o = len(fl)
1888 o = len(fl)
1886 try:
1889 try:
1887 deltas = source.deltaiter()
1890 deltas = source.deltaiter()
1888 added = fl.addgroup(
1891 added = fl.addgroup(
1889 deltas,
1892 deltas,
1890 revmap,
1893 revmap,
1891 trp,
1894 trp,
1892 addrevisioncb=addrevisioncb,
1895 addrevisioncb=addrevisioncb,
1893 )
1896 )
1894 if not added:
1897 if not added:
1895 raise error.Abort(_(b"received file revlog group is empty"))
1898 raise error.Abort(_(b"received file revlog group is empty"))
1896 except error.CensoredBaseError as e:
1899 except error.CensoredBaseError as e:
1897 raise error.Abort(_(b"received delta base is censored: %s") % e)
1900 raise error.Abort(_(b"received delta base is censored: %s") % e)
1898 revisions += len(fl) - o
1901 revisions += len(fl) - o
1899 if f in needfiles:
1902 if f in needfiles:
1900 needs = needfiles[f]
1903 needs = needfiles[f]
1901 for new in pycompat.xrange(o, len(fl)):
1904 for new in pycompat.xrange(o, len(fl)):
1902 n = fl.node(new)
1905 n = fl.node(new)
1903 if n in needs:
1906 if n in needs:
1904 needs.remove(n)
1907 needs.remove(n)
1905 else:
1908 else:
1906 raise error.Abort(_(b"received spurious file revlog entry"))
1909 raise error.Abort(_(b"received spurious file revlog entry"))
1907 if not needs:
1910 if not needs:
1908 del needfiles[f]
1911 del needfiles[f]
1909 progress.complete()
1912 progress.complete()
1910
1913
1911 for f, needs in pycompat.iteritems(needfiles):
1914 for f, needs in pycompat.iteritems(needfiles):
1912 fl = repo.file(f)
1915 fl = repo.file(f)
1913 for n in needs:
1916 for n in needs:
1914 try:
1917 try:
1915 fl.rev(n)
1918 fl.rev(n)
1916 except error.LookupError:
1919 except error.LookupError:
1917 raise error.Abort(
1920 raise error.Abort(
1918 _(b'missing file data for %s:%s - run hg verify')
1921 _(b'missing file data for %s:%s - run hg verify')
1919 % (f, hex(n))
1922 % (f, hex(n))
1920 )
1923 )
1921
1924
1922 return revisions, files
1925 return revisions, files
1923
1926
1924
1927
1925 def get_sidedata_helpers(repo, remote_sd_categories, pull=False):
1928 def get_sidedata_helpers(repo, remote_sd_categories, pull=False):
1926 # Computers for computing sidedata on-the-fly
1929 # Computers for computing sidedata on-the-fly
1927 sd_computers = collections.defaultdict(list)
1930 sd_computers = collections.defaultdict(list)
1928 # Computers for categories to remove from sidedata
1931 # Computers for categories to remove from sidedata
1929 sd_removers = collections.defaultdict(list)
1932 sd_removers = collections.defaultdict(list)
1930
1933
1931 to_generate = remote_sd_categories - repo._wanted_sidedata
1934 to_generate = remote_sd_categories - repo._wanted_sidedata
1932 to_remove = repo._wanted_sidedata - remote_sd_categories
1935 to_remove = repo._wanted_sidedata - remote_sd_categories
1933 if pull:
1936 if pull:
1934 to_generate, to_remove = to_remove, to_generate
1937 to_generate, to_remove = to_remove, to_generate
1935
1938
1936 for revlog_kind, computers in repo._sidedata_computers.items():
1939 for revlog_kind, computers in repo._sidedata_computers.items():
1937 for category, computer in computers.items():
1940 for category, computer in computers.items():
1938 if category in to_generate:
1941 if category in to_generate:
1939 sd_computers[revlog_kind].append(computer)
1942 sd_computers[revlog_kind].append(computer)
1940 if category in to_remove:
1943 if category in to_remove:
1941 sd_removers[revlog_kind].append(computer)
1944 sd_removers[revlog_kind].append(computer)
1942
1945
1943 sidedata_helpers = (repo, sd_computers, sd_removers)
1946 sidedata_helpers = (repo, sd_computers, sd_removers)
1944 return sidedata_helpers
1947 return sidedata_helpers
@@ -1,2686 +1,2691 b''
1 # configitems.py - centralized declaration of configuration option
1 # configitems.py - centralized declaration of configuration option
2 #
2 #
3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
3 # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import functools
10 import functools
11 import re
11 import re
12
12
13 from . import (
13 from . import (
14 encoding,
14 encoding,
15 error,
15 error,
16 )
16 )
17
17
18
18
19 def loadconfigtable(ui, extname, configtable):
19 def loadconfigtable(ui, extname, configtable):
20 """update config item known to the ui with the extension ones"""
20 """update config item known to the ui with the extension ones"""
21 for section, items in sorted(configtable.items()):
21 for section, items in sorted(configtable.items()):
22 knownitems = ui._knownconfig.setdefault(section, itemregister())
22 knownitems = ui._knownconfig.setdefault(section, itemregister())
23 knownkeys = set(knownitems)
23 knownkeys = set(knownitems)
24 newkeys = set(items)
24 newkeys = set(items)
25 for key in sorted(knownkeys & newkeys):
25 for key in sorted(knownkeys & newkeys):
26 msg = b"extension '%s' overwrite config item '%s.%s'"
26 msg = b"extension '%s' overwrite config item '%s.%s'"
27 msg %= (extname, section, key)
27 msg %= (extname, section, key)
28 ui.develwarn(msg, config=b'warn-config')
28 ui.develwarn(msg, config=b'warn-config')
29
29
30 knownitems.update(items)
30 knownitems.update(items)
31
31
32
32
33 class configitem(object):
33 class configitem(object):
34 """represent a known config item
34 """represent a known config item
35
35
36 :section: the official config section where to find this item,
36 :section: the official config section where to find this item,
37 :name: the official name within the section,
37 :name: the official name within the section,
38 :default: default value for this item,
38 :default: default value for this item,
39 :alias: optional list of tuples as alternatives,
39 :alias: optional list of tuples as alternatives,
40 :generic: this is a generic definition, match name using regular expression.
40 :generic: this is a generic definition, match name using regular expression.
41 """
41 """
42
42
43 def __init__(
43 def __init__(
44 self,
44 self,
45 section,
45 section,
46 name,
46 name,
47 default=None,
47 default=None,
48 alias=(),
48 alias=(),
49 generic=False,
49 generic=False,
50 priority=0,
50 priority=0,
51 experimental=False,
51 experimental=False,
52 ):
52 ):
53 self.section = section
53 self.section = section
54 self.name = name
54 self.name = name
55 self.default = default
55 self.default = default
56 self.alias = list(alias)
56 self.alias = list(alias)
57 self.generic = generic
57 self.generic = generic
58 self.priority = priority
58 self.priority = priority
59 self.experimental = experimental
59 self.experimental = experimental
60 self._re = None
60 self._re = None
61 if generic:
61 if generic:
62 self._re = re.compile(self.name)
62 self._re = re.compile(self.name)
63
63
64
64
65 class itemregister(dict):
65 class itemregister(dict):
66 """A specialized dictionary that can handle wild-card selection"""
66 """A specialized dictionary that can handle wild-card selection"""
67
67
68 def __init__(self):
68 def __init__(self):
69 super(itemregister, self).__init__()
69 super(itemregister, self).__init__()
70 self._generics = set()
70 self._generics = set()
71
71
72 def update(self, other):
72 def update(self, other):
73 super(itemregister, self).update(other)
73 super(itemregister, self).update(other)
74 self._generics.update(other._generics)
74 self._generics.update(other._generics)
75
75
76 def __setitem__(self, key, item):
76 def __setitem__(self, key, item):
77 super(itemregister, self).__setitem__(key, item)
77 super(itemregister, self).__setitem__(key, item)
78 if item.generic:
78 if item.generic:
79 self._generics.add(item)
79 self._generics.add(item)
80
80
81 def get(self, key):
81 def get(self, key):
82 baseitem = super(itemregister, self).get(key)
82 baseitem = super(itemregister, self).get(key)
83 if baseitem is not None and not baseitem.generic:
83 if baseitem is not None and not baseitem.generic:
84 return baseitem
84 return baseitem
85
85
86 # search for a matching generic item
86 # search for a matching generic item
87 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
87 generics = sorted(self._generics, key=(lambda x: (x.priority, x.name)))
88 for item in generics:
88 for item in generics:
89 # we use 'match' instead of 'search' to make the matching simpler
89 # we use 'match' instead of 'search' to make the matching simpler
90 # for people unfamiliar with regular expression. Having the match
90 # for people unfamiliar with regular expression. Having the match
91 # rooted to the start of the string will produce less surprising
91 # rooted to the start of the string will produce less surprising
92 # result for user writing simple regex for sub-attribute.
92 # result for user writing simple regex for sub-attribute.
93 #
93 #
94 # For example using "color\..*" match produces an unsurprising
94 # For example using "color\..*" match produces an unsurprising
95 # result, while using search could suddenly match apparently
95 # result, while using search could suddenly match apparently
96 # unrelated configuration that happens to contains "color."
96 # unrelated configuration that happens to contains "color."
97 # anywhere. This is a tradeoff where we favor requiring ".*" on
97 # anywhere. This is a tradeoff where we favor requiring ".*" on
98 # some match to avoid the need to prefix most pattern with "^".
98 # some match to avoid the need to prefix most pattern with "^".
99 # The "^" seems more error prone.
99 # The "^" seems more error prone.
100 if item._re.match(key):
100 if item._re.match(key):
101 return item
101 return item
102
102
103 return None
103 return None
104
104
105
105
106 coreitems = {}
106 coreitems = {}
107
107
108
108
109 def _register(configtable, *args, **kwargs):
109 def _register(configtable, *args, **kwargs):
110 item = configitem(*args, **kwargs)
110 item = configitem(*args, **kwargs)
111 section = configtable.setdefault(item.section, itemregister())
111 section = configtable.setdefault(item.section, itemregister())
112 if item.name in section:
112 if item.name in section:
113 msg = b"duplicated config item registration for '%s.%s'"
113 msg = b"duplicated config item registration for '%s.%s'"
114 raise error.ProgrammingError(msg % (item.section, item.name))
114 raise error.ProgrammingError(msg % (item.section, item.name))
115 section[item.name] = item
115 section[item.name] = item
116
116
117
117
118 # special value for case where the default is derived from other values
118 # special value for case where the default is derived from other values
119 dynamicdefault = object()
119 dynamicdefault = object()
120
120
121 # Registering actual config items
121 # Registering actual config items
122
122
123
123
124 def getitemregister(configtable):
124 def getitemregister(configtable):
125 f = functools.partial(_register, configtable)
125 f = functools.partial(_register, configtable)
126 # export pseudo enum as configitem.*
126 # export pseudo enum as configitem.*
127 f.dynamicdefault = dynamicdefault
127 f.dynamicdefault = dynamicdefault
128 return f
128 return f
129
129
130
130
131 coreconfigitem = getitemregister(coreitems)
131 coreconfigitem = getitemregister(coreitems)
132
132
133
133
134 def _registerdiffopts(section, configprefix=b''):
134 def _registerdiffopts(section, configprefix=b''):
135 coreconfigitem(
135 coreconfigitem(
136 section,
136 section,
137 configprefix + b'nodates',
137 configprefix + b'nodates',
138 default=False,
138 default=False,
139 )
139 )
140 coreconfigitem(
140 coreconfigitem(
141 section,
141 section,
142 configprefix + b'showfunc',
142 configprefix + b'showfunc',
143 default=False,
143 default=False,
144 )
144 )
145 coreconfigitem(
145 coreconfigitem(
146 section,
146 section,
147 configprefix + b'unified',
147 configprefix + b'unified',
148 default=None,
148 default=None,
149 )
149 )
150 coreconfigitem(
150 coreconfigitem(
151 section,
151 section,
152 configprefix + b'git',
152 configprefix + b'git',
153 default=False,
153 default=False,
154 )
154 )
155 coreconfigitem(
155 coreconfigitem(
156 section,
156 section,
157 configprefix + b'ignorews',
157 configprefix + b'ignorews',
158 default=False,
158 default=False,
159 )
159 )
160 coreconfigitem(
160 coreconfigitem(
161 section,
161 section,
162 configprefix + b'ignorewsamount',
162 configprefix + b'ignorewsamount',
163 default=False,
163 default=False,
164 )
164 )
165 coreconfigitem(
165 coreconfigitem(
166 section,
166 section,
167 configprefix + b'ignoreblanklines',
167 configprefix + b'ignoreblanklines',
168 default=False,
168 default=False,
169 )
169 )
170 coreconfigitem(
170 coreconfigitem(
171 section,
171 section,
172 configprefix + b'ignorewseol',
172 configprefix + b'ignorewseol',
173 default=False,
173 default=False,
174 )
174 )
175 coreconfigitem(
175 coreconfigitem(
176 section,
176 section,
177 configprefix + b'nobinary',
177 configprefix + b'nobinary',
178 default=False,
178 default=False,
179 )
179 )
180 coreconfigitem(
180 coreconfigitem(
181 section,
181 section,
182 configprefix + b'noprefix',
182 configprefix + b'noprefix',
183 default=False,
183 default=False,
184 )
184 )
185 coreconfigitem(
185 coreconfigitem(
186 section,
186 section,
187 configprefix + b'word-diff',
187 configprefix + b'word-diff',
188 default=False,
188 default=False,
189 )
189 )
190
190
191
191
192 coreconfigitem(
192 coreconfigitem(
193 b'alias',
193 b'alias',
194 b'.*',
194 b'.*',
195 default=dynamicdefault,
195 default=dynamicdefault,
196 generic=True,
196 generic=True,
197 )
197 )
198 coreconfigitem(
198 coreconfigitem(
199 b'auth',
199 b'auth',
200 b'cookiefile',
200 b'cookiefile',
201 default=None,
201 default=None,
202 )
202 )
203 _registerdiffopts(section=b'annotate')
203 _registerdiffopts(section=b'annotate')
204 # bookmarks.pushing: internal hack for discovery
204 # bookmarks.pushing: internal hack for discovery
205 coreconfigitem(
205 coreconfigitem(
206 b'bookmarks',
206 b'bookmarks',
207 b'pushing',
207 b'pushing',
208 default=list,
208 default=list,
209 )
209 )
210 # bundle.mainreporoot: internal hack for bundlerepo
210 # bundle.mainreporoot: internal hack for bundlerepo
211 coreconfigitem(
211 coreconfigitem(
212 b'bundle',
212 b'bundle',
213 b'mainreporoot',
213 b'mainreporoot',
214 default=b'',
214 default=b'',
215 )
215 )
216 coreconfigitem(
216 coreconfigitem(
217 b'censor',
217 b'censor',
218 b'policy',
218 b'policy',
219 default=b'abort',
219 default=b'abort',
220 experimental=True,
220 experimental=True,
221 )
221 )
222 coreconfigitem(
222 coreconfigitem(
223 b'chgserver',
223 b'chgserver',
224 b'idletimeout',
224 b'idletimeout',
225 default=3600,
225 default=3600,
226 )
226 )
227 coreconfigitem(
227 coreconfigitem(
228 b'chgserver',
228 b'chgserver',
229 b'skiphash',
229 b'skiphash',
230 default=False,
230 default=False,
231 )
231 )
232 coreconfigitem(
232 coreconfigitem(
233 b'cmdserver',
233 b'cmdserver',
234 b'log',
234 b'log',
235 default=None,
235 default=None,
236 )
236 )
237 coreconfigitem(
237 coreconfigitem(
238 b'cmdserver',
238 b'cmdserver',
239 b'max-log-files',
239 b'max-log-files',
240 default=7,
240 default=7,
241 )
241 )
242 coreconfigitem(
242 coreconfigitem(
243 b'cmdserver',
243 b'cmdserver',
244 b'max-log-size',
244 b'max-log-size',
245 default=b'1 MB',
245 default=b'1 MB',
246 )
246 )
247 coreconfigitem(
247 coreconfigitem(
248 b'cmdserver',
248 b'cmdserver',
249 b'max-repo-cache',
249 b'max-repo-cache',
250 default=0,
250 default=0,
251 experimental=True,
251 experimental=True,
252 )
252 )
253 coreconfigitem(
253 coreconfigitem(
254 b'cmdserver',
254 b'cmdserver',
255 b'message-encodings',
255 b'message-encodings',
256 default=list,
256 default=list,
257 )
257 )
258 coreconfigitem(
258 coreconfigitem(
259 b'cmdserver',
259 b'cmdserver',
260 b'track-log',
260 b'track-log',
261 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
261 default=lambda: [b'chgserver', b'cmdserver', b'repocache'],
262 )
262 )
263 coreconfigitem(
263 coreconfigitem(
264 b'cmdserver',
264 b'cmdserver',
265 b'shutdown-on-interrupt',
265 b'shutdown-on-interrupt',
266 default=True,
266 default=True,
267 )
267 )
268 coreconfigitem(
268 coreconfigitem(
269 b'color',
269 b'color',
270 b'.*',
270 b'.*',
271 default=None,
271 default=None,
272 generic=True,
272 generic=True,
273 )
273 )
274 coreconfigitem(
274 coreconfigitem(
275 b'color',
275 b'color',
276 b'mode',
276 b'mode',
277 default=b'auto',
277 default=b'auto',
278 )
278 )
279 coreconfigitem(
279 coreconfigitem(
280 b'color',
280 b'color',
281 b'pagermode',
281 b'pagermode',
282 default=dynamicdefault,
282 default=dynamicdefault,
283 )
283 )
284 coreconfigitem(
284 coreconfigitem(
285 b'command-templates',
285 b'command-templates',
286 b'graphnode',
286 b'graphnode',
287 default=None,
287 default=None,
288 alias=[(b'ui', b'graphnodetemplate')],
288 alias=[(b'ui', b'graphnodetemplate')],
289 )
289 )
290 coreconfigitem(
290 coreconfigitem(
291 b'command-templates',
291 b'command-templates',
292 b'log',
292 b'log',
293 default=None,
293 default=None,
294 alias=[(b'ui', b'logtemplate')],
294 alias=[(b'ui', b'logtemplate')],
295 )
295 )
296 coreconfigitem(
296 coreconfigitem(
297 b'command-templates',
297 b'command-templates',
298 b'mergemarker',
298 b'mergemarker',
299 default=(
299 default=(
300 b'{node|short} '
300 b'{node|short} '
301 b'{ifeq(tags, "tip", "", '
301 b'{ifeq(tags, "tip", "", '
302 b'ifeq(tags, "", "", "{tags} "))}'
302 b'ifeq(tags, "", "", "{tags} "))}'
303 b'{if(bookmarks, "{bookmarks} ")}'
303 b'{if(bookmarks, "{bookmarks} ")}'
304 b'{ifeq(branch, "default", "", "{branch} ")}'
304 b'{ifeq(branch, "default", "", "{branch} ")}'
305 b'- {author|user}: {desc|firstline}'
305 b'- {author|user}: {desc|firstline}'
306 ),
306 ),
307 alias=[(b'ui', b'mergemarkertemplate')],
307 alias=[(b'ui', b'mergemarkertemplate')],
308 )
308 )
309 coreconfigitem(
309 coreconfigitem(
310 b'command-templates',
310 b'command-templates',
311 b'pre-merge-tool-output',
311 b'pre-merge-tool-output',
312 default=None,
312 default=None,
313 alias=[(b'ui', b'pre-merge-tool-output-template')],
313 alias=[(b'ui', b'pre-merge-tool-output-template')],
314 )
314 )
315 coreconfigitem(
315 coreconfigitem(
316 b'command-templates',
316 b'command-templates',
317 b'oneline-summary',
317 b'oneline-summary',
318 default=None,
318 default=None,
319 )
319 )
320 coreconfigitem(
320 coreconfigitem(
321 b'command-templates',
321 b'command-templates',
322 b'oneline-summary.*',
322 b'oneline-summary.*',
323 default=dynamicdefault,
323 default=dynamicdefault,
324 generic=True,
324 generic=True,
325 )
325 )
326 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
326 _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.')
327 coreconfigitem(
327 coreconfigitem(
328 b'commands',
328 b'commands',
329 b'commit.post-status',
329 b'commit.post-status',
330 default=False,
330 default=False,
331 )
331 )
332 coreconfigitem(
332 coreconfigitem(
333 b'commands',
333 b'commands',
334 b'grep.all-files',
334 b'grep.all-files',
335 default=False,
335 default=False,
336 experimental=True,
336 experimental=True,
337 )
337 )
338 coreconfigitem(
338 coreconfigitem(
339 b'commands',
339 b'commands',
340 b'merge.require-rev',
340 b'merge.require-rev',
341 default=False,
341 default=False,
342 )
342 )
343 coreconfigitem(
343 coreconfigitem(
344 b'commands',
344 b'commands',
345 b'push.require-revs',
345 b'push.require-revs',
346 default=False,
346 default=False,
347 )
347 )
348 coreconfigitem(
348 coreconfigitem(
349 b'commands',
349 b'commands',
350 b'resolve.confirm',
350 b'resolve.confirm',
351 default=False,
351 default=False,
352 )
352 )
353 coreconfigitem(
353 coreconfigitem(
354 b'commands',
354 b'commands',
355 b'resolve.explicit-re-merge',
355 b'resolve.explicit-re-merge',
356 default=False,
356 default=False,
357 )
357 )
358 coreconfigitem(
358 coreconfigitem(
359 b'commands',
359 b'commands',
360 b'resolve.mark-check',
360 b'resolve.mark-check',
361 default=b'none',
361 default=b'none',
362 )
362 )
363 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
363 _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.')
364 coreconfigitem(
364 coreconfigitem(
365 b'commands',
365 b'commands',
366 b'show.aliasprefix',
366 b'show.aliasprefix',
367 default=list,
367 default=list,
368 )
368 )
369 coreconfigitem(
369 coreconfigitem(
370 b'commands',
370 b'commands',
371 b'status.relative',
371 b'status.relative',
372 default=False,
372 default=False,
373 )
373 )
374 coreconfigitem(
374 coreconfigitem(
375 b'commands',
375 b'commands',
376 b'status.skipstates',
376 b'status.skipstates',
377 default=[],
377 default=[],
378 experimental=True,
378 experimental=True,
379 )
379 )
380 coreconfigitem(
380 coreconfigitem(
381 b'commands',
381 b'commands',
382 b'status.terse',
382 b'status.terse',
383 default=b'',
383 default=b'',
384 )
384 )
385 coreconfigitem(
385 coreconfigitem(
386 b'commands',
386 b'commands',
387 b'status.verbose',
387 b'status.verbose',
388 default=False,
388 default=False,
389 )
389 )
390 coreconfigitem(
390 coreconfigitem(
391 b'commands',
391 b'commands',
392 b'update.check',
392 b'update.check',
393 default=None,
393 default=None,
394 )
394 )
395 coreconfigitem(
395 coreconfigitem(
396 b'commands',
396 b'commands',
397 b'update.requiredest',
397 b'update.requiredest',
398 default=False,
398 default=False,
399 )
399 )
400 coreconfigitem(
400 coreconfigitem(
401 b'committemplate',
401 b'committemplate',
402 b'.*',
402 b'.*',
403 default=None,
403 default=None,
404 generic=True,
404 generic=True,
405 )
405 )
406 coreconfigitem(
406 coreconfigitem(
407 b'convert',
407 b'convert',
408 b'bzr.saverev',
408 b'bzr.saverev',
409 default=True,
409 default=True,
410 )
410 )
411 coreconfigitem(
411 coreconfigitem(
412 b'convert',
412 b'convert',
413 b'cvsps.cache',
413 b'cvsps.cache',
414 default=True,
414 default=True,
415 )
415 )
416 coreconfigitem(
416 coreconfigitem(
417 b'convert',
417 b'convert',
418 b'cvsps.fuzz',
418 b'cvsps.fuzz',
419 default=60,
419 default=60,
420 )
420 )
421 coreconfigitem(
421 coreconfigitem(
422 b'convert',
422 b'convert',
423 b'cvsps.logencoding',
423 b'cvsps.logencoding',
424 default=None,
424 default=None,
425 )
425 )
426 coreconfigitem(
426 coreconfigitem(
427 b'convert',
427 b'convert',
428 b'cvsps.mergefrom',
428 b'cvsps.mergefrom',
429 default=None,
429 default=None,
430 )
430 )
431 coreconfigitem(
431 coreconfigitem(
432 b'convert',
432 b'convert',
433 b'cvsps.mergeto',
433 b'cvsps.mergeto',
434 default=None,
434 default=None,
435 )
435 )
436 coreconfigitem(
436 coreconfigitem(
437 b'convert',
437 b'convert',
438 b'git.committeractions',
438 b'git.committeractions',
439 default=lambda: [b'messagedifferent'],
439 default=lambda: [b'messagedifferent'],
440 )
440 )
441 coreconfigitem(
441 coreconfigitem(
442 b'convert',
442 b'convert',
443 b'git.extrakeys',
443 b'git.extrakeys',
444 default=list,
444 default=list,
445 )
445 )
446 coreconfigitem(
446 coreconfigitem(
447 b'convert',
447 b'convert',
448 b'git.findcopiesharder',
448 b'git.findcopiesharder',
449 default=False,
449 default=False,
450 )
450 )
451 coreconfigitem(
451 coreconfigitem(
452 b'convert',
452 b'convert',
453 b'git.remoteprefix',
453 b'git.remoteprefix',
454 default=b'remote',
454 default=b'remote',
455 )
455 )
456 coreconfigitem(
456 coreconfigitem(
457 b'convert',
457 b'convert',
458 b'git.renamelimit',
458 b'git.renamelimit',
459 default=400,
459 default=400,
460 )
460 )
461 coreconfigitem(
461 coreconfigitem(
462 b'convert',
462 b'convert',
463 b'git.saverev',
463 b'git.saverev',
464 default=True,
464 default=True,
465 )
465 )
466 coreconfigitem(
466 coreconfigitem(
467 b'convert',
467 b'convert',
468 b'git.similarity',
468 b'git.similarity',
469 default=50,
469 default=50,
470 )
470 )
471 coreconfigitem(
471 coreconfigitem(
472 b'convert',
472 b'convert',
473 b'git.skipsubmodules',
473 b'git.skipsubmodules',
474 default=False,
474 default=False,
475 )
475 )
476 coreconfigitem(
476 coreconfigitem(
477 b'convert',
477 b'convert',
478 b'hg.clonebranches',
478 b'hg.clonebranches',
479 default=False,
479 default=False,
480 )
480 )
481 coreconfigitem(
481 coreconfigitem(
482 b'convert',
482 b'convert',
483 b'hg.ignoreerrors',
483 b'hg.ignoreerrors',
484 default=False,
484 default=False,
485 )
485 )
486 coreconfigitem(
486 coreconfigitem(
487 b'convert',
487 b'convert',
488 b'hg.preserve-hash',
488 b'hg.preserve-hash',
489 default=False,
489 default=False,
490 )
490 )
491 coreconfigitem(
491 coreconfigitem(
492 b'convert',
492 b'convert',
493 b'hg.revs',
493 b'hg.revs',
494 default=None,
494 default=None,
495 )
495 )
496 coreconfigitem(
496 coreconfigitem(
497 b'convert',
497 b'convert',
498 b'hg.saverev',
498 b'hg.saverev',
499 default=False,
499 default=False,
500 )
500 )
501 coreconfigitem(
501 coreconfigitem(
502 b'convert',
502 b'convert',
503 b'hg.sourcename',
503 b'hg.sourcename',
504 default=None,
504 default=None,
505 )
505 )
506 coreconfigitem(
506 coreconfigitem(
507 b'convert',
507 b'convert',
508 b'hg.startrev',
508 b'hg.startrev',
509 default=None,
509 default=None,
510 )
510 )
511 coreconfigitem(
511 coreconfigitem(
512 b'convert',
512 b'convert',
513 b'hg.tagsbranch',
513 b'hg.tagsbranch',
514 default=b'default',
514 default=b'default',
515 )
515 )
516 coreconfigitem(
516 coreconfigitem(
517 b'convert',
517 b'convert',
518 b'hg.usebranchnames',
518 b'hg.usebranchnames',
519 default=True,
519 default=True,
520 )
520 )
521 coreconfigitem(
521 coreconfigitem(
522 b'convert',
522 b'convert',
523 b'ignoreancestorcheck',
523 b'ignoreancestorcheck',
524 default=False,
524 default=False,
525 experimental=True,
525 experimental=True,
526 )
526 )
527 coreconfigitem(
527 coreconfigitem(
528 b'convert',
528 b'convert',
529 b'localtimezone',
529 b'localtimezone',
530 default=False,
530 default=False,
531 )
531 )
532 coreconfigitem(
532 coreconfigitem(
533 b'convert',
533 b'convert',
534 b'p4.encoding',
534 b'p4.encoding',
535 default=dynamicdefault,
535 default=dynamicdefault,
536 )
536 )
537 coreconfigitem(
537 coreconfigitem(
538 b'convert',
538 b'convert',
539 b'p4.startrev',
539 b'p4.startrev',
540 default=0,
540 default=0,
541 )
541 )
542 coreconfigitem(
542 coreconfigitem(
543 b'convert',
543 b'convert',
544 b'skiptags',
544 b'skiptags',
545 default=False,
545 default=False,
546 )
546 )
547 coreconfigitem(
547 coreconfigitem(
548 b'convert',
548 b'convert',
549 b'svn.debugsvnlog',
549 b'svn.debugsvnlog',
550 default=True,
550 default=True,
551 )
551 )
552 coreconfigitem(
552 coreconfigitem(
553 b'convert',
553 b'convert',
554 b'svn.trunk',
554 b'svn.trunk',
555 default=None,
555 default=None,
556 )
556 )
557 coreconfigitem(
557 coreconfigitem(
558 b'convert',
558 b'convert',
559 b'svn.tags',
559 b'svn.tags',
560 default=None,
560 default=None,
561 )
561 )
562 coreconfigitem(
562 coreconfigitem(
563 b'convert',
563 b'convert',
564 b'svn.branches',
564 b'svn.branches',
565 default=None,
565 default=None,
566 )
566 )
567 coreconfigitem(
567 coreconfigitem(
568 b'convert',
568 b'convert',
569 b'svn.startrev',
569 b'svn.startrev',
570 default=0,
570 default=0,
571 )
571 )
572 coreconfigitem(
572 coreconfigitem(
573 b'convert',
573 b'convert',
574 b'svn.dangerous-set-commit-dates',
574 b'svn.dangerous-set-commit-dates',
575 default=False,
575 default=False,
576 )
576 )
577 coreconfigitem(
577 coreconfigitem(
578 b'debug',
578 b'debug',
579 b'dirstate.delaywrite',
579 b'dirstate.delaywrite',
580 default=0,
580 default=0,
581 )
581 )
582 coreconfigitem(
582 coreconfigitem(
583 b'debug',
583 b'debug',
584 b'revlog.verifyposition.changelog',
584 b'revlog.verifyposition.changelog',
585 default=b'',
585 default=b'',
586 )
586 )
587 coreconfigitem(
587 coreconfigitem(
588 b'defaults',
588 b'defaults',
589 b'.*',
589 b'.*',
590 default=None,
590 default=None,
591 generic=True,
591 generic=True,
592 )
592 )
593 coreconfigitem(
593 coreconfigitem(
594 b'devel',
594 b'devel',
595 b'all-warnings',
595 b'all-warnings',
596 default=False,
596 default=False,
597 )
597 )
598 coreconfigitem(
598 coreconfigitem(
599 b'devel',
599 b'devel',
600 b'bundle2.debug',
600 b'bundle2.debug',
601 default=False,
601 default=False,
602 )
602 )
603 coreconfigitem(
603 coreconfigitem(
604 b'devel',
604 b'devel',
605 b'bundle.delta',
605 b'bundle.delta',
606 default=b'',
606 default=b'',
607 )
607 )
608 coreconfigitem(
608 coreconfigitem(
609 b'devel',
609 b'devel',
610 b'cache-vfs',
610 b'cache-vfs',
611 default=None,
611 default=None,
612 )
612 )
613 coreconfigitem(
613 coreconfigitem(
614 b'devel',
614 b'devel',
615 b'check-locks',
615 b'check-locks',
616 default=False,
616 default=False,
617 )
617 )
618 coreconfigitem(
618 coreconfigitem(
619 b'devel',
619 b'devel',
620 b'check-relroot',
620 b'check-relroot',
621 default=False,
621 default=False,
622 )
622 )
623 # Track copy information for all file, not just "added" one (very slow)
623 # Track copy information for all file, not just "added" one (very slow)
624 coreconfigitem(
624 coreconfigitem(
625 b'devel',
625 b'devel',
626 b'copy-tracing.trace-all-files',
626 b'copy-tracing.trace-all-files',
627 default=False,
627 default=False,
628 )
628 )
629 coreconfigitem(
629 coreconfigitem(
630 b'devel',
630 b'devel',
631 b'default-date',
631 b'default-date',
632 default=None,
632 default=None,
633 )
633 )
634 coreconfigitem(
634 coreconfigitem(
635 b'devel',
635 b'devel',
636 b'deprec-warn',
636 b'deprec-warn',
637 default=False,
637 default=False,
638 )
638 )
639 coreconfigitem(
639 coreconfigitem(
640 b'devel',
640 b'devel',
641 b'disableloaddefaultcerts',
641 b'disableloaddefaultcerts',
642 default=False,
642 default=False,
643 )
643 )
644 coreconfigitem(
644 coreconfigitem(
645 b'devel',
645 b'devel',
646 b'warn-empty-changegroup',
646 b'warn-empty-changegroup',
647 default=False,
647 default=False,
648 )
648 )
649 coreconfigitem(
649 coreconfigitem(
650 b'devel',
650 b'devel',
651 b'legacy.exchange',
651 b'legacy.exchange',
652 default=list,
652 default=list,
653 )
653 )
654 # When True, revlogs use a special reference version of the nodemap, that is not
654 # When True, revlogs use a special reference version of the nodemap, that is not
655 # performant but is "known" to behave properly.
655 # performant but is "known" to behave properly.
656 coreconfigitem(
656 coreconfigitem(
657 b'devel',
657 b'devel',
658 b'persistent-nodemap',
658 b'persistent-nodemap',
659 default=False,
659 default=False,
660 )
660 )
661 coreconfigitem(
661 coreconfigitem(
662 b'devel',
662 b'devel',
663 b'servercafile',
663 b'servercafile',
664 default=b'',
664 default=b'',
665 )
665 )
666 coreconfigitem(
666 coreconfigitem(
667 b'devel',
667 b'devel',
668 b'serverexactprotocol',
668 b'serverexactprotocol',
669 default=b'',
669 default=b'',
670 )
670 )
671 coreconfigitem(
671 coreconfigitem(
672 b'devel',
672 b'devel',
673 b'serverrequirecert',
673 b'serverrequirecert',
674 default=False,
674 default=False,
675 )
675 )
676 coreconfigitem(
676 coreconfigitem(
677 b'devel',
677 b'devel',
678 b'strip-obsmarkers',
678 b'strip-obsmarkers',
679 default=True,
679 default=True,
680 )
680 )
681 coreconfigitem(
681 coreconfigitem(
682 b'devel',
682 b'devel',
683 b'warn-config',
683 b'warn-config',
684 default=None,
684 default=None,
685 )
685 )
686 coreconfigitem(
686 coreconfigitem(
687 b'devel',
687 b'devel',
688 b'warn-config-default',
688 b'warn-config-default',
689 default=None,
689 default=None,
690 )
690 )
691 coreconfigitem(
691 coreconfigitem(
692 b'devel',
692 b'devel',
693 b'user.obsmarker',
693 b'user.obsmarker',
694 default=None,
694 default=None,
695 )
695 )
696 coreconfigitem(
696 coreconfigitem(
697 b'devel',
697 b'devel',
698 b'warn-config-unknown',
698 b'warn-config-unknown',
699 default=None,
699 default=None,
700 )
700 )
701 coreconfigitem(
701 coreconfigitem(
702 b'devel',
702 b'devel',
703 b'debug.copies',
703 b'debug.copies',
704 default=False,
704 default=False,
705 )
705 )
706 coreconfigitem(
706 coreconfigitem(
707 b'devel',
707 b'devel',
708 b'copy-tracing.multi-thread',
708 b'copy-tracing.multi-thread',
709 default=True,
709 default=True,
710 )
710 )
711 coreconfigitem(
711 coreconfigitem(
712 b'devel',
712 b'devel',
713 b'debug.extensions',
713 b'debug.extensions',
714 default=False,
714 default=False,
715 )
715 )
716 coreconfigitem(
716 coreconfigitem(
717 b'devel',
717 b'devel',
718 b'debug.repo-filters',
718 b'debug.repo-filters',
719 default=False,
719 default=False,
720 )
720 )
721 coreconfigitem(
721 coreconfigitem(
722 b'devel',
722 b'devel',
723 b'debug.peer-request',
723 b'debug.peer-request',
724 default=False,
724 default=False,
725 )
725 )
726 # If discovery.exchange-heads is False, the discovery will not start with
726 # If discovery.exchange-heads is False, the discovery will not start with
727 # remote head fetching and local head querying.
727 # remote head fetching and local head querying.
728 coreconfigitem(
728 coreconfigitem(
729 b'devel',
729 b'devel',
730 b'discovery.exchange-heads',
730 b'discovery.exchange-heads',
731 default=True,
731 default=True,
732 )
732 )
733 # If discovery.grow-sample is False, the sample size used in set discovery will
733 # If discovery.grow-sample is False, the sample size used in set discovery will
734 # not be increased through the process
734 # not be increased through the process
735 coreconfigitem(
735 coreconfigitem(
736 b'devel',
736 b'devel',
737 b'discovery.grow-sample',
737 b'discovery.grow-sample',
738 default=True,
738 default=True,
739 )
739 )
740 # When discovery.grow-sample.dynamic is True, the default, the sample size is
740 # When discovery.grow-sample.dynamic is True, the default, the sample size is
741 # adapted to the shape of the undecided set (it is set to the max of:
741 # adapted to the shape of the undecided set (it is set to the max of:
742 # <target-size>, len(roots(undecided)), len(heads(undecided)
742 # <target-size>, len(roots(undecided)), len(heads(undecided)
743 coreconfigitem(
743 coreconfigitem(
744 b'devel',
744 b'devel',
745 b'discovery.grow-sample.dynamic',
745 b'discovery.grow-sample.dynamic',
746 default=True,
746 default=True,
747 )
747 )
748 # discovery.grow-sample.rate control the rate at which the sample grow
748 # discovery.grow-sample.rate control the rate at which the sample grow
749 coreconfigitem(
749 coreconfigitem(
750 b'devel',
750 b'devel',
751 b'discovery.grow-sample.rate',
751 b'discovery.grow-sample.rate',
752 default=1.05,
752 default=1.05,
753 )
753 )
754 # If discovery.randomize is False, random sampling during discovery are
754 # If discovery.randomize is False, random sampling during discovery are
755 # deterministic. It is meant for integration tests.
755 # deterministic. It is meant for integration tests.
756 coreconfigitem(
756 coreconfigitem(
757 b'devel',
757 b'devel',
758 b'discovery.randomize',
758 b'discovery.randomize',
759 default=True,
759 default=True,
760 )
760 )
761 # Control the initial size of the discovery sample
761 # Control the initial size of the discovery sample
762 coreconfigitem(
762 coreconfigitem(
763 b'devel',
763 b'devel',
764 b'discovery.sample-size',
764 b'discovery.sample-size',
765 default=200,
765 default=200,
766 )
766 )
767 # Control the initial size of the discovery for initial change
767 # Control the initial size of the discovery for initial change
768 coreconfigitem(
768 coreconfigitem(
769 b'devel',
769 b'devel',
770 b'discovery.sample-size.initial',
770 b'discovery.sample-size.initial',
771 default=100,
771 default=100,
772 )
772 )
773 _registerdiffopts(section=b'diff')
773 _registerdiffopts(section=b'diff')
774 coreconfigitem(
774 coreconfigitem(
775 b'diff',
775 b'diff',
776 b'merge',
776 b'merge',
777 default=False,
777 default=False,
778 experimental=True,
778 experimental=True,
779 )
779 )
780 coreconfigitem(
780 coreconfigitem(
781 b'email',
781 b'email',
782 b'bcc',
782 b'bcc',
783 default=None,
783 default=None,
784 )
784 )
785 coreconfigitem(
785 coreconfigitem(
786 b'email',
786 b'email',
787 b'cc',
787 b'cc',
788 default=None,
788 default=None,
789 )
789 )
790 coreconfigitem(
790 coreconfigitem(
791 b'email',
791 b'email',
792 b'charsets',
792 b'charsets',
793 default=list,
793 default=list,
794 )
794 )
795 coreconfigitem(
795 coreconfigitem(
796 b'email',
796 b'email',
797 b'from',
797 b'from',
798 default=None,
798 default=None,
799 )
799 )
800 coreconfigitem(
800 coreconfigitem(
801 b'email',
801 b'email',
802 b'method',
802 b'method',
803 default=b'smtp',
803 default=b'smtp',
804 )
804 )
805 coreconfigitem(
805 coreconfigitem(
806 b'email',
806 b'email',
807 b'reply-to',
807 b'reply-to',
808 default=None,
808 default=None,
809 )
809 )
810 coreconfigitem(
810 coreconfigitem(
811 b'email',
811 b'email',
812 b'to',
812 b'to',
813 default=None,
813 default=None,
814 )
814 )
815 coreconfigitem(
815 coreconfigitem(
816 b'experimental',
816 b'experimental',
817 b'archivemetatemplate',
817 b'archivemetatemplate',
818 default=dynamicdefault,
818 default=dynamicdefault,
819 )
819 )
820 coreconfigitem(
820 coreconfigitem(
821 b'experimental',
821 b'experimental',
822 b'auto-publish',
822 b'auto-publish',
823 default=b'publish',
823 default=b'publish',
824 )
824 )
825 coreconfigitem(
825 coreconfigitem(
826 b'experimental',
826 b'experimental',
827 b'bundle-phases',
827 b'bundle-phases',
828 default=False,
828 default=False,
829 )
829 )
830 coreconfigitem(
830 coreconfigitem(
831 b'experimental',
831 b'experimental',
832 b'bundle2-advertise',
832 b'bundle2-advertise',
833 default=True,
833 default=True,
834 )
834 )
835 coreconfigitem(
835 coreconfigitem(
836 b'experimental',
836 b'experimental',
837 b'bundle2-output-capture',
837 b'bundle2-output-capture',
838 default=False,
838 default=False,
839 )
839 )
840 coreconfigitem(
840 coreconfigitem(
841 b'experimental',
841 b'experimental',
842 b'bundle2.pushback',
842 b'bundle2.pushback',
843 default=False,
843 default=False,
844 )
844 )
845 coreconfigitem(
845 coreconfigitem(
846 b'experimental',
846 b'experimental',
847 b'bundle2lazylocking',
847 b'bundle2lazylocking',
848 default=False,
848 default=False,
849 )
849 )
850 coreconfigitem(
850 coreconfigitem(
851 b'experimental',
851 b'experimental',
852 b'bundlecomplevel',
852 b'bundlecomplevel',
853 default=None,
853 default=None,
854 )
854 )
855 coreconfigitem(
855 coreconfigitem(
856 b'experimental',
856 b'experimental',
857 b'bundlecomplevel.bzip2',
857 b'bundlecomplevel.bzip2',
858 default=None,
858 default=None,
859 )
859 )
860 coreconfigitem(
860 coreconfigitem(
861 b'experimental',
861 b'experimental',
862 b'bundlecomplevel.gzip',
862 b'bundlecomplevel.gzip',
863 default=None,
863 default=None,
864 )
864 )
865 coreconfigitem(
865 coreconfigitem(
866 b'experimental',
866 b'experimental',
867 b'bundlecomplevel.none',
867 b'bundlecomplevel.none',
868 default=None,
868 default=None,
869 )
869 )
870 coreconfigitem(
870 coreconfigitem(
871 b'experimental',
871 b'experimental',
872 b'bundlecomplevel.zstd',
872 b'bundlecomplevel.zstd',
873 default=None,
873 default=None,
874 )
874 )
875 coreconfigitem(
875 coreconfigitem(
876 b'experimental',
876 b'experimental',
877 b'bundlecompthreads',
877 b'bundlecompthreads',
878 default=None,
878 default=None,
879 )
879 )
880 coreconfigitem(
880 coreconfigitem(
881 b'experimental',
881 b'experimental',
882 b'bundlecompthreads.bzip2',
882 b'bundlecompthreads.bzip2',
883 default=None,
883 default=None,
884 )
884 )
885 coreconfigitem(
885 coreconfigitem(
886 b'experimental',
886 b'experimental',
887 b'bundlecompthreads.gzip',
887 b'bundlecompthreads.gzip',
888 default=None,
888 default=None,
889 )
889 )
890 coreconfigitem(
890 coreconfigitem(
891 b'experimental',
891 b'experimental',
892 b'bundlecompthreads.none',
892 b'bundlecompthreads.none',
893 default=None,
893 default=None,
894 )
894 )
895 coreconfigitem(
895 coreconfigitem(
896 b'experimental',
896 b'experimental',
897 b'bundlecompthreads.zstd',
897 b'bundlecompthreads.zstd',
898 default=None,
898 default=None,
899 )
899 )
900 coreconfigitem(
900 coreconfigitem(
901 b'experimental',
901 b'experimental',
902 b'changegroup3',
902 b'changegroup3',
903 default=False,
903 default=False,
904 )
904 )
905 coreconfigitem(
905 coreconfigitem(
906 b'experimental',
906 b'experimental',
907 b'changegroup4',
908 default=False,
909 )
910 coreconfigitem(
911 b'experimental',
907 b'cleanup-as-archived',
912 b'cleanup-as-archived',
908 default=False,
913 default=False,
909 )
914 )
910 coreconfigitem(
915 coreconfigitem(
911 b'experimental',
916 b'experimental',
912 b'clientcompressionengines',
917 b'clientcompressionengines',
913 default=list,
918 default=list,
914 )
919 )
915 coreconfigitem(
920 coreconfigitem(
916 b'experimental',
921 b'experimental',
917 b'copytrace',
922 b'copytrace',
918 default=b'on',
923 default=b'on',
919 )
924 )
920 coreconfigitem(
925 coreconfigitem(
921 b'experimental',
926 b'experimental',
922 b'copytrace.movecandidateslimit',
927 b'copytrace.movecandidateslimit',
923 default=100,
928 default=100,
924 )
929 )
925 coreconfigitem(
930 coreconfigitem(
926 b'experimental',
931 b'experimental',
927 b'copytrace.sourcecommitlimit',
932 b'copytrace.sourcecommitlimit',
928 default=100,
933 default=100,
929 )
934 )
930 coreconfigitem(
935 coreconfigitem(
931 b'experimental',
936 b'experimental',
932 b'copies.read-from',
937 b'copies.read-from',
933 default=b"filelog-only",
938 default=b"filelog-only",
934 )
939 )
935 coreconfigitem(
940 coreconfigitem(
936 b'experimental',
941 b'experimental',
937 b'copies.write-to',
942 b'copies.write-to',
938 default=b'filelog-only',
943 default=b'filelog-only',
939 )
944 )
940 coreconfigitem(
945 coreconfigitem(
941 b'experimental',
946 b'experimental',
942 b'crecordtest',
947 b'crecordtest',
943 default=None,
948 default=None,
944 )
949 )
945 coreconfigitem(
950 coreconfigitem(
946 b'experimental',
951 b'experimental',
947 b'directaccess',
952 b'directaccess',
948 default=False,
953 default=False,
949 )
954 )
950 coreconfigitem(
955 coreconfigitem(
951 b'experimental',
956 b'experimental',
952 b'directaccess.revnums',
957 b'directaccess.revnums',
953 default=False,
958 default=False,
954 )
959 )
955 coreconfigitem(
960 coreconfigitem(
956 b'experimental',
961 b'experimental',
957 b'editortmpinhg',
962 b'editortmpinhg',
958 default=False,
963 default=False,
959 )
964 )
960 coreconfigitem(
965 coreconfigitem(
961 b'experimental',
966 b'experimental',
962 b'evolution',
967 b'evolution',
963 default=list,
968 default=list,
964 )
969 )
965 coreconfigitem(
970 coreconfigitem(
966 b'experimental',
971 b'experimental',
967 b'evolution.allowdivergence',
972 b'evolution.allowdivergence',
968 default=False,
973 default=False,
969 alias=[(b'experimental', b'allowdivergence')],
974 alias=[(b'experimental', b'allowdivergence')],
970 )
975 )
971 coreconfigitem(
976 coreconfigitem(
972 b'experimental',
977 b'experimental',
973 b'evolution.allowunstable',
978 b'evolution.allowunstable',
974 default=None,
979 default=None,
975 )
980 )
976 coreconfigitem(
981 coreconfigitem(
977 b'experimental',
982 b'experimental',
978 b'evolution.createmarkers',
983 b'evolution.createmarkers',
979 default=None,
984 default=None,
980 )
985 )
981 coreconfigitem(
986 coreconfigitem(
982 b'experimental',
987 b'experimental',
983 b'evolution.effect-flags',
988 b'evolution.effect-flags',
984 default=True,
989 default=True,
985 alias=[(b'experimental', b'effect-flags')],
990 alias=[(b'experimental', b'effect-flags')],
986 )
991 )
987 coreconfigitem(
992 coreconfigitem(
988 b'experimental',
993 b'experimental',
989 b'evolution.exchange',
994 b'evolution.exchange',
990 default=None,
995 default=None,
991 )
996 )
992 coreconfigitem(
997 coreconfigitem(
993 b'experimental',
998 b'experimental',
994 b'evolution.bundle-obsmarker',
999 b'evolution.bundle-obsmarker',
995 default=False,
1000 default=False,
996 )
1001 )
997 coreconfigitem(
1002 coreconfigitem(
998 b'experimental',
1003 b'experimental',
999 b'evolution.bundle-obsmarker:mandatory',
1004 b'evolution.bundle-obsmarker:mandatory',
1000 default=True,
1005 default=True,
1001 )
1006 )
1002 coreconfigitem(
1007 coreconfigitem(
1003 b'experimental',
1008 b'experimental',
1004 b'log.topo',
1009 b'log.topo',
1005 default=False,
1010 default=False,
1006 )
1011 )
1007 coreconfigitem(
1012 coreconfigitem(
1008 b'experimental',
1013 b'experimental',
1009 b'evolution.report-instabilities',
1014 b'evolution.report-instabilities',
1010 default=True,
1015 default=True,
1011 )
1016 )
1012 coreconfigitem(
1017 coreconfigitem(
1013 b'experimental',
1018 b'experimental',
1014 b'evolution.track-operation',
1019 b'evolution.track-operation',
1015 default=True,
1020 default=True,
1016 )
1021 )
1017 # repo-level config to exclude a revset visibility
1022 # repo-level config to exclude a revset visibility
1018 #
1023 #
1019 # The target use case is to use `share` to expose different subset of the same
1024 # The target use case is to use `share` to expose different subset of the same
1020 # repository, especially server side. See also `server.view`.
1025 # repository, especially server side. See also `server.view`.
1021 coreconfigitem(
1026 coreconfigitem(
1022 b'experimental',
1027 b'experimental',
1023 b'extra-filter-revs',
1028 b'extra-filter-revs',
1024 default=None,
1029 default=None,
1025 )
1030 )
1026 coreconfigitem(
1031 coreconfigitem(
1027 b'experimental',
1032 b'experimental',
1028 b'maxdeltachainspan',
1033 b'maxdeltachainspan',
1029 default=-1,
1034 default=-1,
1030 )
1035 )
1031 # tracks files which were undeleted (merge might delete them but we explicitly
1036 # tracks files which were undeleted (merge might delete them but we explicitly
1032 # kept/undeleted them) and creates new filenodes for them
1037 # kept/undeleted them) and creates new filenodes for them
1033 coreconfigitem(
1038 coreconfigitem(
1034 b'experimental',
1039 b'experimental',
1035 b'merge-track-salvaged',
1040 b'merge-track-salvaged',
1036 default=False,
1041 default=False,
1037 )
1042 )
1038 coreconfigitem(
1043 coreconfigitem(
1039 b'experimental',
1044 b'experimental',
1040 b'mergetempdirprefix',
1045 b'mergetempdirprefix',
1041 default=None,
1046 default=None,
1042 )
1047 )
1043 coreconfigitem(
1048 coreconfigitem(
1044 b'experimental',
1049 b'experimental',
1045 b'mmapindexthreshold',
1050 b'mmapindexthreshold',
1046 default=None,
1051 default=None,
1047 )
1052 )
1048 coreconfigitem(
1053 coreconfigitem(
1049 b'experimental',
1054 b'experimental',
1050 b'narrow',
1055 b'narrow',
1051 default=False,
1056 default=False,
1052 )
1057 )
1053 coreconfigitem(
1058 coreconfigitem(
1054 b'experimental',
1059 b'experimental',
1055 b'nonnormalparanoidcheck',
1060 b'nonnormalparanoidcheck',
1056 default=False,
1061 default=False,
1057 )
1062 )
1058 coreconfigitem(
1063 coreconfigitem(
1059 b'experimental',
1064 b'experimental',
1060 b'exportableenviron',
1065 b'exportableenviron',
1061 default=list,
1066 default=list,
1062 )
1067 )
1063 coreconfigitem(
1068 coreconfigitem(
1064 b'experimental',
1069 b'experimental',
1065 b'extendedheader.index',
1070 b'extendedheader.index',
1066 default=None,
1071 default=None,
1067 )
1072 )
1068 coreconfigitem(
1073 coreconfigitem(
1069 b'experimental',
1074 b'experimental',
1070 b'extendedheader.similarity',
1075 b'extendedheader.similarity',
1071 default=False,
1076 default=False,
1072 )
1077 )
1073 coreconfigitem(
1078 coreconfigitem(
1074 b'experimental',
1079 b'experimental',
1075 b'graphshorten',
1080 b'graphshorten',
1076 default=False,
1081 default=False,
1077 )
1082 )
1078 coreconfigitem(
1083 coreconfigitem(
1079 b'experimental',
1084 b'experimental',
1080 b'graphstyle.parent',
1085 b'graphstyle.parent',
1081 default=dynamicdefault,
1086 default=dynamicdefault,
1082 )
1087 )
1083 coreconfigitem(
1088 coreconfigitem(
1084 b'experimental',
1089 b'experimental',
1085 b'graphstyle.missing',
1090 b'graphstyle.missing',
1086 default=dynamicdefault,
1091 default=dynamicdefault,
1087 )
1092 )
1088 coreconfigitem(
1093 coreconfigitem(
1089 b'experimental',
1094 b'experimental',
1090 b'graphstyle.grandparent',
1095 b'graphstyle.grandparent',
1091 default=dynamicdefault,
1096 default=dynamicdefault,
1092 )
1097 )
1093 coreconfigitem(
1098 coreconfigitem(
1094 b'experimental',
1099 b'experimental',
1095 b'hook-track-tags',
1100 b'hook-track-tags',
1096 default=False,
1101 default=False,
1097 )
1102 )
1098 coreconfigitem(
1103 coreconfigitem(
1099 b'experimental',
1104 b'experimental',
1100 b'httppeer.advertise-v2',
1105 b'httppeer.advertise-v2',
1101 default=False,
1106 default=False,
1102 )
1107 )
1103 coreconfigitem(
1108 coreconfigitem(
1104 b'experimental',
1109 b'experimental',
1105 b'httppeer.v2-encoder-order',
1110 b'httppeer.v2-encoder-order',
1106 default=None,
1111 default=None,
1107 )
1112 )
1108 coreconfigitem(
1113 coreconfigitem(
1109 b'experimental',
1114 b'experimental',
1110 b'httppostargs',
1115 b'httppostargs',
1111 default=False,
1116 default=False,
1112 )
1117 )
1113 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1118 coreconfigitem(b'experimental', b'nointerrupt', default=False)
1114 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1119 coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True)
1115
1120
1116 coreconfigitem(
1121 coreconfigitem(
1117 b'experimental',
1122 b'experimental',
1118 b'obsmarkers-exchange-debug',
1123 b'obsmarkers-exchange-debug',
1119 default=False,
1124 default=False,
1120 )
1125 )
1121 coreconfigitem(
1126 coreconfigitem(
1122 b'experimental',
1127 b'experimental',
1123 b'remotenames',
1128 b'remotenames',
1124 default=False,
1129 default=False,
1125 )
1130 )
1126 coreconfigitem(
1131 coreconfigitem(
1127 b'experimental',
1132 b'experimental',
1128 b'removeemptydirs',
1133 b'removeemptydirs',
1129 default=True,
1134 default=True,
1130 )
1135 )
1131 coreconfigitem(
1136 coreconfigitem(
1132 b'experimental',
1137 b'experimental',
1133 b'revert.interactive.select-to-keep',
1138 b'revert.interactive.select-to-keep',
1134 default=False,
1139 default=False,
1135 )
1140 )
1136 coreconfigitem(
1141 coreconfigitem(
1137 b'experimental',
1142 b'experimental',
1138 b'revisions.prefixhexnode',
1143 b'revisions.prefixhexnode',
1139 default=False,
1144 default=False,
1140 )
1145 )
1141 coreconfigitem(
1146 coreconfigitem(
1142 b'experimental',
1147 b'experimental',
1143 b'revlogv2',
1148 b'revlogv2',
1144 default=None,
1149 default=None,
1145 )
1150 )
1146 coreconfigitem(
1151 coreconfigitem(
1147 b'experimental',
1152 b'experimental',
1148 b'revisions.disambiguatewithin',
1153 b'revisions.disambiguatewithin',
1149 default=None,
1154 default=None,
1150 )
1155 )
1151 coreconfigitem(
1156 coreconfigitem(
1152 b'experimental',
1157 b'experimental',
1153 b'rust.index',
1158 b'rust.index',
1154 default=False,
1159 default=False,
1155 )
1160 )
1156 coreconfigitem(
1161 coreconfigitem(
1157 b'experimental',
1162 b'experimental',
1158 b'server.filesdata.recommended-batch-size',
1163 b'server.filesdata.recommended-batch-size',
1159 default=50000,
1164 default=50000,
1160 )
1165 )
1161 coreconfigitem(
1166 coreconfigitem(
1162 b'experimental',
1167 b'experimental',
1163 b'server.manifestdata.recommended-batch-size',
1168 b'server.manifestdata.recommended-batch-size',
1164 default=100000,
1169 default=100000,
1165 )
1170 )
1166 coreconfigitem(
1171 coreconfigitem(
1167 b'experimental',
1172 b'experimental',
1168 b'server.stream-narrow-clones',
1173 b'server.stream-narrow-clones',
1169 default=False,
1174 default=False,
1170 )
1175 )
1171 coreconfigitem(
1176 coreconfigitem(
1172 b'experimental',
1177 b'experimental',
1173 b'single-head-per-branch',
1178 b'single-head-per-branch',
1174 default=False,
1179 default=False,
1175 )
1180 )
1176 coreconfigitem(
1181 coreconfigitem(
1177 b'experimental',
1182 b'experimental',
1178 b'single-head-per-branch:account-closed-heads',
1183 b'single-head-per-branch:account-closed-heads',
1179 default=False,
1184 default=False,
1180 )
1185 )
1181 coreconfigitem(
1186 coreconfigitem(
1182 b'experimental',
1187 b'experimental',
1183 b'single-head-per-branch:public-changes-only',
1188 b'single-head-per-branch:public-changes-only',
1184 default=False,
1189 default=False,
1185 )
1190 )
1186 coreconfigitem(
1191 coreconfigitem(
1187 b'experimental',
1192 b'experimental',
1188 b'sshserver.support-v2',
1193 b'sshserver.support-v2',
1189 default=False,
1194 default=False,
1190 )
1195 )
1191 coreconfigitem(
1196 coreconfigitem(
1192 b'experimental',
1197 b'experimental',
1193 b'sparse-read',
1198 b'sparse-read',
1194 default=False,
1199 default=False,
1195 )
1200 )
1196 coreconfigitem(
1201 coreconfigitem(
1197 b'experimental',
1202 b'experimental',
1198 b'sparse-read.density-threshold',
1203 b'sparse-read.density-threshold',
1199 default=0.50,
1204 default=0.50,
1200 )
1205 )
1201 coreconfigitem(
1206 coreconfigitem(
1202 b'experimental',
1207 b'experimental',
1203 b'sparse-read.min-gap-size',
1208 b'sparse-read.min-gap-size',
1204 default=b'65K',
1209 default=b'65K',
1205 )
1210 )
1206 coreconfigitem(
1211 coreconfigitem(
1207 b'experimental',
1212 b'experimental',
1208 b'treemanifest',
1213 b'treemanifest',
1209 default=False,
1214 default=False,
1210 )
1215 )
1211 coreconfigitem(
1216 coreconfigitem(
1212 b'experimental',
1217 b'experimental',
1213 b'update.atomic-file',
1218 b'update.atomic-file',
1214 default=False,
1219 default=False,
1215 )
1220 )
1216 coreconfigitem(
1221 coreconfigitem(
1217 b'experimental',
1222 b'experimental',
1218 b'sshpeer.advertise-v2',
1223 b'sshpeer.advertise-v2',
1219 default=False,
1224 default=False,
1220 )
1225 )
1221 coreconfigitem(
1226 coreconfigitem(
1222 b'experimental',
1227 b'experimental',
1223 b'web.apiserver',
1228 b'web.apiserver',
1224 default=False,
1229 default=False,
1225 )
1230 )
1226 coreconfigitem(
1231 coreconfigitem(
1227 b'experimental',
1232 b'experimental',
1228 b'web.api.http-v2',
1233 b'web.api.http-v2',
1229 default=False,
1234 default=False,
1230 )
1235 )
1231 coreconfigitem(
1236 coreconfigitem(
1232 b'experimental',
1237 b'experimental',
1233 b'web.api.debugreflect',
1238 b'web.api.debugreflect',
1234 default=False,
1239 default=False,
1235 )
1240 )
1236 coreconfigitem(
1241 coreconfigitem(
1237 b'experimental',
1242 b'experimental',
1238 b'worker.wdir-get-thread-safe',
1243 b'worker.wdir-get-thread-safe',
1239 default=False,
1244 default=False,
1240 )
1245 )
1241 coreconfigitem(
1246 coreconfigitem(
1242 b'experimental',
1247 b'experimental',
1243 b'worker.repository-upgrade',
1248 b'worker.repository-upgrade',
1244 default=False,
1249 default=False,
1245 )
1250 )
1246 coreconfigitem(
1251 coreconfigitem(
1247 b'experimental',
1252 b'experimental',
1248 b'xdiff',
1253 b'xdiff',
1249 default=False,
1254 default=False,
1250 )
1255 )
1251 coreconfigitem(
1256 coreconfigitem(
1252 b'extensions',
1257 b'extensions',
1253 b'.*',
1258 b'.*',
1254 default=None,
1259 default=None,
1255 generic=True,
1260 generic=True,
1256 )
1261 )
1257 coreconfigitem(
1262 coreconfigitem(
1258 b'extdata',
1263 b'extdata',
1259 b'.*',
1264 b'.*',
1260 default=None,
1265 default=None,
1261 generic=True,
1266 generic=True,
1262 )
1267 )
1263 coreconfigitem(
1268 coreconfigitem(
1264 b'format',
1269 b'format',
1265 b'bookmarks-in-store',
1270 b'bookmarks-in-store',
1266 default=False,
1271 default=False,
1267 )
1272 )
1268 coreconfigitem(
1273 coreconfigitem(
1269 b'format',
1274 b'format',
1270 b'chunkcachesize',
1275 b'chunkcachesize',
1271 default=None,
1276 default=None,
1272 experimental=True,
1277 experimental=True,
1273 )
1278 )
1274 coreconfigitem(
1279 coreconfigitem(
1275 b'format',
1280 b'format',
1276 b'dotencode',
1281 b'dotencode',
1277 default=True,
1282 default=True,
1278 )
1283 )
1279 coreconfigitem(
1284 coreconfigitem(
1280 b'format',
1285 b'format',
1281 b'generaldelta',
1286 b'generaldelta',
1282 default=False,
1287 default=False,
1283 experimental=True,
1288 experimental=True,
1284 )
1289 )
1285 coreconfigitem(
1290 coreconfigitem(
1286 b'format',
1291 b'format',
1287 b'manifestcachesize',
1292 b'manifestcachesize',
1288 default=None,
1293 default=None,
1289 experimental=True,
1294 experimental=True,
1290 )
1295 )
1291 coreconfigitem(
1296 coreconfigitem(
1292 b'format',
1297 b'format',
1293 b'maxchainlen',
1298 b'maxchainlen',
1294 default=dynamicdefault,
1299 default=dynamicdefault,
1295 experimental=True,
1300 experimental=True,
1296 )
1301 )
1297 coreconfigitem(
1302 coreconfigitem(
1298 b'format',
1303 b'format',
1299 b'obsstore-version',
1304 b'obsstore-version',
1300 default=None,
1305 default=None,
1301 )
1306 )
1302 coreconfigitem(
1307 coreconfigitem(
1303 b'format',
1308 b'format',
1304 b'sparse-revlog',
1309 b'sparse-revlog',
1305 default=True,
1310 default=True,
1306 )
1311 )
1307 coreconfigitem(
1312 coreconfigitem(
1308 b'format',
1313 b'format',
1309 b'revlog-compression',
1314 b'revlog-compression',
1310 default=lambda: [b'zstd', b'zlib'],
1315 default=lambda: [b'zstd', b'zlib'],
1311 alias=[(b'experimental', b'format.compression')],
1316 alias=[(b'experimental', b'format.compression')],
1312 )
1317 )
1313 coreconfigitem(
1318 coreconfigitem(
1314 b'format',
1319 b'format',
1315 b'usefncache',
1320 b'usefncache',
1316 default=True,
1321 default=True,
1317 )
1322 )
1318 coreconfigitem(
1323 coreconfigitem(
1319 b'format',
1324 b'format',
1320 b'usegeneraldelta',
1325 b'usegeneraldelta',
1321 default=True,
1326 default=True,
1322 )
1327 )
1323 coreconfigitem(
1328 coreconfigitem(
1324 b'format',
1329 b'format',
1325 b'usestore',
1330 b'usestore',
1326 default=True,
1331 default=True,
1327 )
1332 )
1328
1333
1329
1334
1330 def _persistent_nodemap_default():
1335 def _persistent_nodemap_default():
1331 """compute `use-persistent-nodemap` default value
1336 """compute `use-persistent-nodemap` default value
1332
1337
1333 The feature is disabled unless a fast implementation is available.
1338 The feature is disabled unless a fast implementation is available.
1334 """
1339 """
1335 from . import policy
1340 from . import policy
1336
1341
1337 return policy.importrust('revlog') is not None
1342 return policy.importrust('revlog') is not None
1338
1343
1339
1344
1340 coreconfigitem(
1345 coreconfigitem(
1341 b'format',
1346 b'format',
1342 b'use-persistent-nodemap',
1347 b'use-persistent-nodemap',
1343 default=_persistent_nodemap_default,
1348 default=_persistent_nodemap_default,
1344 )
1349 )
1345 # TODO needs to grow a docket file to at least store the last offset of the data
1350 # TODO needs to grow a docket file to at least store the last offset of the data
1346 # file when rewriting sidedata.
1351 # file when rewriting sidedata.
1347 # Will also need a way of dealing with garbage data if we allow rewriting
1352 # Will also need a way of dealing with garbage data if we allow rewriting
1348 # *existing* sidedata.
1353 # *existing* sidedata.
1349 # Exchange-wise, we will also need to do something more efficient than keeping
1354 # Exchange-wise, we will also need to do something more efficient than keeping
1350 # references to the affected revlogs, especially memory-wise when rewriting
1355 # references to the affected revlogs, especially memory-wise when rewriting
1351 # sidedata.
1356 # sidedata.
1352 # Also... compress the sidedata? (this should be coming very soon)
1357 # Also... compress the sidedata? (this should be coming very soon)
1353 coreconfigitem(
1358 coreconfigitem(
1354 b'format',
1359 b'format',
1355 b'exp-revlogv2.2',
1360 b'exp-revlogv2.2',
1356 default=False,
1361 default=False,
1357 experimental=True,
1362 experimental=True,
1358 )
1363 )
1359 coreconfigitem(
1364 coreconfigitem(
1360 b'format',
1365 b'format',
1361 b'exp-use-copies-side-data-changeset',
1366 b'exp-use-copies-side-data-changeset',
1362 default=False,
1367 default=False,
1363 experimental=True,
1368 experimental=True,
1364 )
1369 )
1365 coreconfigitem(
1370 coreconfigitem(
1366 b'format',
1371 b'format',
1367 b'exp-use-side-data',
1372 b'exp-use-side-data',
1368 default=False,
1373 default=False,
1369 experimental=True,
1374 experimental=True,
1370 )
1375 )
1371 coreconfigitem(
1376 coreconfigitem(
1372 b'format',
1377 b'format',
1373 b'use-share-safe',
1378 b'use-share-safe',
1374 default=False,
1379 default=False,
1375 )
1380 )
1376 coreconfigitem(
1381 coreconfigitem(
1377 b'format',
1382 b'format',
1378 b'internal-phase',
1383 b'internal-phase',
1379 default=False,
1384 default=False,
1380 experimental=True,
1385 experimental=True,
1381 )
1386 )
1382 coreconfigitem(
1387 coreconfigitem(
1383 b'fsmonitor',
1388 b'fsmonitor',
1384 b'warn_when_unused',
1389 b'warn_when_unused',
1385 default=True,
1390 default=True,
1386 )
1391 )
1387 coreconfigitem(
1392 coreconfigitem(
1388 b'fsmonitor',
1393 b'fsmonitor',
1389 b'warn_update_file_count',
1394 b'warn_update_file_count',
1390 default=50000,
1395 default=50000,
1391 )
1396 )
1392 coreconfigitem(
1397 coreconfigitem(
1393 b'fsmonitor',
1398 b'fsmonitor',
1394 b'warn_update_file_count_rust',
1399 b'warn_update_file_count_rust',
1395 default=400000,
1400 default=400000,
1396 )
1401 )
1397 coreconfigitem(
1402 coreconfigitem(
1398 b'help',
1403 b'help',
1399 br'hidden-command\..*',
1404 br'hidden-command\..*',
1400 default=False,
1405 default=False,
1401 generic=True,
1406 generic=True,
1402 )
1407 )
1403 coreconfigitem(
1408 coreconfigitem(
1404 b'help',
1409 b'help',
1405 br'hidden-topic\..*',
1410 br'hidden-topic\..*',
1406 default=False,
1411 default=False,
1407 generic=True,
1412 generic=True,
1408 )
1413 )
1409 coreconfigitem(
1414 coreconfigitem(
1410 b'hooks',
1415 b'hooks',
1411 b'[^:]*',
1416 b'[^:]*',
1412 default=dynamicdefault,
1417 default=dynamicdefault,
1413 generic=True,
1418 generic=True,
1414 )
1419 )
1415 coreconfigitem(
1420 coreconfigitem(
1416 b'hooks',
1421 b'hooks',
1417 b'.*:run-with-plain',
1422 b'.*:run-with-plain',
1418 default=True,
1423 default=True,
1419 generic=True,
1424 generic=True,
1420 )
1425 )
1421 coreconfigitem(
1426 coreconfigitem(
1422 b'hgweb-paths',
1427 b'hgweb-paths',
1423 b'.*',
1428 b'.*',
1424 default=list,
1429 default=list,
1425 generic=True,
1430 generic=True,
1426 )
1431 )
1427 coreconfigitem(
1432 coreconfigitem(
1428 b'hostfingerprints',
1433 b'hostfingerprints',
1429 b'.*',
1434 b'.*',
1430 default=list,
1435 default=list,
1431 generic=True,
1436 generic=True,
1432 )
1437 )
1433 coreconfigitem(
1438 coreconfigitem(
1434 b'hostsecurity',
1439 b'hostsecurity',
1435 b'ciphers',
1440 b'ciphers',
1436 default=None,
1441 default=None,
1437 )
1442 )
1438 coreconfigitem(
1443 coreconfigitem(
1439 b'hostsecurity',
1444 b'hostsecurity',
1440 b'minimumprotocol',
1445 b'minimumprotocol',
1441 default=dynamicdefault,
1446 default=dynamicdefault,
1442 )
1447 )
1443 coreconfigitem(
1448 coreconfigitem(
1444 b'hostsecurity',
1449 b'hostsecurity',
1445 b'.*:minimumprotocol$',
1450 b'.*:minimumprotocol$',
1446 default=dynamicdefault,
1451 default=dynamicdefault,
1447 generic=True,
1452 generic=True,
1448 )
1453 )
1449 coreconfigitem(
1454 coreconfigitem(
1450 b'hostsecurity',
1455 b'hostsecurity',
1451 b'.*:ciphers$',
1456 b'.*:ciphers$',
1452 default=dynamicdefault,
1457 default=dynamicdefault,
1453 generic=True,
1458 generic=True,
1454 )
1459 )
1455 coreconfigitem(
1460 coreconfigitem(
1456 b'hostsecurity',
1461 b'hostsecurity',
1457 b'.*:fingerprints$',
1462 b'.*:fingerprints$',
1458 default=list,
1463 default=list,
1459 generic=True,
1464 generic=True,
1460 )
1465 )
1461 coreconfigitem(
1466 coreconfigitem(
1462 b'hostsecurity',
1467 b'hostsecurity',
1463 b'.*:verifycertsfile$',
1468 b'.*:verifycertsfile$',
1464 default=None,
1469 default=None,
1465 generic=True,
1470 generic=True,
1466 )
1471 )
1467
1472
1468 coreconfigitem(
1473 coreconfigitem(
1469 b'http_proxy',
1474 b'http_proxy',
1470 b'always',
1475 b'always',
1471 default=False,
1476 default=False,
1472 )
1477 )
1473 coreconfigitem(
1478 coreconfigitem(
1474 b'http_proxy',
1479 b'http_proxy',
1475 b'host',
1480 b'host',
1476 default=None,
1481 default=None,
1477 )
1482 )
1478 coreconfigitem(
1483 coreconfigitem(
1479 b'http_proxy',
1484 b'http_proxy',
1480 b'no',
1485 b'no',
1481 default=list,
1486 default=list,
1482 )
1487 )
1483 coreconfigitem(
1488 coreconfigitem(
1484 b'http_proxy',
1489 b'http_proxy',
1485 b'passwd',
1490 b'passwd',
1486 default=None,
1491 default=None,
1487 )
1492 )
1488 coreconfigitem(
1493 coreconfigitem(
1489 b'http_proxy',
1494 b'http_proxy',
1490 b'user',
1495 b'user',
1491 default=None,
1496 default=None,
1492 )
1497 )
1493
1498
1494 coreconfigitem(
1499 coreconfigitem(
1495 b'http',
1500 b'http',
1496 b'timeout',
1501 b'timeout',
1497 default=None,
1502 default=None,
1498 )
1503 )
1499
1504
1500 coreconfigitem(
1505 coreconfigitem(
1501 b'logtoprocess',
1506 b'logtoprocess',
1502 b'commandexception',
1507 b'commandexception',
1503 default=None,
1508 default=None,
1504 )
1509 )
1505 coreconfigitem(
1510 coreconfigitem(
1506 b'logtoprocess',
1511 b'logtoprocess',
1507 b'commandfinish',
1512 b'commandfinish',
1508 default=None,
1513 default=None,
1509 )
1514 )
1510 coreconfigitem(
1515 coreconfigitem(
1511 b'logtoprocess',
1516 b'logtoprocess',
1512 b'command',
1517 b'command',
1513 default=None,
1518 default=None,
1514 )
1519 )
1515 coreconfigitem(
1520 coreconfigitem(
1516 b'logtoprocess',
1521 b'logtoprocess',
1517 b'develwarn',
1522 b'develwarn',
1518 default=None,
1523 default=None,
1519 )
1524 )
1520 coreconfigitem(
1525 coreconfigitem(
1521 b'logtoprocess',
1526 b'logtoprocess',
1522 b'uiblocked',
1527 b'uiblocked',
1523 default=None,
1528 default=None,
1524 )
1529 )
1525 coreconfigitem(
1530 coreconfigitem(
1526 b'merge',
1531 b'merge',
1527 b'checkunknown',
1532 b'checkunknown',
1528 default=b'abort',
1533 default=b'abort',
1529 )
1534 )
1530 coreconfigitem(
1535 coreconfigitem(
1531 b'merge',
1536 b'merge',
1532 b'checkignored',
1537 b'checkignored',
1533 default=b'abort',
1538 default=b'abort',
1534 )
1539 )
1535 coreconfigitem(
1540 coreconfigitem(
1536 b'experimental',
1541 b'experimental',
1537 b'merge.checkpathconflicts',
1542 b'merge.checkpathconflicts',
1538 default=False,
1543 default=False,
1539 )
1544 )
1540 coreconfigitem(
1545 coreconfigitem(
1541 b'merge',
1546 b'merge',
1542 b'followcopies',
1547 b'followcopies',
1543 default=True,
1548 default=True,
1544 )
1549 )
1545 coreconfigitem(
1550 coreconfigitem(
1546 b'merge',
1551 b'merge',
1547 b'on-failure',
1552 b'on-failure',
1548 default=b'continue',
1553 default=b'continue',
1549 )
1554 )
1550 coreconfigitem(
1555 coreconfigitem(
1551 b'merge',
1556 b'merge',
1552 b'preferancestor',
1557 b'preferancestor',
1553 default=lambda: [b'*'],
1558 default=lambda: [b'*'],
1554 experimental=True,
1559 experimental=True,
1555 )
1560 )
1556 coreconfigitem(
1561 coreconfigitem(
1557 b'merge',
1562 b'merge',
1558 b'strict-capability-check',
1563 b'strict-capability-check',
1559 default=False,
1564 default=False,
1560 )
1565 )
1561 coreconfigitem(
1566 coreconfigitem(
1562 b'merge-tools',
1567 b'merge-tools',
1563 b'.*',
1568 b'.*',
1564 default=None,
1569 default=None,
1565 generic=True,
1570 generic=True,
1566 )
1571 )
1567 coreconfigitem(
1572 coreconfigitem(
1568 b'merge-tools',
1573 b'merge-tools',
1569 br'.*\.args$',
1574 br'.*\.args$',
1570 default=b"$local $base $other",
1575 default=b"$local $base $other",
1571 generic=True,
1576 generic=True,
1572 priority=-1,
1577 priority=-1,
1573 )
1578 )
1574 coreconfigitem(
1579 coreconfigitem(
1575 b'merge-tools',
1580 b'merge-tools',
1576 br'.*\.binary$',
1581 br'.*\.binary$',
1577 default=False,
1582 default=False,
1578 generic=True,
1583 generic=True,
1579 priority=-1,
1584 priority=-1,
1580 )
1585 )
1581 coreconfigitem(
1586 coreconfigitem(
1582 b'merge-tools',
1587 b'merge-tools',
1583 br'.*\.check$',
1588 br'.*\.check$',
1584 default=list,
1589 default=list,
1585 generic=True,
1590 generic=True,
1586 priority=-1,
1591 priority=-1,
1587 )
1592 )
1588 coreconfigitem(
1593 coreconfigitem(
1589 b'merge-tools',
1594 b'merge-tools',
1590 br'.*\.checkchanged$',
1595 br'.*\.checkchanged$',
1591 default=False,
1596 default=False,
1592 generic=True,
1597 generic=True,
1593 priority=-1,
1598 priority=-1,
1594 )
1599 )
1595 coreconfigitem(
1600 coreconfigitem(
1596 b'merge-tools',
1601 b'merge-tools',
1597 br'.*\.executable$',
1602 br'.*\.executable$',
1598 default=dynamicdefault,
1603 default=dynamicdefault,
1599 generic=True,
1604 generic=True,
1600 priority=-1,
1605 priority=-1,
1601 )
1606 )
1602 coreconfigitem(
1607 coreconfigitem(
1603 b'merge-tools',
1608 b'merge-tools',
1604 br'.*\.fixeol$',
1609 br'.*\.fixeol$',
1605 default=False,
1610 default=False,
1606 generic=True,
1611 generic=True,
1607 priority=-1,
1612 priority=-1,
1608 )
1613 )
1609 coreconfigitem(
1614 coreconfigitem(
1610 b'merge-tools',
1615 b'merge-tools',
1611 br'.*\.gui$',
1616 br'.*\.gui$',
1612 default=False,
1617 default=False,
1613 generic=True,
1618 generic=True,
1614 priority=-1,
1619 priority=-1,
1615 )
1620 )
1616 coreconfigitem(
1621 coreconfigitem(
1617 b'merge-tools',
1622 b'merge-tools',
1618 br'.*\.mergemarkers$',
1623 br'.*\.mergemarkers$',
1619 default=b'basic',
1624 default=b'basic',
1620 generic=True,
1625 generic=True,
1621 priority=-1,
1626 priority=-1,
1622 )
1627 )
1623 coreconfigitem(
1628 coreconfigitem(
1624 b'merge-tools',
1629 b'merge-tools',
1625 br'.*\.mergemarkertemplate$',
1630 br'.*\.mergemarkertemplate$',
1626 default=dynamicdefault, # take from command-templates.mergemarker
1631 default=dynamicdefault, # take from command-templates.mergemarker
1627 generic=True,
1632 generic=True,
1628 priority=-1,
1633 priority=-1,
1629 )
1634 )
1630 coreconfigitem(
1635 coreconfigitem(
1631 b'merge-tools',
1636 b'merge-tools',
1632 br'.*\.priority$',
1637 br'.*\.priority$',
1633 default=0,
1638 default=0,
1634 generic=True,
1639 generic=True,
1635 priority=-1,
1640 priority=-1,
1636 )
1641 )
1637 coreconfigitem(
1642 coreconfigitem(
1638 b'merge-tools',
1643 b'merge-tools',
1639 br'.*\.premerge$',
1644 br'.*\.premerge$',
1640 default=dynamicdefault,
1645 default=dynamicdefault,
1641 generic=True,
1646 generic=True,
1642 priority=-1,
1647 priority=-1,
1643 )
1648 )
1644 coreconfigitem(
1649 coreconfigitem(
1645 b'merge-tools',
1650 b'merge-tools',
1646 br'.*\.symlink$',
1651 br'.*\.symlink$',
1647 default=False,
1652 default=False,
1648 generic=True,
1653 generic=True,
1649 priority=-1,
1654 priority=-1,
1650 )
1655 )
1651 coreconfigitem(
1656 coreconfigitem(
1652 b'pager',
1657 b'pager',
1653 b'attend-.*',
1658 b'attend-.*',
1654 default=dynamicdefault,
1659 default=dynamicdefault,
1655 generic=True,
1660 generic=True,
1656 )
1661 )
1657 coreconfigitem(
1662 coreconfigitem(
1658 b'pager',
1663 b'pager',
1659 b'ignore',
1664 b'ignore',
1660 default=list,
1665 default=list,
1661 )
1666 )
1662 coreconfigitem(
1667 coreconfigitem(
1663 b'pager',
1668 b'pager',
1664 b'pager',
1669 b'pager',
1665 default=dynamicdefault,
1670 default=dynamicdefault,
1666 )
1671 )
1667 coreconfigitem(
1672 coreconfigitem(
1668 b'patch',
1673 b'patch',
1669 b'eol',
1674 b'eol',
1670 default=b'strict',
1675 default=b'strict',
1671 )
1676 )
1672 coreconfigitem(
1677 coreconfigitem(
1673 b'patch',
1678 b'patch',
1674 b'fuzz',
1679 b'fuzz',
1675 default=2,
1680 default=2,
1676 )
1681 )
1677 coreconfigitem(
1682 coreconfigitem(
1678 b'paths',
1683 b'paths',
1679 b'default',
1684 b'default',
1680 default=None,
1685 default=None,
1681 )
1686 )
1682 coreconfigitem(
1687 coreconfigitem(
1683 b'paths',
1688 b'paths',
1684 b'default-push',
1689 b'default-push',
1685 default=None,
1690 default=None,
1686 )
1691 )
1687 coreconfigitem(
1692 coreconfigitem(
1688 b'paths',
1693 b'paths',
1689 b'.*',
1694 b'.*',
1690 default=None,
1695 default=None,
1691 generic=True,
1696 generic=True,
1692 )
1697 )
1693 coreconfigitem(
1698 coreconfigitem(
1694 b'phases',
1699 b'phases',
1695 b'checksubrepos',
1700 b'checksubrepos',
1696 default=b'follow',
1701 default=b'follow',
1697 )
1702 )
1698 coreconfigitem(
1703 coreconfigitem(
1699 b'phases',
1704 b'phases',
1700 b'new-commit',
1705 b'new-commit',
1701 default=b'draft',
1706 default=b'draft',
1702 )
1707 )
1703 coreconfigitem(
1708 coreconfigitem(
1704 b'phases',
1709 b'phases',
1705 b'publish',
1710 b'publish',
1706 default=True,
1711 default=True,
1707 )
1712 )
1708 coreconfigitem(
1713 coreconfigitem(
1709 b'profiling',
1714 b'profiling',
1710 b'enabled',
1715 b'enabled',
1711 default=False,
1716 default=False,
1712 )
1717 )
1713 coreconfigitem(
1718 coreconfigitem(
1714 b'profiling',
1719 b'profiling',
1715 b'format',
1720 b'format',
1716 default=b'text',
1721 default=b'text',
1717 )
1722 )
1718 coreconfigitem(
1723 coreconfigitem(
1719 b'profiling',
1724 b'profiling',
1720 b'freq',
1725 b'freq',
1721 default=1000,
1726 default=1000,
1722 )
1727 )
1723 coreconfigitem(
1728 coreconfigitem(
1724 b'profiling',
1729 b'profiling',
1725 b'limit',
1730 b'limit',
1726 default=30,
1731 default=30,
1727 )
1732 )
1728 coreconfigitem(
1733 coreconfigitem(
1729 b'profiling',
1734 b'profiling',
1730 b'nested',
1735 b'nested',
1731 default=0,
1736 default=0,
1732 )
1737 )
1733 coreconfigitem(
1738 coreconfigitem(
1734 b'profiling',
1739 b'profiling',
1735 b'output',
1740 b'output',
1736 default=None,
1741 default=None,
1737 )
1742 )
1738 coreconfigitem(
1743 coreconfigitem(
1739 b'profiling',
1744 b'profiling',
1740 b'showmax',
1745 b'showmax',
1741 default=0.999,
1746 default=0.999,
1742 )
1747 )
1743 coreconfigitem(
1748 coreconfigitem(
1744 b'profiling',
1749 b'profiling',
1745 b'showmin',
1750 b'showmin',
1746 default=dynamicdefault,
1751 default=dynamicdefault,
1747 )
1752 )
1748 coreconfigitem(
1753 coreconfigitem(
1749 b'profiling',
1754 b'profiling',
1750 b'showtime',
1755 b'showtime',
1751 default=True,
1756 default=True,
1752 )
1757 )
1753 coreconfigitem(
1758 coreconfigitem(
1754 b'profiling',
1759 b'profiling',
1755 b'sort',
1760 b'sort',
1756 default=b'inlinetime',
1761 default=b'inlinetime',
1757 )
1762 )
1758 coreconfigitem(
1763 coreconfigitem(
1759 b'profiling',
1764 b'profiling',
1760 b'statformat',
1765 b'statformat',
1761 default=b'hotpath',
1766 default=b'hotpath',
1762 )
1767 )
1763 coreconfigitem(
1768 coreconfigitem(
1764 b'profiling',
1769 b'profiling',
1765 b'time-track',
1770 b'time-track',
1766 default=dynamicdefault,
1771 default=dynamicdefault,
1767 )
1772 )
1768 coreconfigitem(
1773 coreconfigitem(
1769 b'profiling',
1774 b'profiling',
1770 b'type',
1775 b'type',
1771 default=b'stat',
1776 default=b'stat',
1772 )
1777 )
1773 coreconfigitem(
1778 coreconfigitem(
1774 b'progress',
1779 b'progress',
1775 b'assume-tty',
1780 b'assume-tty',
1776 default=False,
1781 default=False,
1777 )
1782 )
1778 coreconfigitem(
1783 coreconfigitem(
1779 b'progress',
1784 b'progress',
1780 b'changedelay',
1785 b'changedelay',
1781 default=1,
1786 default=1,
1782 )
1787 )
1783 coreconfigitem(
1788 coreconfigitem(
1784 b'progress',
1789 b'progress',
1785 b'clear-complete',
1790 b'clear-complete',
1786 default=True,
1791 default=True,
1787 )
1792 )
1788 coreconfigitem(
1793 coreconfigitem(
1789 b'progress',
1794 b'progress',
1790 b'debug',
1795 b'debug',
1791 default=False,
1796 default=False,
1792 )
1797 )
1793 coreconfigitem(
1798 coreconfigitem(
1794 b'progress',
1799 b'progress',
1795 b'delay',
1800 b'delay',
1796 default=3,
1801 default=3,
1797 )
1802 )
1798 coreconfigitem(
1803 coreconfigitem(
1799 b'progress',
1804 b'progress',
1800 b'disable',
1805 b'disable',
1801 default=False,
1806 default=False,
1802 )
1807 )
1803 coreconfigitem(
1808 coreconfigitem(
1804 b'progress',
1809 b'progress',
1805 b'estimateinterval',
1810 b'estimateinterval',
1806 default=60.0,
1811 default=60.0,
1807 )
1812 )
1808 coreconfigitem(
1813 coreconfigitem(
1809 b'progress',
1814 b'progress',
1810 b'format',
1815 b'format',
1811 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1816 default=lambda: [b'topic', b'bar', b'number', b'estimate'],
1812 )
1817 )
1813 coreconfigitem(
1818 coreconfigitem(
1814 b'progress',
1819 b'progress',
1815 b'refresh',
1820 b'refresh',
1816 default=0.1,
1821 default=0.1,
1817 )
1822 )
1818 coreconfigitem(
1823 coreconfigitem(
1819 b'progress',
1824 b'progress',
1820 b'width',
1825 b'width',
1821 default=dynamicdefault,
1826 default=dynamicdefault,
1822 )
1827 )
1823 coreconfigitem(
1828 coreconfigitem(
1824 b'pull',
1829 b'pull',
1825 b'confirm',
1830 b'confirm',
1826 default=False,
1831 default=False,
1827 )
1832 )
1828 coreconfigitem(
1833 coreconfigitem(
1829 b'push',
1834 b'push',
1830 b'pushvars.server',
1835 b'pushvars.server',
1831 default=False,
1836 default=False,
1832 )
1837 )
1833 coreconfigitem(
1838 coreconfigitem(
1834 b'rewrite',
1839 b'rewrite',
1835 b'backup-bundle',
1840 b'backup-bundle',
1836 default=True,
1841 default=True,
1837 alias=[(b'ui', b'history-editing-backup')],
1842 alias=[(b'ui', b'history-editing-backup')],
1838 )
1843 )
1839 coreconfigitem(
1844 coreconfigitem(
1840 b'rewrite',
1845 b'rewrite',
1841 b'update-timestamp',
1846 b'update-timestamp',
1842 default=False,
1847 default=False,
1843 )
1848 )
1844 coreconfigitem(
1849 coreconfigitem(
1845 b'rewrite',
1850 b'rewrite',
1846 b'empty-successor',
1851 b'empty-successor',
1847 default=b'skip',
1852 default=b'skip',
1848 experimental=True,
1853 experimental=True,
1849 )
1854 )
1850 coreconfigitem(
1855 coreconfigitem(
1851 b'storage',
1856 b'storage',
1852 b'new-repo-backend',
1857 b'new-repo-backend',
1853 default=b'revlogv1',
1858 default=b'revlogv1',
1854 experimental=True,
1859 experimental=True,
1855 )
1860 )
1856 coreconfigitem(
1861 coreconfigitem(
1857 b'storage',
1862 b'storage',
1858 b'revlog.optimize-delta-parent-choice',
1863 b'revlog.optimize-delta-parent-choice',
1859 default=True,
1864 default=True,
1860 alias=[(b'format', b'aggressivemergedeltas')],
1865 alias=[(b'format', b'aggressivemergedeltas')],
1861 )
1866 )
1862 # experimental as long as rust is experimental (or a C version is implemented)
1867 # experimental as long as rust is experimental (or a C version is implemented)
1863 coreconfigitem(
1868 coreconfigitem(
1864 b'storage',
1869 b'storage',
1865 b'revlog.persistent-nodemap.mmap',
1870 b'revlog.persistent-nodemap.mmap',
1866 default=True,
1871 default=True,
1867 )
1872 )
1868 # experimental as long as format.use-persistent-nodemap is.
1873 # experimental as long as format.use-persistent-nodemap is.
1869 coreconfigitem(
1874 coreconfigitem(
1870 b'storage',
1875 b'storage',
1871 b'revlog.persistent-nodemap.slow-path',
1876 b'revlog.persistent-nodemap.slow-path',
1872 default=b"abort",
1877 default=b"abort",
1873 )
1878 )
1874
1879
1875 coreconfigitem(
1880 coreconfigitem(
1876 b'storage',
1881 b'storage',
1877 b'revlog.reuse-external-delta',
1882 b'revlog.reuse-external-delta',
1878 default=True,
1883 default=True,
1879 )
1884 )
1880 coreconfigitem(
1885 coreconfigitem(
1881 b'storage',
1886 b'storage',
1882 b'revlog.reuse-external-delta-parent',
1887 b'revlog.reuse-external-delta-parent',
1883 default=None,
1888 default=None,
1884 )
1889 )
1885 coreconfigitem(
1890 coreconfigitem(
1886 b'storage',
1891 b'storage',
1887 b'revlog.zlib.level',
1892 b'revlog.zlib.level',
1888 default=None,
1893 default=None,
1889 )
1894 )
1890 coreconfigitem(
1895 coreconfigitem(
1891 b'storage',
1896 b'storage',
1892 b'revlog.zstd.level',
1897 b'revlog.zstd.level',
1893 default=None,
1898 default=None,
1894 )
1899 )
1895 coreconfigitem(
1900 coreconfigitem(
1896 b'server',
1901 b'server',
1897 b'bookmarks-pushkey-compat',
1902 b'bookmarks-pushkey-compat',
1898 default=True,
1903 default=True,
1899 )
1904 )
1900 coreconfigitem(
1905 coreconfigitem(
1901 b'server',
1906 b'server',
1902 b'bundle1',
1907 b'bundle1',
1903 default=True,
1908 default=True,
1904 )
1909 )
1905 coreconfigitem(
1910 coreconfigitem(
1906 b'server',
1911 b'server',
1907 b'bundle1gd',
1912 b'bundle1gd',
1908 default=None,
1913 default=None,
1909 )
1914 )
1910 coreconfigitem(
1915 coreconfigitem(
1911 b'server',
1916 b'server',
1912 b'bundle1.pull',
1917 b'bundle1.pull',
1913 default=None,
1918 default=None,
1914 )
1919 )
1915 coreconfigitem(
1920 coreconfigitem(
1916 b'server',
1921 b'server',
1917 b'bundle1gd.pull',
1922 b'bundle1gd.pull',
1918 default=None,
1923 default=None,
1919 )
1924 )
1920 coreconfigitem(
1925 coreconfigitem(
1921 b'server',
1926 b'server',
1922 b'bundle1.push',
1927 b'bundle1.push',
1923 default=None,
1928 default=None,
1924 )
1929 )
1925 coreconfigitem(
1930 coreconfigitem(
1926 b'server',
1931 b'server',
1927 b'bundle1gd.push',
1932 b'bundle1gd.push',
1928 default=None,
1933 default=None,
1929 )
1934 )
1930 coreconfigitem(
1935 coreconfigitem(
1931 b'server',
1936 b'server',
1932 b'bundle2.stream',
1937 b'bundle2.stream',
1933 default=True,
1938 default=True,
1934 alias=[(b'experimental', b'bundle2.stream')],
1939 alias=[(b'experimental', b'bundle2.stream')],
1935 )
1940 )
1936 coreconfigitem(
1941 coreconfigitem(
1937 b'server',
1942 b'server',
1938 b'compressionengines',
1943 b'compressionengines',
1939 default=list,
1944 default=list,
1940 )
1945 )
1941 coreconfigitem(
1946 coreconfigitem(
1942 b'server',
1947 b'server',
1943 b'concurrent-push-mode',
1948 b'concurrent-push-mode',
1944 default=b'check-related',
1949 default=b'check-related',
1945 )
1950 )
1946 coreconfigitem(
1951 coreconfigitem(
1947 b'server',
1952 b'server',
1948 b'disablefullbundle',
1953 b'disablefullbundle',
1949 default=False,
1954 default=False,
1950 )
1955 )
1951 coreconfigitem(
1956 coreconfigitem(
1952 b'server',
1957 b'server',
1953 b'maxhttpheaderlen',
1958 b'maxhttpheaderlen',
1954 default=1024,
1959 default=1024,
1955 )
1960 )
1956 coreconfigitem(
1961 coreconfigitem(
1957 b'server',
1962 b'server',
1958 b'pullbundle',
1963 b'pullbundle',
1959 default=False,
1964 default=False,
1960 )
1965 )
1961 coreconfigitem(
1966 coreconfigitem(
1962 b'server',
1967 b'server',
1963 b'preferuncompressed',
1968 b'preferuncompressed',
1964 default=False,
1969 default=False,
1965 )
1970 )
1966 coreconfigitem(
1971 coreconfigitem(
1967 b'server',
1972 b'server',
1968 b'streamunbundle',
1973 b'streamunbundle',
1969 default=False,
1974 default=False,
1970 )
1975 )
1971 coreconfigitem(
1976 coreconfigitem(
1972 b'server',
1977 b'server',
1973 b'uncompressed',
1978 b'uncompressed',
1974 default=True,
1979 default=True,
1975 )
1980 )
1976 coreconfigitem(
1981 coreconfigitem(
1977 b'server',
1982 b'server',
1978 b'uncompressedallowsecret',
1983 b'uncompressedallowsecret',
1979 default=False,
1984 default=False,
1980 )
1985 )
1981 coreconfigitem(
1986 coreconfigitem(
1982 b'server',
1987 b'server',
1983 b'view',
1988 b'view',
1984 default=b'served',
1989 default=b'served',
1985 )
1990 )
1986 coreconfigitem(
1991 coreconfigitem(
1987 b'server',
1992 b'server',
1988 b'validate',
1993 b'validate',
1989 default=False,
1994 default=False,
1990 )
1995 )
1991 coreconfigitem(
1996 coreconfigitem(
1992 b'server',
1997 b'server',
1993 b'zliblevel',
1998 b'zliblevel',
1994 default=-1,
1999 default=-1,
1995 )
2000 )
1996 coreconfigitem(
2001 coreconfigitem(
1997 b'server',
2002 b'server',
1998 b'zstdlevel',
2003 b'zstdlevel',
1999 default=3,
2004 default=3,
2000 )
2005 )
2001 coreconfigitem(
2006 coreconfigitem(
2002 b'share',
2007 b'share',
2003 b'pool',
2008 b'pool',
2004 default=None,
2009 default=None,
2005 )
2010 )
2006 coreconfigitem(
2011 coreconfigitem(
2007 b'share',
2012 b'share',
2008 b'poolnaming',
2013 b'poolnaming',
2009 default=b'identity',
2014 default=b'identity',
2010 )
2015 )
2011 coreconfigitem(
2016 coreconfigitem(
2012 b'share',
2017 b'share',
2013 b'safe-mismatch.source-not-safe',
2018 b'safe-mismatch.source-not-safe',
2014 default=b'abort',
2019 default=b'abort',
2015 )
2020 )
2016 coreconfigitem(
2021 coreconfigitem(
2017 b'share',
2022 b'share',
2018 b'safe-mismatch.source-safe',
2023 b'safe-mismatch.source-safe',
2019 default=b'abort',
2024 default=b'abort',
2020 )
2025 )
2021 coreconfigitem(
2026 coreconfigitem(
2022 b'share',
2027 b'share',
2023 b'safe-mismatch.source-not-safe.warn',
2028 b'safe-mismatch.source-not-safe.warn',
2024 default=True,
2029 default=True,
2025 )
2030 )
2026 coreconfigitem(
2031 coreconfigitem(
2027 b'share',
2032 b'share',
2028 b'safe-mismatch.source-safe.warn',
2033 b'safe-mismatch.source-safe.warn',
2029 default=True,
2034 default=True,
2030 )
2035 )
2031 coreconfigitem(
2036 coreconfigitem(
2032 b'shelve',
2037 b'shelve',
2033 b'maxbackups',
2038 b'maxbackups',
2034 default=10,
2039 default=10,
2035 )
2040 )
2036 coreconfigitem(
2041 coreconfigitem(
2037 b'smtp',
2042 b'smtp',
2038 b'host',
2043 b'host',
2039 default=None,
2044 default=None,
2040 )
2045 )
2041 coreconfigitem(
2046 coreconfigitem(
2042 b'smtp',
2047 b'smtp',
2043 b'local_hostname',
2048 b'local_hostname',
2044 default=None,
2049 default=None,
2045 )
2050 )
2046 coreconfigitem(
2051 coreconfigitem(
2047 b'smtp',
2052 b'smtp',
2048 b'password',
2053 b'password',
2049 default=None,
2054 default=None,
2050 )
2055 )
2051 coreconfigitem(
2056 coreconfigitem(
2052 b'smtp',
2057 b'smtp',
2053 b'port',
2058 b'port',
2054 default=dynamicdefault,
2059 default=dynamicdefault,
2055 )
2060 )
2056 coreconfigitem(
2061 coreconfigitem(
2057 b'smtp',
2062 b'smtp',
2058 b'tls',
2063 b'tls',
2059 default=b'none',
2064 default=b'none',
2060 )
2065 )
2061 coreconfigitem(
2066 coreconfigitem(
2062 b'smtp',
2067 b'smtp',
2063 b'username',
2068 b'username',
2064 default=None,
2069 default=None,
2065 )
2070 )
2066 coreconfigitem(
2071 coreconfigitem(
2067 b'sparse',
2072 b'sparse',
2068 b'missingwarning',
2073 b'missingwarning',
2069 default=True,
2074 default=True,
2070 experimental=True,
2075 experimental=True,
2071 )
2076 )
2072 coreconfigitem(
2077 coreconfigitem(
2073 b'subrepos',
2078 b'subrepos',
2074 b'allowed',
2079 b'allowed',
2075 default=dynamicdefault, # to make backporting simpler
2080 default=dynamicdefault, # to make backporting simpler
2076 )
2081 )
2077 coreconfigitem(
2082 coreconfigitem(
2078 b'subrepos',
2083 b'subrepos',
2079 b'hg:allowed',
2084 b'hg:allowed',
2080 default=dynamicdefault,
2085 default=dynamicdefault,
2081 )
2086 )
2082 coreconfigitem(
2087 coreconfigitem(
2083 b'subrepos',
2088 b'subrepos',
2084 b'git:allowed',
2089 b'git:allowed',
2085 default=dynamicdefault,
2090 default=dynamicdefault,
2086 )
2091 )
2087 coreconfigitem(
2092 coreconfigitem(
2088 b'subrepos',
2093 b'subrepos',
2089 b'svn:allowed',
2094 b'svn:allowed',
2090 default=dynamicdefault,
2095 default=dynamicdefault,
2091 )
2096 )
2092 coreconfigitem(
2097 coreconfigitem(
2093 b'templates',
2098 b'templates',
2094 b'.*',
2099 b'.*',
2095 default=None,
2100 default=None,
2096 generic=True,
2101 generic=True,
2097 )
2102 )
2098 coreconfigitem(
2103 coreconfigitem(
2099 b'templateconfig',
2104 b'templateconfig',
2100 b'.*',
2105 b'.*',
2101 default=dynamicdefault,
2106 default=dynamicdefault,
2102 generic=True,
2107 generic=True,
2103 )
2108 )
2104 coreconfigitem(
2109 coreconfigitem(
2105 b'trusted',
2110 b'trusted',
2106 b'groups',
2111 b'groups',
2107 default=list,
2112 default=list,
2108 )
2113 )
2109 coreconfigitem(
2114 coreconfigitem(
2110 b'trusted',
2115 b'trusted',
2111 b'users',
2116 b'users',
2112 default=list,
2117 default=list,
2113 )
2118 )
2114 coreconfigitem(
2119 coreconfigitem(
2115 b'ui',
2120 b'ui',
2116 b'_usedassubrepo',
2121 b'_usedassubrepo',
2117 default=False,
2122 default=False,
2118 )
2123 )
2119 coreconfigitem(
2124 coreconfigitem(
2120 b'ui',
2125 b'ui',
2121 b'allowemptycommit',
2126 b'allowemptycommit',
2122 default=False,
2127 default=False,
2123 )
2128 )
2124 coreconfigitem(
2129 coreconfigitem(
2125 b'ui',
2130 b'ui',
2126 b'archivemeta',
2131 b'archivemeta',
2127 default=True,
2132 default=True,
2128 )
2133 )
2129 coreconfigitem(
2134 coreconfigitem(
2130 b'ui',
2135 b'ui',
2131 b'askusername',
2136 b'askusername',
2132 default=False,
2137 default=False,
2133 )
2138 )
2134 coreconfigitem(
2139 coreconfigitem(
2135 b'ui',
2140 b'ui',
2136 b'available-memory',
2141 b'available-memory',
2137 default=None,
2142 default=None,
2138 )
2143 )
2139
2144
2140 coreconfigitem(
2145 coreconfigitem(
2141 b'ui',
2146 b'ui',
2142 b'clonebundlefallback',
2147 b'clonebundlefallback',
2143 default=False,
2148 default=False,
2144 )
2149 )
2145 coreconfigitem(
2150 coreconfigitem(
2146 b'ui',
2151 b'ui',
2147 b'clonebundleprefers',
2152 b'clonebundleprefers',
2148 default=list,
2153 default=list,
2149 )
2154 )
2150 coreconfigitem(
2155 coreconfigitem(
2151 b'ui',
2156 b'ui',
2152 b'clonebundles',
2157 b'clonebundles',
2153 default=True,
2158 default=True,
2154 )
2159 )
2155 coreconfigitem(
2160 coreconfigitem(
2156 b'ui',
2161 b'ui',
2157 b'color',
2162 b'color',
2158 default=b'auto',
2163 default=b'auto',
2159 )
2164 )
2160 coreconfigitem(
2165 coreconfigitem(
2161 b'ui',
2166 b'ui',
2162 b'commitsubrepos',
2167 b'commitsubrepos',
2163 default=False,
2168 default=False,
2164 )
2169 )
2165 coreconfigitem(
2170 coreconfigitem(
2166 b'ui',
2171 b'ui',
2167 b'debug',
2172 b'debug',
2168 default=False,
2173 default=False,
2169 )
2174 )
2170 coreconfigitem(
2175 coreconfigitem(
2171 b'ui',
2176 b'ui',
2172 b'debugger',
2177 b'debugger',
2173 default=None,
2178 default=None,
2174 )
2179 )
2175 coreconfigitem(
2180 coreconfigitem(
2176 b'ui',
2181 b'ui',
2177 b'editor',
2182 b'editor',
2178 default=dynamicdefault,
2183 default=dynamicdefault,
2179 )
2184 )
2180 coreconfigitem(
2185 coreconfigitem(
2181 b'ui',
2186 b'ui',
2182 b'detailed-exit-code',
2187 b'detailed-exit-code',
2183 default=False,
2188 default=False,
2184 experimental=True,
2189 experimental=True,
2185 )
2190 )
2186 coreconfigitem(
2191 coreconfigitem(
2187 b'ui',
2192 b'ui',
2188 b'fallbackencoding',
2193 b'fallbackencoding',
2189 default=None,
2194 default=None,
2190 )
2195 )
2191 coreconfigitem(
2196 coreconfigitem(
2192 b'ui',
2197 b'ui',
2193 b'forcecwd',
2198 b'forcecwd',
2194 default=None,
2199 default=None,
2195 )
2200 )
2196 coreconfigitem(
2201 coreconfigitem(
2197 b'ui',
2202 b'ui',
2198 b'forcemerge',
2203 b'forcemerge',
2199 default=None,
2204 default=None,
2200 )
2205 )
2201 coreconfigitem(
2206 coreconfigitem(
2202 b'ui',
2207 b'ui',
2203 b'formatdebug',
2208 b'formatdebug',
2204 default=False,
2209 default=False,
2205 )
2210 )
2206 coreconfigitem(
2211 coreconfigitem(
2207 b'ui',
2212 b'ui',
2208 b'formatjson',
2213 b'formatjson',
2209 default=False,
2214 default=False,
2210 )
2215 )
2211 coreconfigitem(
2216 coreconfigitem(
2212 b'ui',
2217 b'ui',
2213 b'formatted',
2218 b'formatted',
2214 default=None,
2219 default=None,
2215 )
2220 )
2216 coreconfigitem(
2221 coreconfigitem(
2217 b'ui',
2222 b'ui',
2218 b'interactive',
2223 b'interactive',
2219 default=None,
2224 default=None,
2220 )
2225 )
2221 coreconfigitem(
2226 coreconfigitem(
2222 b'ui',
2227 b'ui',
2223 b'interface',
2228 b'interface',
2224 default=None,
2229 default=None,
2225 )
2230 )
2226 coreconfigitem(
2231 coreconfigitem(
2227 b'ui',
2232 b'ui',
2228 b'interface.chunkselector',
2233 b'interface.chunkselector',
2229 default=None,
2234 default=None,
2230 )
2235 )
2231 coreconfigitem(
2236 coreconfigitem(
2232 b'ui',
2237 b'ui',
2233 b'large-file-limit',
2238 b'large-file-limit',
2234 default=10000000,
2239 default=10000000,
2235 )
2240 )
2236 coreconfigitem(
2241 coreconfigitem(
2237 b'ui',
2242 b'ui',
2238 b'logblockedtimes',
2243 b'logblockedtimes',
2239 default=False,
2244 default=False,
2240 )
2245 )
2241 coreconfigitem(
2246 coreconfigitem(
2242 b'ui',
2247 b'ui',
2243 b'merge',
2248 b'merge',
2244 default=None,
2249 default=None,
2245 )
2250 )
2246 coreconfigitem(
2251 coreconfigitem(
2247 b'ui',
2252 b'ui',
2248 b'mergemarkers',
2253 b'mergemarkers',
2249 default=b'basic',
2254 default=b'basic',
2250 )
2255 )
2251 coreconfigitem(
2256 coreconfigitem(
2252 b'ui',
2257 b'ui',
2253 b'message-output',
2258 b'message-output',
2254 default=b'stdio',
2259 default=b'stdio',
2255 )
2260 )
2256 coreconfigitem(
2261 coreconfigitem(
2257 b'ui',
2262 b'ui',
2258 b'nontty',
2263 b'nontty',
2259 default=False,
2264 default=False,
2260 )
2265 )
2261 coreconfigitem(
2266 coreconfigitem(
2262 b'ui',
2267 b'ui',
2263 b'origbackuppath',
2268 b'origbackuppath',
2264 default=None,
2269 default=None,
2265 )
2270 )
2266 coreconfigitem(
2271 coreconfigitem(
2267 b'ui',
2272 b'ui',
2268 b'paginate',
2273 b'paginate',
2269 default=True,
2274 default=True,
2270 )
2275 )
2271 coreconfigitem(
2276 coreconfigitem(
2272 b'ui',
2277 b'ui',
2273 b'patch',
2278 b'patch',
2274 default=None,
2279 default=None,
2275 )
2280 )
2276 coreconfigitem(
2281 coreconfigitem(
2277 b'ui',
2282 b'ui',
2278 b'portablefilenames',
2283 b'portablefilenames',
2279 default=b'warn',
2284 default=b'warn',
2280 )
2285 )
2281 coreconfigitem(
2286 coreconfigitem(
2282 b'ui',
2287 b'ui',
2283 b'promptecho',
2288 b'promptecho',
2284 default=False,
2289 default=False,
2285 )
2290 )
2286 coreconfigitem(
2291 coreconfigitem(
2287 b'ui',
2292 b'ui',
2288 b'quiet',
2293 b'quiet',
2289 default=False,
2294 default=False,
2290 )
2295 )
2291 coreconfigitem(
2296 coreconfigitem(
2292 b'ui',
2297 b'ui',
2293 b'quietbookmarkmove',
2298 b'quietbookmarkmove',
2294 default=False,
2299 default=False,
2295 )
2300 )
2296 coreconfigitem(
2301 coreconfigitem(
2297 b'ui',
2302 b'ui',
2298 b'relative-paths',
2303 b'relative-paths',
2299 default=b'legacy',
2304 default=b'legacy',
2300 )
2305 )
2301 coreconfigitem(
2306 coreconfigitem(
2302 b'ui',
2307 b'ui',
2303 b'remotecmd',
2308 b'remotecmd',
2304 default=b'hg',
2309 default=b'hg',
2305 )
2310 )
2306 coreconfigitem(
2311 coreconfigitem(
2307 b'ui',
2312 b'ui',
2308 b'report_untrusted',
2313 b'report_untrusted',
2309 default=True,
2314 default=True,
2310 )
2315 )
2311 coreconfigitem(
2316 coreconfigitem(
2312 b'ui',
2317 b'ui',
2313 b'rollback',
2318 b'rollback',
2314 default=True,
2319 default=True,
2315 )
2320 )
2316 coreconfigitem(
2321 coreconfigitem(
2317 b'ui',
2322 b'ui',
2318 b'signal-safe-lock',
2323 b'signal-safe-lock',
2319 default=True,
2324 default=True,
2320 )
2325 )
2321 coreconfigitem(
2326 coreconfigitem(
2322 b'ui',
2327 b'ui',
2323 b'slash',
2328 b'slash',
2324 default=False,
2329 default=False,
2325 )
2330 )
2326 coreconfigitem(
2331 coreconfigitem(
2327 b'ui',
2332 b'ui',
2328 b'ssh',
2333 b'ssh',
2329 default=b'ssh',
2334 default=b'ssh',
2330 )
2335 )
2331 coreconfigitem(
2336 coreconfigitem(
2332 b'ui',
2337 b'ui',
2333 b'ssherrorhint',
2338 b'ssherrorhint',
2334 default=None,
2339 default=None,
2335 )
2340 )
2336 coreconfigitem(
2341 coreconfigitem(
2337 b'ui',
2342 b'ui',
2338 b'statuscopies',
2343 b'statuscopies',
2339 default=False,
2344 default=False,
2340 )
2345 )
2341 coreconfigitem(
2346 coreconfigitem(
2342 b'ui',
2347 b'ui',
2343 b'strict',
2348 b'strict',
2344 default=False,
2349 default=False,
2345 )
2350 )
2346 coreconfigitem(
2351 coreconfigitem(
2347 b'ui',
2352 b'ui',
2348 b'style',
2353 b'style',
2349 default=b'',
2354 default=b'',
2350 )
2355 )
2351 coreconfigitem(
2356 coreconfigitem(
2352 b'ui',
2357 b'ui',
2353 b'supportcontact',
2358 b'supportcontact',
2354 default=None,
2359 default=None,
2355 )
2360 )
2356 coreconfigitem(
2361 coreconfigitem(
2357 b'ui',
2362 b'ui',
2358 b'textwidth',
2363 b'textwidth',
2359 default=78,
2364 default=78,
2360 )
2365 )
2361 coreconfigitem(
2366 coreconfigitem(
2362 b'ui',
2367 b'ui',
2363 b'timeout',
2368 b'timeout',
2364 default=b'600',
2369 default=b'600',
2365 )
2370 )
2366 coreconfigitem(
2371 coreconfigitem(
2367 b'ui',
2372 b'ui',
2368 b'timeout.warn',
2373 b'timeout.warn',
2369 default=0,
2374 default=0,
2370 )
2375 )
2371 coreconfigitem(
2376 coreconfigitem(
2372 b'ui',
2377 b'ui',
2373 b'timestamp-output',
2378 b'timestamp-output',
2374 default=False,
2379 default=False,
2375 )
2380 )
2376 coreconfigitem(
2381 coreconfigitem(
2377 b'ui',
2382 b'ui',
2378 b'traceback',
2383 b'traceback',
2379 default=False,
2384 default=False,
2380 )
2385 )
2381 coreconfigitem(
2386 coreconfigitem(
2382 b'ui',
2387 b'ui',
2383 b'tweakdefaults',
2388 b'tweakdefaults',
2384 default=False,
2389 default=False,
2385 )
2390 )
2386 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2391 coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')])
2387 coreconfigitem(
2392 coreconfigitem(
2388 b'ui',
2393 b'ui',
2389 b'verbose',
2394 b'verbose',
2390 default=False,
2395 default=False,
2391 )
2396 )
2392 coreconfigitem(
2397 coreconfigitem(
2393 b'verify',
2398 b'verify',
2394 b'skipflags',
2399 b'skipflags',
2395 default=None,
2400 default=None,
2396 )
2401 )
2397 coreconfigitem(
2402 coreconfigitem(
2398 b'web',
2403 b'web',
2399 b'allowbz2',
2404 b'allowbz2',
2400 default=False,
2405 default=False,
2401 )
2406 )
2402 coreconfigitem(
2407 coreconfigitem(
2403 b'web',
2408 b'web',
2404 b'allowgz',
2409 b'allowgz',
2405 default=False,
2410 default=False,
2406 )
2411 )
2407 coreconfigitem(
2412 coreconfigitem(
2408 b'web',
2413 b'web',
2409 b'allow-pull',
2414 b'allow-pull',
2410 alias=[(b'web', b'allowpull')],
2415 alias=[(b'web', b'allowpull')],
2411 default=True,
2416 default=True,
2412 )
2417 )
2413 coreconfigitem(
2418 coreconfigitem(
2414 b'web',
2419 b'web',
2415 b'allow-push',
2420 b'allow-push',
2416 alias=[(b'web', b'allow_push')],
2421 alias=[(b'web', b'allow_push')],
2417 default=list,
2422 default=list,
2418 )
2423 )
2419 coreconfigitem(
2424 coreconfigitem(
2420 b'web',
2425 b'web',
2421 b'allowzip',
2426 b'allowzip',
2422 default=False,
2427 default=False,
2423 )
2428 )
2424 coreconfigitem(
2429 coreconfigitem(
2425 b'web',
2430 b'web',
2426 b'archivesubrepos',
2431 b'archivesubrepos',
2427 default=False,
2432 default=False,
2428 )
2433 )
2429 coreconfigitem(
2434 coreconfigitem(
2430 b'web',
2435 b'web',
2431 b'cache',
2436 b'cache',
2432 default=True,
2437 default=True,
2433 )
2438 )
2434 coreconfigitem(
2439 coreconfigitem(
2435 b'web',
2440 b'web',
2436 b'comparisoncontext',
2441 b'comparisoncontext',
2437 default=5,
2442 default=5,
2438 )
2443 )
2439 coreconfigitem(
2444 coreconfigitem(
2440 b'web',
2445 b'web',
2441 b'contact',
2446 b'contact',
2442 default=None,
2447 default=None,
2443 )
2448 )
2444 coreconfigitem(
2449 coreconfigitem(
2445 b'web',
2450 b'web',
2446 b'deny_push',
2451 b'deny_push',
2447 default=list,
2452 default=list,
2448 )
2453 )
2449 coreconfigitem(
2454 coreconfigitem(
2450 b'web',
2455 b'web',
2451 b'guessmime',
2456 b'guessmime',
2452 default=False,
2457 default=False,
2453 )
2458 )
2454 coreconfigitem(
2459 coreconfigitem(
2455 b'web',
2460 b'web',
2456 b'hidden',
2461 b'hidden',
2457 default=False,
2462 default=False,
2458 )
2463 )
2459 coreconfigitem(
2464 coreconfigitem(
2460 b'web',
2465 b'web',
2461 b'labels',
2466 b'labels',
2462 default=list,
2467 default=list,
2463 )
2468 )
2464 coreconfigitem(
2469 coreconfigitem(
2465 b'web',
2470 b'web',
2466 b'logoimg',
2471 b'logoimg',
2467 default=b'hglogo.png',
2472 default=b'hglogo.png',
2468 )
2473 )
2469 coreconfigitem(
2474 coreconfigitem(
2470 b'web',
2475 b'web',
2471 b'logourl',
2476 b'logourl',
2472 default=b'https://mercurial-scm.org/',
2477 default=b'https://mercurial-scm.org/',
2473 )
2478 )
2474 coreconfigitem(
2479 coreconfigitem(
2475 b'web',
2480 b'web',
2476 b'accesslog',
2481 b'accesslog',
2477 default=b'-',
2482 default=b'-',
2478 )
2483 )
2479 coreconfigitem(
2484 coreconfigitem(
2480 b'web',
2485 b'web',
2481 b'address',
2486 b'address',
2482 default=b'',
2487 default=b'',
2483 )
2488 )
2484 coreconfigitem(
2489 coreconfigitem(
2485 b'web',
2490 b'web',
2486 b'allow-archive',
2491 b'allow-archive',
2487 alias=[(b'web', b'allow_archive')],
2492 alias=[(b'web', b'allow_archive')],
2488 default=list,
2493 default=list,
2489 )
2494 )
2490 coreconfigitem(
2495 coreconfigitem(
2491 b'web',
2496 b'web',
2492 b'allow_read',
2497 b'allow_read',
2493 default=list,
2498 default=list,
2494 )
2499 )
2495 coreconfigitem(
2500 coreconfigitem(
2496 b'web',
2501 b'web',
2497 b'baseurl',
2502 b'baseurl',
2498 default=None,
2503 default=None,
2499 )
2504 )
2500 coreconfigitem(
2505 coreconfigitem(
2501 b'web',
2506 b'web',
2502 b'cacerts',
2507 b'cacerts',
2503 default=None,
2508 default=None,
2504 )
2509 )
2505 coreconfigitem(
2510 coreconfigitem(
2506 b'web',
2511 b'web',
2507 b'certificate',
2512 b'certificate',
2508 default=None,
2513 default=None,
2509 )
2514 )
2510 coreconfigitem(
2515 coreconfigitem(
2511 b'web',
2516 b'web',
2512 b'collapse',
2517 b'collapse',
2513 default=False,
2518 default=False,
2514 )
2519 )
2515 coreconfigitem(
2520 coreconfigitem(
2516 b'web',
2521 b'web',
2517 b'csp',
2522 b'csp',
2518 default=None,
2523 default=None,
2519 )
2524 )
2520 coreconfigitem(
2525 coreconfigitem(
2521 b'web',
2526 b'web',
2522 b'deny_read',
2527 b'deny_read',
2523 default=list,
2528 default=list,
2524 )
2529 )
2525 coreconfigitem(
2530 coreconfigitem(
2526 b'web',
2531 b'web',
2527 b'descend',
2532 b'descend',
2528 default=True,
2533 default=True,
2529 )
2534 )
2530 coreconfigitem(
2535 coreconfigitem(
2531 b'web',
2536 b'web',
2532 b'description',
2537 b'description',
2533 default=b"",
2538 default=b"",
2534 )
2539 )
2535 coreconfigitem(
2540 coreconfigitem(
2536 b'web',
2541 b'web',
2537 b'encoding',
2542 b'encoding',
2538 default=lambda: encoding.encoding,
2543 default=lambda: encoding.encoding,
2539 )
2544 )
2540 coreconfigitem(
2545 coreconfigitem(
2541 b'web',
2546 b'web',
2542 b'errorlog',
2547 b'errorlog',
2543 default=b'-',
2548 default=b'-',
2544 )
2549 )
2545 coreconfigitem(
2550 coreconfigitem(
2546 b'web',
2551 b'web',
2547 b'ipv6',
2552 b'ipv6',
2548 default=False,
2553 default=False,
2549 )
2554 )
2550 coreconfigitem(
2555 coreconfigitem(
2551 b'web',
2556 b'web',
2552 b'maxchanges',
2557 b'maxchanges',
2553 default=10,
2558 default=10,
2554 )
2559 )
2555 coreconfigitem(
2560 coreconfigitem(
2556 b'web',
2561 b'web',
2557 b'maxfiles',
2562 b'maxfiles',
2558 default=10,
2563 default=10,
2559 )
2564 )
2560 coreconfigitem(
2565 coreconfigitem(
2561 b'web',
2566 b'web',
2562 b'maxshortchanges',
2567 b'maxshortchanges',
2563 default=60,
2568 default=60,
2564 )
2569 )
2565 coreconfigitem(
2570 coreconfigitem(
2566 b'web',
2571 b'web',
2567 b'motd',
2572 b'motd',
2568 default=b'',
2573 default=b'',
2569 )
2574 )
2570 coreconfigitem(
2575 coreconfigitem(
2571 b'web',
2576 b'web',
2572 b'name',
2577 b'name',
2573 default=dynamicdefault,
2578 default=dynamicdefault,
2574 )
2579 )
2575 coreconfigitem(
2580 coreconfigitem(
2576 b'web',
2581 b'web',
2577 b'port',
2582 b'port',
2578 default=8000,
2583 default=8000,
2579 )
2584 )
2580 coreconfigitem(
2585 coreconfigitem(
2581 b'web',
2586 b'web',
2582 b'prefix',
2587 b'prefix',
2583 default=b'',
2588 default=b'',
2584 )
2589 )
2585 coreconfigitem(
2590 coreconfigitem(
2586 b'web',
2591 b'web',
2587 b'push_ssl',
2592 b'push_ssl',
2588 default=True,
2593 default=True,
2589 )
2594 )
2590 coreconfigitem(
2595 coreconfigitem(
2591 b'web',
2596 b'web',
2592 b'refreshinterval',
2597 b'refreshinterval',
2593 default=20,
2598 default=20,
2594 )
2599 )
2595 coreconfigitem(
2600 coreconfigitem(
2596 b'web',
2601 b'web',
2597 b'server-header',
2602 b'server-header',
2598 default=None,
2603 default=None,
2599 )
2604 )
2600 coreconfigitem(
2605 coreconfigitem(
2601 b'web',
2606 b'web',
2602 b'static',
2607 b'static',
2603 default=None,
2608 default=None,
2604 )
2609 )
2605 coreconfigitem(
2610 coreconfigitem(
2606 b'web',
2611 b'web',
2607 b'staticurl',
2612 b'staticurl',
2608 default=None,
2613 default=None,
2609 )
2614 )
2610 coreconfigitem(
2615 coreconfigitem(
2611 b'web',
2616 b'web',
2612 b'stripes',
2617 b'stripes',
2613 default=1,
2618 default=1,
2614 )
2619 )
2615 coreconfigitem(
2620 coreconfigitem(
2616 b'web',
2621 b'web',
2617 b'style',
2622 b'style',
2618 default=b'paper',
2623 default=b'paper',
2619 )
2624 )
2620 coreconfigitem(
2625 coreconfigitem(
2621 b'web',
2626 b'web',
2622 b'templates',
2627 b'templates',
2623 default=None,
2628 default=None,
2624 )
2629 )
2625 coreconfigitem(
2630 coreconfigitem(
2626 b'web',
2631 b'web',
2627 b'view',
2632 b'view',
2628 default=b'served',
2633 default=b'served',
2629 experimental=True,
2634 experimental=True,
2630 )
2635 )
2631 coreconfigitem(
2636 coreconfigitem(
2632 b'worker',
2637 b'worker',
2633 b'backgroundclose',
2638 b'backgroundclose',
2634 default=dynamicdefault,
2639 default=dynamicdefault,
2635 )
2640 )
2636 # Windows defaults to a limit of 512 open files. A buffer of 128
2641 # Windows defaults to a limit of 512 open files. A buffer of 128
2637 # should give us enough headway.
2642 # should give us enough headway.
2638 coreconfigitem(
2643 coreconfigitem(
2639 b'worker',
2644 b'worker',
2640 b'backgroundclosemaxqueue',
2645 b'backgroundclosemaxqueue',
2641 default=384,
2646 default=384,
2642 )
2647 )
2643 coreconfigitem(
2648 coreconfigitem(
2644 b'worker',
2649 b'worker',
2645 b'backgroundcloseminfilecount',
2650 b'backgroundcloseminfilecount',
2646 default=2048,
2651 default=2048,
2647 )
2652 )
2648 coreconfigitem(
2653 coreconfigitem(
2649 b'worker',
2654 b'worker',
2650 b'backgroundclosethreadcount',
2655 b'backgroundclosethreadcount',
2651 default=4,
2656 default=4,
2652 )
2657 )
2653 coreconfigitem(
2658 coreconfigitem(
2654 b'worker',
2659 b'worker',
2655 b'enabled',
2660 b'enabled',
2656 default=True,
2661 default=True,
2657 )
2662 )
2658 coreconfigitem(
2663 coreconfigitem(
2659 b'worker',
2664 b'worker',
2660 b'numcpus',
2665 b'numcpus',
2661 default=None,
2666 default=None,
2662 )
2667 )
2663
2668
2664 # Rebase related configuration moved to core because other extension are doing
2669 # Rebase related configuration moved to core because other extension are doing
2665 # strange things. For example, shelve import the extensions to reuse some bit
2670 # strange things. For example, shelve import the extensions to reuse some bit
2666 # without formally loading it.
2671 # without formally loading it.
2667 coreconfigitem(
2672 coreconfigitem(
2668 b'commands',
2673 b'commands',
2669 b'rebase.requiredest',
2674 b'rebase.requiredest',
2670 default=False,
2675 default=False,
2671 )
2676 )
2672 coreconfigitem(
2677 coreconfigitem(
2673 b'experimental',
2678 b'experimental',
2674 b'rebaseskipobsolete',
2679 b'rebaseskipobsolete',
2675 default=True,
2680 default=True,
2676 )
2681 )
2677 coreconfigitem(
2682 coreconfigitem(
2678 b'rebase',
2683 b'rebase',
2679 b'singletransaction',
2684 b'singletransaction',
2680 default=False,
2685 default=False,
2681 )
2686 )
2682 coreconfigitem(
2687 coreconfigitem(
2683 b'rebase',
2688 b'rebase',
2684 b'experimental.inmemory',
2689 b'experimental.inmemory',
2685 default=False,
2690 default=False,
2686 )
2691 )
General Comments 0
You need to be logged in to leave comments. Login now