tests/test-bookmarks-rebase.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 16 Apr 2019 17:26:38 +0200
changeset 42159 4f9a89837f07
parent 35393 4441705b7111
child 45150 dc5e5577af39
permissions -rw-r--r--
setdiscovery: stop limiting the number of local head we initially send In our testing this limitation provides now real gain and instead triggers pathological discovery timing for some repository with many heads. See inline documentation for details. Some timing below: Mozilla try repository, (~1M revs, ~35K heads), discovery between 2 clones with 100 head missing on each side before: ! wall 1.492111 comb 1.490000 user 1.450000 sys 0.040000 (best of 20) ! wall 1.813992 comb 1.820000 user 1.700000 sys 0.120000 (max of 20) ! wall 1.574326 comb 1.573500 user 1.522000 sys 0.051500 (avg of 20) ! wall 1.572583 comb 1.570000 user 1.520000 sys 0.050000 (median of 20) after: ! wall 1.147834 comb 1.150000 user 1.090000 sys 0.060000 (best of 20) ! wall 1.449144 comb 1.450000 user 1.330000 sys 0.120000 (max of 20) ! wall 1.204618 comb 1.202500 user 1.146500 sys 0.056000 (avg of 20) ! wall 1.194407 comb 1.190000 user 1.140000 sys 0.050000 (median of 20) pypy (~100 heads, 317 heads) discovery between clones with only 42 common heads before: ! wall 0.031653 comb 0.030000 user 0.030000 sys 0.000000 (best of 25) ! wall 0.055719 comb 0.050000 user 0.040000 sys 0.010000 (max of 25) ! wall 0.038939 comb 0.039600 user 0.038400 sys 0.001200 (avg of 25) ! wall 0.038660 comb 0.050000 user 0.040000 sys 0.010000 (median of 25) after: ! wall 0.018754 comb 0.020000 user 0.020000 sys 0.000000 (best of 49) ! wall 0.034505 comb 0.040000 user 0.030000 sys 0.010000 (max of 49) ! wall 0.019631 comb 0.019796 user 0.018367 sys 0.001429 (avg of 49) ! wall 0.019132 comb 0.020000 user 0.020000 sys 0.000000 (median of 49) Private repository (~1M revs, ~3K heads), discovery from a strip subset, about 100 changesets to be pulled. before: ! wall 1.837729 comb 1.840000 user 1.790000 sys 0.050000 (best of 20) ! wall 2.203468 comb 2.200000 user 2.100000 sys 0.100000 (max of 20) ! wall 2.049355 comb 2.048500 user 2.002500 sys 0.046000 (avg of 20) ! wall 2.035315 comb 2.040000 user 2.000000 sys 0.040000 (median of 20) after: ! wall 0.136598 comb 0.130000 user 0.110000 sys 0.020000 (best of 20) ! wall 0.330519 comb 0.330000 user 0.260000 sys 0.070000 (max of 20) ! wall 0.157254 comb 0.155500 user 0.123000 sys 0.032500 (avg of 20) ! wall 0.149870 comb 0.140000 user 0.110000 sys 0.030000 (median of 20) Same private repo, discovery between two clone with 500 different heads on each side: before: ! wall 2.372919 comb 2.370000 user 2.320000 sys 0.050000 (best of 20) ! wall 2.622422 comb 2.610000 user 2.510000 sys 0.100000 (max of 20) ! wall 2.450135 comb 2.450000 user 2.402000 sys 0.048000 (avg of 20) ! wall 2.443896 comb 2.450000 user 2.410000 sys 0.040000 (median of 20) after: ! wall 0.625497 comb 0.620000 user 0.570000 sys 0.050000 (best of 20) ! wall 0.834723 comb 0.820000 user 0.730000 sys 0.090000 (max of 20) ! wall 0.675725 comb 0.675500 user 0.628000 sys 0.047500 (avg of 20) ! wall 0.671614 comb 0.680000 user 0.640000 sys 0.040000 (median of 20)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     1
  $ echo "[extensions]" >> $HGRCPATH
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     2
  $ echo "rebase=" >> $HGRCPATH
11198
b345b1cc124f rebase: use helpers.sh in tests
Matt Mackall <mpm@selenic.com>
parents: 8168
diff changeset
     3
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     4
initialize repository
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     5
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     6
  $ hg init
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     7
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     8
  $ echo 'a' > a
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
     9
  $ hg ci -A -m "0"
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    10
  adding a
7317
98408cb74137 bookmarks: Test if rebase works with bookmarks
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    11
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    12
  $ echo 'b' > b
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    13
  $ hg ci -A -m "1"
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    14
  adding b
7317
98408cb74137 bookmarks: Test if rebase works with bookmarks
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    15
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    16
  $ hg up 0
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    17
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    18
  $ echo 'c' > c
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    19
  $ hg ci -A -m "2"
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    20
  adding c
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    21
  created new head
7317
98408cb74137 bookmarks: Test if rebase works with bookmarks
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    22
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    23
  $ echo 'd' > d
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    24
  $ hg ci -A -m "3"
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    25
  adding d
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    26
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    27
  $ hg bookmark -r 1 one
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    28
  $ hg bookmark -r 3 two
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 17005
diff changeset
    29
  $ hg up -q two
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    30
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    31
bookmark list
7317
98408cb74137 bookmarks: Test if rebase works with bookmarks
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    32
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    33
  $ hg bookmark
13388
a184dbd9b2c5 localrepo: sort hg bookmark output
David Soria Parra <dsp@php.net>
parents: 13386
diff changeset
    34
     one                       1:925d80f479bb
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    35
   * two                       3:2ae46b1d99a7
7317
98408cb74137 bookmarks: Test if rebase works with bookmarks
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    36
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    37
rebase
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    38
11907
863567a1364f tests: use regular expressions instead of helpers
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11863
diff changeset
    39
  $ hg rebase -s two -d one
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33332
diff changeset
    40
  rebasing 3:2ae46b1d99a7 "3" (two tip)
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34290
diff changeset
    41
  saved backup bundle to $TESTTMP/.hg/strip-backup/2ae46b1d99a7-e6b057bc-rebase.hg
7317
98408cb74137 bookmarks: Test if rebase works with bookmarks
Alexander Solovyov <piranha@piranha.org.ua>
parents:
diff changeset
    42
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    43
  $ hg log
17005
50f434510da6 rebase: do not add second parent to rebased changeset (drop detach option) (BC)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 13469
diff changeset
    44
  changeset:   3:42e5ed2cdcf4
13386
f78bc5ddbe4f templater: add bookmarks to templates and default output
David Soria Parra <dsp@php.net>
parents: 13385
diff changeset
    45
  bookmark:    two
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    46
  tag:         tip
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    47
  parent:      1:925d80f479bb
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    48
  user:        test
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    49
  date:        Thu Jan 01 00:00:00 1970 +0000
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    50
  summary:     3
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    51
  
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    52
  changeset:   2:db815d6d32e6
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    53
  parent:      0:f7b1eb17ad24
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    54
  user:        test
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    55
  date:        Thu Jan 01 00:00:00 1970 +0000
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    56
  summary:     2
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    57
  
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    58
  changeset:   1:925d80f479bb
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
    59
  bookmark:    one
11863
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    60
  user:        test
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    61
  date:        Thu Jan 01 00:00:00 1970 +0000
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    62
  summary:     1
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    63
  
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    64
  changeset:   0:f7b1eb17ad24
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    65
  user:        test
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    66
  date:        Thu Jan 01 00:00:00 1970 +0000
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    67
  summary:     0
86ec95b1d37b tests: unify test-bookmarks-rebase
Martin Geisler <mg@lazybytes.net>
parents: 11208
diff changeset
    68
  
24758
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    69
aborted rebase should restore active bookmark.
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    70
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    71
  $ hg up 1
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    72
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    73
  (leaving bookmark two)
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    74
  $ echo 'e' > d
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    75
  $ hg ci -A -m "4"
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    76
  adding d
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    77
  created new head
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    78
  $ hg bookmark three
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    79
  $ hg rebase -s three -d two
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33332
diff changeset
    80
  rebasing 4:dd7c838e8362 "4" (three tip)
24758
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    81
  merging d
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25101
diff changeset
    82
  warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
24758
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    83
  unresolved conflicts (see hg resolve, then hg rebase --continue)
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    84
  [1]
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    85
  $ hg rebase --abort
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    86
  rebase aborted
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    87
  $ hg bookmark
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    88
     one                       1:925d80f479bb
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    89
   * three                     4:dd7c838e8362
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    90
     two                       3:42e5ed2cdcf4
d7451adc72f6 rebase: restore bookmark state on abort
Tony Tung <tonytung@fb.com>
parents: 23835
diff changeset
    91
25101
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
    92
after aborted rebase, restoring a bookmark that has been removed should not fail
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
    93
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
    94
  $ hg rebase -s three -d two
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33332
diff changeset
    95
  rebasing 4:dd7c838e8362 "4" (three tip)
25101
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
    96
  merging d
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25101
diff changeset
    97
  warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
25101
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
    98
  unresolved conflicts (see hg resolve, then hg rebase --continue)
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
    99
  [1]
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
   100
  $ hg bookmark -d three
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
   101
  $ hg rebase --abort
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
   102
  rebase aborted
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
   103
  $ hg bookmark
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
   104
     one                       1:925d80f479bb
91c2278c68a3 rebase: check that the bookmark is still valid when restoring (issue4669)
Tony Tung <tonytung@fb.com>
parents: 24758
diff changeset
   105
     two                       3:42e5ed2cdcf4