tests/test-mq-symlinks.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 13 Nov 2017 21:48:35 -0800
changeset 35139 1fb0846ad792
parent 32307 c2380b448265
child 49585 55c6ebd11cb9
permissions -rw-r--r--
bundle2: inline changegroup.readexactly() Profiling reveals this loop is pretty tight. Literally any function call elimination can make a big difference. This commit inlines the relatively trivial changegroup.readexactly() method inside the loop. The results with `hg perfbundleread` on a bundle of the Firefox repo speak for themselves: ! read(8k) ! wall 0.679730 comb 0.680000 user 0.140000 sys 0.540000 (best of 15) ! read(16k) ! wall 0.577228 comb 0.570000 user 0.080000 sys 0.490000 (best of 17) ! read(32k) ! wall 0.516060 comb 0.520000 user 0.040000 sys 0.480000 (best of 20) ! read(128k) ! wall 0.496378 comb 0.490000 user 0.010000 sys 0.480000 (best of 20) ! bundle2 iterparts() ! wall 3.460903 comb 3.460000 user 2.760000 sys 0.700000 (best of 3) ! wall 3.056811 comb 3.050000 user 2.340000 sys 0.710000 (best of 4) ! bundle2 iterparts() seekable ! wall 4.312722 comb 4.310000 user 3.480000 sys 0.830000 (best of 3) ! wall 4.007676 comb 4.000000 user 3.170000 sys 0.830000 (best of 3) ! bundle2 part seek() ! wall 6.754764 comb 6.740000 user 3.970000 sys 2.770000 (best of 3) ! wall 6.267110 comb 6.250000 user 3.480000 sys 2.770000 (best of 3) ! bundle2 part read(8k) ! wall 3.668004 comb 3.660000 user 2.960000 sys 0.700000 (best of 3) ! wall 3.404164 comb 3.400000 user 2.650000 sys 0.750000 (best of 3) ! bundle2 part read(16k) ! wall 3.489196 comb 3.480000 user 2.750000 sys 0.730000 (best of 3) ! wall 3.197972 comb 3.200000 user 2.490000 sys 0.710000 (best of 4) ! bundle2 part read(32k) ! wall 3.388569 comb 3.380000 user 2.640000 sys 0.740000 (best of 3) ! wall 3.060557 comb 3.060000 user 2.340000 sys 0.720000 (best of 4) ! bundle2 part read(128k) ! wall 3.276415 comb 3.270000 user 2.560000 sys 0.710000 (best of 4) ! wall 2.952209 comb 2.950000 user 2.230000 sys 0.720000 (best of 4) Differential Revision: https://phab.mercurial-scm.org/D1392
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 18395
diff changeset
     1
#require symlink
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     2
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     3
  $ echo "[extensions]" >> $HGRCPATH
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     4
  $ echo "mq=" >> $HGRCPATH
5157
f6c520fd70cf mq: teach qpop about symlinks
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     5
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     6
  $ hg init
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     7
  $ hg qinit
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     8
  $ hg qnew base.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
     9
  $ echo aaa > a
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    10
  $ echo bbb > b
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    11
  $ echo ccc > c
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    12
  $ hg add a b c
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    13
  $ hg qrefresh
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 23749
diff changeset
    14
  $ readlink.py a
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    15
  a -> a not a symlink
6360
95413879bac9 test-mq-symlinks: skip if symlinks are not supported
Patrick Mezard <pmezard@gmail.com>
parents: 5683
diff changeset
    16
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    17
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    18
test replacing a file with a symlink
5157
f6c520fd70cf mq: teach qpop about symlinks
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    19
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    20
  $ hg qnew symlink.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    21
  $ rm a
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    22
  $ ln -s b a
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    23
  $ hg qrefresh --git
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 23749
diff changeset
    24
  $ readlink.py a
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    25
  a -> b
5157
f6c520fd70cf mq: teach qpop about symlinks
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    26
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    27
  $ hg qpop
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    28
  popping symlink.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    29
  now at: base.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    30
  $ hg qpush
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    31
  applying symlink.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    32
  now at: symlink.patch
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 23749
diff changeset
    33
  $ readlink.py a
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    34
  a -> b
5157
f6c520fd70cf mq: teach qpop about symlinks
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    35
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    36
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    37
test updating a symlink
7517
49f34b43cf90 patch: handle git patches that remove symlinks (issue1438)
Brendan Cully <brendan@kublai.com>
parents: 6360
diff changeset
    38
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    39
  $ rm a
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    40
  $ ln -s c a
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    41
  $ hg qnew --git -f updatelink
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 23749
diff changeset
    42
  $ readlink.py a
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    43
  a -> c
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    44
  $ hg qpop
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    45
  popping updatelink
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    46
  now at: symlink.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    47
  $ hg qpush --debug
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    48
  applying updatelink
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    49
  patching file a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 22046
diff changeset
    50
  committing files:
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    51
  a
23749
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 22046
diff changeset
    52
  committing manifest
a387b0390082 localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents: 22046
diff changeset
    53
  committing changelog
32307
c2380b448265 caches: move the 'updating the branch cache' message in 'updatecaches'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 25472
diff changeset
    54
  updating the branch cache
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    55
  now at: updatelink
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 23749
diff changeset
    56
  $ readlink.py a
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    57
  a -> c
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    58
  $ hg st
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    59
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    60
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    61
test replacing a symlink with a file
9586
d08099e74b81 patch: handle symlink updates/replacements (issue1785)
Patrick Mezard <pmezard@gmail.com>
parents: 9585
diff changeset
    62
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    63
  $ ln -s c s
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    64
  $ hg add s
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    65
  $ hg qnew --git -f addlink
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    66
  $ rm s
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    67
  $ echo sss > s
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    68
  $ hg qnew --git -f replacelinkwithfile
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    69
  $ hg qpop
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    70
  popping replacelinkwithfile
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    71
  now at: addlink
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    72
  $ hg qpush
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    73
  applying replacelinkwithfile
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    74
  now at: replacelinkwithfile
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    75
  $ cat s
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    76
  sss
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    77
  $ hg st
9586
d08099e74b81 patch: handle symlink updates/replacements (issue1785)
Patrick Mezard <pmezard@gmail.com>
parents: 9585
diff changeset
    78
11908
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    79
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    80
test symlink removal
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    81
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    82
  $ hg qnew removesl.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    83
  $ hg rm a
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    84
  $ hg qrefresh --git
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    85
  $ hg qpop
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    86
  popping removesl.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    87
  now at: replacelinkwithfile
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    88
  $ hg qpush
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    89
  applying removesl.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    90
  now at: removesl.patch
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    91
  $ hg st -c
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    92
  C b
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    93
  C c
7f48f0b188c6 tests: unify test-mq-symlinks
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 10397
diff changeset
    94
  C s
12345
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
    95
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
    96
replace broken symlink with another broken symlink
12340
b0bb72460c44 patch: fix target when patching broken symlinks (issue2368)
Patrick Mezard <pmezard@gmail.com>
parents: 10397
diff changeset
    97
12345
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
    98
  $ ln -s linka linka
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
    99
  $ hg add linka
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   100
  $ hg qnew link
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   101
  $ hg mv linka linkb
12398
2bc926ad65c2 merge with stable
Mads Kiilerich <mads@kiilerich.com>
parents: 12396 12345
diff changeset
   102
  $ rm linkb
2bc926ad65c2 merge with stable
Mads Kiilerich <mads@kiilerich.com>
parents: 12396 12345
diff changeset
   103
  $ ln -s linkb linkb
12345
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   104
  $ hg qnew movelink
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   105
  $ hg qpop
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   106
  popping movelink
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   107
  now at: link
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   108
  $ hg qpush
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   109
  applying movelink
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   110
  now at: movelink
25472
4d2b9b304ad0 tests: drop explicit $TESTDIR from executables
Matt Mackall <mpm@selenic.com>
parents: 23749
diff changeset
   111
  $ readlink.py linkb
12345
e0ee3e822a9a Merge with stable
Patrick Mezard <pmezard@gmail.com>
parents: 12341 11908
diff changeset
   112
  linkb -> linkb