Show More
@@ -0,0 +1,56 b'' | |||
|
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 |
@@ -0,0 +1,43 b'' | |||
|
1 | # initial file contents | |
|
2 | adding f | |
|
3 | line 1 | |
|
4 | line 2 | |
|
5 | line 3 | |
|
6 | # branch 1: editing line 1 | |
|
7 | # branch 2: editing line 3 | |
|
8 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
9 | created new head | |
|
10 | # merge using internal:fail tool | |
|
11 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
|
12 | There are unresolved merges, you can redo the full merge using: | |
|
13 | hg update -C 2 | |
|
14 | hg merge 1 | |
|
15 | line 1 | |
|
16 | line 2 | |
|
17 | third line | |
|
18 | M f | |
|
19 | # merge using internal:local tool | |
|
20 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
21 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
22 | (branch merge, don't forget to commit) | |
|
23 | line 1 | |
|
24 | line 2 | |
|
25 | third line | |
|
26 | M f | |
|
27 | # merge using internal:other tool | |
|
28 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
29 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
30 | (branch merge, don't forget to commit) | |
|
31 | first line | |
|
32 | line 2 | |
|
33 | line 3 | |
|
34 | M f | |
|
35 | # merge using default tool | |
|
36 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
37 | merging f | |
|
38 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
39 | (branch merge, don't forget to commit) | |
|
40 | first line | |
|
41 | line 2 | |
|
42 | third line | |
|
43 | M f |
@@ -16,6 +16,8 b' def _toolbool(ui, tool, part, default=Fa' | |||
|
16 | 16 | return ui.configbool("merge-tools", tool + "." + part, default) |
|
17 | 17 | |
|
18 | 18 | def _findtool(ui, tool): |
|
19 | if tool in ("internal:fail", "internal:local", "internal:other"): | |
|
20 | return tool | |
|
19 | 21 | k = _toolstr(ui, tool, "regkey") |
|
20 | 22 | if k: |
|
21 | 23 | p = util.lookup_reg(k, _toolstr(ui, tool, "regname")) |
General Comments 0
You need to be logged in to leave comments.
Login now