equal
deleted
inserted
replaced
|
1 #!/bin/sh |
|
2 |
|
3 # This test makes sure that we don't mark a file as merged with its ancestor |
|
4 # when we do a merge. |
|
5 |
|
6 cat <<'EOF' > merge |
|
7 #!/bin/sh |
|
8 echo merging for `basename $1` |
|
9 EOF |
|
10 chmod +x merge |
|
11 |
|
12 echo creating base |
|
13 hg init a |
|
14 cd a |
|
15 echo 1 > foo |
|
16 echo 1 > bar |
|
17 echo 1 > baz |
|
18 echo 1 > quux |
|
19 hg add foo bar baz quux |
|
20 hg commit -m "base" -d "0 0" |
|
21 |
|
22 cd .. |
|
23 hg clone a b |
|
24 |
|
25 echo creating branch a |
|
26 cd a |
|
27 echo 2a > foo |
|
28 echo 2a > bar |
|
29 hg commit -m "branch a" -d "0 0" |
|
30 |
|
31 echo creating branch b |
|
32 |
|
33 cd .. |
|
34 cd b |
|
35 echo 2b > foo |
|
36 echo 2b > baz |
|
37 hg commit -m "branch b" -d "0 0" |
|
38 |
|
39 echo "we shouldn't have anything but n state here" |
|
40 hg debugstate | cut -b 1-16,35- |
|
41 |
|
42 echo merging |
|
43 hg pull ../a |
|
44 env HGMERGE=../merge hg update -vm --debug |
|
45 |
|
46 echo 2m > foo |
|
47 echo 2b > baz |
|
48 echo new > quux |
|
49 |
|
50 echo "we shouldn't have anything but foo in merge state here" |
|
51 hg debugstate | cut -b 1-16,35- | grep "^m" |
|
52 |
|
53 hg ci -m "merge" -d "0 0" |
|
54 |
|
55 echo "main: we should have a merge here" |
|
56 hg debugindex .hg/00changelog.i |
|
57 |
|
58 echo "foo: we should have a merge here" |
|
59 hg debugindex .hg/data/foo.i |
|
60 |
|
61 echo "bar: we shouldn't have a merge here" |
|
62 hg debugindex .hg/data/bar.i |
|
63 |
|
64 echo "baz: we shouldn't have a merge here" |
|
65 hg debugindex .hg/data/baz.i |
|
66 |
|
67 echo "quux: we shouldn't have a merge here" |
|
68 hg debugindex .hg/data/quux.i |
|
69 |
|
70 echo "everything should be clean now" |
|
71 hg status |
|
72 |
|
73 hg verify |