tests/test-merge-tools.t
author Martin Geisler <mg@aragost.com>
Mon, 17 Oct 2011 16:45:19 +0200
branchstable
changeset 15286 4be845e3932c
parent 15264 157d93c41c10
child 15501 2371f4aea665
child 15519 bb9ad375b51c
permissions -rw-r--r--
subrepo: pull revisions on demand when archiving hg subrepos Before, running 'hg archive -S' could result in abort: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'! if a subrepo was missing completely or had missing changesets. Now, the missing changesets will be pulled or cloned as appropriate. This make Mercurial subrepos match Git subrepos which already took care to fetch any missing commits before starting the archive.
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
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    33
  $ 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
    34
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    35
  $ beforemerge() {
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    36
  >   cat .hg/hgrc
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    37
  >   echo "# hg update -C 1"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    38
  >   hg update -C 1 > /dev/null
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    39
  > }
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    40
  $ aftermerge() {
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    41
  >   echo "# cat f"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    42
  >   cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    43
  >   echo "# hg stat"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    44
  >   hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    45
  >   rm -f f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    46
  > }
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    47
  $ domerge() {
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    48
  >   beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    49
  >   echo "# hg merge $*"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    50
  >   hg merge $*
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    51
  >   aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    52
  > }
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    53
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    54
Tool selection
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    55
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    56
default is internal merge:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    57
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    58
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    59
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    60
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    61
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    62
hg merge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    63
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
    64
running from a devel copy, not a temp installation
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    65
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    66
  $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    67
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    68
  warning: conflicts during merge.
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    69
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    70
  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
    71
  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
    72
  [1]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    73
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    74
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    75
  <<<<<<< local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    76
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    77
  =======
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    78
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    79
  >>>>>>> other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    80
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    81
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    82
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    83
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    84
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    85
simplest hgrc using false for merge:
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
  $ echo "false.whatever=" >> .hg/hgrc
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    88
  $ domerge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    89
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    90
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    91
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    92
  # hg merge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    93
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    94
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    95
  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
    96
  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
    97
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    98
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
    99
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   100
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   101
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   102
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   103
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   104
true with higher .priority gets precedence:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   105
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   106
  $ echo "true.priority=1" >> .hg/hgrc
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   107
  $ domerge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   108
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   109
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   110
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   111
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   112
  # hg merge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   113
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   114
  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
   115
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   116
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   117
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   118
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   119
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   120
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   121
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   122
unless lowered on command line:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   123
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   124
  $ domerge -r 2 --config merge-tools.true.priority=-7
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   125
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   126
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   127
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   128
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   129
  # hg merge -r 2 --config merge-tools.true.priority=-7
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   130
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   131
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   132
  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
   133
  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
   134
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   135
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   136
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   137
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   138
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   139
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   140
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   141
or false set higher on command line:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   142
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   143
  $ domerge -r 2 --config merge-tools.false.priority=117
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   144
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   145
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   146
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   147
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   148
  # hg merge -r 2 --config merge-tools.false.priority=117
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   149
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   150
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   151
  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
   152
  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
   153
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   154
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   155
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   156
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   157
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   158
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   159
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   160
or true.executable not found in PATH:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   161
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   162
  $ domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   163
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   164
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   165
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   166
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   167
  # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   168
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   169
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   170
  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
   171
  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
   172
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   173
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   174
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   175
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   176
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   177
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   178
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   179
or true.executable with bogus path:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   180
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   181
  $ domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   182
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   183
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   184
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   185
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   186
  # hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   187
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   188
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   189
  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
   190
  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
   191
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   192
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   193
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   194
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   195
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   196
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   197
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   198
but true.executable set to cat found in PATH works:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   199
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   200
  $ echo "true.executable=cat" >> .hg/hgrc
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   201
  $ domerge -r 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   202
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   203
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   204
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   205
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   206
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   207
  # hg merge -r 2
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   208
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   209
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   210
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   211
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   212
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   213
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   214
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   215
  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
   216
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   217
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   218
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   219
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   220
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   221
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   222
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   223
and true.executable set to cat with path works:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   224
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   225
  $ domerge -r 2 --config merge-tools.true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   226
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   227
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   228
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   229
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   230
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   231
  # 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
   232
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   233
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   234
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   235
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   236
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   237
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   238
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   239
  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
   240
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   241
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   242
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   243
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   244
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   245
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   246
15264
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   247
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
   248
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   249
  $ cat > $HGTMP/merge.sh <<EOF
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   250
  > #!/bin/sh
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   251
  > echo 'custom merge tool'
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   252
  > EOF
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   253
  $ chmod +x $HGTMP/merge.sh
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   254
  $ domerge -r 2 --config merge-tools.true.executable='$HGTMP/merge.sh'
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   255
  [merge-tools]
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   256
  false.whatever=
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   257
  true.priority=1
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   258
  true.executable=cat
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   259
  # hg update -C 1
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   260
  # hg merge -r 2 --config merge-tools.true.executable=$HGTMP/merge.sh
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   261
  merging f
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   262
  custom merge tool
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   263
  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
   264
  (branch merge, don't forget to commit)
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   265
  # cat f
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   266
  revision 1
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   267
  space
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   268
  # hg stat
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   269
  M f
157d93c41c10 merge: expand environment variables and ~/ in tool.executable
Greg Ward <greg@gerg.ca>
parents: 15243
diff changeset
   270
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   271
Tool selection and merge-patterns
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   272
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   273
merge-patterns specifies new tool false:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   274
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   275
  $ domerge -r 2 --config merge-patterns.f=false
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   276
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   277
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   278
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   279
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   280
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   281
  # hg merge -r 2 --config merge-patterns.f=false
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   282
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   283
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   284
  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
   285
  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
   286
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   287
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   288
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   289
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   290
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   291
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   292
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   293
merge-patterns specifies executable not found in PATH and gets warning:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   294
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   295
  $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   296
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   297
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   298
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   299
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   300
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   301
  # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   302
  couldn't find merge tool true specified for f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   303
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   304
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   305
  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
   306
  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
   307
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   308
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   309
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   310
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   311
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   312
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   313
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   314
merge-patterns specifies executable with bogus path and gets warning:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   315
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   316
  $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   317
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   318
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   319
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   320
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   321
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   322
  # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   323
  couldn't find merge tool true specified for f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   324
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   325
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   326
  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
   327
  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
   328
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   329
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   330
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   331
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   332
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   333
  ? f.orig
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   334
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   335
ui.merge overrules priority
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   336
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   337
ui.merge specifies false:
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
  $ domerge -r 2 --config ui.merge=false
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   340
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   341
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   342
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   343
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   344
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   345
  # hg merge -r 2 --config ui.merge=false
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   346
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   347
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   348
  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
   349
  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
   350
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   351
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   352
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   353
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   354
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   355
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   356
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   357
ui.merge specifies internal:fail:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   358
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   359
  $ domerge -r 2 --config ui.merge=internal:fail
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   360
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   361
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   362
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   363
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   364
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   365
  # hg merge -r 2 --config ui.merge=internal:fail
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   366
  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
   367
  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
   368
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   369
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   370
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   371
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   372
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   373
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   374
ui.merge specifies internal:local:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   375
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   376
  $ domerge -r 2 --config ui.merge=internal:local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   377
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   378
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   379
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   380
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   381
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   382
  # hg merge -r 2 --config ui.merge=internal:local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   383
  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
   384
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   385
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   386
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   387
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   388
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   389
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   390
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   391
ui.merge specifies internal:other:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   392
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   393
  $ domerge -r 2 --config ui.merge=internal:other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   394
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   395
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   396
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   397
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   398
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   399
  # hg merge -r 2 --config ui.merge=internal:other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   400
  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
   401
  (branch merge, don't forget to commit)
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 2
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
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   408
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
   409
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   410
  $ domerge -r 2 --config ui.merge=internal:prompt
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   411
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   412
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   413
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   414
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   415
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   416
  # hg merge -r 2 --config ui.merge=internal:prompt
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   417
   no tool found to merge f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   418
  keep (l)ocal or take (o)ther? l
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   419
  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
   420
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   421
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   422
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   423
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   424
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   425
  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
   426
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   427
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
   428
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   429
  $ domerge -r 2 --config ui.merge=internal:dump
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   430
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   431
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   432
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   433
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   434
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   435
  # hg merge -r 2 --config ui.merge=internal:dump
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   436
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   437
  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
   438
  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
   439
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   440
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   441
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   442
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   443
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   444
  ? f.base
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   445
  ? f.local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   446
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   447
  ? 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
   448
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   449
f.base:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   450
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   451
  $ cat f.base
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   452
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   453
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   454
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   455
f.local:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   456
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   457
  $ cat f.local
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   458
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   459
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   461
f.other:
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   462
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   463
  $ cat f.other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   464
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   465
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   466
  $ rm f.base f.local f.other
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   467
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   468
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
   469
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   470
  $ domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   471
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   472
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   473
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   474
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   475
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   476
  # hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   477
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   478
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   479
  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
   480
  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
   481
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   482
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   483
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   484
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   485
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   486
  ? f.orig
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   487
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   488
Premerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   489
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   490
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
   491
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   492
  $ domerge -r 2 --config ui.merge=internal:other --tool=false
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   493
  [merge-tools]
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   494
  false.whatever=
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   495
  true.priority=1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   496
  true.executable=cat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   497
  # hg update -C 1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   498
  # hg merge -r 2 --config ui.merge=internal:other --tool=false
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   499
  merging f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   500
  merging f failed!
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   501
  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
   502
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   503
  # cat f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   504
  revision 1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   505
  space
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   506
  # hg stat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   507
  M f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   508
  ? f.orig
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   509
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   510
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
   511
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   512
  $ HGMERGE=internal:other ; export HGMERGE
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   513
  $ domerge -r 2 --tool=false
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   514
  [merge-tools]
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   515
  false.whatever=
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   516
  true.priority=1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   517
  true.executable=cat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   518
  # hg update -C 1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   519
  # hg merge -r 2 --tool=false
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   520
  merging f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   521
  merging f failed!
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   522
  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
   523
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   524
  # cat f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   525
  revision 1
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   526
  space
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   527
  # hg stat
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   528
  M f
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   529
  ? f.orig
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   530
12788
de793925862e merge: implement --tool arguments using new ui.forcemerge configurable
Steve Borho <steve@borho.org>
parents: 12460
diff changeset
   531
  $ 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
   532
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   533
Default is silent simplemerge:
8901
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   534
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   535
  $ domerge -r 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   536
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   537
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   538
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   539
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   540
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   541
  # hg merge -r 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   542
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   543
  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
   544
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   545
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   546
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   547
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   548
  revision 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   549
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   550
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   551
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   552
.premerge=True is same:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   553
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   554
  $ domerge -r 3 --config merge-tools.true.premerge=True
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   555
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   556
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   557
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   558
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   559
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   560
  # hg merge -r 3 --config merge-tools.true.premerge=True
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   561
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   562
  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
   563
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   564
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   565
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   566
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   567
  revision 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   568
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   569
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   570
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   571
.premerge=False executes merge-tool:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   572
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   573
  $ domerge -r 3 --config merge-tools.true.premerge=False
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   574
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   575
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   576
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   577
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   578
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   579
  # 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
   580
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   581
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   582
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   583
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   584
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   585
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   586
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   587
  revision 3
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   588
  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
   589
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   590
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   591
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   592
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   593
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   594
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   595
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   596
Tool execution
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   597
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   598
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
   599
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   600
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   601
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   602
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   603
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   604
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   605
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   606
  $ 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
   607
  >   | sed 's,==> .* <==,==> ... <==,g'
13439
d724a69309e0 util: flush stdout before calling external processes
Mads Kiilerich <mads@kiilerich.com>
parents: 12788
diff changeset
   608
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   609
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   610
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   611
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   612
  
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   613
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   614
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   615
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   616
  
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   617
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   618
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   619
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   620
  
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   621
  ==> ... <==
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   622
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   623
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   624
  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
   625
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   626
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   627
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   628
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   629
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   630
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   631
  M f
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   632
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   633
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
   634
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   635
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   636
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   637
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   638
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   639
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   640
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   641
  $ 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
   642
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   643
  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
   644
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   645
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   646
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   647
  mergeresult
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   648
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   649
  M f
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   650
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   651
- 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
   652
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   653
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   654
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   655
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   656
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   657
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   658
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   659
  $ 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
   660
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   661
  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
   662
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   663
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   664
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   665
  mergeresult
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   666
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   667
  M f
15243
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   668
1e9451476bf8 tests: cleanup of echo statements left over from test conversion
Mads Kiilerich <mads@kiilerich.com>
parents: 13439
diff changeset
   669
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
   670
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   671
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   672
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   673
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   674
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   675
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   676
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   677
  $ 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
   678
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   679
  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
   680
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   681
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   682
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   683
  mergeresult
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   684
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   685
  M f
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   686
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   687
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
   688
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   689
  $ beforemerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   690
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   691
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   692
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   693
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   694
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   695
  $ cat <<EOF > 'my merge tool'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   696
  > #!/bin/sh
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   697
  > cat "\$1" "\$2" "\$3" > "\$4"
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   698
  > EOF
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   699
  $ chmod +x 'my merge tool'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   700
  $ hg merge -r 2 --config merge-tools.true.executable='./my merge tool' --config merge-tools.true.args='$base $local $other $output'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   701
  merging f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   702
  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
   703
  (branch merge, don't forget to commit)
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   704
  $ rm -f 'my merge tool'
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   705
  $ aftermerge
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   706
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   707
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   708
  space
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
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   712
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   713
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   714
  M f
10775
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   715
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   716
Merge post-processing
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   717
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   718
cat is a bad merge-tool and doesn't change:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   719
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   720
  $ domerge -y -r 2 --config merge-tools.true.checkchanged=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   721
  [merge-tools]
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   722
  false.whatever=
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   723
  true.priority=1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   724
  true.executable=cat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   725
  # hg update -C 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   726
  # 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
   727
  merging f
12460
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   728
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   729
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   730
  revision 0
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   731
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   732
  revision 2
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   733
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   734
   output file f appears unchanged
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   735
  was merge successful (yn)? n
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   736
  merging f failed!
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   737
  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
   738
  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
   739
  # cat f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   740
  revision 1
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   741
  space
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   742
  # hg stat
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   743
  M f
09168638b313 tests: unify test-merge-tools
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   744
  ? f.orig