28
|
1 |
set -e
|
|
2 |
set -x
|
|
3 |
|
|
4 |
# skip commit logs
|
|
5 |
export HGMERGE=tkmerge
|
|
6 |
export EDITOR=true
|
|
7 |
|
|
8 |
rm -rf m m1 m2
|
|
9 |
mkdir m
|
|
10 |
cd m
|
|
11 |
|
|
12 |
echo "m this that"
|
|
13 |
echo "this" > a
|
|
14 |
echo "that" > b
|
|
15 |
hg init
|
|
16 |
hg addremove
|
|
17 |
hg commit
|
|
18 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
19 |
echo
|
|
20 |
|
|
21 |
cd ..
|
|
22 |
echo "m2 this that "
|
|
23 |
mkdir m2
|
|
24 |
cd m2
|
|
25 |
hg branch ../m
|
|
26 |
hg checkout
|
|
27 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
28 |
echo
|
|
29 |
|
|
30 |
cd ../m
|
|
31 |
echo "m this1 that "
|
|
32 |
echo "this1" > a
|
|
33 |
hg commit
|
|
34 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
35 |
echo
|
|
36 |
|
|
37 |
cd ..
|
|
38 |
echo "m1 this1 that "
|
|
39 |
mkdir m1
|
|
40 |
cd m1
|
|
41 |
hg branch ../m
|
|
42 |
hg checkout
|
|
43 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
44 |
echo
|
|
45 |
|
|
46 |
cd ../m1
|
|
47 |
echo "m1 this1 that1"
|
|
48 |
echo "that1" > b
|
|
49 |
hg commit
|
|
50 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
51 |
echo
|
|
52 |
|
|
53 |
cd ../m2
|
|
54 |
echo "m2 this that2"
|
|
55 |
echo "that2" > b
|
|
56 |
hg commit
|
|
57 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
58 |
echo
|
|
59 |
|
|
60 |
cd ../m1
|
|
61 |
echo "m1:m2 this1 that1 that2"
|
|
62 |
hg merge ../m2 # b should conflict, a should be fine
|
|
63 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
64 |
echo
|
|
65 |
|
|
66 |
cd ../m2
|
|
67 |
echo "m2 this2 that2"
|
|
68 |
echo "this2" > a
|
|
69 |
hg commit
|
|
70 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
71 |
echo
|
|
72 |
|
|
73 |
cd ../m2
|
|
74 |
echo "m2:m this12 that2"
|
|
75 |
hg merge ../m # a should conflict, b should be fine
|
|
76 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
77 |
echo
|
|
78 |
|
|
79 |
# now here's the interesting bit
|
|
80 |
# if we choose ancestor by file, no conflicts
|
|
81 |
# otherwise we've got two equally close ancestors, each with a conflict
|
|
82 |
# if we go back to the root, we'll have both conflicts again
|
|
83 |
echo "m2:m1 this12 that12"
|
|
84 |
hg merge ../m1 # should be clean
|
|
85 |
echo "a:" `hg dump a` "b:" `hg dump b`
|
|
86 |
echo
|