tests/test-record.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 07 Dec 2022 20:12:23 +0100
changeset 49887 e1953a34c110
parent 49882 f0e9dda408b3
permissions -rw-r--r--
bundle: emit full snapshot as is, without doing a redelta With the new `forced` delta-reused policy, it become important to be able to send full snapshot where full snapshot are needed. Otherwise, the fallback delta will simply be used on the client sideā€¦ creating monstrous delta chain, since revision that are meant as a reset of delta-chain chain becoming too complex are simply adding a new full delta-tree on the leaf of another one. In the `non-forced` cases, client process full snapshot from the bundle differently from deltas, so client will still try to convert the full snapshot into a delta if possible. So this will no lead to pathological storage explosion. I have considered making this configurable, but the impact seems limited enough that it does not seems to be worth it. Especially with the current sparse-revlog format that use "delta-tree" with multiple level snapshots, full snapshot are much less frequent and not that different from other intermediate snapshot that we are already sending over the wire anyway. CPU wise, this will help the bundling side a little as it will not need to reconstruct revisions and compute deltas. The unbundling side might save a tiny amount of CPU as it won't need to reconstruct the delta-base to reconstruct the revision full text. This only slightly visible in some of the benchmarks. And have no real impact on most of them. ### data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog # benchmark.name = perf-bundle # benchmark.variants.revs = last-40000 before: 11.467186 seconds just-emit-full: 11.190576 seconds (-2.41%) with-pull-force: 11.041091 seconds (-3.72%) # benchmark.name = perf-unbundle # benchmark.variants.revs = last-40000 before: 16.744862 just-emit-full:: 16.561036 seconds (-1.10%) with-pull-force: 16.389344 seconds (-2.12%) # benchmark.name = pull # benchmark.variants.revs = last-40000 before: 26.870569 just-emit-full: 26.391188 seconds (-1.78%) with-pull-force: 25.633184 seconds (-4.60%) Space wise (so network-wise) the impact is fairly small. When taking compression into account. Below are tests the size of `hg bundle --all` for a handful of benchmark repositories (with bzip, zstd compression and without it) This show a small increase in the bundle size, but nothing really significant except maybe for mozilla-try (+12%) that nobody really pulls large chunk of anyway. Mozilla-try is also the repository that benefit the most for not having to recompute deltas client size. ### mercurial: bzip-before: 26 406 342 bytes bzip-after: 26 691 543 bytes +1.08% zstd-before: 27 918 645 bytes zstd-after: 28 075 896 bytes +0.56% none-before: 98 675 601 bytes none-after: 100 411 237 bytes +1.76% ### pypy bzip-before: 201 295 752 bytes bzip-after: 209 780 282 bytes +4.21% zstd-before: 202 974 795 bytes zstd-after: 205 165 780 bytes +1.08% none-before: 871 070 261 bytes none-after: 993 595 057 bytes +14.07% ### netbeans bzip-before: 601 314 330 bytes bzip-after: 614 246 241 bytes +2.15% zstd-before: 604 745 136 bytes zstd-after: 615 497 705 bytes +1.78% none-before: 3 338 238 571 bytes none-after: 3 439 422 535 bytes +3.03% ### mozilla-central bzip-before: 1 493 006 921 bytes bzip-after: 1 549 650 570 bytes +3.79% zstd-before: 1 481 910 102 bytes zstd-after: 1 513 052 415 bytes +2.10% none-before: 6 535 929 910 bytes none-after: 7 010 191 342 bytes +7.26% ### mozilla-try bzip-before: 6 583 425 999 bytes bzip-after: 7 423 536 928 bytes +12.76% zstd-before: 6 021 009 212 bytes zstd-after: 6 674 922 420 bytes +10.86% none-before: 22 954 739 558 bytes none-after: 26 013 854 771 bytes +13.32%
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12328
b63f6422d2a7 tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents: 12316
diff changeset
     1
Set up a repo
5037
b2607267236d Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
23172
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 23054
diff changeset
     3
  $ cat <<EOF >> $HGRCPATH
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 23054
diff changeset
     4
  > [ui]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 23054
diff changeset
     5
  > interactive = true
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 23054
diff changeset
     6
  > [extensions]
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 23054
diff changeset
     7
  > record =
e955549cd045 tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents: 23054
diff changeset
     8
  > EOF
5037
b2607267236d Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     9
12074
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    10
  $ hg init a
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    11
  $ cd a
5037
b2607267236d Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    12
24308
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    13
Record help
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    14
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    15
  $ hg record -h
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    16
  hg record [OPTION]... [FILE]...
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    17
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    18
  interactively select changes to commit
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    19
  
27729
58f8b29c37ff minirst: change hgrole to use single quotes
timeless <timeless@mozdev.org>
parents: 25304
diff changeset
    20
      If a list of files is omitted, all changes reported by 'hg status' will be
24308
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    21
      candidates for recording.
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    22
  
27729
58f8b29c37ff minirst: change hgrole to use single quotes
timeless <timeless@mozdev.org>
parents: 25304
diff changeset
    23
      See 'hg help dates' for a list of formats valid for -d/--date.
24308
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    24
  
30880
7074589cf22a record: update help to describe ui.interface
eloimorlaas <eloimorlaas@fb.com>
parents: 30158
diff changeset
    25
      If using the text interface (see 'hg help config'), you will be prompted
7074589cf22a record: update help to describe ui.interface
eloimorlaas <eloimorlaas@fb.com>
parents: 30158
diff changeset
    26
      for whether to record changes to each modified file, and for files with
7074589cf22a record: update help to describe ui.interface
eloimorlaas <eloimorlaas@fb.com>
parents: 30158
diff changeset
    27
      multiple changes, for each change to use. For each query, the following
7074589cf22a record: update help to describe ui.interface
eloimorlaas <eloimorlaas@fb.com>
parents: 30158
diff changeset
    28
      responses are possible:
24308
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    29
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    30
        y - record this change
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    31
        n - skip this change
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    32
        e - edit this change manually
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    33
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    34
        s - skip remaining changes to this file
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    35
        f - record remaining changes to this file
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    36
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    37
        d - done, skip remaining changes and files
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    38
        a - record all changes to all remaining files
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    39
        q - quit, recording no changes
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    40
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    41
        ? - display help
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    42
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    43
      This command is not available when committing a merge.
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    44
  
29978
7109d5ddeb0c help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents: 28697
diff changeset
    45
  (use 'hg help -e record' to show help for the record extension)
28697
d001d6d27570 record: deprecate the extension
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27729
diff changeset
    46
  
24308
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    47
  options ([+] can be repeated):
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    48
  
30152
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    49
   -A --addremove           mark new/missing files as added/removed before
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    50
                            committing
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    51
      --close-branch        mark a branch head as closed
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    52
      --amend               amend the parent of the working directory
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    53
   -s --secret              use the secret phase for committing
49882
f0e9dda408b3 commit: add --draft option to use draft phase
Martin von Zweigbergk <martinvonz@google.com>
parents: 45846
diff changeset
    54
      --draft               use the draft phase for committing
30152
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    55
   -e --edit                invoke editor on commit messages
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    56
   -I --include PATTERN [+] include names matching the given patterns
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    57
   -X --exclude PATTERN [+] exclude names matching the given patterns
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    58
   -m --message TEXT        use text as commit message
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    59
   -l --logfile FILE        read commit message from file
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    60
   -d --date DATE           record the specified date as commit date
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    61
   -u --user USER           record the specified user as committer
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    62
   -S --subrepos            recurse into subrepositories
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    63
   -w --ignore-all-space    ignore white space when comparing lines
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    64
   -b --ignore-space-change ignore changes in the amount of white space
d65e246100ed help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 30026
diff changeset
    65
   -B --ignore-blank-lines  ignore changes whose lines are all blank
34031
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 30880
diff changeset
    66
   -Z --ignore-space-at-eol ignore changes in whitespace at EOL
24308
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    67
  
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    68
  (some details hidden, use --verbose to show complete help)
1725843a7644 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents: 24235
diff changeset
    69
12074
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    70
Select no files
5037
b2607267236d Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    71
12074
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    72
  $ touch empty-rw
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    73
  $ hg add empty-rw
5037
b2607267236d Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    74
12074
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    75
  $ hg record empty-rw<<EOF
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    76
  > n
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    77
  > EOF
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    78
  diff --git a/empty-rw b/empty-rw
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    79
  new file mode 100644
42071
db72f9f6580e interactive: do not prompt about files given in command line
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 34031
diff changeset
    80
  abort: empty commit message
45846
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 42071
diff changeset
    81
  [10]
12074
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    82
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    83
  $ hg tip -p
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    84
  changeset:   -1:000000000000
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    85
  tag:         tip
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    86
  user:        
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    87
  date:        Thu Jan 01 00:00:00 1970 +0000
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    88
  
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    89
  
35c143e85b1b tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11238
diff changeset
    90
5037
b2607267236d Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    91