tests/test-merge-internal-tools-pattern.t
author Sune Foldager <cryo@cyanite.org>
Mon, 13 Sep 2010 16:25:13 +0200
changeset 12278 c4c2ba553401
parent 12257 470e0b1ddc6e
child 12314 f2daa6ab514a
permissions -rw-r--r--
merge with stable
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     1
# Make sure that the internal merge tools (internal:fail, internal:local, and
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
     2
# internal:other) are used when matched by a merge-pattern in hgrc
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
     3
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     4
Make sure HGMERGE doesn't interfere with the test:
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     5
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     6
  $ unset HGMERGE
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     7
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     8
  $ hg init
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
     9
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    10
Initial file contents:
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    11
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    12
  $ echo "line 1" > f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    13
  $ echo "line 2" >> f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    14
  $ echo "line 3" >> f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    15
  $ hg ci -Am "revision 0"
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    16
  adding f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    17
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    18
  $ cat f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    19
  line 1
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    20
  line 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    21
  line 3
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    22
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    23
Branch 1: editing line 1:
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    24
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    25
  $ sed 's/line 1/first line/' f > f.new
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    26
  $ mv f.new f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    27
  $ hg ci -Am "edited first line"
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    28
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    29
Branch 2: editing line 3:
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    30
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    31
  $ hg update 0
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    32
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    33
  $ sed 's/line 3/third line/' f > f.new
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    34
  $ mv f.new f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    35
  $ hg ci -Am "edited third line"
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    36
  created new head
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    37
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    38
Merge using internal:fail tool:
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    39
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    40
  $ echo "[merge-patterns]" > .hg/hgrc
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    41
  $ echo "* = internal:fail" >> .hg/hgrc
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    42
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    43
  $ hg merge
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    44
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    45
  use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    46
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    47
  $ cat f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    48
  line 1
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    49
  line 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    50
  third line
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    51
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    52
  $ hg stat
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    53
  M f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    54
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    55
Merge using internal:local tool:
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    56
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    57
  $ hg update -C 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    58
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    59
  $ sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    60
  $ mv .hg/hgrc.new .hg/hgrc
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    61
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    62
  $ hg merge
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    63
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    64
  (branch merge, don't forget to commit)
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    65
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    66
  $ cat f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    67
  line 1
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    68
  line 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    69
  third line
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    70
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    71
  $ hg stat
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    72
  M f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    73
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    74
Merge using internal:other tool:
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    75
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    76
  $ hg update -C 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    77
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    78
  $ sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    79
  $ mv .hg/hgrc.new .hg/hgrc
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    80
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    81
  $ hg merge
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    82
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    83
  (branch merge, don't forget to commit)
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    84
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    85
  $ cat f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    86
  first line
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    87
  line 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    88
  line 3
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    89
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    90
  $ hg stat
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    91
  M f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    92
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    93
Merge using default tool:
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    94
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    95
  $ hg update -C 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    96
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    97
  $ rm .hg/hgrc
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
    98
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
    99
  $ hg merge
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   100
  merging f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   101
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   102
  (branch merge, don't forget to commit)
6521
a3668330f14a test that internal merge tools are used when set for a merge-pattern in hgrc
Dov Feldstern <dfeldstern@fastimap.com>
parents:
diff changeset
   103
12257
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   104
  $ cat f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   105
  first line
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   106
  line 2
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   107
  third line
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   108
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   109
  $ hg stat
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   110
  M f
470e0b1ddc6e tests: unify test-merge-internal-tools-pattern
Adrian Buehlmann <adrian@cadifra.com>
parents: 12156
diff changeset
   111