tests/test-merge-halt.t
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 06 Sep 2018 14:04:46 -0700
changeset 39568 842cd0bdda75
parent 34884 05535d0dea68
child 45150 dc5e5577af39
permissions -rw-r--r--
util: teach lrucachedict to enforce a max total cost Now that lrucachedict entries can have a numeric cost associated with them and we can easily pop the oldest item in the cache, it now becomes relatively trivial to implement support for enforcing a high water mark on the total cost of items in the cache. This commit teaches lrucachedict instances to have a max cost associated with them. When items are inserted, we pop old items until enough "cost" frees up to make room for the new item. This feature is close to zero cost when not used (modulo the insertion regressed introduced by the previous commit): $ ./hg perflrucachedict --size 4 --gets 1000000 --sets 1000000 --mixed 1000000 ! gets ! wall 0.607444 comb 0.610000 user 0.610000 sys 0.000000 (best of 17) ! wall 0.601653 comb 0.600000 user 0.600000 sys 0.000000 (best of 17) ! inserts ! wall 0.678261 comb 0.680000 user 0.680000 sys 0.000000 (best of 14) ! wall 0.685042 comb 0.680000 user 0.680000 sys 0.000000 (best of 15) ! sets ! wall 0.808770 comb 0.800000 user 0.800000 sys 0.000000 (best of 13) ! wall 0.834241 comb 0.830000 user 0.830000 sys 0.000000 (best of 12) ! mixed ! wall 0.782441 comb 0.780000 user 0.780000 sys 0.000000 (best of 13) ! wall 0.803804 comb 0.800000 user 0.800000 sys 0.000000 (best of 13) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 ! init ! wall 0.006952 comb 0.010000 user 0.010000 sys 0.000000 (best of 418) ! gets ! wall 0.613350 comb 0.610000 user 0.610000 sys 0.000000 (best of 17) ! wall 0.617415 comb 0.620000 user 0.620000 sys 0.000000 (best of 17) ! inserts ! wall 0.701270 comb 0.700000 user 0.700000 sys 0.000000 (best of 15) ! wall 0.700516 comb 0.700000 user 0.700000 sys 0.000000 (best of 15) ! sets ! wall 0.825720 comb 0.830000 user 0.830000 sys 0.000000 (best of 13) ! wall 0.837946 comb 0.840000 user 0.830000 sys 0.010000 (best of 12) ! mixed ! wall 0.821644 comb 0.820000 user 0.820000 sys 0.000000 (best of 13) ! wall 0.850559 comb 0.850000 user 0.850000 sys 0.000000 (best of 12) I reckon the slight slowdown on insert is due to added if checks. For caches with total cost limiting enabled: $ hg perflrucachedict --size 4 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 100 ! gets w/ cost limit ! wall 0.598737 comb 0.590000 user 0.590000 sys 0.000000 (best of 17) ! inserts w/ cost limit ! wall 1.694282 comb 1.700000 user 1.700000 sys 0.000000 (best of 6) ! mixed w/ cost limit ! wall 1.157655 comb 1.150000 user 1.150000 sys 0.000000 (best of 9) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 10000 ! gets w/ cost limit ! wall 0.598526 comb 0.600000 user 0.600000 sys 0.000000 (best of 17) ! inserts w/ cost limit ! wall 37.838315 comb 37.840000 user 37.840000 sys 0.000000 (best of 3) ! mixed w/ cost limit ! wall 18.060198 comb 18.060000 user 18.060000 sys 0.000000 (best of 3) $ hg perflrucachedict --size 1000 --gets 1000000 --sets 1000000 --mixed 1000000 --costlimit 10000 --mixedgetfreq 90 ! gets w/ cost limit ! wall 0.600024 comb 0.600000 user 0.600000 sys 0.000000 (best of 17) ! inserts w/ cost limit ! wall 37.154547 comb 37.120000 user 37.120000 sys 0.000000 (best of 3) ! mixed w/ cost limit ! wall 4.381602 comb 4.380000 user 4.370000 sys 0.010000 (best of 3) The functions we're benchmarking are slightly different, which could move numbers by a few milliseconds. But the slowdown on insert is too great to be explained by that. The slowness is due to insert heavy operations needing to call popoldest() repeatedly when the cache is at capacity. The next commit will address this. Differential Revision: https://phab.mercurial-scm.org/D4503
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34679
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     2
  > [extensions]
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     3
  > rebase=
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     4
  > [phases]
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     5
  > publish=False
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     6
  > [merge]
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     7
  > EOF
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     8
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     9
  $ hg init repo
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    10
  $ cd repo
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    11
  $ echo a > a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    12
  $ echo b > b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    13
  $ hg commit -qAm ab
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    14
  $ echo c >> a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    15
  $ echo c >> b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    16
  $ hg commit -qAm c
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    17
  $ hg up -q ".^"
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    18
  $ echo d >> a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    19
  $ echo d >> b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    20
  $ hg commit -qAm d
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    21
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    22
Testing on-failure=continue
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    23
  $ echo on-failure=continue >> $HGRCPATH
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    24
  $ hg rebase -s 1 -d 2 --tool false
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    25
  rebasing 1:1f28a51c3c9b "c"
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    26
  merging a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    27
  merging b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    28
  merging a failed!
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    29
  merging b failed!
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    30
  unresolved conflicts (see hg resolve, then hg rebase --continue)
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    31
  [1]
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    32
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    33
  $ hg resolve --list
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    34
  U a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    35
  U b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    36
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    37
  $ hg rebase --abort
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    38
  rebase aborted
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    39
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    40
Testing on-failure=halt
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    41
  $ echo on-failure=halt >> $HGRCPATH
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    42
  $ hg rebase -s 1 -d 2 --tool false
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    43
  rebasing 1:1f28a51c3c9b "c"
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    44
  merging a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    45
  merging b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    46
  merging a failed!
34797
284fa44f7f39 merge: allow user to halt merge on merge-tool failures
Ryan McElroy <rmcelroy@fb.com>
parents: 34679
diff changeset
    47
  merge halted after failed merge (see hg resolve)
34679
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    48
  [1]
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    49
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    50
  $ hg resolve --list
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    51
  U a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    52
  U b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    53
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    54
  $ hg rebase --abort
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    55
  rebase aborted
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    56
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    57
Testing on-failure=prompt
34884
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    58
  $ cat <<EOS >> $HGRCPATH
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    59
  > [merge]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    60
  > on-failure=prompt
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    61
  > [ui]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    62
  > interactive=1
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    63
  > EOS
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    64
  $ cat <<EOS | hg rebase -s 1 -d 2 --tool false
34679
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    65
  > y
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    66
  > n
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    67
  > EOS
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    68
  rebasing 1:1f28a51c3c9b "c"
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    69
  merging a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    70
  merging b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    71
  merging a failed!
34797
284fa44f7f39 merge: allow user to halt merge on merge-tool failures
Ryan McElroy <rmcelroy@fb.com>
parents: 34679
diff changeset
    72
  continue merge operation (yn)? y
34679
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    73
  merging b failed!
34797
284fa44f7f39 merge: allow user to halt merge on merge-tool failures
Ryan McElroy <rmcelroy@fb.com>
parents: 34679
diff changeset
    74
  continue merge operation (yn)? n
284fa44f7f39 merge: allow user to halt merge on merge-tool failures
Ryan McElroy <rmcelroy@fb.com>
parents: 34679
diff changeset
    75
  merge halted after failed merge (see hg resolve)
34679
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    76
  [1]
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    77
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    78
  $ hg resolve --list
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    79
  U a
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    80
  U b
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    81
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    82
  $ hg rebase --abort
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    83
  rebase aborted
143337bcec9b merge: add tests to show current behavior on failed filemerges
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    84
34884
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    85
Check that successful tool with failed post-check halts the merge
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    86
  $ cat <<EOS >> $HGRCPATH
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    87
  > [merge-tools]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    88
  > true.check=changed
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    89
  > EOS
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    90
  $ cat <<EOS | hg rebase -s 1 -d 2 --tool true
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    91
  > y
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    92
  > n
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    93
  > n
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    94
  > EOS
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    95
  rebasing 1:1f28a51c3c9b "c"
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    96
  merging a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    97
  merging b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    98
   output file a appears unchanged
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
    99
  was merge successful (yn)? y
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   100
   output file b appears unchanged
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   101
  was merge successful (yn)? n
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   102
  merging b failed!
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   103
  continue merge operation (yn)? n
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   104
  merge halted after failed merge (see hg resolve)
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   105
  [1]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   106
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   107
  $ hg resolve --list
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   108
  R a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   109
  U b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   110
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   111
  $ hg rebase --abort
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   112
  rebase aborted
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   113
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   114
Check that conflicts with conflict check also halts the merge
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   115
  $ cat <<EOS >> $HGRCPATH
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   116
  > [merge-tools]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   117
  > true.check=conflicts
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   118
  > true.premerge=keep
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   119
  > [merge]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   120
  > on-failure=halt
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   121
  > EOS
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   122
  $ hg rebase -s 1 -d 2 --tool true
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   123
  rebasing 1:1f28a51c3c9b "c"
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   124
  merging a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   125
  merging b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   126
  merging a failed!
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   127
  merge halted after failed merge (see hg resolve)
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   128
  [1]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   129
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   130
  $ hg resolve --list
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   131
  U a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   132
  U b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   133
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   134
  $ hg rebase --abort
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   135
  rebase aborted
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   136
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   137
Check that always-prompt also can halt the merge
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   138
  $ cat <<EOS | hg rebase -s 1 -d 2 --tool true --config merge-tools.true.check=prompt
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   139
  > y
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   140
  > n
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   141
  > EOS
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   142
  rebasing 1:1f28a51c3c9b "c"
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   143
  merging a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   144
  merging b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   145
  was merge of 'a' successful (yn)? y
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   146
  was merge of 'b' successful (yn)? n
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   147
  merging b failed!
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   148
  merge halted after failed merge (see hg resolve)
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   149
  [1]
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   150
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   151
  $ hg resolve --list
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   152
  R a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   153
  U b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   154
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   155
  $ hg rebase --abort
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   156
  rebase aborted
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   157
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   158
Check that successful tool otherwise allows the merge to continue
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   159
  $ hg rebase -s 1 -d 2 --tool echo --keep --config merge-tools.echo.premerge=keep
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   160
  rebasing 1:1f28a51c3c9b "c"
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   161
  merging a
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   162
  merging b
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   163
  $TESTTMP/repo/a *a~base* *a~other* (glob)
05535d0dea68 merge: additional test cases to show merge-halting behavior
Ryan McElroy <rmcelroy@fb.com>
parents: 34797
diff changeset
   164
  $TESTTMP/repo/b *b~base* *b~other* (glob)