##// END OF EJS Templates
branchmap: use mmap for faster revbranchcache loading...
Arseniy Alekseyev -
r52268:02e7d79e default
parent child Browse files
Show More
@@ -1,870 +1,931 b''
1 1 # branchmap.py - logic to computes, maintain and stores branchmap for local repo
2 2 #
3 3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8
9 9 import struct
10 10
11 11 from .node import (
12 12 bin,
13 13 hex,
14 14 nullrev,
15 15 )
16 16
17 17 from typing import (
18 18 Callable,
19 19 Dict,
20 20 Iterable,
21 21 List,
22 22 Optional,
23 23 Set,
24 24 TYPE_CHECKING,
25 25 Tuple,
26 26 Union,
27 27 )
28 28
29 29 from . import (
30 30 encoding,
31 31 error,
32 32 obsolete,
33 33 scmutil,
34 34 util,
35 35 )
36 36
37 37 from .utils import (
38 38 repoviewutil,
39 39 stringutil,
40 40 )
41 41
42 42 if TYPE_CHECKING:
43 43 from . import localrepo
44 44
45 45 assert [localrepo]
46 46
47 47 subsettable = repoviewutil.subsettable
48 48
49 49 calcsize = struct.calcsize
50 50 pack_into = struct.pack_into
51 51 unpack_from = struct.unpack_from
52 52
53 53
54 54 class BranchMapCache:
55 55 """mapping of filtered views of repo with their branchcache"""
56 56
57 57 def __init__(self):
58 58 self._per_filter = {}
59 59
60 60 def __getitem__(self, repo):
61 61 self.updatecache(repo)
62 62 return self._per_filter[repo.filtername]
63 63
64 64 def updatecache(self, repo):
65 65 """Update the cache for the given filtered view on a repository"""
66 66 # This can trigger updates for the caches for subsets of the filtered
67 67 # view, e.g. when there is no cache for this filtered view or the cache
68 68 # is stale.
69 69
70 70 cl = repo.changelog
71 71 filtername = repo.filtername
72 72 bcache = self._per_filter.get(filtername)
73 73 if bcache is None or not bcache.validfor(repo):
74 74 # cache object missing or cache object stale? Read from disk
75 75 bcache = branchcache.fromfile(repo)
76 76
77 77 revs = []
78 78 if bcache is None:
79 79 # no (fresh) cache available anymore, perhaps we can re-use
80 80 # the cache for a subset, then extend that to add info on missing
81 81 # revisions.
82 82 subsetname = subsettable.get(filtername)
83 83 if subsetname is not None:
84 84 subset = repo.filtered(subsetname)
85 85 bcache = self[subset].copy()
86 86 extrarevs = subset.changelog.filteredrevs - cl.filteredrevs
87 87 revs.extend(r for r in extrarevs if r <= bcache.tiprev)
88 88 else:
89 89 # nothing to fall back on, start empty.
90 90 bcache = branchcache(repo)
91 91
92 92 revs.extend(cl.revs(start=bcache.tiprev + 1))
93 93 if revs:
94 94 bcache.update(repo, revs)
95 95
96 96 assert bcache.validfor(repo), filtername
97 97 self._per_filter[repo.filtername] = bcache
98 98
99 99 def replace(self, repo, remotebranchmap):
100 100 """Replace the branchmap cache for a repo with a branch mapping.
101 101
102 102 This is likely only called during clone with a branch map from a
103 103 remote.
104 104
105 105 """
106 106 cl = repo.changelog
107 107 clrev = cl.rev
108 108 clbranchinfo = cl.branchinfo
109 109 rbheads = []
110 110 closed = set()
111 111 for bheads in remotebranchmap.values():
112 112 rbheads += bheads
113 113 for h in bheads:
114 114 r = clrev(h)
115 115 b, c = clbranchinfo(r)
116 116 if c:
117 117 closed.add(h)
118 118
119 119 if rbheads:
120 120 rtiprev = max((int(clrev(node)) for node in rbheads))
121 121 cache = branchcache(
122 122 repo,
123 123 remotebranchmap,
124 124 repo[rtiprev].node(),
125 125 rtiprev,
126 126 closednodes=closed,
127 127 )
128 128
129 129 # Try to stick it as low as possible
130 130 # filter above served are unlikely to be fetch from a clone
131 131 for candidate in (b'base', b'immutable', b'served'):
132 132 rview = repo.filtered(candidate)
133 133 if cache.validfor(rview):
134 134 self._per_filter[candidate] = cache
135 135 cache.write(rview)
136 136 return
137 137
138 138 def clear(self):
139 139 self._per_filter.clear()
140 140
141 141 def write_delayed(self, repo):
142 142 unfi = repo.unfiltered()
143 143 for filtername, cache in self._per_filter.items():
144 144 if cache._delayed:
145 145 repo = unfi.filtered(filtername)
146 146 cache.write(repo)
147 147
148 148
149 149 def _unknownnode(node):
150 150 """raises ValueError when branchcache found a node which does not exists"""
151 151 raise ValueError('node %s does not exist' % node.hex())
152 152
153 153
154 154 def _branchcachedesc(repo):
155 155 if repo.filtername is not None:
156 156 return b'branch cache (%s)' % repo.filtername
157 157 else:
158 158 return b'branch cache'
159 159
160 160
161 161 class branchcache:
162 162 """A dict like object that hold branches heads cache.
163 163
164 164 This cache is used to avoid costly computations to determine all the
165 165 branch heads of a repo.
166 166
167 167 The cache is serialized on disk in the following format:
168 168
169 169 <tip hex node> <tip rev number> [optional filtered repo hex hash]
170 170 <branch head hex node> <open/closed state> <branch name>
171 171 <branch head hex node> <open/closed state> <branch name>
172 172 ...
173 173
174 174 The first line is used to check if the cache is still valid. If the
175 175 branch cache is for a filtered repo view, an optional third hash is
176 176 included that hashes the hashes of all filtered and obsolete revisions.
177 177
178 178 The open/closed state is represented by a single letter 'o' or 'c'.
179 179 This field can be used to avoid changelog reads when determining if a
180 180 branch head closes a branch or not.
181 181 """
182 182
183 183 def __init__(
184 184 self,
185 185 repo: "localrepo.localrepository",
186 186 entries: Union[
187 187 Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
188 188 ] = (),
189 189 tipnode: Optional[bytes] = None,
190 190 tiprev: Optional[int] = nullrev,
191 191 filteredhash: Optional[bytes] = None,
192 192 closednodes: Optional[Set[bytes]] = None,
193 193 hasnode: Optional[Callable[[bytes], bool]] = None,
194 194 ) -> None:
195 195 """hasnode is a function which can be used to verify whether changelog
196 196 has a given node or not. If it's not provided, we assume that every node
197 197 we have exists in changelog"""
198 198 self._repo = repo
199 199 self._delayed = False
200 200 if tipnode is None:
201 201 self.tipnode = repo.nullid
202 202 else:
203 203 self.tipnode = tipnode
204 204 self.tiprev = tiprev
205 205 self.filteredhash = filteredhash
206 206 # closednodes is a set of nodes that close their branch. If the branch
207 207 # cache has been updated, it may contain nodes that are no longer
208 208 # heads.
209 209 if closednodes is None:
210 210 self._closednodes = set()
211 211 else:
212 212 self._closednodes = closednodes
213 213 self._entries = dict(entries)
214 214 # whether closed nodes are verified or not
215 215 self._closedverified = False
216 216 # branches for which nodes are verified
217 217 self._verifiedbranches = set()
218 218 self._hasnode = hasnode
219 219 if self._hasnode is None:
220 220 self._hasnode = lambda x: True
221 221
222 222 def _verifyclosed(self):
223 223 """verify the closed nodes we have"""
224 224 if self._closedverified:
225 225 return
226 226 for node in self._closednodes:
227 227 if not self._hasnode(node):
228 228 _unknownnode(node)
229 229
230 230 self._closedverified = True
231 231
232 232 def _verifybranch(self, branch):
233 233 """verify head nodes for the given branch."""
234 234 if branch not in self._entries or branch in self._verifiedbranches:
235 235 return
236 236 for n in self._entries[branch]:
237 237 if not self._hasnode(n):
238 238 _unknownnode(n)
239 239
240 240 self._verifiedbranches.add(branch)
241 241
242 242 def _verifyall(self):
243 243 """verifies nodes of all the branches"""
244 244 needverification = set(self._entries.keys()) - self._verifiedbranches
245 245 for b in needverification:
246 246 self._verifybranch(b)
247 247
248 248 def __iter__(self):
249 249 return iter(self._entries)
250 250
251 251 def __setitem__(self, key, value):
252 252 self._entries[key] = value
253 253
254 254 def __getitem__(self, key):
255 255 self._verifybranch(key)
256 256 return self._entries[key]
257 257
258 258 def __contains__(self, key):
259 259 self._verifybranch(key)
260 260 return key in self._entries
261 261
262 262 def iteritems(self):
263 263 for k, v in self._entries.items():
264 264 self._verifybranch(k)
265 265 yield k, v
266 266
267 267 items = iteritems
268 268
269 269 def hasbranch(self, label):
270 270 """checks whether a branch of this name exists or not"""
271 271 self._verifybranch(label)
272 272 return label in self._entries
273 273
274 274 @classmethod
275 275 def fromfile(cls, repo):
276 276 f = None
277 277 try:
278 278 f = repo.cachevfs(cls._filename(repo))
279 279 lineiter = iter(f)
280 280 cachekey = next(lineiter).rstrip(b'\n').split(b" ", 2)
281 281 last, lrev = cachekey[:2]
282 282 last, lrev = bin(last), int(lrev)
283 283 filteredhash = None
284 284 hasnode = repo.changelog.hasnode
285 285 if len(cachekey) > 2:
286 286 filteredhash = bin(cachekey[2])
287 287 bcache = cls(
288 288 repo,
289 289 tipnode=last,
290 290 tiprev=lrev,
291 291 filteredhash=filteredhash,
292 292 hasnode=hasnode,
293 293 )
294 294 if not bcache.validfor(repo):
295 295 # invalidate the cache
296 296 raise ValueError('tip differs')
297 297 bcache.load(repo, lineiter)
298 298 except (IOError, OSError):
299 299 return None
300 300
301 301 except Exception as inst:
302 302 if repo.ui.debugflag:
303 303 msg = b'invalid %s: %s\n'
304 304 repo.ui.debug(
305 305 msg
306 306 % (
307 307 _branchcachedesc(repo),
308 308 stringutil.forcebytestr(inst),
309 309 )
310 310 )
311 311 bcache = None
312 312
313 313 finally:
314 314 if f:
315 315 f.close()
316 316
317 317 return bcache
318 318
319 319 def load(self, repo, lineiter):
320 320 """fully loads the branchcache by reading from the file using the line
321 321 iterator passed"""
322 322 for line in lineiter:
323 323 line = line.rstrip(b'\n')
324 324 if not line:
325 325 continue
326 326 node, state, label = line.split(b" ", 2)
327 327 if state not in b'oc':
328 328 raise ValueError('invalid branch state')
329 329 label = encoding.tolocal(label.strip())
330 330 node = bin(node)
331 331 self._entries.setdefault(label, []).append(node)
332 332 if state == b'c':
333 333 self._closednodes.add(node)
334 334
335 335 @staticmethod
336 336 def _filename(repo):
337 337 """name of a branchcache file for a given repo or repoview"""
338 338 filename = b"branch2"
339 339 if repo.filtername:
340 340 filename = b'%s-%s' % (filename, repo.filtername)
341 341 return filename
342 342
343 343 def validfor(self, repo):
344 344 """check that cache contents are valid for (a subset of) this repo
345 345
346 346 - False when the order of changesets changed or if we detect a strip.
347 347 - True when cache is up-to-date for the current repo or its subset."""
348 348 try:
349 349 node = repo.changelog.node(self.tiprev)
350 350 except IndexError:
351 351 # changesets were stripped and now we don't even have enough to
352 352 # find tiprev
353 353 return False
354 354 if self.tipnode != node:
355 355 # tiprev doesn't correspond to tipnode: repo was stripped, or this
356 356 # repo has a different order of changesets
357 357 return False
358 358 tiphash = scmutil.filteredhash(repo, self.tiprev, needobsolete=True)
359 359 # hashes don't match if this repo view has a different set of filtered
360 360 # revisions (e.g. due to phase changes) or obsolete revisions (e.g.
361 361 # history was rewritten)
362 362 return self.filteredhash == tiphash
363 363
364 364 def _branchtip(self, heads):
365 365 """Return tuple with last open head in heads and false,
366 366 otherwise return last closed head and true."""
367 367 tip = heads[-1]
368 368 closed = True
369 369 for h in reversed(heads):
370 370 if h not in self._closednodes:
371 371 tip = h
372 372 closed = False
373 373 break
374 374 return tip, closed
375 375
376 376 def branchtip(self, branch):
377 377 """Return the tipmost open head on branch head, otherwise return the
378 378 tipmost closed head on branch.
379 379 Raise KeyError for unknown branch."""
380 380 return self._branchtip(self[branch])[0]
381 381
382 382 def iteropen(self, nodes):
383 383 return (n for n in nodes if n not in self._closednodes)
384 384
385 385 def branchheads(self, branch, closed=False):
386 386 self._verifybranch(branch)
387 387 heads = self._entries[branch]
388 388 if not closed:
389 389 heads = list(self.iteropen(heads))
390 390 return heads
391 391
392 392 def iterbranches(self):
393 393 for bn, heads in self.items():
394 394 yield (bn, heads) + self._branchtip(heads)
395 395
396 396 def iterheads(self):
397 397 """returns all the heads"""
398 398 self._verifyall()
399 399 return self._entries.values()
400 400
401 401 def copy(self):
402 402 """return an deep copy of the branchcache object"""
403 403 return type(self)(
404 404 self._repo,
405 405 self._entries,
406 406 self.tipnode,
407 407 self.tiprev,
408 408 self.filteredhash,
409 409 self._closednodes,
410 410 )
411 411
412 412 def write(self, repo):
413 413 tr = repo.currenttransaction()
414 414 if not getattr(tr, 'finalized', True):
415 415 # Avoid premature writing.
416 416 #
417 417 # (The cache warming setup by localrepo will update the file later.)
418 418 self._delayed = True
419 419 return
420 420 try:
421 421 filename = self._filename(repo)
422 422 with repo.cachevfs(filename, b"w", atomictemp=True) as f:
423 423 cachekey = [hex(self.tipnode), b'%d' % self.tiprev]
424 424 if self.filteredhash is not None:
425 425 cachekey.append(hex(self.filteredhash))
426 426 f.write(b" ".join(cachekey) + b'\n')
427 427 nodecount = 0
428 428 for label, nodes in sorted(self._entries.items()):
429 429 label = encoding.fromlocal(label)
430 430 for node in nodes:
431 431 nodecount += 1
432 432 if node in self._closednodes:
433 433 state = b'c'
434 434 else:
435 435 state = b'o'
436 436 f.write(b"%s %s %s\n" % (hex(node), state, label))
437 437 repo.ui.log(
438 438 b'branchcache',
439 439 b'wrote %s with %d labels and %d nodes\n',
440 440 _branchcachedesc(repo),
441 441 len(self._entries),
442 442 nodecount,
443 443 )
444 444 self._delayed = False
445 445 except (IOError, OSError, error.Abort) as inst:
446 446 # Abort may be raised by read only opener, so log and continue
447 447 repo.ui.debug(
448 448 b"couldn't write branch cache: %s\n"
449 449 % stringutil.forcebytestr(inst)
450 450 )
451 451
452 452 def update(self, repo, revgen):
453 453 """Given a branchhead cache, self, that may have extra nodes or be
454 454 missing heads, and a generator of nodes that are strictly a superset of
455 455 heads missing, this function updates self to be correct.
456 456 """
457 457 starttime = util.timer()
458 458 cl = repo.changelog
459 459 # collect new branch entries
460 460 newbranches = {}
461 461 getbranchinfo = repo.revbranchcache().branchinfo
462 462 for r in revgen:
463 463 branch, closesbranch = getbranchinfo(r)
464 464 newbranches.setdefault(branch, []).append(r)
465 465 if closesbranch:
466 466 self._closednodes.add(cl.node(r))
467 467
468 468 # new tip revision which we found after iterating items from new
469 469 # branches
470 470 ntiprev = self.tiprev
471 471
472 472 # Delay fetching the topological heads until they are needed.
473 473 # A repository without non-continous branches can skip this part.
474 474 topoheads = None
475 475
476 476 # If a changeset is visible, its parents must be visible too, so
477 477 # use the faster unfiltered parent accessor.
478 478 parentrevs = repo.unfiltered().changelog.parentrevs
479 479
480 480 # Faster than using ctx.obsolete()
481 481 obsrevs = obsolete.getrevs(repo, b'obsolete')
482 482
483 483 for branch, newheadrevs in newbranches.items():
484 484 # For every branch, compute the new branchheads.
485 485 # A branchhead is a revision such that no descendant is on
486 486 # the same branch.
487 487 #
488 488 # The branchheads are computed iteratively in revision order.
489 489 # This ensures topological order, i.e. parents are processed
490 490 # before their children. Ancestors are inclusive here, i.e.
491 491 # any revision is an ancestor of itself.
492 492 #
493 493 # Core observations:
494 494 # - The current revision is always a branchhead for the
495 495 # repository up to that point.
496 496 # - It is the first revision of the branch if and only if
497 497 # there was no branchhead before. In that case, it is the
498 498 # only branchhead as there are no possible ancestors on
499 499 # the same branch.
500 500 # - If a parent is on the same branch, a branchhead can
501 501 # only be an ancestor of that parent, if it is parent
502 502 # itself. Otherwise it would have been removed as ancestor
503 503 # of that parent before.
504 504 # - Therefore, if all parents are on the same branch, they
505 505 # can just be removed from the branchhead set.
506 506 # - If one parent is on the same branch and the other is not
507 507 # and there was exactly one branchhead known, the existing
508 508 # branchhead can only be an ancestor if it is the parent.
509 509 # Otherwise it would have been removed as ancestor of
510 510 # the parent before. The other parent therefore can't have
511 511 # a branchhead as ancestor.
512 512 # - In all other cases, the parents on different branches
513 513 # could have a branchhead as ancestor. Those parents are
514 514 # kept in the "uncertain" set. If all branchheads are also
515 515 # topological heads, they can't have descendants and further
516 516 # checks can be skipped. Otherwise, the ancestors of the
517 517 # "uncertain" set are removed from branchheads.
518 518 # This computation is heavy and avoided if at all possible.
519 519 bheads = self._entries.get(branch, [])
520 520 bheadset = {cl.rev(node) for node in bheads}
521 521 uncertain = set()
522 522 for newrev in sorted(newheadrevs):
523 523 if newrev in obsrevs:
524 524 # We ignore obsolete changesets as they shouldn't be
525 525 # considered heads.
526 526 continue
527 527
528 528 if not bheadset:
529 529 bheadset.add(newrev)
530 530 continue
531 531
532 532 parents = [p for p in parentrevs(newrev) if p != nullrev]
533 533 samebranch = set()
534 534 otherbranch = set()
535 535 obsparents = set()
536 536 for p in parents:
537 537 if p in obsrevs:
538 538 # We ignored this obsolete changeset earlier, but now
539 539 # that it has non-ignored children, we need to make
540 540 # sure their ancestors are not considered heads. To
541 541 # achieve that, we will simply treat this obsolete
542 542 # changeset as a parent from other branch.
543 543 obsparents.add(p)
544 544 elif p in bheadset or getbranchinfo(p)[0] == branch:
545 545 samebranch.add(p)
546 546 else:
547 547 otherbranch.add(p)
548 548 if not (len(bheadset) == len(samebranch) == 1):
549 549 uncertain.update(otherbranch)
550 550 uncertain.update(obsparents)
551 551 bheadset.difference_update(samebranch)
552 552 bheadset.add(newrev)
553 553
554 554 if uncertain:
555 555 if topoheads is None:
556 556 topoheads = set(cl.headrevs())
557 557 if bheadset - topoheads:
558 558 floorrev = min(bheadset)
559 559 if floorrev <= max(uncertain):
560 560 ancestors = set(cl.ancestors(uncertain, floorrev))
561 561 bheadset -= ancestors
562 562 if bheadset:
563 563 self[branch] = [cl.node(rev) for rev in sorted(bheadset)]
564 564 tiprev = max(newheadrevs)
565 565 if tiprev > ntiprev:
566 566 ntiprev = tiprev
567 567
568 568 if ntiprev > self.tiprev:
569 569 self.tiprev = ntiprev
570 570 self.tipnode = cl.node(ntiprev)
571 571
572 572 if not self.validfor(repo):
573 573 # old cache key is now invalid for the repo, but we've just updated
574 574 # the cache and we assume it's valid, so let's make the cache key
575 575 # valid as well by recomputing it from the cached data
576 576 self.tipnode = repo.nullid
577 577 self.tiprev = nullrev
578 578 for heads in self.iterheads():
579 579 if not heads:
580 580 # all revisions on a branch are obsolete
581 581 continue
582 582 # note: tiprev is not necessarily the tip revision of repo,
583 583 # because the tip could be obsolete (i.e. not a head)
584 584 tiprev = max(cl.rev(node) for node in heads)
585 585 if tiprev > self.tiprev:
586 586 self.tipnode = cl.node(tiprev)
587 587 self.tiprev = tiprev
588 588 self.filteredhash = scmutil.filteredhash(
589 589 repo, self.tiprev, needobsolete=True
590 590 )
591 591
592 592 duration = util.timer() - starttime
593 593 repo.ui.log(
594 594 b'branchcache',
595 595 b'updated %s in %.4f seconds\n',
596 596 _branchcachedesc(repo),
597 597 duration,
598 598 )
599 599
600 600 self.write(repo)
601 601
602 602
603 603 class remotebranchcache(branchcache):
604 604 """Branchmap info for a remote connection, should not write locally"""
605 605
606 606 def write(self, repo):
607 607 pass
608 608
609 609
610 610 # Revision branch info cache
611 611
612 612 _rbcversion = b'-v1'
613 613 _rbcnames = b'rbc-names' + _rbcversion
614 614 _rbcrevs = b'rbc-revs' + _rbcversion
615 615 # [4 byte hash prefix][4 byte branch name number with sign bit indicating open]
616 616 _rbcrecfmt = b'>4sI'
617 617 _rbcrecsize = calcsize(_rbcrecfmt)
618 618 _rbcmininc = 64 * _rbcrecsize
619 619 _rbcnodelen = 4
620 620 _rbcbranchidxmask = 0x7FFFFFFF
621 621 _rbccloseflag = 0x80000000
622 622
623 623
624 class rbcrevs:
625 """a byte string consisting of an immutable prefix followed by a mutable suffix"""
626
627 def __init__(self, revs):
628 self._prefix = revs
629 self._rest = bytearray()
630
631 def __len__(self):
632 return len(self._prefix) + len(self._rest)
633
634 def unpack_record(self, rbcrevidx):
635 if rbcrevidx < len(self._prefix):
636 return unpack_from(_rbcrecfmt, util.buffer(self._prefix), rbcrevidx)
637 else:
638 return unpack_from(
639 _rbcrecfmt,
640 util.buffer(self._rest),
641 rbcrevidx - len(self._prefix),
642 )
643
644 def make_mutable(self):
645 if len(self._prefix) > 0:
646 entirety = bytearray()
647 entirety[:] = self._prefix
648 entirety.extend(self._rest)
649 self._rest = entirety
650 self._prefix = bytearray()
651
652 def truncate(self, pos):
653 self.make_mutable()
654 del self._rest[pos:]
655
656 def pack_into(self, rbcrevidx, node, branchidx):
657 if rbcrevidx < len(self._prefix):
658 self.make_mutable()
659 buf = self._rest
660 start_offset = rbcrevidx - len(self._prefix)
661 end_offset = start_offset + _rbcrecsize
662
663 if len(self._rest) < end_offset:
664 # bytearray doesn't allocate extra space at least in Python 3.7.
665 # When multiple changesets are added in a row, precise resize would
666 # result in quadratic complexity. Overallocate to compensate by
667 # using the classic doubling technique for dynamic arrays instead.
668 # If there was a gap in the map before, less space will be reserved.
669 self._rest.extend(b'\0' * end_offset)
670 return pack_into(
671 _rbcrecfmt,
672 buf,
673 start_offset,
674 node,
675 branchidx,
676 )
677
678 def extend(self, extension):
679 return self._rest.extend(extension)
680
681 def slice(self, begin, end):
682 if begin < len(self._prefix):
683 acc = bytearray()
684 acc[:] = self._prefix[begin:end]
685 acc.extend(
686 self._rest[begin - len(self._prefix) : end - len(self._prefix)]
687 )
688 return acc
689 return self._rest[begin - len(self._prefix) : end - len(self._prefix)]
690
691
624 692 class revbranchcache:
625 693 """Persistent cache, mapping from revision number to branch name and close.
626 694 This is a low level cache, independent of filtering.
627 695
628 696 Branch names are stored in rbc-names in internal encoding separated by 0.
629 697 rbc-names is append-only, and each branch name is only stored once and will
630 698 thus have a unique index.
631 699
632 700 The branch info for each revision is stored in rbc-revs as constant size
633 701 records. The whole file is read into memory, but it is only 'parsed' on
634 702 demand. The file is usually append-only but will be truncated if repo
635 703 modification is detected.
636 704 The record for each revision contains the first 4 bytes of the
637 705 corresponding node hash, and the record is only used if it still matches.
638 706 Even a completely trashed rbc-revs fill thus still give the right result
639 707 while converging towards full recovery ... assuming no incorrectly matching
640 708 node hashes.
641 709 The record also contains 4 bytes where 31 bits contains the index of the
642 710 branch and the last bit indicate that it is a branch close commit.
643 711 The usage pattern for rbc-revs is thus somewhat similar to 00changelog.i
644 712 and will grow with it but be 1/8th of its size.
645 713 """
646 714
647 715 def __init__(self, repo, readonly=True):
648 716 assert repo.filtername is None
649 717 self._repo = repo
650 718 self._names = [] # branch names in local encoding with static index
651 self._rbcrevs = bytearray()
719 self._rbcrevs = rbcrevs(bytearray())
652 720 self._rbcsnameslen = 0 # length of names read at _rbcsnameslen
653 721 try:
654 722 bndata = repo.cachevfs.read(_rbcnames)
655 723 self._rbcsnameslen = len(bndata) # for verification before writing
656 724 if bndata:
657 725 self._names = [
658 726 encoding.tolocal(bn) for bn in bndata.split(b'\0')
659 727 ]
660 728 except (IOError, OSError):
661 729 if readonly:
662 730 # don't try to use cache - fall back to the slow path
663 731 self.branchinfo = self._branchinfo
664 732
665 733 if self._names:
666 734 try:
735 if repo.ui.configbool(b'format', b'mmap-revbranchcache'):
736 with repo.cachevfs(_rbcrevs) as fp:
737 data = util.buffer(util.mmapread(fp))
738 else:
667 739 data = repo.cachevfs.read(_rbcrevs)
668 self._rbcrevs[:] = data
740 self._rbcrevs = rbcrevs(data)
669 741 except (IOError, OSError) as inst:
670 742 repo.ui.debug(
671 743 b"couldn't read revision branch cache: %s\n"
672 744 % stringutil.forcebytestr(inst)
673 745 )
674 746 # remember number of good records on disk
675 747 self._rbcrevslen = min(
676 748 len(self._rbcrevs) // _rbcrecsize, len(repo.changelog)
677 749 )
678 750 if self._rbcrevslen == 0:
679 751 self._names = []
680 752 self._rbcnamescount = len(self._names) # number of names read at
681 753 # _rbcsnameslen
682 754
683 755 def _clear(self):
684 756 self._rbcsnameslen = 0
685 757 del self._names[:]
686 758 self._rbcnamescount = 0
687 759 self._rbcrevslen = len(self._repo.changelog)
688 self._rbcrevs = bytearray(self._rbcrevslen * _rbcrecsize)
760 self._rbcrevs = rbcrevs(bytearray(self._rbcrevslen * _rbcrecsize))
689 761 util.clearcachedproperty(self, b'_namesreverse')
690 762
691 763 @util.propertycache
692 764 def _namesreverse(self):
693 765 return {b: r for r, b in enumerate(self._names)}
694 766
695 767 def branchinfo(self, rev):
696 768 """Return branch name and close flag for rev, using and updating
697 769 persistent cache."""
698 770 changelog = self._repo.changelog
699 771 rbcrevidx = rev * _rbcrecsize
700 772
701 773 # avoid negative index, changelog.read(nullrev) is fast without cache
702 774 if rev == nullrev:
703 775 return changelog.branchinfo(rev)
704 776
705 777 # if requested rev isn't allocated, grow and cache the rev info
706 778 if len(self._rbcrevs) < rbcrevidx + _rbcrecsize:
707 779 return self._branchinfo(rev)
708 780
709 781 # fast path: extract data from cache, use it if node is matching
710 782 reponode = changelog.node(rev)[:_rbcnodelen]
711 cachenode, branchidx = unpack_from(
712 _rbcrecfmt, util.buffer(self._rbcrevs), rbcrevidx
713 )
783 cachenode, branchidx = self._rbcrevs.unpack_record(rbcrevidx)
714 784 close = bool(branchidx & _rbccloseflag)
715 785 if close:
716 786 branchidx &= _rbcbranchidxmask
717 787 if cachenode == b'\0\0\0\0':
718 788 pass
719 789 elif cachenode == reponode:
720 790 try:
721 791 return self._names[branchidx], close
722 792 except IndexError:
723 793 # recover from invalid reference to unknown branch
724 794 self._repo.ui.debug(
725 795 b"referenced branch names not found"
726 796 b" - rebuilding revision branch cache from scratch\n"
727 797 )
728 798 self._clear()
729 799 else:
730 800 # rev/node map has changed, invalidate the cache from here up
731 801 self._repo.ui.debug(
732 802 b"history modification detected - truncating "
733 803 b"revision branch cache to revision %d\n" % rev
734 804 )
735 805 truncate = rbcrevidx + _rbcrecsize
736 del self._rbcrevs[truncate:]
806 self._rbcrevs.truncate(truncate)
737 807 self._rbcrevslen = min(self._rbcrevslen, truncate)
738 808
739 809 # fall back to slow path and make sure it will be written to disk
740 810 return self._branchinfo(rev)
741 811
742 812 def _branchinfo(self, rev):
743 813 """Retrieve branch info from changelog and update _rbcrevs"""
744 814 changelog = self._repo.changelog
745 815 b, close = changelog.branchinfo(rev)
746 816 if b in self._namesreverse:
747 817 branchidx = self._namesreverse[b]
748 818 else:
749 819 branchidx = len(self._names)
750 820 self._names.append(b)
751 821 self._namesreverse[b] = branchidx
752 822 reponode = changelog.node(rev)
753 823 if close:
754 824 branchidx |= _rbccloseflag
755 825 self._setcachedata(rev, reponode, branchidx)
756 826 return b, close
757 827
758 828 def setdata(self, rev, changelogrevision):
759 829 """add new data information to the cache"""
760 830 branch, close = changelogrevision.branchinfo
761 831
762 832 if branch in self._namesreverse:
763 833 branchidx = self._namesreverse[branch]
764 834 else:
765 835 branchidx = len(self._names)
766 836 self._names.append(branch)
767 837 self._namesreverse[branch] = branchidx
768 838 if close:
769 839 branchidx |= _rbccloseflag
770 840 self._setcachedata(rev, self._repo.changelog.node(rev), branchidx)
771 841 # If no cache data were readable (non exists, bad permission, etc)
772 842 # the cache was bypassing itself by setting:
773 843 #
774 844 # self.branchinfo = self._branchinfo
775 845 #
776 846 # Since we now have data in the cache, we need to drop this bypassing.
777 847 if 'branchinfo' in vars(self):
778 848 del self.branchinfo
779 849
780 850 def _setcachedata(self, rev, node, branchidx):
781 851 """Writes the node's branch data to the in-memory cache data."""
782 852 if rev == nullrev:
783 853 return
784 854 rbcrevidx = rev * _rbcrecsize
785 requiredsize = rbcrevidx + _rbcrecsize
786 rbccur = len(self._rbcrevs)
787 if rbccur < requiredsize:
788 # bytearray doesn't allocate extra space at least in Python 3.7.
789 # When multiple changesets are added in a row, precise resize would
790 # result in quadratic complexity. Overallocate to compensate by
791 # use the classic doubling technique for dynamic arrays instead.
792 # If there was a gap in the map before, less space will be reserved.
793 self._rbcrevs.extend(b'\0' * max(_rbcmininc, requiredsize))
794 pack_into(_rbcrecfmt, self._rbcrevs, rbcrevidx, node, branchidx)
855 self._rbcrevs.pack_into(rbcrevidx, node, branchidx)
795 856 self._rbcrevslen = min(self._rbcrevslen, rev)
796 857
797 858 tr = self._repo.currenttransaction()
798 859 if tr:
799 860 tr.addfinalize(b'write-revbranchcache', self.write)
800 861
801 862 def write(self, tr=None):
802 863 """Save branch cache if it is dirty."""
803 864 repo = self._repo
804 865 wlock = None
805 866 step = b''
806 867 try:
807 868 # write the new names
808 869 if self._rbcnamescount < len(self._names):
809 870 wlock = repo.wlock(wait=False)
810 871 step = b' names'
811 872 self._writenames(repo)
812 873
813 874 # write the new revs
814 875 start = self._rbcrevslen * _rbcrecsize
815 876 if start != len(self._rbcrevs):
816 877 step = b''
817 878 if wlock is None:
818 879 wlock = repo.wlock(wait=False)
819 880 self._writerevs(repo, start)
820 881
821 882 except (IOError, OSError, error.Abort, error.LockError) as inst:
822 883 repo.ui.debug(
823 884 b"couldn't write revision branch cache%s: %s\n"
824 885 % (step, stringutil.forcebytestr(inst))
825 886 )
826 887 finally:
827 888 if wlock is not None:
828 889 wlock.release()
829 890
830 891 def _writenames(self, repo):
831 892 """write the new branch names to revbranchcache"""
832 893 if self._rbcnamescount != 0:
833 894 f = repo.cachevfs.open(_rbcnames, b'ab')
834 895 if f.tell() == self._rbcsnameslen:
835 896 f.write(b'\0')
836 897 else:
837 898 f.close()
838 899 repo.ui.debug(b"%s changed - rewriting it\n" % _rbcnames)
839 900 self._rbcnamescount = 0
840 901 self._rbcrevslen = 0
841 902 if self._rbcnamescount == 0:
842 903 # before rewriting names, make sure references are removed
843 904 repo.cachevfs.unlinkpath(_rbcrevs, ignoremissing=True)
844 905 f = repo.cachevfs.open(_rbcnames, b'wb')
845 906 f.write(
846 907 b'\0'.join(
847 908 encoding.fromlocal(b)
848 909 for b in self._names[self._rbcnamescount :]
849 910 )
850 911 )
851 912 self._rbcsnameslen = f.tell()
852 913 f.close()
853 914 self._rbcnamescount = len(self._names)
854 915
855 916 def _writerevs(self, repo, start):
856 917 """write the new revs to revbranchcache"""
857 918 revs = min(len(repo.changelog), len(self._rbcrevs) // _rbcrecsize)
858 919 with repo.cachevfs.open(_rbcrevs, b'ab') as f:
859 920 if f.tell() != start:
860 921 repo.ui.debug(
861 922 b"truncating cache/%s to %d\n" % (_rbcrevs, start)
862 923 )
863 924 f.seek(start)
864 925 if f.tell() != start:
865 926 start = 0
866 927 f.seek(start)
867 928 f.truncate()
868 929 end = revs * _rbcrecsize
869 f.write(self._rbcrevs[start:end])
930 f.write(self._rbcrevs.slice(start, end))
870 931 self._rbcrevslen = revs
@@ -1,2915 +1,2920 b''
1 1 # configitems.toml - centralized declaration of configuration options
2 2 #
3 3 # This file contains declarations of the core Mercurial configuration options.
4 4 #
5 5 # # Structure
6 6 #
7 7 # items: array of config items
8 8 # templates: mapping of template name to template declaration
9 9 # template-applications: array of template applications
10 10 #
11 11 # # Elements
12 12 #
13 13 # ## Item
14 14 #
15 15 # Declares a core Mercurial option.
16 16 #
17 17 # - section: string (required)
18 18 # - name: string (required)
19 19 # - default-type: boolean, changes how `default` is read
20 20 # - default: any
21 21 # - generic: boolean
22 22 # - priority: integer, only if `generic` is true
23 23 # - alias: list of 2-tuples of strings
24 24 # - experimental: boolean
25 25 # - documentation: string
26 26 # - in_core_extension: string
27 27 #
28 28 # ## Template
29 29 #
30 30 # Declares a group of options to be re-used for multiple sections.
31 31 #
32 32 # - all the same fields as `Item`, except `section` and `name`
33 33 # - `suffix` (string, required)
34 34 #
35 35 # ## Template applications
36 36 #
37 37 # Uses a `Template` to instanciate its options in a given section.
38 38 #
39 39 # - template: string (required, must match a `Template` name)
40 40 # - section: string (required)
41 41
42 42 [[items]]
43 43 section = "alias"
44 44 name = ".*"
45 45 default-type = "dynamic"
46 46 generic = true
47 47
48 48 [[items]]
49 49 section = "auth"
50 50 name = "cookiefile"
51 51
52 52 # bookmarks.pushing: internal hack for discovery
53 53 [[items]]
54 54 section = "bookmarks"
55 55 name = "pushing"
56 56 default-type = "list_type"
57 57
58 58 # bundle.mainreporoot: internal hack for bundlerepo
59 59 [[items]]
60 60 section = "bundle"
61 61 name = "mainreporoot"
62 62 default = ""
63 63
64 64 [[items]]
65 65 section = "censor"
66 66 name = "policy"
67 67 default = "abort"
68 68 experimental = true
69 69
70 70 [[items]]
71 71 section = "chgserver"
72 72 name = "idletimeout"
73 73 default = 3600
74 74
75 75 [[items]]
76 76 section = "chgserver"
77 77 name = "skiphash"
78 78 default = false
79 79
80 80 [[items]]
81 81 section = "cmdserver"
82 82 name = "log"
83 83
84 84 [[items]]
85 85 section = "cmdserver"
86 86 name = "max-log-files"
87 87 default = 7
88 88
89 89 [[items]]
90 90 section = "cmdserver"
91 91 name = "max-log-size"
92 92 default = "1 MB"
93 93
94 94 [[items]]
95 95 section = "cmdserver"
96 96 name = "max-repo-cache"
97 97 default = 0
98 98 experimental = true
99 99
100 100 [[items]]
101 101 section = "cmdserver"
102 102 name = "message-encodings"
103 103 default-type = "list_type"
104 104
105 105 [[items]]
106 106 section = "cmdserver"
107 107 name = "shutdown-on-interrupt"
108 108 default = true
109 109
110 110 [[items]]
111 111 section = "cmdserver"
112 112 name = "track-log"
113 113 default-type = "lambda"
114 114 default = [ "chgserver", "cmdserver", "repocache",]
115 115
116 116 [[items]]
117 117 section = "color"
118 118 name = ".*"
119 119 generic = true
120 120
121 121 [[items]]
122 122 section = "color"
123 123 name = "mode"
124 124 default = "auto"
125 125
126 126 [[items]]
127 127 section = "color"
128 128 name = "pagermode"
129 129 default-type = "dynamic"
130 130
131 131 [[items]]
132 132 section = "command-templates"
133 133 name = "graphnode"
134 134 alias = [["ui", "graphnodetemplate"]]
135 135
136 136 [[items]]
137 137 section = "command-templates"
138 138 name = "log"
139 139 alias = [["ui", "logtemplate"]]
140 140
141 141 [[items]]
142 142 section = "command-templates"
143 143 name = "mergemarker"
144 144 default = '{node|short} {ifeq(tags, "tip", "", ifeq(tags, "", "", "{tags} "))}{if(bookmarks, "{bookmarks} ")}{ifeq(branch, "default", "", "{branch} ")}- {author|user}: {desc|firstline}'
145 145 alias = [["ui", "mergemarkertemplate"]]
146 146
147 147 [[items]]
148 148 section = "command-templates"
149 149 name = "oneline-summary"
150 150
151 151 [[items]]
152 152 section = "command-templates"
153 153 name = "oneline-summary.*"
154 154 default-type = "dynamic"
155 155 generic = true
156 156
157 157 [[items]]
158 158 section = "command-templates"
159 159 name = "pre-merge-tool-output"
160 160 alias = [["ui", "pre-merge-tool-output-template"]]
161 161
162 162 [[items]]
163 163 section = "commands"
164 164 name = "commit.post-status"
165 165 default = false
166 166
167 167 [[items]]
168 168 section = "commands"
169 169 name = "grep.all-files"
170 170 default = false
171 171 experimental = true
172 172
173 173 [[items]]
174 174 section = "commands"
175 175 name = "merge.require-rev"
176 176 default = false
177 177
178 178 [[items]]
179 179 section = "commands"
180 180 name = "push.require-revs"
181 181 default = false
182 182
183 183 # Rebase related configuration moved to core because other extension are doing
184 184 # strange things. For example, shelve import the extensions to reuse some bit
185 185 # without formally loading it.
186 186 [[items]]
187 187 section = "commands"
188 188 name = "rebase.requiredest"
189 189 default = false
190 190
191 191 [[items]]
192 192 section = "commands"
193 193 name = "resolve.confirm"
194 194 default = false
195 195
196 196 [[items]]
197 197 section = "commands"
198 198 name = "resolve.explicit-re-merge"
199 199 default = false
200 200
201 201 [[items]]
202 202 section = "commands"
203 203 name = "resolve.mark-check"
204 204 default = "none"
205 205
206 206 [[items]]
207 207 section = "commands"
208 208 name = "show.aliasprefix"
209 209 default-type = "list_type"
210 210
211 211 [[items]]
212 212 section = "commands"
213 213 name = "status.relative"
214 214 default = false
215 215
216 216 [[items]]
217 217 section = "commands"
218 218 name = "status.skipstates"
219 219 default = []
220 220 experimental = true
221 221
222 222 [[items]]
223 223 section = "commands"
224 224 name = "status.terse"
225 225 default = ""
226 226
227 227 [[items]]
228 228 section = "commands"
229 229 name = "status.verbose"
230 230 default = false
231 231
232 232 [[items]]
233 233 section = "commands"
234 234 name = "update.check"
235 235
236 236 [[items]]
237 237 section = "commands"
238 238 name = "update.requiredest"
239 239 default = false
240 240
241 241 [[items]]
242 242 section = "committemplate"
243 243 name = ".*"
244 244 generic = true
245 245
246 246 [[items]]
247 247 section = "convert"
248 248 name = "bzr.saverev"
249 249 default = true
250 250
251 251 [[items]]
252 252 section = "convert"
253 253 name = "cvsps.cache"
254 254 default = true
255 255
256 256 [[items]]
257 257 section = "convert"
258 258 name = "cvsps.fuzz"
259 259 default = 60
260 260
261 261 [[items]]
262 262 section = "convert"
263 263 name = "cvsps.logencoding"
264 264
265 265 [[items]]
266 266 section = "convert"
267 267 name = "cvsps.mergefrom"
268 268
269 269 [[items]]
270 270 section = "convert"
271 271 name = "cvsps.mergeto"
272 272
273 273 [[items]]
274 274 section = "convert"
275 275 name = "git.committeractions"
276 276 default-type = "lambda"
277 277 default = [ "messagedifferent",]
278 278
279 279 [[items]]
280 280 section = "convert"
281 281 name = "git.extrakeys"
282 282 default-type = "list_type"
283 283
284 284 [[items]]
285 285 section = "convert"
286 286 name = "git.findcopiesharder"
287 287 default = false
288 288
289 289 [[items]]
290 290 section = "convert"
291 291 name = "git.remoteprefix"
292 292 default = "remote"
293 293
294 294 [[items]]
295 295 section = "convert"
296 296 name = "git.renamelimit"
297 297 default = 400
298 298
299 299 [[items]]
300 300 section = "convert"
301 301 name = "git.saverev"
302 302 default = true
303 303
304 304 [[items]]
305 305 section = "convert"
306 306 name = "git.similarity"
307 307 default = 50
308 308
309 309 [[items]]
310 310 section = "convert"
311 311 name = "git.skipsubmodules"
312 312 default = false
313 313
314 314 [[items]]
315 315 section = "convert"
316 316 name = "hg.clonebranches"
317 317 default = false
318 318
319 319 [[items]]
320 320 section = "convert"
321 321 name = "hg.ignoreerrors"
322 322 default = false
323 323
324 324 [[items]]
325 325 section = "convert"
326 326 name = "hg.preserve-hash"
327 327 default = false
328 328
329 329 [[items]]
330 330 section = "convert"
331 331 name = "hg.revs"
332 332
333 333 [[items]]
334 334 section = "convert"
335 335 name = "hg.saverev"
336 336 default = false
337 337
338 338 [[items]]
339 339 section = "convert"
340 340 name = "hg.sourcename"
341 341
342 342 [[items]]
343 343 section = "convert"
344 344 name = "hg.startrev"
345 345
346 346 [[items]]
347 347 section = "convert"
348 348 name = "hg.tagsbranch"
349 349 default = "default"
350 350
351 351 [[items]]
352 352 section = "convert"
353 353 name = "hg.usebranchnames"
354 354 default = true
355 355
356 356 [[items]]
357 357 section = "convert"
358 358 name = "ignoreancestorcheck"
359 359 default = false
360 360 experimental = true
361 361
362 362 [[items]]
363 363 section = "convert"
364 364 name = "localtimezone"
365 365 default = false
366 366
367 367 [[items]]
368 368 section = "convert"
369 369 name = "p4.encoding"
370 370 default-type = "dynamic"
371 371
372 372 [[items]]
373 373 section = "convert"
374 374 name = "p4.startrev"
375 375 default = 0
376 376
377 377 [[items]]
378 378 section = "convert"
379 379 name = "skiptags"
380 380 default = false
381 381
382 382 [[items]]
383 383 section = "convert"
384 384 name = "svn.branches"
385 385
386 386 [[items]]
387 387 section = "convert"
388 388 name = "svn.dangerous-set-commit-dates"
389 389 default = false
390 390
391 391 [[items]]
392 392 section = "convert"
393 393 name = "svn.debugsvnlog"
394 394 default = true
395 395
396 396 [[items]]
397 397 section = "convert"
398 398 name = "svn.startrev"
399 399 default = 0
400 400
401 401 [[items]]
402 402 section = "convert"
403 403 name = "svn.tags"
404 404
405 405 [[items]]
406 406 section = "convert"
407 407 name = "svn.trunk"
408 408
409 409 [[items]]
410 410 section = "debug"
411 411 name = "bundling-stats"
412 412 default = false
413 413 documentation = "Display extra information about the bundling process."
414 414
415 415 [[items]]
416 416 section = "debug"
417 417 name = "dirstate.delaywrite"
418 418 default = 0
419 419
420 420 [[items]]
421 421 section = "debug"
422 422 name = "revlog.debug-delta"
423 423 default = false
424 424
425 425 [[items]]
426 426 section = "debug"
427 427 name = "revlog.verifyposition.changelog"
428 428 default = ""
429 429
430 430 [[items]]
431 431 section = "debug"
432 432 name = "unbundling-stats"
433 433 default = false
434 434 documentation = "Display extra information about the unbundling process."
435 435
436 436 [[items]]
437 437 section = "defaults"
438 438 name = ".*"
439 439 generic = true
440 440
441 441 [[items]]
442 442 section = "devel"
443 443 name = "all-warnings"
444 444 default = false
445 445
446 446 [[items]]
447 447 section = "devel"
448 448 name = "bundle.delta"
449 449 default = ""
450 450
451 451 [[items]]
452 452 section = "devel"
453 453 name = "bundle2.debug"
454 454 default = false
455 455
456 456 [[items]]
457 457 section = "devel"
458 458 name = "cache-vfs"
459 459
460 460 [[items]]
461 461 section = "devel"
462 462 name = "check-locks"
463 463 default = false
464 464
465 465 [[items]]
466 466 section = "devel"
467 467 name = "check-relroot"
468 468 default = false
469 469
470 470 [[items]]
471 471 section = "devel"
472 472 name = "copy-tracing.multi-thread"
473 473 default = true
474 474
475 475 # Track copy information for all files, not just "added" ones (very slow)
476 476 [[items]]
477 477 section = "devel"
478 478 name = "copy-tracing.trace-all-files"
479 479 default = false
480 480
481 481 [[items]]
482 482 section = "devel"
483 483 name = "debug.abort-update"
484 484 default = false
485 485 documentation = """If true, then any merge with the working copy, \
486 486 e.g. [hg update], will be aborted after figuring out what needs to be done, \
487 487 but before spawning the parallel worker."""
488 488
489 489 [[items]]
490 490 section = "devel"
491 491 name = "debug.copies"
492 492 default = false
493 493
494 494 [[items]]
495 495 section = "devel"
496 496 name = "debug.extensions"
497 497 default = false
498 498
499 499 [[items]]
500 500 section = "devel"
501 501 name = "debug.peer-request"
502 502 default = false
503 503
504 504 [[items]]
505 505 section = "devel"
506 506 name = "debug.repo-filters"
507 507 default = false
508 508
509 509 [[items]]
510 510 section = "devel"
511 511 name = "default-date"
512 512
513 513 [[items]]
514 514 section = "devel"
515 515 name = "deprec-warn"
516 516 default = false
517 517
518 518 # possible values:
519 519 # - auto (the default)
520 520 # - force-append
521 521 # - force-new
522 522 [[items]]
523 523 section = "devel"
524 524 name = "dirstate.v2.data_update_mode"
525 525 default = "auto"
526 526
527 527 [[items]]
528 528 section = "devel"
529 529 name = "disableloaddefaultcerts"
530 530 default = false
531 531
532 532 [[items]]
533 533 section = "devel"
534 534 name = "discovery.exchange-heads"
535 535 default = true
536 536 documentation = """If false, the discovery will not start with remote \
537 537 head fetching and local head querying."""
538 538
539 539 [[items]]
540 540 section = "devel"
541 541 name = "discovery.grow-sample"
542 542 default = true
543 543 documentation = """If false, the sample size used in set discovery \
544 544 will not be increased through the process."""
545 545
546 546 [[items]]
547 547 section = "devel"
548 548 name = "discovery.grow-sample.dynamic"
549 549 default = true
550 550 documentation = """If true, the default, the sample size is adapted to the shape \
551 551 of the undecided set. It is set to the max of:
552 552 `<target-size>, len(roots(undecided)), len(heads(undecided))`"""
553 553
554 554 [[items]]
555 555 section = "devel"
556 556 name = "discovery.grow-sample.rate"
557 557 default = 1.05
558 558 documentation = "Controls the rate at which the sample grows."
559 559
560 560 [[items]]
561 561 section = "devel"
562 562 name = "discovery.randomize"
563 563 default = true
564 564 documentation = """If false, random samplings during discovery are deterministic. \
565 565 It is meant for integration tests."""
566 566
567 567 [[items]]
568 568 section = "devel"
569 569 name = "discovery.sample-size"
570 570 default = 200
571 571 documentation = "Controls the initial size of the discovery sample."
572 572
573 573 [[items]]
574 574 section = "devel"
575 575 name = "discovery.sample-size.initial"
576 576 default = 100
577 577 documentation = "Controls the initial size of the discovery for initial change."
578 578
579 579 [[items]]
580 580 section = "devel"
581 581 name = "legacy.exchange"
582 582 default-type = "list_type"
583 583
584 584 [[items]]
585 585 section = "devel"
586 586 name = "persistent-nodemap"
587 587 default = false
588 588 documentation = """When true, revlogs use a special reference version of the \
589 589 nodemap, that is not performant but is "known" to behave properly."""
590 590
591 591 [[items]]
592 592 section = "devel"
593 593 name = "server-insecure-exact-protocol"
594 594 default = ""
595 595
596 596 [[items]]
597 597 section = "devel"
598 598 name = "servercafile"
599 599 default = ""
600 600
601 601 [[items]]
602 602 section = "devel"
603 603 name = "serverexactprotocol"
604 604 default = ""
605 605
606 606 [[items]]
607 607 section = "devel"
608 608 name = "serverrequirecert"
609 609 default = false
610 610
611 611 [[items]]
612 612 section = "devel"
613 613 name = "strip-obsmarkers"
614 614 default = true
615 615
616 616 [[items]]
617 617 section = 'devel'
618 618 name = 'sync.status.pre-dirstate-write-file'
619 619 documentation = """
620 620 Makes the status algorithm wait for the existence of this file \
621 621 (or until a timeout of `devel.sync.status.pre-dirstate-write-file-timeout` \
622 622 seconds) before taking the lock and writing the dirstate. \
623 623 Status signals that it's ready to wait by creating a file \
624 624 with the same name + `.waiting`. \
625 625 Useful when testing race conditions."""
626 626
627 627 [[items]]
628 628 section = 'devel'
629 629 name = 'sync.status.pre-dirstate-write-file-timeout'
630 630 default=2
631 631
632 632 [[items]]
633 633 section = 'devel'
634 634 name = 'sync.dirstate.post-docket-read-file'
635 635
636 636 [[items]]
637 637 section = 'devel'
638 638 name = 'sync.dirstate.post-docket-read-file-timeout'
639 639 default=2
640 640
641 641 [[items]]
642 642 section = 'devel'
643 643 name = 'sync.dirstate.pre-read-file'
644 644
645 645 [[items]]
646 646 section = 'devel'
647 647 name = 'sync.dirstate.pre-read-file-timeout'
648 648 default=2
649 649
650 650 [[items]]
651 651 section = "devel"
652 652 name = "user.obsmarker"
653 653
654 654 [[items]]
655 655 section = "devel"
656 656 name = "warn-config"
657 657
658 658 [[items]]
659 659 section = "devel"
660 660 name = "warn-config-default"
661 661
662 662 [[items]]
663 663 section = "devel"
664 664 name = "warn-config-unknown"
665 665
666 666 [[items]]
667 667 section = "devel"
668 668 name = "warn-empty-changegroup"
669 669 default = false
670 670
671 671 [[items]]
672 672 section = "diff"
673 673 name = "merge"
674 674 default = false
675 675 experimental = true
676 676
677 677 [[items]]
678 678 section = "email"
679 679 name = "bcc"
680 680
681 681 [[items]]
682 682 section = "email"
683 683 name = "cc"
684 684
685 685 [[items]]
686 686 section = "email"
687 687 name = "charsets"
688 688 default-type = "list_type"
689 689
690 690 [[items]]
691 691 section = "email"
692 692 name = "from"
693 693
694 694 [[items]]
695 695 section = "email"
696 696 name = "method"
697 697 default = "smtp"
698 698
699 699 [[items]]
700 700 section = "email"
701 701 name = "reply-to"
702 702
703 703 [[items]]
704 704 section = "email"
705 705 name = "to"
706 706
707 707 [[items]]
708 708 section = "experimental"
709 709 name = "archivemetatemplate"
710 710 default-type = "dynamic"
711 711
712 712 [[items]]
713 713 section = "experimental"
714 714 name = "auto-publish"
715 715 default = "publish"
716 716
717 717 [[items]]
718 718 section = "experimental"
719 719 name = "bundle-phases"
720 720 default = false
721 721
722 722 [[items]]
723 723 section = "experimental"
724 724 name = "bundle2-advertise"
725 725 default = true
726 726
727 727 [[items]]
728 728 section = "experimental"
729 729 name = "bundle2-output-capture"
730 730 default = false
731 731
732 732 [[items]]
733 733 section = "experimental"
734 734 name = "bundle2.pushback"
735 735 default = false
736 736
737 737 [[items]]
738 738 section = "experimental"
739 739 name = "bundle2lazylocking"
740 740 default = false
741 741
742 742 [[items]]
743 743 section = "experimental"
744 744 name = "bundlecomplevel"
745 745
746 746 [[items]]
747 747 section = "experimental"
748 748 name = "bundlecomplevel.bzip2"
749 749
750 750 [[items]]
751 751 section = "experimental"
752 752 name = "bundlecomplevel.gzip"
753 753
754 754 [[items]]
755 755 section = "experimental"
756 756 name = "bundlecomplevel.none"
757 757
758 758 [[items]]
759 759 section = "experimental"
760 760 name = "bundlecomplevel.zstd"
761 761
762 762 [[items]]
763 763 section = "experimental"
764 764 name = "bundlecompthreads"
765 765
766 766 [[items]]
767 767 section = "experimental"
768 768 name = "bundlecompthreads.bzip2"
769 769
770 770 [[items]]
771 771 section = "experimental"
772 772 name = "bundlecompthreads.gzip"
773 773
774 774 [[items]]
775 775 section = "experimental"
776 776 name = "bundlecompthreads.none"
777 777
778 778 [[items]]
779 779 section = "experimental"
780 780 name = "bundlecompthreads.zstd"
781 781
782 782 [[items]]
783 783 section = "experimental"
784 784 name = "changegroup3"
785 785 default = true
786 786
787 787 [[items]]
788 788 section = "experimental"
789 789 name = "changegroup4"
790 790 default = false
791 791
792 792 # might remove rank configuration once the computation has no impact
793 793 [[items]]
794 794 section = "experimental"
795 795 name = "changelog-v2.compute-rank"
796 796 default = true
797 797
798 798 [[items]]
799 799 section = "experimental"
800 800 name = "cleanup-as-archived"
801 801 default = false
802 802
803 803 [[items]]
804 804 section = "experimental"
805 805 name = "clientcompressionengines"
806 806 default-type = "list_type"
807 807
808 808 [[items]]
809 809 section = "experimental"
810 810 name = "copies.read-from"
811 811 default = "filelog-only"
812 812
813 813 [[items]]
814 814 section = "experimental"
815 815 name = "copies.write-to"
816 816 default = "filelog-only"
817 817
818 818 [[items]]
819 819 section = "experimental"
820 820 name = "copytrace"
821 821 default = "on"
822 822
823 823 [[items]]
824 824 section = "experimental"
825 825 name = "copytrace.movecandidateslimit"
826 826 default = 100
827 827
828 828 [[items]]
829 829 section = "experimental"
830 830 name = "copytrace.sourcecommitlimit"
831 831 default = 100
832 832
833 833 [[items]]
834 834 section = "experimental"
835 835 name = "crecordtest"
836 836
837 837 [[items]]
838 838 section = "experimental"
839 839 name = "directaccess"
840 840 default = false
841 841
842 842 [[items]]
843 843 section = "experimental"
844 844 name = "directaccess.revnums"
845 845 default = false
846 846
847 847 [[items]]
848 848 section = "experimental"
849 849 name = "editortmpinhg"
850 850 default = false
851 851
852 852 [[items]]
853 853 section = "experimental"
854 854 name = "evolution"
855 855 default-type = "list_type"
856 856
857 857 [[items]]
858 858 section = "experimental"
859 859 name = "evolution.allowdivergence"
860 860 default = false
861 861 alias = [["experimental", "allowdivergence"]]
862 862
863 863 [[items]]
864 864 section = "experimental"
865 865 name = "evolution.allowunstable"
866 866
867 867 [[items]]
868 868 section = "experimental"
869 869 name = "evolution.bundle-obsmarker"
870 870 default = false
871 871
872 872 [[items]]
873 873 section = "experimental"
874 874 name = "evolution.bundle-obsmarker:mandatory"
875 875 default = true
876 876
877 877 [[items]]
878 878 section = "experimental"
879 879 name = "evolution.createmarkers"
880 880
881 881 [[items]]
882 882 section = "experimental"
883 883 name = "evolution.effect-flags"
884 884 default = true
885 885 alias = [["experimental", "effect-flags"]]
886 886
887 887 [[items]]
888 888 section = "experimental"
889 889 name = "evolution.exchange"
890 890
891 891 [[items]]
892 892 section = "experimental"
893 893 name = "evolution.report-instabilities"
894 894 default = true
895 895
896 896 [[items]]
897 897 section = "experimental"
898 898 name = "evolution.track-operation"
899 899 default = true
900 900
901 901 [[items]]
902 902 section = "experimental"
903 903 name = "exportableenviron"
904 904 default-type = "list_type"
905 905
906 906 [[items]]
907 907 section = "experimental"
908 908 name = "extendedheader.index"
909 909
910 910 [[items]]
911 911 section = "experimental"
912 912 name = "extendedheader.similarity"
913 913 default = false
914 914
915 915 [[items]]
916 916 section = "experimental"
917 917 name = "extra-filter-revs"
918 918 documentation = """Repo-level config to prevent a revset from being visible.
919 919 The target use case is to use `share` to expose different subsets of the same \
920 920 repository, especially server side. See also `server.view`."""
921 921
922 922 [[items]]
923 923 section = "experimental"
924 924 name = "graphshorten"
925 925 default = false
926 926
927 927 [[items]]
928 928 section = "experimental"
929 929 name = "graphstyle.grandparent"
930 930 default-type = "dynamic"
931 931
932 932 [[items]]
933 933 section = "experimental"
934 934 name = "graphstyle.missing"
935 935 default-type = "dynamic"
936 936
937 937 [[items]]
938 938 section = "experimental"
939 939 name = "graphstyle.parent"
940 940 default-type = "dynamic"
941 941
942 942 [[items]]
943 943 section = "experimental"
944 944 name = "hook-track-tags"
945 945 default = false
946 946
947 947 [[items]]
948 948 section = "experimental"
949 949 name = "httppostargs"
950 950 default = false
951 951
952 952 [[items]]
953 953 section = "experimental"
954 954 name = "log.topo"
955 955 default = false
956 956
957 957 [[items]]
958 958 section = "experimental"
959 959 name = "maxdeltachainspan"
960 960 default = -1
961 961
962 962 [[items]]
963 963 section = "experimental"
964 964 name = "merge-track-salvaged"
965 965 default = false
966 966 documentation = """Tracks files which were undeleted (merge might delete them \
967 967 but we explicitly kept/undeleted them) and creates new filenodes for them."""
968 968
969 969 [[items]]
970 970 section = "experimental"
971 971 name = "merge.checkpathconflicts"
972 972 default = false
973 973
974 974 [[items]]
975 975 section = "experimental"
976 976 name = "mmapindexthreshold"
977 977
978 978 [[items]]
979 979 section = "experimental"
980 980 name = "narrow"
981 981 default = false
982 982
983 983 [[items]]
984 984 section = "experimental"
985 985 name = "nointerrupt"
986 986 default = false
987 987
988 988 [[items]]
989 989 section = "experimental"
990 990 name = "nointerrupt-interactiveonly"
991 991 default = true
992 992
993 993 [[items]]
994 994 section = "experimental"
995 995 name = "nonnormalparanoidcheck"
996 996 default = false
997 997
998 998 [[items]]
999 999 section = "experimental"
1000 1000 name = "obsmarkers-exchange-debug"
1001 1001 default = false
1002 1002
1003 1003 [[items]]
1004 1004 section = "experimental"
1005 1005 name = "rebaseskipobsolete"
1006 1006 default = true
1007 1007
1008 1008 [[items]]
1009 1009 section = "experimental"
1010 1010 name = "remotenames"
1011 1011 default = false
1012 1012
1013 1013 [[items]]
1014 1014 section = "experimental"
1015 1015 name = "removeemptydirs"
1016 1016 default = true
1017 1017
1018 1018 [[items]]
1019 1019 section = "experimental"
1020 1020 name = "revert.interactive.select-to-keep"
1021 1021 default = false
1022 1022
1023 1023 [[items]]
1024 1024 section = "experimental"
1025 1025 name = "revisions.disambiguatewithin"
1026 1026
1027 1027 [[items]]
1028 1028 section = "experimental"
1029 1029 name = "revisions.prefixhexnode"
1030 1030 default = false
1031 1031
1032 1032 # "out of experimental" todo list.
1033 1033 #
1034 1034 # * include management of a persistent nodemap in the main docket
1035 1035 # * enforce a "no-truncate" policy for mmap safety
1036 1036 # - for censoring operation
1037 1037 # - for stripping operation
1038 1038 # - for rollback operation
1039 1039 # * proper streaming (race free) of the docket file
1040 1040 # * track garbage data to evemtually allow rewriting -existing- sidedata.
1041 1041 # * Exchange-wise, we will also need to do something more efficient than
1042 1042 # keeping references to the affected revlogs, especially memory-wise when
1043 1043 # rewriting sidedata.
1044 1044 # * introduce a proper solution to reduce the number of filelog related files.
1045 1045 # * use caching for reading sidedata (similar to what we do for data).
1046 1046 # * no longer set offset=0 if sidedata_size=0 (simplify cutoff computation).
1047 1047 # * Improvement to consider
1048 1048 # - avoid compression header in chunk using the default compression?
1049 1049 # - forbid "inline" compression mode entirely?
1050 1050 # - split the data offset and flag field (the 2 bytes save are mostly trouble)
1051 1051 # - keep track of uncompressed -chunk- size (to preallocate memory better)
1052 1052 # - keep track of chain base or size (probably not that useful anymore)
1053 1053 [[items]]
1054 1054 section = "experimental"
1055 1055 name = "revlogv2"
1056 1056
1057 1057 [[items]]
1058 1058 section = "experimental"
1059 1059 name = "rust.index"
1060 1060 default = false
1061 1061
1062 1062 [[items]]
1063 1063 section = "experimental"
1064 1064 name = "server.allow-hidden-access"
1065 1065 default-type = "list_type"
1066 1066
1067 1067 [[items]]
1068 1068 section = "experimental"
1069 1069 name = "server.filesdata.recommended-batch-size"
1070 1070 default = 50000
1071 1071
1072 1072 [[items]]
1073 1073 section = "experimental"
1074 1074 name = "server.manifestdata.recommended-batch-size"
1075 1075 default = 100000
1076 1076
1077 1077 [[items]]
1078 1078 section = "experimental"
1079 1079 name = "server.stream-narrow-clones"
1080 1080 default = false
1081 1081
1082 1082 [[items]]
1083 1083 section = "experimental"
1084 1084 name = "single-head-per-branch"
1085 1085 default = false
1086 1086
1087 1087 [[items]]
1088 1088 section = "experimental"
1089 1089 name = "single-head-per-branch:account-closed-heads"
1090 1090 default = false
1091 1091
1092 1092 [[items]]
1093 1093 section = "experimental"
1094 1094 name = "single-head-per-branch:public-changes-only"
1095 1095 default = false
1096 1096
1097 1097 [[items]]
1098 1098 section = "experimental"
1099 1099 name = "sparse-read"
1100 1100 default = false
1101 1101
1102 1102 [[items]]
1103 1103 section = "experimental"
1104 1104 name = "sparse-read.density-threshold"
1105 1105 default = 0.5
1106 1106
1107 1107 [[items]]
1108 1108 section = "experimental"
1109 1109 name = "sparse-read.min-gap-size"
1110 1110 default = "65K"
1111 1111
1112 1112 [[items]]
1113 1113 section = "experimental"
1114 1114 name = "stream-v3"
1115 1115 default = false
1116 1116
1117 1117 [[items]]
1118 1118 section = "experimental"
1119 1119 name = "treemanifest"
1120 1120 default = false
1121 1121
1122 1122 [[items]]
1123 1123 section = "experimental"
1124 1124 name = "update.atomic-file"
1125 1125 default = false
1126 1126
1127 1127 [[items]]
1128 1128 section = "experimental"
1129 1129 name = "web.full-garbage-collection-rate"
1130 1130 default = 1 # still forcing a full collection on each request
1131 1131
1132 1132 [[items]]
1133 1133 section = "experimental"
1134 1134 name = "worker.repository-upgrade"
1135 1135 default = false
1136 1136
1137 1137 [[items]]
1138 1138 section = "experimental"
1139 1139 name = "worker.wdir-get-thread-safe"
1140 1140 default = false
1141 1141
1142 1142 [[items]]
1143 1143 section = "experimental"
1144 1144 name = "xdiff"
1145 1145 default = false
1146 1146
1147 1147 [[items]]
1148 1148 section = "extdata"
1149 1149 name = ".*"
1150 1150 generic = true
1151 1151
1152 1152 [[items]]
1153 1153 section = "extensions"
1154 1154 name = "[^:]*"
1155 1155 generic = true
1156 1156
1157 1157 [[items]]
1158 1158 section = "extensions"
1159 1159 name = "[^:]*:required"
1160 1160 default = false
1161 1161 generic = true
1162 1162
1163 1163 [[items]]
1164 1164 section = "format"
1165 1165 name = "bookmarks-in-store"
1166 1166 default = false
1167 1167
1168 1168 [[items]]
1169 1169 section = "format"
1170 1170 name = "chunkcachesize"
1171 1171 experimental = true
1172 1172
1173 1173 [[items]]
1174 1174 section = "format"
1175 1175 name = "dotencode"
1176 1176 default = true
1177 1177
1178 1178 # The interaction between the archived phase and obsolescence markers needs to
1179 1179 # be sorted out before wider usage of this are to be considered.
1180 1180 #
1181 1181 # At the time this message is written, behavior when archiving obsolete
1182 1182 # changeset differ significantly from stripping. As part of stripping, we also
1183 1183 # remove the obsolescence marker associated to the stripped changesets,
1184 1184 # revealing the precedecessors changesets when applicable. When archiving, we
1185 1185 # don't touch the obsolescence markers, keeping everything hidden. This can
1186 1186 # result in quite confusing situation for people combining exchanging draft
1187 1187 # with the archived phases. As some markers needed by others may be skipped
1188 1188 # during exchange.
1189 1189 [[items]]
1190 1190 section = "format"
1191 1191 name = "exp-archived-phase"
1192 1192 default = false
1193 1193 experimental = true
1194 1194
1195 1195 # Experimental TODOs:
1196 1196 #
1197 1197 # * Same as for revlogv2 (but for the reduction of the number of files)
1198 1198 # * Actually computing the rank of changesets
1199 1199 # * Improvement to investigate
1200 1200 # - storing .hgtags fnode
1201 1201 # - storing branch related identifier
1202 1202 [[items]]
1203 1203 section = "format"
1204 1204 name = "exp-use-changelog-v2"
1205 1205 experimental = true
1206 1206
1207 1207 [[items]]
1208 1208 section = "format"
1209 1209 name = "exp-use-copies-side-data-changeset"
1210 1210 default = false
1211 1211 experimental = true
1212 1212
1213 1213 [[items]]
1214 1214 section = "format"
1215 1215 name = "generaldelta"
1216 1216 default = false
1217 1217 experimental = true
1218 1218
1219 1219 [[items]]
1220 1220 section = "format"
1221 1221 name = "manifestcachesize"
1222 1222 experimental = true
1223 1223
1224 1224 [[items]]
1225 1225 section = "format"
1226 1226 name = "maxchainlen"
1227 1227 default-type = "dynamic"
1228 1228 experimental = true
1229 1229
1230 1230 [[items]]
1231 1231 section = "format"
1232 1232 name = "obsstore-version"
1233 1233
1234 1234 [[items]]
1235 1235 section = "format"
1236 1236 name = "revlog-compression"
1237 1237 default-type = "lambda"
1238 1238 alias = [["experimental", "format.compression"]]
1239 1239 default = [ "zstd", "zlib",]
1240 1240
1241 1241 [[items]]
1242 1242 section = "format"
1243 1243 name = "sparse-revlog"
1244 1244 default = true
1245 1245
1246 1246 [[items]]
1247 1247 section = "format"
1248 1248 name = "use-dirstate-tracked-hint"
1249 1249 default = false
1250 1250 experimental = true
1251 1251
1252 1252 [[items]]
1253 1253 section = "format"
1254 1254 name = "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"
1255 1255 default = false
1256 1256 experimental = true
1257 1257
1258 1258 [[items]]
1259 1259 section = "format"
1260 1260 name = "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet"
1261 1261 default = false
1262 1262 experimental = true
1263 1263
1264 1264 [[items]]
1265 1265 section = "format"
1266 1266 name = "use-dirstate-tracked-hint.version"
1267 1267 default = 1
1268 1268 experimental = true
1269 1269
1270 1270 [[items]]
1271 1271 section = "format"
1272 1272 name = "use-dirstate-v2"
1273 1273 default = false
1274 1274 alias = [["format", "exp-rc-dirstate-v2"]]
1275 1275 experimental = true
1276 1276 documentation = """Enables dirstate-v2 format *when creating a new repository*.
1277 1277 Which format to use for existing repos is controlled by `.hg/requires`."""
1278 1278
1279 1279 [[items]]
1280 1280 section = "format"
1281 1281 name = "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories"
1282 1282 default = false
1283 1283 experimental = true
1284 1284
1285 1285 [[items]]
1286 1286 section = "format"
1287 1287 name = "use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet"
1288 1288 default = false
1289 1289 experimental = true
1290 1290
1291 1291 # Having this on by default means we are confident about the scaling of phases.
1292 1292 # This is not garanteed to be the case at the time this message is written.
1293 1293 [[items]]
1294 1294 section = "format"
1295 1295 name = "use-internal-phase"
1296 1296 default = false
1297 1297 experimental = true
1298 1298
1299 1299 [[items]]
1300 1300 section = "format"
1301 1301 name = "use-persistent-nodemap"
1302 1302 default-type = "dynamic"
1303 1303
1304 1304 [[items]]
1305 1305 section = "format"
1306 1306 name = "use-share-safe"
1307 1307 default = true
1308 1308
1309 1309 [[items]]
1310 1310 section = "format"
1311 1311 name = "use-share-safe.automatic-upgrade-of-mismatching-repositories"
1312 1312 default = false
1313 1313 experimental = true
1314 1314
1315 1315 [[items]]
1316 1316 section = "format"
1317 1317 name = "use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet"
1318 1318 default = false
1319 1319 experimental = true
1320 1320
1321 1321 [[items]]
1322 1322 section = "format"
1323 1323 name = "usefncache"
1324 1324 default = true
1325 1325
1326 1326 [[items]]
1327 1327 section = "format"
1328 1328 name = "usegeneraldelta"
1329 1329 default = true
1330 1330
1331 1331 [[items]]
1332 1332 section = "format"
1333 1333 name = "usestore"
1334 1334 default = true
1335 1335
1336 1336 [[items]]
1337 1337 section = "fsmonitor"
1338 1338 name = "warn_update_file_count"
1339 1339 default = 50000
1340 1340
1341 1341 [[items]]
1342 1342 section = "fsmonitor"
1343 1343 name = "warn_update_file_count_rust"
1344 1344 default = 400000
1345 1345
1346 1346 [[items]]
1347 1347 section = "fsmonitor"
1348 1348 name = "warn_when_unused"
1349 1349 default = true
1350 1350
1351 1351 [[items]]
1352 1352 section = "help"
1353 1353 name = 'hidden-command\..*'
1354 1354 default = false
1355 1355 generic = true
1356 1356
1357 1357 [[items]]
1358 1358 section = "help"
1359 1359 name = 'hidden-topic\..*'
1360 1360 default = false
1361 1361 generic = true
1362 1362
1363 1363 [[items]]
1364 1364 section = "hgweb-paths"
1365 1365 name = ".*"
1366 1366 default-type = "list_type"
1367 1367 generic = true
1368 1368
1369 1369 [[items]]
1370 1370 section = "hooks"
1371 1371 name = ".*:run-with-plain"
1372 1372 default = true
1373 1373 generic = true
1374 1374
1375 1375 [[items]]
1376 1376 section = "hooks"
1377 1377 name = "[^:]*"
1378 1378 default-type = "dynamic"
1379 1379 generic = true
1380 1380
1381 1381 [[items]]
1382 1382 section = "hostfingerprints"
1383 1383 name = ".*"
1384 1384 default-type = "list_type"
1385 1385 generic = true
1386 1386
1387 1387 [[items]]
1388 1388 section = "hostsecurity"
1389 1389 name = ".*:ciphers$"
1390 1390 default-type = "dynamic"
1391 1391 generic = true
1392 1392
1393 1393 [[items]]
1394 1394 section = "hostsecurity"
1395 1395 name = ".*:fingerprints$"
1396 1396 default-type = "list_type"
1397 1397 generic = true
1398 1398
1399 1399 [[items]]
1400 1400 section = "hostsecurity"
1401 1401 name = ".*:minimumprotocol$"
1402 1402 default-type = "dynamic"
1403 1403 generic = true
1404 1404
1405 1405 [[items]]
1406 1406 section = "hostsecurity"
1407 1407 name = ".*:verifycertsfile$"
1408 1408 generic = true
1409 1409
1410 1410 [[items]]
1411 1411 section = "hostsecurity"
1412 1412 name = "ciphers"
1413 1413
1414 1414 [[items]]
1415 1415 section = "hostsecurity"
1416 1416 name = "minimumprotocol"
1417 1417 default-type = "dynamic"
1418 1418
1419 1419 [[items]]
1420 1420 section = "http"
1421 1421 name = "timeout"
1422 1422
1423 1423 [[items]]
1424 1424 section = "http_proxy"
1425 1425 name = "always"
1426 1426 default = false
1427 1427
1428 1428 [[items]]
1429 1429 section = "http_proxy"
1430 1430 name = "host"
1431 1431
1432 1432 [[items]]
1433 1433 section = "http_proxy"
1434 1434 name = "no"
1435 1435 default-type = "list_type"
1436 1436
1437 1437 [[items]]
1438 1438 section = "http_proxy"
1439 1439 name = "passwd"
1440 1440
1441 1441 [[items]]
1442 1442 section = "http_proxy"
1443 1443 name = "user"
1444 1444
1445 1445 [[items]]
1446 1446 section = "logtoprocess"
1447 1447 name = "command"
1448 1448
1449 1449 [[items]]
1450 1450 section = "logtoprocess"
1451 1451 name = "commandexception"
1452 1452
1453 1453 [[items]]
1454 1454 section = "logtoprocess"
1455 1455 name = "commandfinish"
1456 1456
1457 1457 [[items]]
1458 1458 section = "logtoprocess"
1459 1459 name = "develwarn"
1460 1460
1461 1461 [[items]]
1462 1462 section = "logtoprocess"
1463 1463 name = "uiblocked"
1464 1464
1465 1465 [[items]]
1466 1466 section = "merge"
1467 1467 name = "checkignored"
1468 1468 default = "abort"
1469 1469
1470 1470 [[items]]
1471 1471 section = "merge"
1472 1472 name = "checkunknown"
1473 1473 default = "abort"
1474 1474
1475 1475 [[items]]
1476 1476 section = "merge"
1477 1477 name = "disable-partial-tools"
1478 1478 default = false
1479 1479 experimental = true
1480 1480
1481 1481 [[items]]
1482 1482 section = "merge"
1483 1483 name = "followcopies"
1484 1484 default = true
1485 1485
1486 1486 [[items]]
1487 1487 section = "merge"
1488 1488 name = "on-failure"
1489 1489 default = "continue"
1490 1490
1491 1491 [[items]]
1492 1492 section = "merge"
1493 1493 name = "preferancestor"
1494 1494 default-type = "lambda"
1495 1495 default = ["*"]
1496 1496 experimental = true
1497 1497
1498 1498 [[items]]
1499 1499 section = "merge"
1500 1500 name = "strict-capability-check"
1501 1501 default = false
1502 1502
1503 1503 [[items]]
1504 1504 section = "merge-tools"
1505 1505 name = ".*"
1506 1506 generic = true
1507 1507
1508 1508 [[items]]
1509 1509 section = "merge-tools"
1510 1510 name = '.*\.args$'
1511 1511 default = "$local $base $other"
1512 1512 generic = true
1513 1513 priority = -1
1514 1514
1515 1515 [[items]]
1516 1516 section = "merge-tools"
1517 1517 name = '.*\.binary$'
1518 1518 default = false
1519 1519 generic = true
1520 1520 priority = -1
1521 1521
1522 1522 [[items]]
1523 1523 section = "merge-tools"
1524 1524 name = '.*\.check$'
1525 1525 default-type = "list_type"
1526 1526 generic = true
1527 1527 priority = -1
1528 1528
1529 1529 [[items]]
1530 1530 section = "merge-tools"
1531 1531 name = '.*\.checkchanged$'
1532 1532 default = false
1533 1533 generic = true
1534 1534 priority = -1
1535 1535
1536 1536 [[items]]
1537 1537 section = "merge-tools"
1538 1538 name = '.*\.executable$'
1539 1539 default-type = "dynamic"
1540 1540 generic = true
1541 1541 priority = -1
1542 1542
1543 1543 [[items]]
1544 1544 section = "merge-tools"
1545 1545 name = '.*\.fixeol$'
1546 1546 default = false
1547 1547 generic = true
1548 1548 priority = -1
1549 1549
1550 1550 [[items]]
1551 1551 section = "merge-tools"
1552 1552 name = '.*\.gui$'
1553 1553 default = false
1554 1554 generic = true
1555 1555 priority = -1
1556 1556
1557 1557 [[items]]
1558 1558 section = "merge-tools"
1559 1559 name = '.*\.mergemarkers$'
1560 1560 default = "basic"
1561 1561 generic = true
1562 1562 priority = -1
1563 1563
1564 1564 [[items]]
1565 1565 section = "merge-tools"
1566 1566 name = '.*\.mergemarkertemplate$' # take from command-templates.mergemarker
1567 1567 default-type = "dynamic"
1568 1568 generic = true
1569 1569 priority = -1
1570 1570
1571 1571 [[items]]
1572 1572 section = "merge-tools"
1573 1573 name = '.*\.premerge$'
1574 1574 default-type = "dynamic"
1575 1575 generic = true
1576 1576 priority = -1
1577 1577
1578 1578 [[items]]
1579 1579 section = "merge-tools"
1580 1580 name = '.*\.priority$'
1581 1581 default = 0
1582 1582 generic = true
1583 1583 priority = -1
1584 1584
1585 1585 [[items]]
1586 1586 section = "merge-tools"
1587 1587 name = '.*\.regappend$'
1588 1588 default = ""
1589 1589 generic = true
1590 1590 priority = -1
1591 1591
1592 1592 [[items]]
1593 1593 section = "merge-tools"
1594 1594 name = '.*\.symlink$'
1595 1595 default = false
1596 1596 generic = true
1597 1597 priority = -1
1598 1598
1599 1599 [[items]]
1600 1600 section = "pager"
1601 1601 name = "attend-.*"
1602 1602 default-type = "dynamic"
1603 1603 generic = true
1604 1604
1605 1605 [[items]]
1606 1606 section = "pager"
1607 1607 name = "ignore"
1608 1608 default-type = "list_type"
1609 1609
1610 1610 [[items]]
1611 1611 section = "pager"
1612 1612 name = "pager"
1613 1613 default-type = "dynamic"
1614 1614
1615 1615 [[items]]
1616 1616 section = "partial-merge-tools"
1617 1617 name = ".*"
1618 1618 generic = true
1619 1619 experimental = true
1620 1620
1621 1621 [[items]]
1622 1622 section = "partial-merge-tools"
1623 1623 name = '.*\.args'
1624 1624 default = "$local $base $other"
1625 1625 generic = true
1626 1626 priority = -1
1627 1627 experimental = true
1628 1628
1629 1629 [[items]]
1630 1630 section = "partial-merge-tools"
1631 1631 name = '.*\.disable'
1632 1632 default = false
1633 1633 generic = true
1634 1634 priority = -1
1635 1635 experimental = true
1636 1636
1637 1637 [[items]]
1638 1638 section = "partial-merge-tools"
1639 1639 name = '.*\.executable$'
1640 1640 default-type = "dynamic"
1641 1641 generic = true
1642 1642 priority = -1
1643 1643 experimental = true
1644 1644
1645 1645 [[items]]
1646 1646 section = "partial-merge-tools"
1647 1647 name = '.*\.order'
1648 1648 default = 0
1649 1649 generic = true
1650 1650 priority = -1
1651 1651 experimental = true
1652 1652
1653 1653 [[items]]
1654 1654 section = "partial-merge-tools"
1655 1655 name = '.*\.patterns'
1656 1656 default-type = "dynamic"
1657 1657 generic = true
1658 1658 priority = -1
1659 1659 experimental = true
1660 1660
1661 1661 [[items]]
1662 1662 section = "patch"
1663 1663 name = "eol"
1664 1664 default = "strict"
1665 1665
1666 1666 [[items]]
1667 1667 section = "patch"
1668 1668 name = "fuzz"
1669 1669 default = 2
1670 1670
1671 1671 [[items]]
1672 1672 section = "paths"
1673 1673 name = "[^:]*"
1674 1674 generic = true
1675 1675
1676 1676 [[items]]
1677 1677 section = "paths"
1678 1678 name = ".*:bookmarks.mode"
1679 1679 default = "default"
1680 1680 generic = true
1681 1681
1682 1682 [[items]]
1683 1683 section = "paths"
1684 1684 name = ".*:multi-urls"
1685 1685 default = false
1686 1686 generic = true
1687 1687
1688 1688 [[items]]
1689 1689 section = "paths"
1690 1690 name = ".*:pulled-delta-reuse-policy"
1691 1691 generic = true
1692 1692
1693 1693 [[items]]
1694 1694 section = "paths"
1695 1695 name = ".*:pushrev"
1696 1696 generic = true
1697 1697
1698 1698 [[items]]
1699 1699 section = "paths"
1700 1700 name = ".*:pushurl"
1701 1701 generic = true
1702 1702
1703 1703 [[items]]
1704 1704 section = "paths"
1705 1705 name = "default"
1706 1706
1707 1707 [[items]]
1708 1708 section = "paths"
1709 1709 name = "default-push"
1710 1710
1711 1711 [[items]]
1712 1712 section = "phases"
1713 1713 name = "checksubrepos"
1714 1714 default = "follow"
1715 1715
1716 1716 [[items]]
1717 1717 section = "phases"
1718 1718 name = "new-commit"
1719 1719 default = "draft"
1720 1720
1721 1721 [[items]]
1722 1722 section = "phases"
1723 1723 name = "publish"
1724 1724 default = true
1725 1725
1726 1726 [[items]]
1727 1727 section = "profiling"
1728 1728 name = "enabled"
1729 1729 default = false
1730 1730
1731 1731 [[items]]
1732 1732 section = "profiling"
1733 1733 name = "format"
1734 1734 default = "text"
1735 1735
1736 1736 [[items]]
1737 1737 section = "profiling"
1738 1738 name = "freq"
1739 1739 default = 1000
1740 1740
1741 1741 [[items]]
1742 1742 section = "profiling"
1743 1743 name = "limit"
1744 1744 default = 30
1745 1745
1746 1746 [[items]]
1747 1747 section = "profiling"
1748 1748 name = "nested"
1749 1749 default = 0
1750 1750
1751 1751 [[items]]
1752 1752 section = "profiling"
1753 1753 name = "output"
1754 1754
1755 1755 [[items]]
1756 1756 section = "profiling"
1757 1757 name = "showmax"
1758 1758 default = 0.999
1759 1759
1760 1760 [[items]]
1761 1761 section = "profiling"
1762 1762 name = "showmin"
1763 1763 default-type = "dynamic"
1764 1764
1765 1765 [[items]]
1766 1766 section = "profiling"
1767 1767 name = "showtime"
1768 1768 default = true
1769 1769
1770 1770 [[items]]
1771 1771 section = "profiling"
1772 1772 name = "sort"
1773 1773 default = "inlinetime"
1774 1774
1775 1775 [[items]]
1776 1776 section = "profiling"
1777 1777 name = "statformat"
1778 1778 default = "hotpath"
1779 1779
1780 1780 [[items]]
1781 1781 section = "profiling"
1782 1782 name = "time-track"
1783 1783 default-type = "dynamic"
1784 1784
1785 1785 [[items]]
1786 1786 section = "profiling"
1787 1787 name = "type"
1788 1788 default = "stat"
1789 1789
1790 1790 [[items]]
1791 1791 section = "progress"
1792 1792 name = "assume-tty"
1793 1793 default = false
1794 1794
1795 1795 [[items]]
1796 1796 section = "progress"
1797 1797 name = "changedelay"
1798 1798 default = 1
1799 1799
1800 1800 [[items]]
1801 1801 section = "progress"
1802 1802 name = "clear-complete"
1803 1803 default = true
1804 1804
1805 1805 [[items]]
1806 1806 section = "progress"
1807 1807 name = "debug"
1808 1808 default = false
1809 1809
1810 1810 [[items]]
1811 1811 section = "progress"
1812 1812 name = "delay"
1813 1813 default = 3
1814 1814
1815 1815 [[items]]
1816 1816 section = "progress"
1817 1817 name = "disable"
1818 1818 default = false
1819 1819
1820 1820 [[items]]
1821 1821 section = "progress"
1822 1822 name = "estimateinterval"
1823 1823 default = 60.0
1824 1824
1825 1825 [[items]]
1826 1826 section = "progress"
1827 1827 name = "format"
1828 1828 default-type = "lambda"
1829 1829 default = [ "topic", "bar", "number", "estimate",]
1830 1830
1831 1831 [[items]]
1832 1832 section = "progress"
1833 1833 name = "refresh"
1834 1834 default = 0.1
1835 1835
1836 1836 [[items]]
1837 1837 section = "progress"
1838 1838 name = "width"
1839 1839 default-type = "dynamic"
1840 1840
1841 1841 [[items]]
1842 1842 section = "pull"
1843 1843 name = "confirm"
1844 1844 default = false
1845 1845
1846 1846 [[items]]
1847 1847 section = "push"
1848 1848 name = "pushvars.server"
1849 1849 default = false
1850 1850
1851 1851 [[items]]
1852 1852 section = "rebase"
1853 1853 name = "experimental.inmemory"
1854 1854 default = false
1855 1855
1856 1856 [[items]]
1857 1857 section = "rebase"
1858 1858 name = "singletransaction"
1859 1859 default = false
1860 1860
1861 1861 [[items]]
1862 1862 section = "rebase"
1863 1863 name = "store-source"
1864 1864 default = true
1865 1865 experimental = true
1866 1866 documentation = """Controls creation of a `rebase_source` extra field during rebase.
1867 1867 When false, no such field is created. This is useful e.g. for incrementally \
1868 1868 converting changesets and then rebasing them onto an existing repo.
1869 1869 WARNING: this is an advanced setting reserved for people who know \
1870 1870 exactly what they are doing. Misuse of this setting can easily \
1871 1871 result in obsmarker cycles and a vivid headache."""
1872 1872
1873 1873 [[items]]
1874 1874 section = "rewrite"
1875 1875 name = "backup-bundle"
1876 1876 default = true
1877 1877 alias = [["ui", "history-editing-backup"]]
1878 1878
1879 1879 [[items]]
1880 1880 section = "rewrite"
1881 1881 name = "empty-successor"
1882 1882 default = "skip"
1883 1883 experimental = true
1884 1884
1885 1885 [[items]]
1886 1886 section = "rewrite"
1887 1887 name = "update-timestamp"
1888 1888 default = false
1889 1889
1890 1890 [[items]]
1891 1891 section = "rhg"
1892 1892 name = "cat"
1893 1893 default = true
1894 1894 experimental = true
1895 1895 documentation = """rhg cat has some quirks that need to be ironed out. \
1896 1896 In particular, the `-r` argument accepts a partial hash, but does not \
1897 1897 correctly resolve `abcdef` as a potential bookmark, tag or branch name."""
1898 1898
1899 1899 [[items]]
1900 1900 section = "rhg"
1901 1901 name = "fallback-exectutable"
1902 1902 experimental = true
1903 1903
1904 1904 [[items]]
1905 1905 section = "rhg"
1906 1906 name = "fallback-immediately"
1907 1907 default = false
1908 1908 experimental = true
1909 1909
1910 1910 [[items]]
1911 1911 section = "rhg"
1912 1912 name = "ignored-extensions"
1913 1913 default-type = "list_type"
1914 1914 experimental = true
1915 1915
1916 1916 [[items]]
1917 1917 section = "rhg"
1918 1918 name = "on-unsupported"
1919 1919 default = "abort"
1920 1920 experimental = true
1921 1921
1922 1922 [[items]]
1923 1923 section = "server"
1924 1924 name = "bookmarks-pushkey-compat"
1925 1925 default = true
1926 1926
1927 1927 [[items]]
1928 1928 section = "server"
1929 1929 name = "bundle1"
1930 1930 default = true
1931 1931
1932 1932 [[items]]
1933 1933 section = "server"
1934 1934 name = "bundle1.pull"
1935 1935
1936 1936 [[items]]
1937 1937 section = "server"
1938 1938 name = "bundle1.push"
1939 1939
1940 1940 [[items]]
1941 1941 section = "server"
1942 1942 name = "bundle1gd"
1943 1943
1944 1944 [[items]]
1945 1945 section = "server"
1946 1946 name = "bundle1gd.pull"
1947 1947
1948 1948 [[items]]
1949 1949 section = "server"
1950 1950 name = "bundle1gd.push"
1951 1951
1952 1952 [[items]]
1953 1953 section = "server"
1954 1954 name = "bundle2.stream"
1955 1955 default = true
1956 1956 alias = [["experimental", "bundle2.stream"]]
1957 1957
1958 1958 [[items]]
1959 1959 section = "server"
1960 1960 name = "compressionengines"
1961 1961 default-type = "list_type"
1962 1962
1963 1963 [[items]]
1964 1964 section = "server"
1965 1965 name = "concurrent-push-mode"
1966 1966 default = "check-related"
1967 1967
1968 1968 [[items]]
1969 1969 section = "server"
1970 1970 name = "disablefullbundle"
1971 1971 default = false
1972 1972
1973 1973 [[items]]
1974 1974 section = "server"
1975 1975 name = "maxhttpheaderlen"
1976 1976 default = 1024
1977 1977
1978 1978 [[items]]
1979 1979 section = "server"
1980 1980 name = "preferuncompressed"
1981 1981 default = false
1982 1982
1983 1983 [[items]]
1984 1984 section = "server"
1985 1985 name = "pullbundle"
1986 1986 default = true
1987 1987
1988 1988 [[items]]
1989 1989 section = "server"
1990 1990 name = "streamunbundle"
1991 1991 default = false
1992 1992
1993 1993 [[items]]
1994 1994 section = "server"
1995 1995 name = "uncompressed"
1996 1996 default = true
1997 1997
1998 1998 [[items]]
1999 1999 section = "server"
2000 2000 name = "uncompressedallowsecret"
2001 2001 default = false
2002 2002
2003 2003 [[items]]
2004 2004 section = "server"
2005 2005 name = "validate"
2006 2006 default = false
2007 2007
2008 2008 [[items]]
2009 2009 section = "server"
2010 2010 name = "view"
2011 2011 default = "served"
2012 2012
2013 2013 [[items]]
2014 2014 section = "server"
2015 2015 name = "zliblevel"
2016 2016 default = -1
2017 2017
2018 2018 [[items]]
2019 2019 section = "server"
2020 2020 name = "zstdlevel"
2021 2021 default = 3
2022 2022
2023 2023 [[items]]
2024 2024 section = "share"
2025 2025 name = "pool"
2026 2026
2027 2027 [[items]]
2028 2028 section = "share"
2029 2029 name = "poolnaming"
2030 2030 default = "identity"
2031 2031
2032 2032 [[items]]
2033 2033 section = "share"
2034 2034 name = "safe-mismatch.source-not-safe"
2035 2035 default = "abort"
2036 2036
2037 2037 [[items]]
2038 2038 section = "share"
2039 2039 name = "safe-mismatch.source-not-safe.warn"
2040 2040 default = true
2041 2041
2042 2042 [[items]]
2043 2043 section = "share"
2044 2044 name = "safe-mismatch.source-not-safe:verbose-upgrade"
2045 2045 default = true
2046 2046
2047 2047 [[items]]
2048 2048 section = "share"
2049 2049 name = "safe-mismatch.source-safe"
2050 2050 default = "abort"
2051 2051
2052 2052 [[items]]
2053 2053 section = "share"
2054 2054 name = "safe-mismatch.source-safe.warn"
2055 2055 default = true
2056 2056
2057 2057 [[items]]
2058 2058 section = "share"
2059 2059 name = "safe-mismatch.source-safe:verbose-upgrade"
2060 2060 default = true
2061 2061
2062 2062 [[items]]
2063 2063 section = "shelve"
2064 2064 name = "maxbackups"
2065 2065 default = 10
2066 2066
2067 2067 [[items]]
2068 2068 section = "shelve"
2069 2069 name = "store"
2070 2070 default = "internal"
2071 2071 experimental = true
2072 2072
2073 2073 [[items]]
2074 2074 section = "smtp"
2075 2075 name = "host"
2076 2076
2077 2077 [[items]]
2078 2078 section = "smtp"
2079 2079 name = "local_hostname"
2080 2080
2081 2081 [[items]]
2082 2082 section = "smtp"
2083 2083 name = "password"
2084 2084
2085 2085 [[items]]
2086 2086 section = "smtp"
2087 2087 name = "port"
2088 2088 default-type = "dynamic"
2089 2089
2090 2090 [[items]]
2091 2091 section = "smtp"
2092 2092 name = "tls"
2093 2093 default = "none"
2094 2094
2095 2095 [[items]]
2096 2096 section = "smtp"
2097 2097 name = "username"
2098 2098
2099 2099 [[items]]
2100 2100 section = "sparse"
2101 2101 name = "missingwarning"
2102 2102 default = true
2103 2103 experimental = true
2104 2104
2105 2105 [[items]]
2106 2106 section = "storage"
2107 2107 name = "dirstate-v2.slow-path"
2108 2108 default = "abort"
2109 2109 experimental = true # experimental as long as format.use-dirstate-v2 is.
2110 2110
2111 2111 [[items]]
2112 2112 section = "storage"
2113 2113 name = "new-repo-backend"
2114 2114 default = "revlogv1"
2115 2115 experimental = true
2116 2116
2117 2117 [[items]]
2118 2118 section = "storage"
2119 2119 name = "revlog.delta-parent-search.candidate-group-chunk-size"
2120 2120 default = 20
2121 2121
2122 2122 [[items]]
2123 2123 section = "storage"
2124 2124 name = "revlog.issue6528.fix-incoming"
2125 2125 default = true
2126 2126
2127 2127 [[items]]
2128 2128 section = "storage"
2129 2129 name = "revlog.optimize-delta-parent-choice"
2130 2130 default = true
2131 2131 alias = [["format", "aggressivemergedeltas"]]
2132 2132
2133 2133 [[items]]
2134 2134 section = "storage"
2135 2135 name = "revlog.persistent-nodemap.mmap"
2136 2136 default = true
2137 2137
2138 2138 [[items]]
2139 2139 section = "storage"
2140 2140 name = "revlog.persistent-nodemap.slow-path"
2141 2141 default = "abort"
2142 2142
2143 2143 [[items]]
2144 2144 section = "storage"
2145 2145 name = "revlog.reuse-external-delta"
2146 2146 default = true
2147 2147
2148 2148 [[items]]
2149 2149 section = "storage"
2150 2150 name = "revlog.reuse-external-delta-parent"
2151 2151 documentation = """This option is true unless `format.generaldelta` is set."""
2152 2152
2153 2153 [[items]]
2154 2154 section = "storage"
2155 2155 name = "revlog.zlib.level"
2156 2156
2157 2157 [[items]]
2158 2158 section = "storage"
2159 2159 name = "revlog.zstd.level"
2160 2160
2161 2161 [[items]]
2162 2162 section = "subrepos"
2163 2163 name = "allowed"
2164 2164 default-type = "dynamic" # to make backporting simpler
2165 2165
2166 2166 [[items]]
2167 2167 section = "subrepos"
2168 2168 name = "git:allowed"
2169 2169 default-type = "dynamic"
2170 2170
2171 2171 [[items]]
2172 2172 section = "subrepos"
2173 2173 name = "hg:allowed"
2174 2174 default-type = "dynamic"
2175 2175
2176 2176 [[items]]
2177 2177 section = "subrepos"
2178 2178 name = "svn:allowed"
2179 2179 default-type = "dynamic"
2180 2180
2181 2181 [[items]]
2182 2182 section = "templateconfig"
2183 2183 name = ".*"
2184 2184 default-type = "dynamic"
2185 2185 generic = true
2186 2186
2187 2187 [[items]]
2188 2188 section = "templates"
2189 2189 name = ".*"
2190 2190 generic = true
2191 2191
2192 2192 [[items]]
2193 2193 section = "trusted"
2194 2194 name = "groups"
2195 2195 default-type = "list_type"
2196 2196
2197 2197 [[items]]
2198 2198 section = "trusted"
2199 2199 name = "users"
2200 2200 default-type = "list_type"
2201 2201
2202 2202 [[items]]
2203 2203 section = "ui"
2204 2204 name = "_usedassubrepo"
2205 2205 default = false
2206 2206
2207 2207 [[items]]
2208 2208 section = "ui"
2209 2209 name = "allowemptycommit"
2210 2210 default = false
2211 2211
2212 2212 [[items]]
2213 2213 section = "ui"
2214 2214 name = "archivemeta"
2215 2215 default = true
2216 2216
2217 2217 [[items]]
2218 2218 section = "ui"
2219 2219 name = "askusername"
2220 2220 default = false
2221 2221
2222 2222 [[items]]
2223 2223 section = "ui"
2224 2224 name = "available-memory"
2225 2225
2226 2226 [[items]]
2227 2227 section = "ui"
2228 2228 name = "clonebundlefallback"
2229 2229 default = false
2230 2230
2231 2231 [[items]]
2232 2232 section = "ui"
2233 2233 name = "clonebundleprefers"
2234 2234 default-type = "list_type"
2235 2235
2236 2236 [[items]]
2237 2237 section = "ui"
2238 2238 name = "clonebundles"
2239 2239 default = true
2240 2240
2241 2241 [[items]]
2242 2242 section = "ui"
2243 2243 name = "color"
2244 2244 default = "auto"
2245 2245
2246 2246 [[items]]
2247 2247 section = "ui"
2248 2248 name = "commitsubrepos"
2249 2249 default = false
2250 2250
2251 2251 [[items]]
2252 2252 section = "ui"
2253 2253 name = "debug"
2254 2254 default = false
2255 2255
2256 2256 [[items]]
2257 2257 section = "ui"
2258 2258 name = "debugger"
2259 2259
2260 2260 [[items]]
2261 2261 section = "ui"
2262 2262 name = "detailed-exit-code"
2263 2263 default = false
2264 2264 experimental = true
2265 2265
2266 2266 [[items]]
2267 2267 section = "ui"
2268 2268 name = "editor"
2269 2269 default-type = "dynamic"
2270 2270
2271 2271 [[items]]
2272 2272 section = "ui"
2273 2273 name = "fallbackencoding"
2274 2274
2275 2275 [[items]]
2276 2276 section = "ui"
2277 2277 name = "forcecwd"
2278 2278
2279 2279 [[items]]
2280 2280 section = "ui"
2281 2281 name = "forcemerge"
2282 2282
2283 2283 [[items]]
2284 2284 section = "ui"
2285 2285 name = "formatdebug"
2286 2286 default = false
2287 2287
2288 2288 [[items]]
2289 2289 section = "ui"
2290 2290 name = "formatjson"
2291 2291 default = false
2292 2292
2293 2293 [[items]]
2294 2294 section = "ui"
2295 2295 name = "formatted"
2296 2296
2297 2297 [[items]]
2298 2298 section = "ui"
2299 2299 name = "interactive"
2300 2300
2301 2301 [[items]]
2302 2302 section = "ui"
2303 2303 name = "interface"
2304 2304
2305 2305 [[items]]
2306 2306 section = "ui"
2307 2307 name = "interface.chunkselector"
2308 2308
2309 2309 [[items]]
2310 2310 section = "ui"
2311 2311 name = "large-file-limit"
2312 2312 default = 10485760
2313 2313
2314 2314 [[items]]
2315 2315 section = "ui"
2316 2316 name = "logblockedtimes"
2317 2317 default = false
2318 2318
2319 2319 [[items]]
2320 2320 section = "ui"
2321 2321 name = "merge"
2322 2322
2323 2323 [[items]]
2324 2324 section = "ui"
2325 2325 name = "mergemarkers"
2326 2326 default = "basic"
2327 2327
2328 2328 [[items]]
2329 2329 section = "ui"
2330 2330 name = "message-output"
2331 2331 default = "stdio"
2332 2332
2333 2333 [[items]]
2334 2334 section = "ui"
2335 2335 name = "nontty"
2336 2336 default = false
2337 2337
2338 2338 [[items]]
2339 2339 section = "ui"
2340 2340 name = "origbackuppath"
2341 2341
2342 2342 [[items]]
2343 2343 section = "ui"
2344 2344 name = "paginate"
2345 2345 default = true
2346 2346
2347 2347 [[items]]
2348 2348 section = "ui"
2349 2349 name = "patch"
2350 2350
2351 2351 [[items]]
2352 2352 section = "ui"
2353 2353 name = "portablefilenames"
2354 2354 default = "warn"
2355 2355
2356 2356 [[items]]
2357 2357 section = "ui"
2358 2358 name = "promptecho"
2359 2359 default = false
2360 2360
2361 2361 [[items]]
2362 2362 section = "ui"
2363 2363 name = "quiet"
2364 2364 default = false
2365 2365
2366 2366 [[items]]
2367 2367 section = "ui"
2368 2368 name = "quietbookmarkmove"
2369 2369 default = false
2370 2370
2371 2371 [[items]]
2372 2372 section = "ui"
2373 2373 name = "relative-paths"
2374 2374 default = "legacy"
2375 2375
2376 2376 [[items]]
2377 2377 section = "ui"
2378 2378 name = "remotecmd"
2379 2379 default = "hg"
2380 2380
2381 2381 [[items]]
2382 2382 section = "ui"
2383 2383 name = "report_untrusted"
2384 2384 default = true
2385 2385
2386 2386 [[items]]
2387 2387 section = "ui"
2388 2388 name = "rollback"
2389 2389 default = true
2390 2390
2391 2391 [[items]]
2392 2392 section = "ui"
2393 2393 name = "signal-safe-lock"
2394 2394 default = true
2395 2395
2396 2396 [[items]]
2397 2397 section = "ui"
2398 2398 name = "slash"
2399 2399 default = false
2400 2400
2401 2401 [[items]]
2402 2402 section = "ui"
2403 2403 name = "ssh"
2404 2404 default = "ssh"
2405 2405
2406 2406 [[items]]
2407 2407 section = "ui"
2408 2408 name = "ssherrorhint"
2409 2409
2410 2410 [[items]]
2411 2411 section = "ui"
2412 2412 name = "statuscopies"
2413 2413 default = false
2414 2414
2415 2415 [[items]]
2416 2416 section = "ui"
2417 2417 name = "strict"
2418 2418 default = false
2419 2419
2420 2420 [[items]]
2421 2421 section = "ui"
2422 2422 name = "style"
2423 2423 default = ""
2424 2424
2425 2425 [[items]]
2426 2426 section = "ui"
2427 2427 name = "supportcontact"
2428 2428
2429 2429 [[items]]
2430 2430 section = "ui"
2431 2431 name = "textwidth"
2432 2432 default = 78
2433 2433
2434 2434 [[items]]
2435 2435 section = "ui"
2436 2436 name = "timeout"
2437 2437 default = "600"
2438 2438
2439 2439 [[items]]
2440 2440 section = "ui"
2441 2441 name = "timeout.warn"
2442 2442 default = 0
2443 2443
2444 2444 [[items]]
2445 2445 section = "ui"
2446 2446 name = "timestamp-output"
2447 2447 default = false
2448 2448
2449 2449 [[items]]
2450 2450 section = "ui"
2451 2451 name = "traceback"
2452 2452 default = false
2453 2453
2454 2454 [[items]]
2455 2455 section = "ui"
2456 2456 name = "tweakdefaults"
2457 2457 default = false
2458 2458
2459 2459 [[items]]
2460 2460 section = "ui"
2461 2461 name = "username"
2462 2462 alias = [["ui", "user"]]
2463 2463
2464 2464 [[items]]
2465 2465 section = "ui"
2466 2466 name = "verbose"
2467 2467 default = false
2468 2468
2469 2469 [[items]]
2470 2470 section = "usage"
2471 2471 name = "repository-role"
2472 2472 default = "default"
2473 2473 documentation = """What this repository is used for.
2474 2474
2475 2475 This is used to adjust behavior and performance to best fit the repository purpose.
2476 2476
2477 2477 Currently recognised values are:
2478 2478 - default: an all purpose repository
2479 2479 """
2480 2480
2481 2481 [[items]]
2482 2482 section = "usage"
2483 2483 name = "resources"
2484 2484 default = "default"
2485 2485 documentation = """How aggressive Mercurial can be with resource usage:
2486 2486
2487 2487 Currently recognised values are:
2488 2488 - default: the default value currently is equivalent to medium,
2489 2489 - high: allows for higher cpu, memory and disk-space usage to improve the performance of some operations.
2490 2490 - medium: aims at a moderate resource usage,
2491 2491 - low: reduces resources usage when possible, decreasing overall performance.
2492 2492
2493 2493 For finer configuration, see also `usage.resources.cpu`,
2494 2494 `usage.resources.disk` and `usage.resources.memory`.
2495 2495 """
2496 2496
2497 2497 [[items]]
2498 2498 section = "usage"
2499 2499 name = "resources.cpu"
2500 2500 default = "default"
2501 2501 documentation = """How aggressive Mercurial can be in terms of cpu usage:
2502 2502
2503 2503 Currently recognised values are:
2504 2504 - default: the default value, inherits the value from `usage.resources`,
2505 2505 - high: allows for more aggressive cpu usage, improving storage quality and
2506 2506 the performance of some operations at the expense of machine load
2507 2507 - medium: aims at a moderate cpu usage,
2508 2508 - low: reduces cpu usage when possible, potentially at the expense of
2509 2509 slower operations, increased storage and exchange payload.
2510 2510
2511 2511 """
2512 2512
2513 2513 [[items]]
2514 2514 section = "usage"
2515 2515 name = "resources.disk"
2516 2516 default = "default"
2517 2517 documentation = """How aggressive Mercurial can be in terms of disk usage:
2518 2518
2519 2519 Currently recognised values are:
2520 2520 - default: the default value, inherits the value from `usage.resources`,
2521 2521 - high: allows for more disk space usage where it can improve the performance,
2522 2522 - medium: aims at a moderate disk usage,
2523 2523 - low: reduces disk usage when possible, decreasing performance in some occasion.
2524 2524 """
2525 2525
2526 2526 [[items]]
2527 2527 section = "usage"
2528 2528 name = "resources.memory"
2529 2529 default = "default"
2530 2530 documentation = """How aggressive Mercurial can be in terms of memory usage:
2531 2531
2532 2532 Currently recognised values are:
2533 2533 - default: the default value, inherits the value from `usage.resources`,
2534 2534 - high: allows for more aggressive memory usage to improve overall performance,
2535 2535 - medium: aims at a moderate memory usage,
2536 2536 - low: reduces memory usage when possible at the cost of overall performance.
2537 2537 """
2538 2538
2539 2539 [[items]]
2540 2540 section = "verify"
2541 2541 name = "skipflags"
2542 2542 default = 0
2543 2543
2544 2544 [[items]]
2545 2545 section = "web"
2546 2546 name = "accesslog"
2547 2547 default = "-"
2548 2548
2549 2549 [[items]]
2550 2550 section = "web"
2551 2551 name = "address"
2552 2552 default = ""
2553 2553
2554 2554 [[items]]
2555 2555 section = "web"
2556 2556 name = "allow-archive"
2557 2557 default-type = "list_type"
2558 2558 alias = [["web", "allow_archive"]]
2559 2559
2560 2560 [[items]]
2561 2561 section = "web"
2562 2562 name = "allow-pull"
2563 2563 default = true
2564 2564 alias = [["web", "allowpull"]]
2565 2565
2566 2566 [[items]]
2567 2567 section = "web"
2568 2568 name = "allow-push"
2569 2569 default-type = "list_type"
2570 2570 alias = [["web", "allow_push"]]
2571 2571
2572 2572 [[items]]
2573 2573 section = "web"
2574 2574 name = "allow_read"
2575 2575 default-type = "list_type"
2576 2576
2577 2577 [[items]]
2578 2578 section = "web"
2579 2579 name = "allowbz2"
2580 2580 default = false
2581 2581
2582 2582 [[items]]
2583 2583 section = "web"
2584 2584 name = "allowgz"
2585 2585 default = false
2586 2586
2587 2587 [[items]]
2588 2588 section = "web"
2589 2589 name = "allowzip"
2590 2590 default = false
2591 2591
2592 2592 [[items]]
2593 2593 section = "web"
2594 2594 name = "archivesubrepos"
2595 2595 default = false
2596 2596
2597 2597 [[items]]
2598 2598 section = "web"
2599 2599 name = "baseurl"
2600 2600
2601 2601 [[items]]
2602 2602 section = "web"
2603 2603 name = "cacerts"
2604 2604
2605 2605 [[items]]
2606 2606 section = "web"
2607 2607 name = "cache"
2608 2608 default = true
2609 2609
2610 2610 [[items]]
2611 2611 section = "web"
2612 2612 name = "certificate"
2613 2613
2614 2614 [[items]]
2615 2615 section = "web"
2616 2616 name = "collapse"
2617 2617 default = false
2618 2618
2619 2619 [[items]]
2620 2620 section = "web"
2621 2621 name = "comparisoncontext"
2622 2622 default = 5
2623 2623
2624 2624 [[items]]
2625 2625 section = "web"
2626 2626 name = "contact"
2627 2627
2628 2628 [[items]]
2629 2629 section = "web"
2630 2630 name = "csp"
2631 2631
2632 2632 [[items]]
2633 2633 section = "web"
2634 2634 name = "deny_push"
2635 2635 default-type = "list_type"
2636 2636
2637 2637 [[items]]
2638 2638 section = "web"
2639 2639 name = "deny_read"
2640 2640 default-type = "list_type"
2641 2641
2642 2642 [[items]]
2643 2643 section = "web"
2644 2644 name = "descend"
2645 2645 default = true
2646 2646
2647 2647 [[items]]
2648 2648 section = "web"
2649 2649 name = "description"
2650 2650 default = ""
2651 2651
2652 2652 [[items]]
2653 2653 section = "web"
2654 2654 name = "encoding"
2655 2655 default-type = "lazy_module"
2656 2656 default = "encoding.encoding"
2657 2657
2658 2658 [[items]]
2659 2659 section = "web"
2660 2660 name = "errorlog"
2661 2661 default = "-"
2662 2662
2663 2663 [[items]]
2664 2664 section = "web"
2665 2665 name = "guessmime"
2666 2666 default = false
2667 2667
2668 2668 [[items]]
2669 2669 section = "web"
2670 2670 name = "hidden"
2671 2671 default = false
2672 2672
2673 2673 [[items]]
2674 2674 section = "web"
2675 2675 name = "ipv6"
2676 2676 default = false
2677 2677
2678 2678 [[items]]
2679 2679 section = "web"
2680 2680 name = "labels"
2681 2681 default-type = "list_type"
2682 2682
2683 2683 [[items]]
2684 2684 section = "web"
2685 2685 name = "logoimg"
2686 2686 default = "hglogo.png"
2687 2687
2688 2688 [[items]]
2689 2689 section = "web"
2690 2690 name = "logourl"
2691 2691 default = "https://mercurial-scm.org/"
2692 2692
2693 2693 [[items]]
2694 2694 section = "web"
2695 2695 name = "maxchanges"
2696 2696 default = 10
2697 2697
2698 2698 [[items]]
2699 2699 section = "web"
2700 2700 name = "maxfiles"
2701 2701 default = 10
2702 2702
2703 2703 [[items]]
2704 2704 section = "web"
2705 2705 name = "maxshortchanges"
2706 2706 default = 60
2707 2707
2708 2708 [[items]]
2709 2709 section = "web"
2710 2710 name = "motd"
2711 2711 default = ""
2712 2712
2713 2713 [[items]]
2714 2714 section = "web"
2715 2715 name = "name"
2716 2716 default-type = "dynamic"
2717 2717
2718 2718 [[items]]
2719 2719 section = "web"
2720 2720 name = "port"
2721 2721 default = 8000
2722 2722
2723 2723 [[items]]
2724 2724 section = "web"
2725 2725 name = "prefix"
2726 2726 default = ""
2727 2727
2728 2728 [[items]]
2729 2729 section = "web"
2730 2730 name = "push_ssl"
2731 2731 default = true
2732 2732
2733 2733 [[items]]
2734 2734 section = "web"
2735 2735 name = "refreshinterval"
2736 2736 default = 20
2737 2737
2738 2738 [[items]]
2739 2739 section = "web"
2740 2740 name = "server-header"
2741 2741
2742 2742 [[items]]
2743 2743 section = "web"
2744 2744 name = "static"
2745 2745
2746 2746 [[items]]
2747 2747 section = "web"
2748 2748 name = "staticurl"
2749 2749
2750 2750 [[items]]
2751 2751 section = "web"
2752 2752 name = "stripes"
2753 2753 default = 1
2754 2754
2755 2755 [[items]]
2756 2756 section = "web"
2757 2757 name = "style"
2758 2758 default = "paper"
2759 2759
2760 2760 [[items]]
2761 2761 section = "web"
2762 2762 name = "templates"
2763 2763
2764 2764 [[items]]
2765 2765 section = "web"
2766 2766 name = "view"
2767 2767 default = "served"
2768 2768 experimental = true
2769 2769
2770 2770 [[items]]
2771 2771 section = "worker"
2772 2772 name = "backgroundclose"
2773 2773 default-type = "dynamic"
2774 2774
2775 2775 [[items]]
2776 2776 section = "worker"
2777 2777 name = "backgroundclosemaxqueue"
2778 2778 # Windows defaults to a limit of 512 open files. A buffer of 128
2779 2779 # should give us enough headway.
2780 2780 default = 384
2781 2781
2782 2782 [[items]]
2783 2783 section = "worker"
2784 2784 name = "backgroundcloseminfilecount"
2785 2785 default = 2048
2786 2786
2787 2787 [[items]]
2788 2788 section = "worker"
2789 2789 name = "backgroundclosethreadcount"
2790 2790 default = 4
2791 2791
2792 2792 [[items]]
2793 2793 section = "worker"
2794 2794 name = "enabled"
2795 2795 default = true
2796 2796
2797 2797 [[items]]
2798 2798 section = "worker"
2799 2799 name = "numcpus"
2800 2800
2801 2801 # Templates and template applications
2802 2802
2803 2803 [[template-applications]]
2804 2804 template = "diff-options"
2805 2805 section = "annotate"
2806 2806
2807 2807 [[template-applications]]
2808 2808 template = "diff-options"
2809 2809 section = "commands"
2810 2810 prefix = "commit.interactive"
2811 2811
2812 2812 [[template-applications]]
2813 2813 template = "diff-options"
2814 2814 section = "commands"
2815 2815 prefix = "revert.interactive"
2816 2816
2817 2817 [[template-applications]]
2818 2818 template = "diff-options"
2819 2819 section = "diff"
2820 2820
2821 2821 [templates]
2822 2822 [[templates.diff-options]]
2823 2823 suffix = "nodates"
2824 2824 default = false
2825 2825
2826 2826 [[templates.diff-options]]
2827 2827 suffix = "showfunc"
2828 2828 default = false
2829 2829
2830 2830 [[templates.diff-options]]
2831 2831 suffix = "unified"
2832 2832
2833 2833 [[templates.diff-options]]
2834 2834 suffix = "git"
2835 2835 default = false
2836 2836
2837 2837 [[templates.diff-options]]
2838 2838 suffix = "ignorews"
2839 2839 default = false
2840 2840
2841 2841 [[templates.diff-options]]
2842 2842 suffix = "ignorewsamount"
2843 2843 default = false
2844 2844
2845 2845 [[templates.diff-options]]
2846 2846 suffix = "ignoreblanklines"
2847 2847 default = false
2848 2848
2849 2849 [[templates.diff-options]]
2850 2850 suffix = "ignorewseol"
2851 2851 default = false
2852 2852
2853 2853 [[templates.diff-options]]
2854 2854 suffix = "nobinary"
2855 2855 default = false
2856 2856
2857 2857 [[templates.diff-options]]
2858 2858 suffix = "noprefix"
2859 2859 default = false
2860 2860
2861 2861 [[templates.diff-options]]
2862 2862 suffix = "word-diff"
2863 2863 default = false
2864 2864
2865 2865 # In-core extensions
2866 2866
2867 2867 [[items]]
2868 2868 section = "blackbox"
2869 2869 name = "debug.to-stderr"
2870 2870 default = false
2871 2871 in_core_extension = "blackbox"
2872 2872
2873 2873 [[items]]
2874 2874 section = "blackbox"
2875 2875 name = "dirty"
2876 2876 default = false
2877 2877 in_core_extension = "blackbox"
2878 2878
2879 2879 [[items]]
2880 2880 section = "blackbox"
2881 2881 name = "maxsize"
2882 2882 default = "1 MB"
2883 2883 in_core_extension = "blackbox"
2884 2884
2885 2885 [[items]]
2886 2886 section = "blackbox"
2887 2887 name = "logsource"
2888 2888 default = false
2889 2889 in_core_extension = "blackbox"
2890 2890
2891 2891 [[items]]
2892 2892 section = "blackbox"
2893 2893 name = "maxfiles"
2894 2894 default = 7
2895 2895 in_core_extension = "blackbox"
2896 2896
2897 2897 [[items]]
2898 2898 section = "blackbox"
2899 2899 name = "track"
2900 2900 default-type = "lambda"
2901 2901 default = ["*"]
2902 2902 in_core_extension = "blackbox"
2903 2903
2904 2904 [[items]]
2905 2905 section = "blackbox"
2906 2906 name = "ignore"
2907 2907 default-type = "lambda"
2908 2908 default = ["chgserver", "cmdserver", "extension"]
2909 2909 in_core_extension = "blackbox"
2910 2910
2911 2911 [[items]]
2912 2912 section = "blackbox"
2913 2913 name = "date-format"
2914 2914 default = ""
2915 2915 in_core_extension = "blackbox"
2916
2917 [[items]]
2918 section = "format"
2919 name = "mmap-revbranchcache"
2920 default = false
@@ -1,1364 +1,1366 b''
1 #testcases mmap nommap
2
3 #if mmap
4 $ cat <<EOF >> $HGRCPATH
5 > [format]
6 > mmap-revbranchcache=true
7 > EOF
8 #endif
9
1 10 $ hg init a
2 11 $ cd a
3 12
4 13 Verify checking branch of nullrev before the cache is created doesnt crash
5 14 $ hg log -r 'branch(.)' -T '{branch}\n'
6 15
7 16 Basic test
8 17 $ echo 'root' >root
9 18 $ hg add root
10 19 $ hg commit -d '0 0' -m "Adding root node"
11 20
12 21 $ echo 'a' >a
13 22 $ hg add a
14 23 $ hg branch a
15 24 marked working directory as branch a
16 25 (branches are permanent and global, did you want a bookmark?)
17 26 $ hg commit -d '1 0' -m "Adding a branch"
18 27
19 28 $ hg branch q
20 29 marked working directory as branch q
21 30 $ echo 'aa' >a
22 31 $ hg branch -C
23 32 reset working directory to branch a
24 33 $ hg commit -d '2 0' -m "Adding to a branch"
25 34
26 35 $ hg update -C 0
27 36 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 37 $ echo 'b' >b
29 38 $ hg add b
30 39 $ hg branch b
31 40 marked working directory as branch b
32 41 $ hg commit -d '2 0' -m "Adding b branch"
33 42
34 43 $ echo 'bh1' >bh1
35 44 $ hg add bh1
36 45 $ hg commit -d '3 0' -m "Adding b branch head 1"
37 46
38 47 $ hg update -C 2
39 48 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
40 49 $ echo 'bh2' >bh2
41 50 $ hg add bh2
42 51 $ hg commit -d '4 0' -m "Adding b branch head 2"
43 52
44 53 $ echo 'c' >c
45 54 $ hg add c
46 55 $ hg branch c
47 56 marked working directory as branch c
48 57 $ hg commit -d '5 0' -m "Adding c branch"
49 58
50 59 reserved names
51 60
52 61 $ hg branch tip
53 62 abort: the name 'tip' is reserved
54 63 [10]
55 64 $ hg branch null
56 65 abort: the name 'null' is reserved
57 66 [10]
58 67 $ hg branch .
59 68 abort: the name '.' is reserved
60 69 [10]
61 70
62 71 invalid characters
63 72
64 73 $ hg branch 'foo:bar'
65 74 abort: ':' cannot be used in a name
66 75 [10]
67 76
68 77 $ hg branch 'foo
69 78 > bar'
70 79 abort: '\n' cannot be used in a name
71 80 [10]
72 81
73 82 trailing or leading spaces should be stripped before testing duplicates
74 83
75 84 $ hg branch 'b '
76 85 abort: a branch of the same name already exists
77 86 (use 'hg update' to switch to it)
78 87 [10]
79 88
80 89 $ hg branch ' b'
81 90 abort: a branch of the same name already exists
82 91 (use 'hg update' to switch to it)
83 92 [10]
84 93
85 94 underscores in numeric branch names (issue6737)
86 95
87 96 $ hg branch 2700_210
88 97 marked working directory as branch 2700_210
89 98
90 99 verify update will accept invalid legacy branch names
91 100
92 101 $ hg init test-invalid-branch-name
93 102 $ cd test-invalid-branch-name
94 103 $ hg unbundle -u "$TESTDIR"/bundles/test-invalid-branch-name.hg
95 104 adding changesets
96 105 adding manifests
97 106 adding file changes
98 107 added 3 changesets with 3 changes to 2 files
99 108 new changesets f0e4c7f04036:33c2ceb9310b (3 drafts)
100 109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 110
102 111 $ hg update '"colon:test"'
103 112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 113 $ cd ..
105 114
106 115 $ echo 'd' >d
107 116 $ hg add d
108 117 $ hg branch 'a branch name much longer than the default justification used by branches'
109 118 marked working directory as branch a branch name much longer than the default justification used by branches
110 119 $ hg commit -d '6 0' -m "Adding d branch"
111 120
112 121 $ hg branches
113 122 a branch name much longer than the default justification used by branches 7:10ff5895aa57
114 123 b 4:aee39cd168d0
115 124 c 6:589736a22561 (inactive)
116 125 a 5:d8cbc61dbaa6 (inactive)
117 126 default 0:19709c5a4e75 (inactive)
118 127
119 128 -------
120 129
121 130 $ hg branches -a
122 131 a branch name much longer than the default justification used by branches 7:10ff5895aa57
123 132 b 4:aee39cd168d0
124 133
125 134 --- Branch a
126 135
127 136 $ hg log -b a
128 137 changeset: 5:d8cbc61dbaa6
129 138 branch: a
130 139 parent: 2:881fe2b92ad0
131 140 user: test
132 141 date: Thu Jan 01 00:00:04 1970 +0000
133 142 summary: Adding b branch head 2
134 143
135 144 changeset: 2:881fe2b92ad0
136 145 branch: a
137 146 user: test
138 147 date: Thu Jan 01 00:00:02 1970 +0000
139 148 summary: Adding to a branch
140 149
141 150 changeset: 1:dd6b440dd85a
142 151 branch: a
143 152 user: test
144 153 date: Thu Jan 01 00:00:01 1970 +0000
145 154 summary: Adding a branch
146 155
147 156
148 157 ---- Branch b
149 158
150 159 $ hg log -b b
151 160 changeset: 4:aee39cd168d0
152 161 branch: b
153 162 user: test
154 163 date: Thu Jan 01 00:00:03 1970 +0000
155 164 summary: Adding b branch head 1
156 165
157 166 changeset: 3:ac22033332d1
158 167 branch: b
159 168 parent: 0:19709c5a4e75
160 169 user: test
161 170 date: Thu Jan 01 00:00:02 1970 +0000
162 171 summary: Adding b branch
163 172
164 173
165 174 ---- going to test branch listing by rev
166 175 $ hg branches -r0
167 176 default 0:19709c5a4e75 (inactive)
168 177 $ hg branches -qr0
169 178 default
170 179 --- now more than one rev
171 180 $ hg branches -r2:5
172 181 b 4:aee39cd168d0
173 182 a 5:d8cbc61dbaa6 (inactive)
174 183 $ hg branches -qr2:5
175 184 b
176 185 a
177 186 ---- going to test branch closing
178 187
179 188 $ hg branches
180 189 a branch name much longer than the default justification used by branches 7:10ff5895aa57
181 190 b 4:aee39cd168d0
182 191 c 6:589736a22561 (inactive)
183 192 a 5:d8cbc61dbaa6 (inactive)
184 193 default 0:19709c5a4e75 (inactive)
185 194 $ hg up -C b
186 195 2 files updated, 0 files merged, 4 files removed, 0 files unresolved
187 196 $ echo 'xxx1' >> b
188 197 $ hg commit -d '7 0' -m 'adding cset to branch b'
189 198 $ hg up -C aee39cd168d0
190 199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 200 $ echo 'xxx2' >> b
192 201 $ hg commit -d '8 0' -m 'adding head to branch b'
193 202 created new head
194 203 $ echo 'xxx3' >> b
195 204 $ hg commit -d '9 0' -m 'adding another cset to branch b'
196 205 $ hg branches
197 206 b 10:bfbe841b666e
198 207 a branch name much longer than the default justification used by branches 7:10ff5895aa57
199 208 c 6:589736a22561 (inactive)
200 209 a 5:d8cbc61dbaa6 (inactive)
201 210 default 0:19709c5a4e75 (inactive)
202 211 $ hg heads --closed
203 212 changeset: 10:bfbe841b666e
204 213 branch: b
205 214 tag: tip
206 215 user: test
207 216 date: Thu Jan 01 00:00:09 1970 +0000
208 217 summary: adding another cset to branch b
209 218
210 219 changeset: 8:eebb944467c9
211 220 branch: b
212 221 parent: 4:aee39cd168d0
213 222 user: test
214 223 date: Thu Jan 01 00:00:07 1970 +0000
215 224 summary: adding cset to branch b
216 225
217 226 changeset: 7:10ff5895aa57
218 227 branch: a branch name much longer than the default justification used by branches
219 228 user: test
220 229 date: Thu Jan 01 00:00:06 1970 +0000
221 230 summary: Adding d branch
222 231
223 232 changeset: 6:589736a22561
224 233 branch: c
225 234 user: test
226 235 date: Thu Jan 01 00:00:05 1970 +0000
227 236 summary: Adding c branch
228 237
229 238 changeset: 5:d8cbc61dbaa6
230 239 branch: a
231 240 parent: 2:881fe2b92ad0
232 241 user: test
233 242 date: Thu Jan 01 00:00:04 1970 +0000
234 243 summary: Adding b branch head 2
235 244
236 245 changeset: 0:19709c5a4e75
237 246 user: test
238 247 date: Thu Jan 01 00:00:00 1970 +0000
239 248 summary: Adding root node
240 249
241 250 $ hg heads
242 251 changeset: 10:bfbe841b666e
243 252 branch: b
244 253 tag: tip
245 254 user: test
246 255 date: Thu Jan 01 00:00:09 1970 +0000
247 256 summary: adding another cset to branch b
248 257
249 258 changeset: 8:eebb944467c9
250 259 branch: b
251 260 parent: 4:aee39cd168d0
252 261 user: test
253 262 date: Thu Jan 01 00:00:07 1970 +0000
254 263 summary: adding cset to branch b
255 264
256 265 changeset: 7:10ff5895aa57
257 266 branch: a branch name much longer than the default justification used by branches
258 267 user: test
259 268 date: Thu Jan 01 00:00:06 1970 +0000
260 269 summary: Adding d branch
261 270
262 271 changeset: 6:589736a22561
263 272 branch: c
264 273 user: test
265 274 date: Thu Jan 01 00:00:05 1970 +0000
266 275 summary: Adding c branch
267 276
268 277 changeset: 5:d8cbc61dbaa6
269 278 branch: a
270 279 parent: 2:881fe2b92ad0
271 280 user: test
272 281 date: Thu Jan 01 00:00:04 1970 +0000
273 282 summary: Adding b branch head 2
274 283
275 284 changeset: 0:19709c5a4e75
276 285 user: test
277 286 date: Thu Jan 01 00:00:00 1970 +0000
278 287 summary: Adding root node
279 288
280 289 $ hg commit -d '9 0' --close-branch -m 'prune bad branch'
281 290 $ hg branches -a
282 291 b 8:eebb944467c9
283 292 a branch name much longer than the default justification used by branches 7:10ff5895aa57
284 293 $ hg up -C b
285 294 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 295 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
287 296 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
288 297 abort: current revision is already a branch closing head
289 298 [10]
290 299
291 300 $ echo foo > b
292 301 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
293 302
294 303 $ echo bar > b
295 304 $ hg commit -d '9 0' --close-branch -m 're-closing this branch' bh1
296 305 abort: current revision is already a branch closing head
297 306 [10]
298 307 $ hg commit -d '9 0' --close-branch -m 're-closing this branch' b
299 308
300 309 $ echo baz > b
301 310 $ hg commit -d '9 0' --close-branch -m 'empty re-closing this branch' -X b
302 311 abort: current revision is already a branch closing head
303 312 [10]
304 313 $ hg revert b
305 314
306 315 $ hg debugstrip --rev 13: --no-backup
307 316 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 317 $ hg revert --all --no-backup
309 318
310 319 $ hg log -r tip --debug
311 320 changeset: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
312 321 branch: b
313 322 tag: tip
314 323 phase: draft
315 324 parent: 8:eebb944467c9fb9651ed232aeaf31b3c0a7fc6c1
316 325 parent: -1:0000000000000000000000000000000000000000
317 326 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
318 327 user: test
319 328 date: Thu Jan 01 00:00:09 1970 +0000
320 329 extra: branch=b
321 330 extra: close=1
322 331 description:
323 332 close this part branch too
324 333
325 334
326 335 --- b branch should be inactive
327 336
328 337 $ hg branches
329 338 a branch name much longer than the default justification used by branches 7:10ff5895aa57
330 339 c 6:589736a22561 (inactive)
331 340 a 5:d8cbc61dbaa6 (inactive)
332 341 default 0:19709c5a4e75 (inactive)
333 342 $ hg branches -c
334 343 a branch name much longer than the default justification used by branches 7:10ff5895aa57
335 344 b 12:e3d49c0575d8 (closed)
336 345 c 6:589736a22561 (inactive)
337 346 a 5:d8cbc61dbaa6 (inactive)
338 347 default 0:19709c5a4e75 (inactive)
339 348 $ hg branches -a
340 349 a branch name much longer than the default justification used by branches 7:10ff5895aa57
341 350 $ hg branches -q
342 351 a branch name much longer than the default justification used by branches
343 352 c
344 353 a
345 354 default
346 355 $ hg heads b
347 356 no open branch heads found on branches b
348 357 [1]
349 358 $ hg heads --closed b
350 359 changeset: 12:e3d49c0575d8
351 360 branch: b
352 361 tag: tip
353 362 parent: 8:eebb944467c9
354 363 user: test
355 364 date: Thu Jan 01 00:00:09 1970 +0000
356 365 summary: close this part branch too
357 366
358 367 changeset: 11:d3f163457ebf
359 368 branch: b
360 369 user: test
361 370 date: Thu Jan 01 00:00:09 1970 +0000
362 371 summary: prune bad branch
363 372
364 373 $ echo 'xxx4' >> b
365 374 $ hg commit -d '9 0' -m 'reopen branch with a change'
366 375 reopening closed branch head 12
367 376
368 377 --- branch b is back in action
369 378
370 379 $ hg branches -a
371 380 b 13:e23b5505d1ad
372 381 a branch name much longer than the default justification used by branches 7:10ff5895aa57
373 382
374 383 ---- test heads listings
375 384
376 385 $ hg heads
377 386 changeset: 13:e23b5505d1ad
378 387 branch: b
379 388 tag: tip
380 389 user: test
381 390 date: Thu Jan 01 00:00:09 1970 +0000
382 391 summary: reopen branch with a change
383 392
384 393 changeset: 7:10ff5895aa57
385 394 branch: a branch name much longer than the default justification used by branches
386 395 user: test
387 396 date: Thu Jan 01 00:00:06 1970 +0000
388 397 summary: Adding d branch
389 398
390 399 changeset: 6:589736a22561
391 400 branch: c
392 401 user: test
393 402 date: Thu Jan 01 00:00:05 1970 +0000
394 403 summary: Adding c branch
395 404
396 405 changeset: 5:d8cbc61dbaa6
397 406 branch: a
398 407 parent: 2:881fe2b92ad0
399 408 user: test
400 409 date: Thu Jan 01 00:00:04 1970 +0000
401 410 summary: Adding b branch head 2
402 411
403 412 changeset: 0:19709c5a4e75
404 413 user: test
405 414 date: Thu Jan 01 00:00:00 1970 +0000
406 415 summary: Adding root node
407 416
408 417
409 418 branch default
410 419
411 420 $ hg heads default
412 421 changeset: 0:19709c5a4e75
413 422 user: test
414 423 date: Thu Jan 01 00:00:00 1970 +0000
415 424 summary: Adding root node
416 425
417 426
418 427 branch a
419 428
420 429 $ hg heads a
421 430 changeset: 5:d8cbc61dbaa6
422 431 branch: a
423 432 parent: 2:881fe2b92ad0
424 433 user: test
425 434 date: Thu Jan 01 00:00:04 1970 +0000
426 435 summary: Adding b branch head 2
427 436
428 437 $ hg heads --active a
429 438 no open branch heads found on branches a
430 439 [1]
431 440
432 441 branch b
433 442
434 443 $ hg heads b
435 444 changeset: 13:e23b5505d1ad
436 445 branch: b
437 446 tag: tip
438 447 user: test
439 448 date: Thu Jan 01 00:00:09 1970 +0000
440 449 summary: reopen branch with a change
441 450
442 451 $ hg heads --closed b
443 452 changeset: 13:e23b5505d1ad
444 453 branch: b
445 454 tag: tip
446 455 user: test
447 456 date: Thu Jan 01 00:00:09 1970 +0000
448 457 summary: reopen branch with a change
449 458
450 459 changeset: 11:d3f163457ebf
451 460 branch: b
452 461 user: test
453 462 date: Thu Jan 01 00:00:09 1970 +0000
454 463 summary: prune bad branch
455 464
456 465
457 466 reclose branch
458 467
459 468 $ hg up -C c
460 469 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
461 470 $ hg commit -d '9 0' --close-branch -m 'reclosing this branch'
462 471 $ hg branches
463 472 b 13:e23b5505d1ad
464 473 a branch name much longer than the default justification used by branches 7:10ff5895aa57
465 474 a 5:d8cbc61dbaa6 (inactive)
466 475 default 0:19709c5a4e75 (inactive)
467 476 $ hg branches --closed
468 477 b 13:e23b5505d1ad
469 478 a branch name much longer than the default justification used by branches 7:10ff5895aa57
470 479 c 14:f894c25619d3 (closed)
471 480 a 5:d8cbc61dbaa6 (inactive)
472 481 default 0:19709c5a4e75 (inactive)
473 482
474 483 multihead branch
475 484
476 485 $ hg up -C default
477 486 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
478 487 $ hg branch m
479 488 marked working directory as branch m
480 489 $ touch m
481 490 $ hg add m
482 491 $ hg commit -d '10 0' -m 'multihead base'
483 492 $ echo "m1" >m
484 493 $ hg commit -d '10 0' -m 'head 1'
485 494 $ hg up -C '.^'
486 495 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 496 $ echo "m2" >m
488 497 $ hg commit -d '10 0' -m 'head 2'
489 498 created new head
490 499 $ hg log -b m
491 500 changeset: 17:df343b0df04f
492 501 branch: m
493 502 tag: tip
494 503 parent: 15:f3447637f53e
495 504 user: test
496 505 date: Thu Jan 01 00:00:10 1970 +0000
497 506 summary: head 2
498 507
499 508 changeset: 16:a58ca5d3bdf3
500 509 branch: m
501 510 user: test
502 511 date: Thu Jan 01 00:00:10 1970 +0000
503 512 summary: head 1
504 513
505 514 changeset: 15:f3447637f53e
506 515 branch: m
507 516 parent: 0:19709c5a4e75
508 517 user: test
509 518 date: Thu Jan 01 00:00:10 1970 +0000
510 519 summary: multihead base
511 520
512 521 $ hg heads --topo m
513 522 changeset: 17:df343b0df04f
514 523 branch: m
515 524 tag: tip
516 525 parent: 15:f3447637f53e
517 526 user: test
518 527 date: Thu Jan 01 00:00:10 1970 +0000
519 528 summary: head 2
520 529
521 530 changeset: 16:a58ca5d3bdf3
522 531 branch: m
523 532 user: test
524 533 date: Thu Jan 01 00:00:10 1970 +0000
525 534 summary: head 1
526 535
527 536 $ hg branches
528 537 m 17:df343b0df04f
529 538 b 13:e23b5505d1ad
530 539 a branch name much longer than the default justification used by branches 7:10ff5895aa57
531 540 a 5:d8cbc61dbaa6 (inactive)
532 541 default 0:19709c5a4e75 (inactive)
533 542
534 543 partially merge multihead branch
535 544
536 545 $ hg up -C default
537 546 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
538 547 $ hg branch md
539 548 marked working directory as branch md
540 549 $ hg merge m
541 550 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
542 551 (branch merge, don't forget to commit)
543 552 $ hg commit -d '11 0' -m 'merge head 2'
544 553 $ hg heads --topo m
545 554 changeset: 16:a58ca5d3bdf3
546 555 branch: m
547 556 user: test
548 557 date: Thu Jan 01 00:00:10 1970 +0000
549 558 summary: head 1
550 559
551 560 $ hg branches
552 561 md 18:c914c99f1fbb
553 562 m 17:df343b0df04f
554 563 b 13:e23b5505d1ad
555 564 a branch name much longer than the default justification used by branches 7:10ff5895aa57
556 565 a 5:d8cbc61dbaa6 (inactive)
557 566 default 0:19709c5a4e75 (inactive)
558 567
559 568 partially close multihead branch
560 569
561 570 $ hg up -C a58ca5d3bdf3
562 571 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
563 572 $ hg commit -d '12 0' -m 'close head 1' --close-branch
564 573 $ hg heads --topo m
565 574 changeset: 19:cd21a80baa3d
566 575 branch: m
567 576 tag: tip
568 577 parent: 16:a58ca5d3bdf3
569 578 user: test
570 579 date: Thu Jan 01 00:00:12 1970 +0000
571 580 summary: close head 1
572 581
573 582 $ hg branches
574 583 md 18:c914c99f1fbb
575 584 b 13:e23b5505d1ad
576 585 a branch name much longer than the default justification used by branches 7:10ff5895aa57
577 586 m 17:df343b0df04f (inactive)
578 587 a 5:d8cbc61dbaa6 (inactive)
579 588 default 0:19709c5a4e75 (inactive)
580 589
581 590 default branch colors:
582 591
583 592 $ cat <<EOF >> $HGRCPATH
584 593 > [extensions]
585 594 > color =
586 595 > [color]
587 596 > mode = ansi
588 597 > EOF
589 598
590 599 $ hg up -C b
591 600 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
592 601 $ hg branches --color=always
593 602 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
594 603 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
595 604 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
596 605 \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc)
597 606 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
598 607 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
599 608
600 609 default closed branch color:
601 610
602 611 $ hg branches --color=always --closed
603 612 \x1b[0;0mmd\x1b[0m\x1b[0;33m 18:c914c99f1fbb\x1b[0m (esc)
604 613 \x1b[0;32mb\x1b[0m\x1b[0;33m 13:e23b5505d1ad\x1b[0m (esc)
605 614 \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;33m 7:10ff5895aa57\x1b[0m (esc)
606 615 \x1b[0;0mm\x1b[0m\x1b[0;33m 17:df343b0df04f\x1b[0m (inactive) (esc)
607 616 \x1b[0;30;1mc\x1b[0m\x1b[0;33m 14:f894c25619d3\x1b[0m (closed) (esc)
608 617 \x1b[0;0ma\x1b[0m\x1b[0;33m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
609 618 \x1b[0;0mdefault\x1b[0m\x1b[0;33m 0:19709c5a4e75\x1b[0m (inactive) (esc)
610 619
611 620 $ cat <<EOF >> $HGRCPATH
612 621 > [extensions]
613 622 > color =
614 623 > [color]
615 624 > branches.active = green
616 625 > branches.closed = blue
617 626 > branches.current = red
618 627 > branches.inactive = magenta
619 628 > log.changeset = cyan
620 629 > EOF
621 630
622 631 custom branch colors:
623 632
624 633 $ hg branches --color=always
625 634 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
626 635 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
627 636 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
628 637 \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc)
629 638 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
630 639 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
631 640
632 641 custom closed branch color:
633 642
634 643 $ hg branches --color=always --closed
635 644 \x1b[0;32mmd\x1b[0m\x1b[0;36m 18:c914c99f1fbb\x1b[0m (esc)
636 645 \x1b[0;31mb\x1b[0m\x1b[0;36m 13:e23b5505d1ad\x1b[0m (esc)
637 646 \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m\x1b[0;36m 7:10ff5895aa57\x1b[0m (esc)
638 647 \x1b[0;35mm\x1b[0m\x1b[0;36m 17:df343b0df04f\x1b[0m (inactive) (esc)
639 648 \x1b[0;34mc\x1b[0m\x1b[0;36m 14:f894c25619d3\x1b[0m (closed) (esc)
640 649 \x1b[0;35ma\x1b[0m\x1b[0;36m 5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
641 650 \x1b[0;35mdefault\x1b[0m\x1b[0;36m 0:19709c5a4e75\x1b[0m (inactive) (esc)
642 651
643 652 template output:
644 653
645 654 $ hg branches -Tjson --closed
646 655 [
647 656 {
648 657 "active": true,
649 658 "branch": "md",
650 659 "closed": false,
651 660 "current": false,
652 661 "node": "c914c99f1fbb2b1d785a0a939ed3f67275df18e9",
653 662 "rev": 18
654 663 },
655 664 {
656 665 "active": true,
657 666 "branch": "b",
658 667 "closed": false,
659 668 "current": true,
660 669 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
661 670 "rev": 13
662 671 },
663 672 {
664 673 "active": true,
665 674 "branch": "a branch name much longer than the default justification used by branches",
666 675 "closed": false,
667 676 "current": false,
668 677 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
669 678 "rev": 7
670 679 },
671 680 {
672 681 "active": false,
673 682 "branch": "m",
674 683 "closed": false,
675 684 "current": false,
676 685 "node": "df343b0df04feb2a946cd4b6e9520e552fef14ee",
677 686 "rev": 17
678 687 },
679 688 {
680 689 "active": false,
681 690 "branch": "c",
682 691 "closed": true,
683 692 "current": false,
684 693 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
685 694 "rev": 14
686 695 },
687 696 {
688 697 "active": false,
689 698 "branch": "a",
690 699 "closed": false,
691 700 "current": false,
692 701 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
693 702 "rev": 5
694 703 },
695 704 {
696 705 "active": false,
697 706 "branch": "default",
698 707 "closed": false,
699 708 "current": false,
700 709 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
701 710 "rev": 0
702 711 }
703 712 ]
704 713
705 714 $ hg branches --closed -T '{if(closed, "{branch}\n")}'
706 715 c
707 716
708 717 $ hg branches -T '{word(0, branch)}: {desc|firstline}\n'
709 718 md: merge head 2
710 719 b: reopen branch with a change
711 720 a: Adding d branch
712 721 m: head 2
713 722 a: Adding b branch head 2
714 723 default: Adding root node
715 724
716 725 $ cat <<'EOF' > "$TESTTMP/map-myjson"
717 726 > docheader = '\{\n'
718 727 > docfooter = '\n}\n'
719 728 > separator = ',\n'
720 729 > branches = ' {dict(branch, node|short)|json}'
721 730 > EOF
722 731 $ hg branches -T "$TESTTMP/map-myjson"
723 732 {
724 733 {"branch": "md", "node": "c914c99f1fbb"},
725 734 {"branch": "b", "node": "e23b5505d1ad"},
726 735 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
727 736 {"branch": "m", "node": "df343b0df04f"},
728 737 {"branch": "a", "node": "d8cbc61dbaa6"},
729 738 {"branch": "default", "node": "19709c5a4e75"}
730 739 }
731 740
732 741 $ cat <<'EOF' >> .hg/hgrc
733 742 > [templates]
734 743 > myjson = ' {dict(branch, node|short)|json}'
735 744 > myjson:docheader = '\{\n'
736 745 > myjson:docfooter = '\n}\n'
737 746 > myjson:separator = ',\n'
738 747 > EOF
739 748 $ hg branches -T myjson
740 749 {
741 750 {"branch": "md", "node": "c914c99f1fbb"},
742 751 {"branch": "b", "node": "e23b5505d1ad"},
743 752 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)
744 753 {"branch": "m", "node": "df343b0df04f"},
745 754 {"branch": "a", "node": "d8cbc61dbaa6"},
746 755 {"branch": "default", "node": "19709c5a4e75"}
747 756 }
748 757
749 758 $ cat <<'EOF' >> .hg/hgrc
750 759 > [templates]
751 760 > :docheader = 'should not be selected as a docheader for literal templates\n'
752 761 > EOF
753 762 $ hg branches -T '{branch}\n'
754 763 md
755 764 b
756 765 a branch name much longer than the default justification used by branches
757 766 m
758 767 a
759 768 default
760 769
761 770 Tests of revision branch name caching
762 771
763 772 We rev branch cache is updated automatically. In these tests we use a trick to
764 773 trigger rebuilds. We remove the branch head cache and run 'hg head' to cause a
765 774 rebuild that also will populate the rev branch cache.
766 775
767 776 revision branch cache is created when building the branch head cache
768 777 $ rm -rf .hg/cache; hg head a -T '{rev}\n'
769 778 5
770 779 $ f --hexdump --size .hg/cache/rbc-*
771 780 .hg/cache/rbc-names-v1: size=92
772 781 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
773 782 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
774 783 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
775 784 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
776 785 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
777 786 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 |ranches.m.md|
778 787 .hg/cache/rbc-revs-v1: size=160
779 788 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
780 789 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
781 790 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
782 791 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
783 792 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
784 793 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
785 794 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
786 795 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....|
787 796 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....|
788 797 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......|
789 798
790 799 no errors when revbranchcache is not writable
791 800
792 801 $ echo >> .hg/cache/rbc-revs-v1
793 802 $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
794 803 $ mkdir .hg/cache/rbc-revs-v1
795 804 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n'
796 805 5
797 806 $ rmdir .hg/cache/rbc-revs-v1
798 807 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
799 808
800 809 no errors when wlock cannot be acquired
801 810
802 811 #if unix-permissions
803 812 $ mv .hg/cache/rbc-revs-v1 .hg/cache/rbc-revs-v1_
804 813 $ rm -f .hg/cache/branch*
805 814 $ chmod 555 .hg
806 815 $ hg head a -T '{rev}\n'
807 816 5
808 817 $ chmod 755 .hg
809 818 $ mv .hg/cache/rbc-revs-v1_ .hg/cache/rbc-revs-v1
810 819 #endif
811 820
812 821 recovery from invalid cache revs file with trailing data
813 822 $ echo >> .hg/cache/rbc-revs-v1
814 823 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
815 824 5
816 825 truncating cache/rbc-revs-v1 to 160
817 826 $ f --size .hg/cache/rbc-revs*
818 827 .hg/cache/rbc-revs-v1: size=160
819 828 recovery from invalid cache file with partial last record
820 829 $ mv .hg/cache/rbc-revs-v1 .
821 830 $ f -qDB 119 rbc-revs-v1 > .hg/cache/rbc-revs-v1
822 831 $ f --size .hg/cache/rbc-revs*
823 832 .hg/cache/rbc-revs-v1: size=119
824 833 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
825 834 5
826 835 truncating cache/rbc-revs-v1 to 112
827 836 $ f --size .hg/cache/rbc-revs*
828 837 .hg/cache/rbc-revs-v1: size=160
829 838 recovery from invalid cache file with missing record - no truncation
830 839 $ mv .hg/cache/rbc-revs-v1 .
831 840 $ f -qDB 112 rbc-revs-v1 > .hg/cache/rbc-revs-v1
832 841 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
833 842 5
834 843 $ f --size .hg/cache/rbc-revs*
835 844 .hg/cache/rbc-revs-v1: size=160
836 845 recovery from invalid cache file with some bad records
837 846 $ mv .hg/cache/rbc-revs-v1 .
838 847 $ f -qDB 8 rbc-revs-v1 > .hg/cache/rbc-revs-v1
839 848 $ f --size .hg/cache/rbc-revs*
840 849 .hg/cache/rbc-revs-v1: size=8
841 850 $ f -qDB 112 rbc-revs-v1 >> .hg/cache/rbc-revs-v1
842 851 $ f --size .hg/cache/rbc-revs*
843 852 .hg/cache/rbc-revs-v1: size=120
844 853 $ hg log -r 'branch(.)' -T '{rev} ' --debug
845 854 history modification detected - truncating revision branch cache to revision 13
846 855 history modification detected - truncating revision branch cache to revision 1
847 856 3 4 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 8
848 857 $ rm -f .hg/cache/branch* && hg head a -T '{rev}\n' --debug
849 858 5
850 859 truncating cache/rbc-revs-v1 to 104
851 860 $ f --size --hexdump --bytes=16 .hg/cache/rbc-revs*
852 861 .hg/cache/rbc-revs-v1: size=160
853 862 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
854 863 cache is updated when committing
855 864 $ hg branch i-will-regret-this
856 865 marked working directory as branch i-will-regret-this
857 866 $ hg ci -m regrets
858 867 $ f --size .hg/cache/rbc-*
859 868 .hg/cache/rbc-names-v1: size=111
860 869 .hg/cache/rbc-revs-v1: size=168
861 870 update after rollback - the cache will be correct but rbc-names will will still
862 871 contain the branch name even though it no longer is used
863 872 $ hg up -qr '.^'
864 873 $ hg rollback -qf
865 874 $ f --size --hexdump .hg/cache/rbc-*
866 875 .hg/cache/rbc-names-v1: size=111
867 876 0000: 64 65 66 61 75 6c 74 00 61 00 62 00 63 00 61 20 |default.a.b.c.a |
868 877 0010: 62 72 61 6e 63 68 20 6e 61 6d 65 20 6d 75 63 68 |branch name much|
869 878 0020: 20 6c 6f 6e 67 65 72 20 74 68 61 6e 20 74 68 65 | longer than the|
870 879 0030: 20 64 65 66 61 75 6c 74 20 6a 75 73 74 69 66 69 | default justifi|
871 880 0040: 63 61 74 69 6f 6e 20 75 73 65 64 20 62 79 20 62 |cation used by b|
872 881 0050: 72 61 6e 63 68 65 73 00 6d 00 6d 64 00 69 2d 77 |ranches.m.md.i-w|
873 882 0060: 69 6c 6c 2d 72 65 67 72 65 74 2d 74 68 69 73 |ill-regret-this|
874 883 .hg/cache/rbc-revs-v1: size=160
875 884 0000: 19 70 9c 5a 00 00 00 00 dd 6b 44 0d 00 00 00 01 |.p.Z.....kD.....|
876 885 0010: 88 1f e2 b9 00 00 00 01 ac 22 03 33 00 00 00 02 |.........".3....|
877 886 0020: ae e3 9c d1 00 00 00 02 d8 cb c6 1d 00 00 00 01 |................|
878 887 0030: 58 97 36 a2 00 00 00 03 10 ff 58 95 00 00 00 04 |X.6.......X.....|
879 888 0040: ee bb 94 44 00 00 00 02 5f 40 61 bb 00 00 00 02 |...D...._@a.....|
880 889 0050: bf be 84 1b 00 00 00 02 d3 f1 63 45 80 00 00 02 |..........cE....|
881 890 0060: e3 d4 9c 05 80 00 00 02 e2 3b 55 05 00 00 00 02 |.........;U.....|
882 891 0070: f8 94 c2 56 80 00 00 03 f3 44 76 37 00 00 00 05 |...V.....Dv7....|
883 892 0080: a5 8c a5 d3 00 00 00 05 df 34 3b 0d 00 00 00 05 |.........4;.....|
884 893 0090: c9 14 c9 9f 00 00 00 06 cd 21 a8 0b 80 00 00 05 |.........!......|
885 894 cache is updated/truncated when stripping - it is thus very hard to get in a
886 895 situation where the cache is out of sync and the hash check detects it
887 896 $ hg --config extensions.strip= strip -r tip --nob
888 897 $ f --size .hg/cache/rbc-revs*
889 898 .hg/cache/rbc-revs-v1: size=152
890 899
891 900 cache is rebuilt when corruption is detected
892 901 $ echo > .hg/cache/rbc-names-v1
893 902 $ hg log -r '5:&branch(.)' -T '{rev} ' --debug
894 903 referenced branch names not found - rebuilding revision branch cache from scratch
895 904 8 9 10 11 12 13 truncating cache/rbc-revs-v1 to 40
896 905 $ f --size --hexdump .hg/cache/rbc-*
897 906 .hg/cache/rbc-names-v1: size=84
898 907 0000: 62 00 61 00 63 00 61 20 62 72 61 6e 63 68 20 6e |b.a.c.a branch n|
899 908 0010: 61 6d 65 20 6d 75 63 68 20 6c 6f 6e 67 65 72 20 |ame much longer |
900 909 0020: 74 68 61 6e 20 74 68 65 20 64 65 66 61 75 6c 74 |than the default|
901 910 0030: 20 6a 75 73 74 69 66 69 63 61 74 69 6f 6e 20 75 | justification u|
902 911 0040: 73 65 64 20 62 79 20 62 72 61 6e 63 68 65 73 00 |sed by branches.|
903 912 0050: 6d 00 6d 64 |m.md|
904 913 .hg/cache/rbc-revs-v1: size=152
905 914 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
906 915 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
907 916 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 01 |................|
908 917 0030: 58 97 36 a2 00 00 00 02 10 ff 58 95 00 00 00 03 |X.6.......X.....|
909 918 0040: ee bb 94 44 00 00 00 00 5f 40 61 bb 00 00 00 00 |...D...._@a.....|
910 919 0050: bf be 84 1b 00 00 00 00 d3 f1 63 45 80 00 00 00 |..........cE....|
911 920 0060: e3 d4 9c 05 80 00 00 00 e2 3b 55 05 00 00 00 00 |.........;U.....|
912 921 0070: f8 94 c2 56 80 00 00 02 f3 44 76 37 00 00 00 04 |...V.....Dv7....|
913 922 0080: a5 8c a5 d3 00 00 00 04 df 34 3b 0d 00 00 00 04 |.........4;.....|
914 923 0090: c9 14 c9 9f 00 00 00 05 |........|
915 924
916 925 Test that cache files are created and grows correctly:
917 926
918 927 $ rm .hg/cache/rbc*
919 928 $ hg log -r "5 & branch(5)" -T "{rev}\n"
920 929 5
921 930 $ f --size --hexdump .hg/cache/rbc-*
922 931 .hg/cache/rbc-names-v1: size=1
923 932 0000: 61 |a|
924 .hg/cache/rbc-revs-v1: size=152
933 .hg/cache/rbc-revs-v1: size=48
925 934 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
926 935 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
927 936 0020: 00 00 00 00 00 00 00 00 d8 cb c6 1d 00 00 00 00 |................|
928 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
929 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
930 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
931 0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
932 0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
933 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
934 0090: 00 00 00 00 00 00 00 00 |........|
935 937
936 938 $ cd ..
937 939
938 940 Test for multiple incorrect branch cache entries:
939 941
940 942 $ hg init b
941 943 $ cd b
942 944 $ touch f
943 945 $ hg ci -Aqmf
944 946 $ echo >> f
945 947 $ hg ci -Amf
946 948 $ hg branch -q branch
947 949 $ hg ci -Amf
948 950
949 951 $ f --size --hexdump .hg/cache/rbc-*
950 952 .hg/cache/rbc-names-v1: size=14
951 953 0000: 64 65 66 61 75 6c 74 00 62 72 61 6e 63 68 |default.branch|
952 954 .hg/cache/rbc-revs-v1: size=24
953 955 0000: 66 e5 f5 aa 00 00 00 00 fa 4c 04 e5 00 00 00 00 |f........L......|
954 956 0010: 56 46 78 69 00 00 00 01 |VFxi....|
955 957 $ : > .hg/cache/rbc-revs-v1
956 958
957 959 No superfluous rebuilding of cache:
958 960 $ hg log -r "branch(null)&branch(branch)" --debug
959 961 $ f --size --hexdump .hg/cache/rbc-*
960 962 .hg/cache/rbc-names-v1: size=14
961 963 0000: 64 65 66 61 75 6c 74 00 62 72 61 6e 63 68 |default.branch|
962 964 .hg/cache/rbc-revs-v1: size=24
963 965 0000: 66 e5 f5 aa 00 00 00 00 fa 4c 04 e5 00 00 00 00 |f........L......|
964 966 0010: 56 46 78 69 00 00 00 01 |VFxi....|
965 967
966 968 $ cd ..
967 969
968 970 Test to make sure that `--close-branch` only works on a branch head:
969 971 --------------------------------------------------------------------
970 972 $ hg init closebranch
971 973 $ cd closebranch
972 974 $ for ch in a b c; do
973 975 > echo $ch > $ch
974 976 > hg add $ch
975 977 > hg ci -m "added "$ch
976 978 > done;
977 979
978 980 $ hg up -r "desc('added b')"
979 981 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
980 982
981 983 trying to close branch from a cset which is not a branch head
982 984 it should abort:
983 985 $ hg ci -m "closing branch" --close-branch
984 986 abort: can only close branch heads
985 987 (use --force-close-branch to close branch from a non-head changeset)
986 988 [10]
987 989
988 990 $ hg up 0
989 991 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
990 992 $ hg log -GT "{rev}: {node|short} {desc|firstline}\n\t{branch}\n\n"
991 993 o 2: 155349b645be added c
992 994 | default
993 995 |
994 996 o 1: 5f6d8a4bf34a added b
995 997 | default
996 998 |
997 999 @ 0: 9092f1db7931 added a
998 1000 default
999 1001
1000 1002 Test --force-close-branch to close a branch from a non-head changeset:
1001 1003 ---------------------------------------------------------------------
1002 1004
1003 1005 $ hg show stack --config extensions.show=
1004 1006 o 1553 added c
1005 1007 o 5f6d added b
1006 1008 @ 9092 added a
1007 1009
1008 1010 $ hg ci -m "branch closed" --close-branch
1009 1011 abort: can only close branch heads
1010 1012 (use --force-close-branch to close branch from a non-head changeset)
1011 1013 [10]
1012 1014
1013 1015 $ hg ci -m "branch closed" --force-close-branch
1014 1016 created new head
1015 1017 $ cd ..
1016 1018
1017 1019 Test various special cases for the branchmap
1018 1020 --------------------------------------------
1019 1021
1020 1022 Basic fork of the same branch
1021 1023
1022 1024 $ hg init branchmap-testing1
1023 1025 $ cd branchmap-testing1
1024 1026 $ hg debugbuild '@A . :base . :p1 *base /p1'
1025 1027 $ hg log -G
1026 1028 o changeset: 3:71ca9a6d524e
1027 1029 |\ branch: A
1028 1030 | | tag: tip
1029 1031 | | parent: 2:a3b807b3ff0b
1030 1032 | | parent: 1:99ba08759bc7
1031 1033 | | user: debugbuilddag
1032 1034 | | date: Thu Jan 01 00:00:03 1970 +0000
1033 1035 | | summary: r3
1034 1036 | |
1035 1037 | o changeset: 2:a3b807b3ff0b
1036 1038 | | branch: A
1037 1039 | | parent: 0:2ab8003a1750
1038 1040 | | user: debugbuilddag
1039 1041 | | date: Thu Jan 01 00:00:02 1970 +0000
1040 1042 | | summary: r2
1041 1043 | |
1042 1044 o | changeset: 1:99ba08759bc7
1043 1045 |/ branch: A
1044 1046 | tag: p1
1045 1047 | user: debugbuilddag
1046 1048 | date: Thu Jan 01 00:00:01 1970 +0000
1047 1049 | summary: r1
1048 1050 |
1049 1051 o changeset: 0:2ab8003a1750
1050 1052 branch: A
1051 1053 tag: base
1052 1054 user: debugbuilddag
1053 1055 date: Thu Jan 01 00:00:00 1970 +0000
1054 1056 summary: r0
1055 1057
1056 1058 $ hg branches
1057 1059 A 3:71ca9a6d524e
1058 1060 $ hg clone -r 1 -r 2 . ../branchmap-testing1-clone
1059 1061 adding changesets
1060 1062 adding manifests
1061 1063 adding file changes
1062 1064 added 3 changesets with 0 changes to 0 files (+1 heads)
1063 1065 new changesets 2ab8003a1750:a3b807b3ff0b
1064 1066 updating to branch A
1065 1067 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1066 1068 $ cd ../branchmap-testing1-clone
1067 1069 $ hg pull ../branchmap-testing1
1068 1070 pulling from ../branchmap-testing1
1069 1071 searching for changes
1070 1072 adding changesets
1071 1073 adding manifests
1072 1074 adding file changes
1073 1075 added 1 changesets with 0 changes to 0 files (-1 heads)
1074 1076 new changesets 71ca9a6d524e
1075 1077 (run 'hg update' to get a working copy)
1076 1078 $ hg branches
1077 1079 A 3:71ca9a6d524e
1078 1080 $ cd ..
1079 1081
1080 1082 Switching to a different branch and back
1081 1083
1082 1084 $ hg init branchmap-testing2
1083 1085 $ cd branchmap-testing2
1084 1086 $ hg debugbuild '@A . @B . @A .'
1085 1087 $ hg log -G
1086 1088 o changeset: 2:9699e9f260b5
1087 1089 | branch: A
1088 1090 | tag: tip
1089 1091 | user: debugbuilddag
1090 1092 | date: Thu Jan 01 00:00:02 1970 +0000
1091 1093 | summary: r2
1092 1094 |
1093 1095 o changeset: 1:0bc7d348d965
1094 1096 | branch: B
1095 1097 | user: debugbuilddag
1096 1098 | date: Thu Jan 01 00:00:01 1970 +0000
1097 1099 | summary: r1
1098 1100 |
1099 1101 o changeset: 0:2ab8003a1750
1100 1102 branch: A
1101 1103 user: debugbuilddag
1102 1104 date: Thu Jan 01 00:00:00 1970 +0000
1103 1105 summary: r0
1104 1106
1105 1107 $ hg branches
1106 1108 A 2:9699e9f260b5
1107 1109 B 1:0bc7d348d965 (inactive)
1108 1110 $ hg clone -r 1 . ../branchmap-testing2-clone
1109 1111 adding changesets
1110 1112 adding manifests
1111 1113 adding file changes
1112 1114 added 2 changesets with 0 changes to 0 files
1113 1115 new changesets 2ab8003a1750:0bc7d348d965
1114 1116 updating to branch B
1115 1117 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1116 1118 $ cd ../branchmap-testing2-clone
1117 1119 $ hg pull ../branchmap-testing2
1118 1120 pulling from ../branchmap-testing2
1119 1121 searching for changes
1120 1122 adding changesets
1121 1123 adding manifests
1122 1124 adding file changes
1123 1125 added 1 changesets with 0 changes to 0 files
1124 1126 new changesets 9699e9f260b5
1125 1127 (run 'hg update' to get a working copy)
1126 1128 $ hg branches
1127 1129 A 2:9699e9f260b5
1128 1130 B 1:0bc7d348d965 (inactive)
1129 1131 $ cd ..
1130 1132
1131 1133 A fork on a branch switching to a different branch and back
1132 1134 is still collecting the fork.
1133 1135
1134 1136 $ hg init branchmap-testing3
1135 1137 $ cd branchmap-testing3
1136 1138 $ hg debugbuild '@A . :base . :p1 *base @B . @A /p1'
1137 1139 $ hg log -G
1138 1140 o changeset: 4:3614a1711d23
1139 1141 |\ branch: A
1140 1142 | | tag: tip
1141 1143 | | parent: 3:e9c8abcf65aa
1142 1144 | | parent: 1:99ba08759bc7
1143 1145 | | user: debugbuilddag
1144 1146 | | date: Thu Jan 01 00:00:04 1970 +0000
1145 1147 | | summary: r4
1146 1148 | |
1147 1149 | o changeset: 3:e9c8abcf65aa
1148 1150 | | branch: B
1149 1151 | | user: debugbuilddag
1150 1152 | | date: Thu Jan 01 00:00:03 1970 +0000
1151 1153 | | summary: r3
1152 1154 | |
1153 1155 | o changeset: 2:a3b807b3ff0b
1154 1156 | | branch: A
1155 1157 | | parent: 0:2ab8003a1750
1156 1158 | | user: debugbuilddag
1157 1159 | | date: Thu Jan 01 00:00:02 1970 +0000
1158 1160 | | summary: r2
1159 1161 | |
1160 1162 o | changeset: 1:99ba08759bc7
1161 1163 |/ branch: A
1162 1164 | tag: p1
1163 1165 | user: debugbuilddag
1164 1166 | date: Thu Jan 01 00:00:01 1970 +0000
1165 1167 | summary: r1
1166 1168 |
1167 1169 o changeset: 0:2ab8003a1750
1168 1170 branch: A
1169 1171 tag: base
1170 1172 user: debugbuilddag
1171 1173 date: Thu Jan 01 00:00:00 1970 +0000
1172 1174 summary: r0
1173 1175
1174 1176 $ hg branches
1175 1177 A 4:3614a1711d23
1176 1178 B 3:e9c8abcf65aa (inactive)
1177 1179 $ hg clone -r 1 -r 3 . ../branchmap-testing3-clone
1178 1180 adding changesets
1179 1181 adding manifests
1180 1182 adding file changes
1181 1183 added 4 changesets with 0 changes to 0 files (+1 heads)
1182 1184 new changesets 2ab8003a1750:e9c8abcf65aa
1183 1185 updating to branch A
1184 1186 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1185 1187 $ cd ../branchmap-testing3-clone
1186 1188 $ hg pull ../branchmap-testing3
1187 1189 pulling from ../branchmap-testing3
1188 1190 searching for changes
1189 1191 adding changesets
1190 1192 adding manifests
1191 1193 adding file changes
1192 1194 added 1 changesets with 0 changes to 0 files (-1 heads)
1193 1195 new changesets 3614a1711d23
1194 1196 (run 'hg update' to get a working copy)
1195 1197 $ hg branches
1196 1198 A 4:3614a1711d23
1197 1199 B 3:e9c8abcf65aa (inactive)
1198 1200 $ cd ..
1199 1201
1200 1202 Intermediary parents are on different branches.
1201 1203
1202 1204 $ hg init branchmap-testing4
1203 1205 $ cd branchmap-testing4
1204 1206 $ hg debugbuild '@A . @B :base . @A :p1 *base @C . @A /p1'
1205 1207 $ hg log -G
1206 1208 o changeset: 4:4bf67499b70a
1207 1209 |\ branch: A
1208 1210 | | tag: tip
1209 1211 | | parent: 3:4a546028fa8f
1210 1212 | | parent: 1:0bc7d348d965
1211 1213 | | user: debugbuilddag
1212 1214 | | date: Thu Jan 01 00:00:04 1970 +0000
1213 1215 | | summary: r4
1214 1216 | |
1215 1217 | o changeset: 3:4a546028fa8f
1216 1218 | | branch: C
1217 1219 | | user: debugbuilddag
1218 1220 | | date: Thu Jan 01 00:00:03 1970 +0000
1219 1221 | | summary: r3
1220 1222 | |
1221 1223 | o changeset: 2:a3b807b3ff0b
1222 1224 | | branch: A
1223 1225 | | parent: 0:2ab8003a1750
1224 1226 | | user: debugbuilddag
1225 1227 | | date: Thu Jan 01 00:00:02 1970 +0000
1226 1228 | | summary: r2
1227 1229 | |
1228 1230 o | changeset: 1:0bc7d348d965
1229 1231 |/ branch: B
1230 1232 | tag: p1
1231 1233 | user: debugbuilddag
1232 1234 | date: Thu Jan 01 00:00:01 1970 +0000
1233 1235 | summary: r1
1234 1236 |
1235 1237 o changeset: 0:2ab8003a1750
1236 1238 branch: A
1237 1239 tag: base
1238 1240 user: debugbuilddag
1239 1241 date: Thu Jan 01 00:00:00 1970 +0000
1240 1242 summary: r0
1241 1243
1242 1244 $ hg branches
1243 1245 A 4:4bf67499b70a
1244 1246 C 3:4a546028fa8f (inactive)
1245 1247 B 1:0bc7d348d965 (inactive)
1246 1248 $ hg clone -r 1 -r 3 . ../branchmap-testing4-clone
1247 1249 adding changesets
1248 1250 adding manifests
1249 1251 adding file changes
1250 1252 added 4 changesets with 0 changes to 0 files (+1 heads)
1251 1253 new changesets 2ab8003a1750:4a546028fa8f
1252 1254 updating to branch B
1253 1255 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1254 1256 $ cd ../branchmap-testing4-clone
1255 1257 $ hg pull ../branchmap-testing4
1256 1258 pulling from ../branchmap-testing4
1257 1259 searching for changes
1258 1260 adding changesets
1259 1261 adding manifests
1260 1262 adding file changes
1261 1263 added 1 changesets with 0 changes to 0 files (-1 heads)
1262 1264 new changesets 4bf67499b70a
1263 1265 (run 'hg update' to get a working copy)
1264 1266 $ hg branches
1265 1267 A 4:4bf67499b70a
1266 1268 C 3:4a546028fa8f (inactive)
1267 1269 B 1:0bc7d348d965 (inactive)
1268 1270 $ cd ..
1269 1271
1270 1272 Check that the cache are not written too early
1271 1273 ----------------------------------------------
1272 1274
1273 1275 $ hg log -R branchmap-testing1 -G
1274 1276 o changeset: 3:71ca9a6d524e
1275 1277 |\ branch: A
1276 1278 | | tag: tip
1277 1279 | | parent: 2:a3b807b3ff0b
1278 1280 | | parent: 1:99ba08759bc7
1279 1281 | | user: debugbuilddag
1280 1282 | | date: Thu Jan 01 00:00:03 1970 +0000
1281 1283 | | summary: r3
1282 1284 | |
1283 1285 | o changeset: 2:a3b807b3ff0b
1284 1286 | | branch: A
1285 1287 | | parent: 0:2ab8003a1750
1286 1288 | | user: debugbuilddag
1287 1289 | | date: Thu Jan 01 00:00:02 1970 +0000
1288 1290 | | summary: r2
1289 1291 | |
1290 1292 o | changeset: 1:99ba08759bc7
1291 1293 |/ branch: A
1292 1294 | tag: p1
1293 1295 | user: debugbuilddag
1294 1296 | date: Thu Jan 01 00:00:01 1970 +0000
1295 1297 | summary: r1
1296 1298 |
1297 1299 o changeset: 0:2ab8003a1750
1298 1300 branch: A
1299 1301 tag: base
1300 1302 user: debugbuilddag
1301 1303 date: Thu Jan 01 00:00:00 1970 +0000
1302 1304 summary: r0
1303 1305
1304 1306 $ hg bundle -R branchmap-testing1 --base 1 bundle.hg --rev 'head()'
1305 1307 2 changesets found
1306 1308
1307 1309 Unbundling revision should warm the served cache
1308 1310
1309 1311 $ hg clone branchmap-testing1 --rev 1 branchmap-update-01
1310 1312 adding changesets
1311 1313 adding manifests
1312 1314 adding file changes
1313 1315 added 2 changesets with 0 changes to 0 files
1314 1316 new changesets 2ab8003a1750:99ba08759bc7
1315 1317 updating to branch A
1316 1318 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1317 1319 $ cat branchmap-update-01/.hg/cache/branch2-served
1318 1320 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1319 1321 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1320 1322 $ hg -R branchmap-update-01 unbundle bundle.hg
1321 1323 adding changesets
1322 1324 adding manifests
1323 1325 adding file changes
1324 1326 added 2 changesets with 0 changes to 0 files
1325 1327 new changesets a3b807b3ff0b:71ca9a6d524e (2 drafts)
1326 1328 (run 'hg update' to get a working copy)
1327 1329 $ cat branchmap-update-01/.hg/cache/branch2-served
1328 1330 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 3
1329 1331 71ca9a6d524ed3c2a215119b2086ac3b8c4c8286 o A
1330 1332
1331 1333 aborted Unbundle should not update the on disk cache
1332 1334
1333 1335 $ cat >> simplehook.py << EOF
1334 1336 > import sys
1335 1337 > from mercurial import node
1336 1338 > from mercurial import branchmap
1337 1339 > def hook(ui, repo, *args, **kwargs):
1338 1340 > s = repo.filtered(b"served")
1339 1341 > s.branchmap()
1340 1342 > return 1
1341 1343 > EOF
1342 1344 $ hg clone branchmap-testing1 --rev 1 branchmap-update-02
1343 1345 adding changesets
1344 1346 adding manifests
1345 1347 adding file changes
1346 1348 added 2 changesets with 0 changes to 0 files
1347 1349 new changesets 2ab8003a1750:99ba08759bc7
1348 1350 updating to branch A
1349 1351 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1350 1352
1351 1353 $ cat branchmap-update-02/.hg/cache/branch2-served
1352 1354 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1353 1355 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
1354 1356 $ hg -R branchmap-update-02 unbundle bundle.hg --config "hooks.pretxnclose=python:$TESTTMP/simplehook.py:hook"
1355 1357 adding changesets
1356 1358 adding manifests
1357 1359 adding file changes
1358 1360 transaction abort!
1359 1361 rollback completed
1360 1362 abort: pretxnclose hook failed
1361 1363 [40]
1362 1364 $ cat branchmap-update-02/.hg/cache/branch2-served
1363 1365 99ba08759bc7f6fdbe5304e83d0387f35c082479 1
1364 1366 99ba08759bc7f6fdbe5304e83d0387f35c082479 o A
General Comments 0
You need to be logged in to leave comments. Login now