Mercurial > hg
comparison tests/test-merge-internal-tools-pattern @ 6521:a3668330f14a
test that internal merge tools are used when set for a merge-pattern in hgrc
It is possible to specify that one of the internal merge tools (internal:fail,
internal:local or internal:other) should be used for performing merges on files
matching a given pattern. This test makes sure that such a setting actually
works.
author | Dov Feldstern <dfeldstern@fastimap.com> |
---|---|
date | Fri, 04 Apr 2008 02:20:58 +0300 |
parents | |
children | 4c94b6d0fb1c |
comparison
equal
deleted
inserted
replaced
6520:ba0b2dacc623 | 6521:a3668330f14a |
---|---|
1 #!/bin/sh | |
2 | |
3 # make sure that the internal merge tools (internal:fail, internal:local, and | |
4 # internal:other) are used when matched by a merge-pattern in hgrc | |
5 | |
6 unset HGMERGE # make sure HGMERGE doesn't interfere with the test | |
7 | |
8 hg init | |
9 | |
10 echo "# initial file contents" | |
11 echo "line 1" > f | |
12 echo "line 2" >> f | |
13 echo "line 3" >> f | |
14 hg commit -Am "revision 0" -d "1000000 0" | |
15 cat f | |
16 echo "# branch 1: editing line 1" | |
17 sed 's/line 1/first line/' f > f.new | |
18 mv f.new f | |
19 hg commit -Am "edited first line" -d "1000000 0" | |
20 | |
21 echo "# branch 2: editing line 3" | |
22 hg update 0 | |
23 sed 's/line 3/third line/' f > f.new | |
24 mv f.new f | |
25 hg commit -Am "edited third line" -d "1000000 0" | |
26 | |
27 echo "# merge using internal:fail tool" | |
28 echo "[merge-patterns]" > .hg/hgrc | |
29 echo "* = internal:fail" >> .hg/hgrc | |
30 hg merge | |
31 cat f | |
32 hg stat | |
33 | |
34 echo "# merge using internal:local tool" | |
35 hg update -C 2 | |
36 sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new | |
37 mv .hg/hgrc.new .hg/hgrc | |
38 hg merge | |
39 cat f | |
40 hg stat | |
41 | |
42 echo "# merge using internal:other tool" | |
43 hg update -C 2 | |
44 sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new | |
45 mv .hg/hgrc.new .hg/hgrc | |
46 hg merge | |
47 cat f | |
48 hg stat | |
49 | |
50 echo "# merge using default tool" | |
51 hg update -C 2 | |
52 rm .hg/hgrc | |
53 hg merge | |
54 cat f | |
55 hg stat | |
56 |