Show More
@@ -1892,6 +1892,11 coreconfigitem( | |||
|
1892 | 1892 | default=True, |
|
1893 | 1893 | alias=[(b'format', b'aggressivemergedeltas')], |
|
1894 | 1894 | ) |
|
1895 | coreconfigitem( | |
|
1896 | b'storage', | |
|
1897 | b'revlog.issue6528.fix-incoming', | |
|
1898 | default=True, | |
|
1899 | ) | |
|
1895 | 1900 | # experimental as long as rust is experimental (or a C version is implemented) |
|
1896 | 1901 | coreconfigitem( |
|
1897 | 1902 | b'storage', |
@@ -38,6 +38,8 class filelog(object): | |||
|
38 | 38 | # Used by LFS. |
|
39 | 39 | self._revlog.filename = path |
|
40 | 40 | self.nullid = self._revlog.nullid |
|
41 | opts = opener.options | |
|
42 | self._fix_issue6528 = opts.get(b'issue6528.fix-incoming', True) | |
|
41 | 43 | |
|
42 | 44 | def __len__(self): |
|
43 | 45 | return len(self._revlog) |
@@ -160,7 +162,8 class filelog(object): | |||
|
160 | 162 | |
|
161 | 163 | with self._revlog._writing(transaction): |
|
162 | 164 | |
|
163 | deltas = rewrite.filter_delta_issue6528(self._revlog, deltas) | |
|
165 | if self._fix_issue6528: | |
|
166 | deltas = rewrite.filter_delta_issue6528(self._revlog, deltas) | |
|
164 | 167 | |
|
165 | 168 | return self._revlog.addgroup( |
|
166 | 169 | deltas, |
@@ -2043,6 +2043,21 Alias definitions for revsets. See :hg:` | |||
|
2043 | 2043 | Control the strategy Mercurial uses internally to store history. Options in this |
|
2044 | 2044 | category impact performance and repository size. |
|
2045 | 2045 | |
|
2046 | ``revlog.issue6528.fix-incoming`` | |
|
2047 | Version 5.8 of Mercurial had a bug leading to altering the parent of file | |
|
2048 | revision with copy information (or any other metadata) on exchange. This | |
|
2049 | leads to the copy metadata to be overlooked by various internal logic. The | |
|
2050 | issue was fixed in Mercurial 5.8.1. | |
|
2051 | (See https://bz.mercurial-scm.org/show_bug.cgi?id=6528 for details) | |
|
2052 | ||
|
2053 | As a result Mercurial is now checking and fixing incoming file revisions to | |
|
2054 | make sure there parents are in the right order. This behavior can be | |
|
2055 | disabled by setting this option to `no`. This apply to revisions added | |
|
2056 | through push, pull, clone and unbundle. | |
|
2057 | ||
|
2058 | To fix affected revisions that already exist within the repository, one can | |
|
2059 | use :hg:`debug-repair-issue-6528`. | |
|
2060 | ||
|
2046 | 2061 | ``revlog.optimize-delta-parent-choice`` |
|
2047 | 2062 | When storing a merge revision, both parents will be equally considered as |
|
2048 | 2063 | a possible delta base. This results in better delta selection and improved |
@@ -1043,6 +1043,9 def resolverevlogstorevfsoptions(ui, req | |||
|
1043 | 1043 | ) |
|
1044 | 1044 | options[b'deltabothparents'] = deltabothparents |
|
1045 | 1045 | |
|
1046 | issue6528 = ui.configbool(b'storage', b'revlog.issue6528.fix-incoming') | |
|
1047 | options[b'issue6528.fix-incoming'] = issue6528 | |
|
1048 | ||
|
1046 | 1049 | lazydelta = ui.configbool(b'storage', b'revlog.reuse-external-delta') |
|
1047 | 1050 | lazydeltabase = False |
|
1048 | 1051 | if lazydelta: |
@@ -524,3 +524,104 And that the repair command does not fin | |||
|
524 | 524 | no affected revisions were found |
|
525 | 525 | |
|
526 | 526 | $ cd .. |
|
527 | ||
|
528 | A config option can disable the fixing of the bad bundle on the fly | |
|
529 | ------------------------------------------------------------------- | |
|
530 | ||
|
531 | ||
|
532 | ||
|
533 | from a v1 bundle | |
|
534 | ~~~~~~~~~~~~~~~~ | |
|
535 | ||
|
536 | $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1 | |
|
537 | bzip2-v1 | |
|
538 | ||
|
539 | $ hg init unbundle-v1-no-fix | |
|
540 | $ cd unbundle-v1-no-fix | |
|
541 | ||
|
542 | $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1 --config storage.revlog.issue6528.fix-incoming=no | |
|
543 | adding changesets | |
|
544 | adding manifests | |
|
545 | adding file changes | |
|
546 | added 8 changesets with 12 changes to 4 files | |
|
547 | new changesets f5a5a568022f:3beabb508514 (8 drafts) | |
|
548 | (run 'hg update' to get a working copy) | |
|
549 | ||
|
550 | Check that revision were not fixed on the fly | |
|
551 | ||
|
552 | $ hg debugrevlogindex b.txt | |
|
553 | rev linkrev nodeid p1 p2 | |
|
554 | 0 2 05b806ebe5ea 000000000000 000000000000 | |
|
555 | 1 3 a58b36ad6b65 05b806ebe5ea 000000000000 | |
|
556 | 2 6 216a5fe8b8ed 000000000000 000000000000 | |
|
557 | 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000 | |
|
558 | ||
|
559 | $ hg debugrevlogindex D.txt | |
|
560 | rev linkrev nodeid p1 p2 | |
|
561 | 0 6 2a8d3833f2fb 000000000000 000000000000 | |
|
562 | 1 7 2a80419dfc31 2a8d3833f2fb 000000000000 | |
|
563 | ||
|
564 | That we do see the symptoms of the bug | |
|
565 | ||
|
566 | $ hg up -- -1 | |
|
567 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
568 | $ hg status | |
|
569 | M D.txt (?) | |
|
570 | M b.txt (?) | |
|
571 | ||
|
572 | And that the repair command find issue to fix. | |
|
573 | ||
|
574 | $ hg debug-repair-issue6528 --dry-run | |
|
575 | found affected revision 1 for filelog 'data/D.txt.i' | |
|
576 | found affected revision 1 for filelog 'data/b.txt.i' | |
|
577 | found affected revision 3 for filelog 'data/b.txt.i' | |
|
578 | ||
|
579 | $ cd .. | |
|
580 | ||
|
581 | from a v2 bundle | |
|
582 | ~~~~~~~~~~~~~~~~ | |
|
583 | ||
|
584 | $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2 | |
|
585 | bzip2-v2 | |
|
586 | ||
|
587 | $ hg init unbundle-v2-no-fix | |
|
588 | $ cd unbundle-v2-no-fix | |
|
589 | ||
|
590 | $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2 --config storage.revlog.issue6528.fix-incoming=no | |
|
591 | adding changesets | |
|
592 | adding manifests | |
|
593 | adding file changes | |
|
594 | added 8 changesets with 12 changes to 4 files | |
|
595 | new changesets f5a5a568022f:3beabb508514 (8 drafts) | |
|
596 | (run 'hg update' to get a working copy) | |
|
597 | ||
|
598 | Check that revision were not fixed on the fly | |
|
599 | ||
|
600 | $ hg debugrevlogindex b.txt | |
|
601 | rev linkrev nodeid p1 p2 | |
|
602 | 0 2 05b806ebe5ea 000000000000 000000000000 | |
|
603 | 1 3 a58b36ad6b65 05b806ebe5ea 000000000000 | |
|
604 | 2 6 216a5fe8b8ed 000000000000 000000000000 | |
|
605 | 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000 | |
|
606 | ||
|
607 | $ hg debugrevlogindex D.txt | |
|
608 | rev linkrev nodeid p1 p2 | |
|
609 | 0 6 2a8d3833f2fb 000000000000 000000000000 | |
|
610 | 1 7 2a80419dfc31 2a8d3833f2fb 000000000000 | |
|
611 | ||
|
612 | That we do see the symptoms of the bug | |
|
613 | ||
|
614 | $ hg up -- -1 | |
|
615 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
616 | $ hg status | |
|
617 | M D.txt (?) | |
|
618 | M b.txt (?) | |
|
619 | ||
|
620 | And that the repair command find issue to fix. | |
|
621 | ||
|
622 | $ hg debug-repair-issue6528 --dry-run | |
|
623 | found affected revision 1 for filelog 'data/D.txt.i' | |
|
624 | found affected revision 1 for filelog 'data/b.txt.i' | |
|
625 | found affected revision 3 for filelog 'data/b.txt.i' | |
|
626 | ||
|
627 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now