tests/test-merge-tools.t
author Martin von Zweigbergk <martinvonz@google.com>
Mon, 09 Mar 2015 17:13:22 -0700
changeset 24276 2720f967a7b1
parent 24121 9d0b6ef92eb2
child 24809 32d0d2f38910
permissions -rw-r--r--
largefiles: replace manifestdict.__contains__, don't extend class We're soon going to add an alternative manifest class (treemanifest). Rather than extending both those classes by largesfiles versions, let's replace the method on the manifest instances.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     1
test merge-tools configuration - mostly exercising filemerge.py
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     3
  $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     4
  $ hg init
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     5
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     6
revision 0
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     7
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     8
  $ echo "revision 0" > f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
     9
  $ echo "space" >> f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    10
  $ hg commit -Am "revision 0"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    11
  adding f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    12
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    13
revision 1
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    14
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    15
  $ echo "revision 1" > f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    16
  $ echo "space" >> f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    17
  $ hg commit -Am "revision 1"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    18
  $ hg update 0 > /dev/null
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    19
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    20
revision 2
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    21
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    22
  $ echo "revision 2" > f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    23
  $ echo "space" >> f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    24
  $ hg commit -Am "revision 2"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    25
  created new head
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    26
  $ hg update 0 > /dev/null
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    27
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    28
revision 3 - simple to merge
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    29
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    30
  $ echo "revision 3" >> f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    31
  $ hg commit -Am "revision 3"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    32
  created new head
22029
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    33
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    34
revision 4 - hard to merge
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    35
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    36
  $ hg update 0 > /dev/null
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    37
  $ echo "revision 4" > f
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    38
  $ hg commit -Am "revision 4"
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    39
  created new head
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
    40
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    41
  $ echo "[merge-tools]" > .hg/hgrc
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
    42
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    43
  $ beforemerge() {
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    44
  >   cat .hg/hgrc
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    45
  >   echo "# hg update -C 1"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    46
  >   hg update -C 1 > /dev/null
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    47
  > }
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    48
  $ aftermerge() {
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    49
  >   echo "# cat f"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    50
  >   cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    51
  >   echo "# hg stat"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    52
  >   hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    53
  >   rm -f f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    54
  > }
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    55
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    56
Tool selection
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    57
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    58
default is internal merge:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    59
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    60
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    61
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    62
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    63
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    64
hg merge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    65
override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    66
running from a devel copy, not a temp installation
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    67
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    68
  $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    69
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    70
  warning: conflicts during merge.
15501
2371f4aea665 merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents: 15264
diff changeset
    71
  merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    72
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    73
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    74
  [1]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    75
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    76
  # cat f
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21552
diff changeset
    77
  <<<<<<< local: ef83787e2614  - test: revision 1
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    78
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    79
  =======
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    80
  revision 2
21693
9c35f3a8cac4 merge: drop the quotes around commit description
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21552
diff changeset
    81
  >>>>>>> other: 0185f4e0cf02  - test: revision 2
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    82
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    83
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    84
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    85
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    86
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    87
simplest hgrc using false for merge:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    88
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    89
  $ echo "false.whatever=" >> .hg/hgrc
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
    90
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    91
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    92
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    93
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
    94
  $ hg merge -r 2
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    95
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    96
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    97
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    98
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
    99
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   100
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   101
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   102
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   103
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   104
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   105
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   106
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   107
15545
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   108
unexecutable file in $PATH shouldn't be found:
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   109
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   110
  $ touch false
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   111
  $ hg up -qC 1
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   112
  $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   113
  merging f
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   114
  warning: conflicts during merge.
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   115
  merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   116
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   117
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   118
  [1]
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   119
  $ rm false
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   120
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   121
executable directory in $PATH shouldn't be found:
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   122
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   123
  $ mkdir false
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   124
  $ hg up -qC 1
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   125
  $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   126
  merging f
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   127
  warning: conflicts during merge.
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   128
  merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   129
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   130
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   131
  [1]
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   132
  $ rmdir false
2607de602105 tests: test findexe() access check fixed in 58f96703a9ab
Mads Kiilerich <mads@kiilerich.com>
parents: 15524
diff changeset
   133
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   134
true with higher .priority gets precedence:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   135
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   136
  $ echo "true.priority=1" >> .hg/hgrc
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   137
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   138
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   139
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   140
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   141
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   142
  $ hg merge -r 2
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   143
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   144
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   145
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   146
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   147
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   148
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   149
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   150
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   151
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   152
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   153
unless lowered on command line:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   154
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   155
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   156
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   157
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   158
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   159
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   160
  $ hg merge -r 2 --config merge-tools.true.priority=-7
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   161
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   162
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   163
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   164
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   165
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   166
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   167
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   168
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   169
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   170
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   171
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   172
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   173
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   174
or false set higher on command line:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   175
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   176
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   177
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   178
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   179
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   180
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   181
  $ hg merge -r 2 --config merge-tools.false.priority=117
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   182
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   183
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   184
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   185
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   186
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   187
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   188
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   189
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   190
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   191
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   192
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   193
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   194
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   195
or true.executable not found in PATH:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   196
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   197
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   198
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   199
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   200
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   201
  # hg update -C 1
17492
973c2b0b403c spelling: nonexistent
timeless@mozdev.org
parents: 16972
diff changeset
   202
  $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   203
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   204
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   205
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   206
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   207
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   208
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   209
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   210
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   211
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   212
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   213
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   214
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   215
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   216
or true.executable with bogus path:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   217
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   218
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   219
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   220
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   221
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   222
  # hg update -C 1
17492
973c2b0b403c spelling: nonexistent
timeless@mozdev.org
parents: 16972
diff changeset
   223
  $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   224
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   225
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   226
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   227
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   228
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   229
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   230
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   231
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   232
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   233
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   234
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   235
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   236
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   237
but true.executable set to cat found in PATH works:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   238
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   239
  $ echo "true.executable=cat" >> .hg/hgrc
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   240
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   241
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   242
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   243
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   244
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   245
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   246
  $ hg merge -r 2
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   247
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   248
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   249
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   250
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   251
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   252
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   253
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   254
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   255
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   256
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   257
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   258
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   259
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   260
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   261
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   262
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   263
and true.executable set to cat with path works:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   264
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   265
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   266
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   267
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   268
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   269
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   270
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   271
  $ hg merge -r 2 --config merge-tools.true.executable=cat
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   272
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   273
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   274
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   275
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   276
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   277
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   278
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   279
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   280
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   281
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   282
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   283
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   284
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   285
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   286
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   287
16972
5efe9c6a34fe tests: add some missing #if's / hghave requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16967
diff changeset
   288
#if unix-permissions
5efe9c6a34fe tests: add some missing #if's / hghave requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16967
diff changeset
   289
15264
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   290
environment variables in true.executable are handled:
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   291
19264
eac114e13b96 tests: avoid writing files to HGTMP
Matt Mackall <mpm@selenic.com>
parents: 18325
diff changeset
   292
  $ echo 'echo "custom merge tool"' > .hg/merge.sh
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   293
  $ beforemerge
15264
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   294
  [merge-tools]
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   295
  false.whatever=
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   296
  true.priority=1
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   297
  true.executable=cat
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   298
  # hg update -C 1
16967
30cfa286947c test-merge-tools: adapt for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16961
diff changeset
   299
  $ hg --config merge-tools.true.executable='sh' \
19264
eac114e13b96 tests: avoid writing files to HGTMP
Matt Mackall <mpm@selenic.com>
parents: 18325
diff changeset
   300
  >    --config merge-tools.true.args=.hg/merge.sh \
16967
30cfa286947c test-merge-tools: adapt for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16961
diff changeset
   301
  >    merge -r 2
15264
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   302
  merging f
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   303
  custom merge tool
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   304
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   305
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   306
  $ aftermerge
15264
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   307
  # cat f
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   308
  revision 1
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   309
  space
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   310
  # hg stat
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   311
  M f
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   312
16972
5efe9c6a34fe tests: add some missing #if's / hghave requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16967
diff changeset
   313
#endif
5efe9c6a34fe tests: add some missing #if's / hghave requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16967
diff changeset
   314
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   315
Tool selection and merge-patterns
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   316
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   317
merge-patterns specifies new tool false:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   318
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   319
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   320
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   321
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   322
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   323
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   324
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   325
  $ hg merge -r 2 --config merge-patterns.f=false
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   326
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   327
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   328
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   329
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   330
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   331
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   332
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   333
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   334
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   335
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   336
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   337
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   338
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   339
merge-patterns specifies executable not found in PATH and gets warning:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   340
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   341
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   342
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   343
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   344
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   345
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   346
  # hg update -C 1
17492
973c2b0b403c spelling: nonexistent
timeless@mozdev.org
parents: 16972
diff changeset
   347
  $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   348
  couldn't find merge tool true specified for f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   349
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   350
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   351
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   352
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   353
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   354
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   355
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   356
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   357
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   358
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   359
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   360
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   361
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   362
merge-patterns specifies executable with bogus path and gets warning:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   363
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   364
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   365
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   366
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   367
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   368
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   369
  # hg update -C 1
17492
973c2b0b403c spelling: nonexistent
timeless@mozdev.org
parents: 16972
diff changeset
   370
  $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   371
  couldn't find merge tool true specified for f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   372
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   373
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   374
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   375
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   376
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   377
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   378
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   379
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   380
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   381
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   382
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   383
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   384
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   385
ui.merge overrules priority
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   386
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   387
ui.merge specifies false:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   388
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   389
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   390
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   391
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   392
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   393
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   394
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   395
  $ hg merge -r 2 --config ui.merge=false
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   396
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   397
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   398
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   399
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   400
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   401
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   402
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   403
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   404
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   405
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   406
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   407
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   408
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   409
ui.merge specifies internal:fail:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   410
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   411
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   412
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   413
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   414
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   415
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   416
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   417
  $ hg merge -r 2 --config ui.merge=internal:fail
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   418
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   419
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   420
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   421
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   422
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   423
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   424
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   425
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   426
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   427
22706
ad25986c4cd3 filemerge: introduce :x as short version of internal:x merge tool name
Mads Kiilerich <madski@unity3d.com>
parents: 22032
diff changeset
   428
ui.merge specifies :local (without internal prefix):
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   429
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   430
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   431
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   432
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   433
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   434
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   435
  # hg update -C 1
22706
ad25986c4cd3 filemerge: introduce :x as short version of internal:x merge tool name
Mads Kiilerich <madski@unity3d.com>
parents: 22032
diff changeset
   436
  $ hg merge -r 2 --config ui.merge=:local
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   437
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   438
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   439
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   440
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   441
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   442
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   443
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   444
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   445
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   446
ui.merge specifies internal:other:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   447
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   448
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   449
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   450
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   451
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   452
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   453
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   454
  $ hg merge -r 2 --config ui.merge=internal:other
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   455
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   456
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   457
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   458
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   459
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   460
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   461
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   462
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   463
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   464
ui.merge specifies internal:prompt:
7846
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   465
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   466
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   467
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   468
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   469
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   470
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   471
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   472
  $ hg merge -r 2 --config ui.merge=internal:prompt
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   473
   no tool found to merge f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   474
  keep (l)ocal or take (o)ther? l
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   475
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   476
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   477
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   478
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   479
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   480
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   481
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   482
  M f
7846
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   483
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   484
ui.merge specifies internal:dump:
7846
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   485
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   486
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   487
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   488
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   489
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   490
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   491
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   492
  $ hg merge -r 2 --config ui.merge=internal:dump
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   493
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   494
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   495
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   496
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   497
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   498
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   499
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   500
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   501
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   502
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   503
  ? f.base
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   504
  ? f.local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   505
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   506
  ? f.other
7846
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   507
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   508
f.base:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   509
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   510
  $ cat f.base
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   511
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   512
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   513
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   514
f.local:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   515
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   516
  $ cat f.local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   517
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   518
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   519
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   520
f.other:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   521
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   522
  $ cat f.other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   523
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   524
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   525
  $ rm f.base f.local f.other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   526
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   527
ui.merge specifies internal:other but is overruled by pattern for false:
8901
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   528
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   529
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   530
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   531
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   532
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   533
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   534
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   535
  $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   536
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   537
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   538
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   539
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   540
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   541
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   542
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   543
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   544
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   545
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   546
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   547
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   548
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   549
Premerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   550
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   551
ui.merge specifies internal:other but is overruled by --tool=false
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   552
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   553
  $ beforemerge
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   554
  [merge-tools]
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   555
  false.whatever=
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   556
  true.priority=1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   557
  true.executable=cat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   558
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   559
  $ hg merge -r 2 --config ui.merge=internal:other --tool=false
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   560
  merging f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   561
  merging f failed!
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   562
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   563
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   564
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   565
  $ aftermerge
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   566
  # cat f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   567
  revision 1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   568
  space
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   569
  # hg stat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   570
  M f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   571
  ? f.orig
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   572
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   573
HGMERGE specifies internal:other but is overruled by --tool=false
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   574
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   575
  $ HGMERGE=internal:other ; export HGMERGE
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   576
  $ beforemerge
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   577
  [merge-tools]
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   578
  false.whatever=
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   579
  true.priority=1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   580
  true.executable=cat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   581
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   582
  $ hg merge -r 2 --tool=false
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   583
  merging f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   584
  merging f failed!
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   585
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   586
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   587
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   588
  $ aftermerge
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   589
  # cat f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   590
  revision 1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   591
  space
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   592
  # hg stat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   593
  M f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   594
  ? f.orig
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   595
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   596
  $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   597
21552
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   598
update is a merge ...
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   599
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   600
  $ beforemerge
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   601
  [merge-tools]
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   602
  false.whatever=
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   603
  true.priority=1
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   604
  true.executable=cat
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   605
  # hg update -C 1
24121
9d0b6ef92eb2 test-merge-tools: fix flaky test by avoiding debugsetparents
Martin von Zweigbergk <martinvonz@google.com>
parents: 22707
diff changeset
   606
  $ hg update -q 0
9d0b6ef92eb2 test-merge-tools: fix flaky test by avoiding debugsetparents
Martin von Zweigbergk <martinvonz@google.com>
parents: 22707
diff changeset
   607
  $ hg revert -q -r 1 .
21552
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   608
  $ hg update -r 2
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   609
  merging f
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   610
  revision 1
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   611
  space
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   612
  revision 0
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   613
  space
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   614
  revision 2
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   615
  space
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   616
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   617
  $ aftermerge
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   618
  # cat f
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   619
  revision 1
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   620
  space
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   621
  # hg stat
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   622
  M f
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   623
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   624
update should also have --tool
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   625
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   626
  $ beforemerge
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   627
  [merge-tools]
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   628
  false.whatever=
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   629
  true.priority=1
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   630
  true.executable=cat
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   631
  # hg update -C 1
24121
9d0b6ef92eb2 test-merge-tools: fix flaky test by avoiding debugsetparents
Martin von Zweigbergk <martinvonz@google.com>
parents: 22707
diff changeset
   632
  $ hg update -q 0
9d0b6ef92eb2 test-merge-tools: fix flaky test by avoiding debugsetparents
Martin von Zweigbergk <martinvonz@google.com>
parents: 22707
diff changeset
   633
  $ hg revert -q -r 1 .
21552
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   634
  $ hg update -r 2 --tool false
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   635
  merging f
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   636
  merging f failed!
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   637
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   638
  use 'hg resolve' to retry unresolved file merges
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   639
  [1]
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   640
  $ aftermerge
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   641
  # cat f
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   642
  revision 1
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   643
  space
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   644
  # hg stat
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   645
  M f
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   646
  ? f.orig
61151f429a5f update: introduce --tool for controlling the merge tool
Mads Kiilerich <madski@unity3d.com>
parents: 21519
diff changeset
   647
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   648
Default is silent simplemerge:
8901
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   649
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   650
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   651
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   652
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   653
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   654
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   655
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   656
  $ hg merge -r 3
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   657
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   658
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   659
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   660
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   661
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   662
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   663
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   664
  revision 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   665
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   666
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   667
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   668
.premerge=True is same:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   669
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   670
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   671
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   672
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   673
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   674
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   675
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   676
  $ hg merge -r 3 --config merge-tools.true.premerge=True
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   677
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   678
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   679
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   680
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   681
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   682
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   683
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   684
  revision 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   685
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   686
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   687
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   688
.premerge=False executes merge-tool:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   689
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   690
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   691
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   692
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   693
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   694
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   695
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   696
  $ hg merge -r 3 --config merge-tools.true.premerge=False
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   697
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   698
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   699
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   700
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   701
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   702
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   703
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   704
  revision 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   705
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   706
  (branch merge, don't forget to commit)
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   707
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   708
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   709
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   710
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   711
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   712
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   713
22030
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   714
premerge=keep keeps conflict markers in:
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   715
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   716
  $ beforemerge
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   717
  [merge-tools]
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   718
  false.whatever=
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   719
  true.priority=1
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   720
  true.executable=cat
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   721
  # hg update -C 1
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   722
  $ hg merge -r 4 --config merge-tools.true.premerge=keep
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   723
  merging f
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   724
  <<<<<<< local: ef83787e2614  - test: revision 1
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   725
  revision 1
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   726
  space
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   727
  =======
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   728
  revision 4
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   729
  >>>>>>> other: 81448d39c9a0 - test: revision 4
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   730
  revision 0
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   731
  space
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   732
  revision 4
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   733
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   734
  (branch merge, don't forget to commit)
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   735
  $ aftermerge
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   736
  # cat f
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   737
  <<<<<<< local: ef83787e2614  - test: revision 1
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   738
  revision 1
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   739
  space
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   740
  =======
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   741
  revision 4
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   742
  >>>>>>> other: 81448d39c9a0 - test: revision 4
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   743
  # hg stat
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   744
  M f
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   745
22032
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   746
premerge=keep-merge3 keeps conflict markers with base content:
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   747
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   748
  $ beforemerge
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   749
  [merge-tools]
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   750
  false.whatever=
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   751
  true.priority=1
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   752
  true.executable=cat
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   753
  # hg update -C 1
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   754
  $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   755
  merging f
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   756
  <<<<<<< local: ef83787e2614  - test: revision 1
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   757
  revision 1
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   758
  space
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   759
  ||||||| base
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   760
  revision 0
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   761
  space
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   762
  =======
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   763
  revision 4
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   764
  >>>>>>> other: 81448d39c9a0 - test: revision 4
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   765
  revision 0
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   766
  space
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   767
  revision 4
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   768
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   769
  (branch merge, don't forget to commit)
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   770
  $ aftermerge
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   771
  # cat f
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   772
  <<<<<<< local: ef83787e2614  - test: revision 1
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   773
  revision 1
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   774
  space
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   775
  ||||||| base
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   776
  revision 0
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   777
  space
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   778
  =======
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   779
  revision 4
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   780
  >>>>>>> other: 81448d39c9a0 - test: revision 4
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   781
  # hg stat
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   782
  M f
d7f25834ffbb merge-tools: add a `premerge=keep-merge3` config option
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22030
diff changeset
   783
22030
ecdff28d13e2 mergetools: add a test for premerge --keep
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22029
diff changeset
   784
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   785
Tool execution
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   786
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   787
set tools.args explicit to include $base $local $other $output:
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   788
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   789
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   790
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   791
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   792
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   793
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   794
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   795
  $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   796
  >   | sed 's,==> .* <==,==> ... <==,g'
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   797
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   798
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   799
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   800
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   801
  
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   802
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   803
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   804
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   805
  
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   806
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   807
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   808
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   809
  
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   810
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   811
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   812
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   813
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   814
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   815
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   816
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   817
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   818
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   819
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   820
  M f
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   821
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   822
Merge with "echo mergeresult > $local":
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   823
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   824
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   825
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   826
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   827
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   828
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   829
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   830
  $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   831
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   832
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   833
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   834
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   835
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   836
  mergeresult
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   837
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   838
  M f
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   839
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   840
- and $local is the file f:
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   841
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   842
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   843
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   844
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   845
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   846
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   847
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   848
  $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   849
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   850
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   851
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   852
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   853
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   854
  mergeresult
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   855
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   856
  M f
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   857
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   858
Merge with "echo mergeresult > $output" - the variable is a bit magic:
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   859
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   860
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   861
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   862
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   863
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   864
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   865
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   866
  $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   867
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   868
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   869
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   870
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   871
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   872
  mergeresult
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   873
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   874
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   875
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   876
Merge using tool with a path that must be quoted:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   877
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   878
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   879
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   880
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   881
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   882
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   883
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   884
  $ cat <<EOF > 'my merge tool'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   885
  > cat "\$1" "\$2" "\$3" > "\$4"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   886
  > EOF
16967
30cfa286947c test-merge-tools: adapt for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16961
diff changeset
   887
  $ hg --config merge-tools.true.executable='sh' \
30cfa286947c test-merge-tools: adapt for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16961
diff changeset
   888
  >    --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
30cfa286947c test-merge-tools: adapt for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 16961
diff changeset
   889
  >    merge -r 2
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   890
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   891
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   892
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   893
  $ rm -f 'my merge tool'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   894
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   895
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   896
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   897
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   898
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   899
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   900
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   901
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   902
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   903
  M f
10775
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   904
17885
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   905
Issue3581: Merging a filename that needs to be quoted
17902
195ad823b5d5 tests: fix test for issue3581 for vfat on Linux
Matt Mackall <mpm@selenic.com>
parents: 17901
diff changeset
   906
(This test doesn't work on Windows filesystems even on Linux, so check
195ad823b5d5 tests: fix test for issue3581 for vfat on Linux
Matt Mackall <mpm@selenic.com>
parents: 17901
diff changeset
   907
for Unix-like permission)
17885
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   908
17902
195ad823b5d5 tests: fix test for issue3581 for vfat on Linux
Matt Mackall <mpm@selenic.com>
parents: 17901
diff changeset
   909
#if unix-permissions
17885
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   910
  $ beforemerge
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   911
  [merge-tools]
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   912
  false.whatever=
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   913
  true.priority=1
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   914
  true.executable=cat
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   915
  # hg update -C 1
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   916
  $ echo "revision 5" > '"; exit 1; echo "'
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   917
  $ hg commit -Am "revision 5"
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   918
  adding "; exit 1; echo "
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   919
  warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
22029
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   920
  $ hg update -C 1 > /dev/null
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   921
  $ echo "revision 6" > '"; exit 1; echo "'
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   922
  $ hg commit -Am "revision 6"
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   923
  adding "; exit 1; echo "
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   924
  warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "'
17885
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   925
  created new head
22029
f28329171a86 test-merge-tools: introduce a "revision 4" that merges with conflict
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21693
diff changeset
   926
  $ hg merge --config merge-tools.true.executable="true" -r 5
17885
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   927
  merging "; exit 1; echo "
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   928
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   929
  (branch merge, don't forget to commit)
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   930
  $ hg update -C 1 > /dev/null
17901
a19046744e4e filemerge: only run test for issue3581 on non-windows environments
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17885
diff changeset
   931
#endif
17885
9a2cf955db84 filemerge: use util.shellquote when calling merge (issue3581)
Keegan Carruthers-Smith <keegancsmith@fb.com>
parents: 17492
diff changeset
   932
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   933
Merge post-processing
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   934
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   935
cat is a bad merge-tool and doesn't change:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   936
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   937
  $ beforemerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   938
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   939
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   940
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   941
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   942
  # hg update -C 1
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   943
  $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   944
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   945
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   946
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   947
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   948
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   949
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   950
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   951
   output file f appears unchanged
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   952
  was merge successful (yn)? n
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   953
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   954
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   955
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
16961
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   956
  [1]
cdbb53a640c1 test-merge-tools: inline pointless domerge function
Adrian Buehlmann <adrian@cadifra.com>
parents: 15545
diff changeset
   957
  $ aftermerge
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   958
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   959
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   960
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   961
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   962
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   963
  ? f.orig
18256
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   964
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   965
#if symlink
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   966
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   967
internal merge cannot handle symlinks and shouldn't try:
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   968
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   969
  $ hg update -q -C 1
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   970
  $ rm f
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   971
  $ ln -s symlink f
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   972
  $ hg commit -qm 'f is symlink'
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   973
  $ hg merge -r 2 --tool internal:merge
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   974
  merging f
22707
38e0363dcbe0 filemerge: switch the default name for internal tools from internal:x to :x
Mads Kiilerich <madski@unity3d.com>
parents: 22706
diff changeset
   975
  warning: internal :merge cannot merge symlinks for f
18256
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   976
  merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   977
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   978
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   979
  [1]
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   980
d084df89d948 merge: make internal merge fail cleanly on symlinks
Mads Kiilerich <mads@kiilerich.com>
parents: 17902
diff changeset
   981
#endif