tests/test-merge-tools
author Brodie Rao <brodie@bitheap.org>
Fri, 02 Apr 2010 15:22:19 -0500
changeset 10827 b66388f6adfa
parent 10775 c52057614c72
child 12156 4c94b6d0fb1c
permissions -rwxr-xr-x
color: don't split colors across lines (which confuses less -R) Currently, less -R doesn't support colors spanning multiple lines; only the first line will be colorized. Instead of allowing colors to span multiple lines, the color extension now applies colors to each line it receives, even when ui.write() is given multiple lines in one call.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     1
#!/bin/sh
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     2
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     3
# test merge-tools configuration - mostly exercising filemerge.py
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     4
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     5
unset HGMERGE # make sure HGMERGE doesn't interfere with the test
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     6
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     7
hg init
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     8
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
     9
echo "# revision 0"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    10
echo "revision 0" > f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    11
echo "space" >> f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    12
hg commit -Am "revision 0" -d "1000000 0"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    13
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    14
echo "# revision 1"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    15
echo "revision 1" > f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    16
echo "space" >> f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    17
hg commit -Am "revision 1" -d "1000000 0"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    18
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    19
hg update 0 > /dev/null
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    20
echo "# revision 2"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    21
echo "revision 2" > f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    22
echo "space" >> f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    23
hg commit -Am "revision 2" -d "1000000 0"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    24
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    25
hg update 0 > /dev/null
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    26
echo "# revision 3 - simple to merge"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    27
echo "revision 3" >> f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    28
hg commit -Am "revision 3" -d "1000000 0"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    29
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    30
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    31
echo "[merge-tools]" > .hg/hgrc
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    32
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    33
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    34
beforemerge() {
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    35
  cat .hg/hgrc
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    36
  echo "# hg update -C 1"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    37
  hg update -C 1 > /dev/null
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    38
}
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    39
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    40
aftermerge() {
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    41
  echo "# cat f"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    42
  cat f
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    43
  echo "# hg stat"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    44
  hg stat
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    45
  rm -f f.orig
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    46
  echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    47
}
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    48
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    49
domerge() {
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    50
  beforemerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    51
  echo "# hg merge $*"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    52
  hg merge $*
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    53
  aftermerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    54
}
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    55
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    56
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    57
echo Tool selection
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    58
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    59
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    60
echo "# default is internal merge:"
7785
660c8dd44060 test-merge-tool: Make sure no hgmerge can be found in $PATH
Mads Kiilerich <mads@kiilerich.com>
parents: 7769
diff changeset
    61
beforemerge
660c8dd44060 test-merge-tool: Make sure no hgmerge can be found in $PATH
Mads Kiilerich <mads@kiilerich.com>
parents: 7769
diff changeset
    62
echo "# hg merge -r 2"
8674
0941ee76489e run-tests: redefine --with-hg so it takes the 'hg' script to run.
Greg Ward <greg-hg@gerg.ca>
parents: 8539
diff changeset
    63
# override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
0941ee76489e run-tests: redefine --with-hg so it takes the 'hg' script to run.
Greg Ward <greg-hg@gerg.ca>
parents: 8539
diff changeset
    64
# running from a devel copy, not a temp installation
10775
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
    65
PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
7785
660c8dd44060 test-merge-tool: Make sure no hgmerge can be found in $PATH
Mads Kiilerich <mads@kiilerich.com>
parents: 7769
diff changeset
    66
aftermerge
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    67
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    68
echo "# simplest hgrc using false for merge:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    69
echo "false.whatever=" >> .hg/hgrc
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    70
domerge -r 2
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    71
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    72
echo "# true with higher .priority gets precedence:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    73
echo "true.priority=1" >> .hg/hgrc
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    74
domerge -r 2
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    75
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    76
echo "# unless lowered on command line:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    77
domerge -r 2 --config merge-tools.true.priority=-7
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    78
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    79
echo "# or false set higher on command line:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    80
domerge -r 2 --config merge-tools.false.priority=117
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    81
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    82
echo "# or true.executable not found in PATH:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    83
domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    84
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    85
echo "# or true.executable with bogus path:"
10282
08a0f04b56bd many, many trivial check-code fixups
Matt Mackall <mpm@selenic.com>
parents: 8901
diff changeset
    86
domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    87
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    88
echo "# but true.executable set to cat found in PATH works:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    89
echo "true.executable=cat" >> .hg/hgrc
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    90
domerge -r 2
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    91
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    92
echo "# and true.executable set to cat with path works:"
8539
9a4fe59b1eca test-merge-tools: windows fixes
Patrick Mezard <pmezard@gmail.com>
parents: 7846
diff changeset
    93
domerge -r 2 --config merge-tools.true.executable=cat
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    94
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    95
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    96
echo Tool selection and merge-patterns
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    97
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
    98
7769
8c06d4bf2c23 test-merge-tools: Don't use tac
Mads Kiilerich <mads@kiilerich.com>
parents: 7731
diff changeset
    99
echo "# merge-patterns specifies new tool false:"
8c06d4bf2c23 test-merge-tools: Don't use tac
Mads Kiilerich <mads@kiilerich.com>
parents: 7731
diff changeset
   100
domerge -r 2 --config merge-patterns.f=false
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   101
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   102
echo "# merge-patterns specifies executable not found in PATH and gets warning:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   103
domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   104
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   105
echo "# merge-patterns specifies executable with bogus path and gets warning:"
10282
08a0f04b56bd many, many trivial check-code fixups
Matt Mackall <mpm@selenic.com>
parents: 8901
diff changeset
   106
domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   107
7846
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   108
echo
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   109
echo ui.merge overrules priority
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   110
echo
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   111
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   112
echo "# ui.merge specifies false:"
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   113
domerge -r 2 --config ui.merge=false
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   114
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   115
echo "# ui.merge specifies internal:fail:"
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   116
domerge -r 2 --config ui.merge=internal:fail
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   117
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   118
echo "# ui.merge specifies internal:local:"
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   119
domerge -r 2 --config ui.merge=internal:local
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   120
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   121
echo "# ui.merge specifies internal:other:"
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   122
domerge -r 2 --config ui.merge=internal:other
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   123
8901
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   124
echo "# ui.merge specifies internal:prompt:"
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   125
domerge -r 2 --config ui.merge=internal:prompt
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   126
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   127
echo "# ui.merge specifies internal:dump:"
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   128
domerge -r 2 --config ui.merge=internal:dump
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   129
echo f.base:
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   130
cat f.base
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   131
echo f.local:
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   132
cat f.local
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   133
echo f.other:
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   134
cat f.other
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   135
rm f.base f.local f.other
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   136
echo
94319ae527cf test merge-tools internal:dump and internal:prompt
Mads Kiilerich <mads@kiilerich.com>
parents: 8674
diff changeset
   137
7846
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   138
echo "# ui.merge specifies internal:other but is overruled by pattern for false:"
1cb6836946be test-merge-tools: test ui.merge functionality and selection of internal tools
Mads Kiilerich <mads@kiilerich.com>
parents: 7785
diff changeset
   139
domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   140
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   141
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   142
echo Premerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   143
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   144
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   145
echo "# Default is silent simplemerge:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   146
domerge -r 3
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   147
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   148
echo "# .premerge=True is same:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   149
domerge -r 3 --config merge-tools.true.premerge=True
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   150
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   151
echo "# .premerge=False executes merge-tool:"
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   152
domerge -r 3 --config merge-tools.true.premerge=False
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   153
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   154
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   155
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   156
echo Tool execution
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   157
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   158
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   159
echo '# set tools.args explicit to include $base $local $other $output:' # default '$local $base $other'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   160
beforemerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   161
hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   162
  | sed 's,==> .* <==,==> ... <==,g'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   163
aftermerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   164
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   165
echo '# Merge with "echo mergeresult > $local":'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   166
beforemerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   167
hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   168
aftermerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   169
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   170
echo '# - and $local is the file f:'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   171
beforemerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   172
hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   173
aftermerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   174
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   175
echo '# Merge with "echo mergeresult > $output" - the variable is a bit magic:'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   176
beforemerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   177
hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   178
aftermerge
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   179
10775
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   180
echo '# Merge using tool with a path that must be quoted:'
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   181
beforemerge
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   182
cat <<EOF > 'my merge tool'
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   183
#!/bin/sh
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   184
cat "\$1" "\$2" "\$3" > "\$4"
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   185
EOF
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   186
chmod +x 'my merge tool'
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   187
hg merge -r 2 --config merge-tools.true.executable='./my merge tool' --config merge-tools.true.args='$base $local $other $output'
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   188
rm -f 'my merge tool'
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   189
aftermerge
c52057614c72 Tests with spaces in paths
Mads Kiilerich <mads@kiilerich.com>
parents: 10282
diff changeset
   190
7731
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   191
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   192
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   193
echo Merge post-processing
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   194
echo
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   195
737f274d1915 test-merge-tools
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
   196
echo "# cat is a bad merge-tool and doesn't change:"
8539
9a4fe59b1eca test-merge-tools: windows fixes
Patrick Mezard <pmezard@gmail.com>
parents: 7846
diff changeset
   197
domerge -y -r 2 --config merge-tools.true.checkchanged=1