##// END OF EJS Templates
test-filebranch: avoid a shell script
Alexis S. L. Carvalho -
r4293:b0140ead default
parent child Browse files
Show More
@@ -1,79 +1,79 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 # This test makes sure that we don't mark a file as merged with its ancestor
3 # This test makes sure that we don't mark a file as merged with its ancestor
4 # when we do a merge.
4 # when we do a merge.
5
5
6 cat <<'EOF' > merge
6 cat <<EOF > merge
7 #!/bin/sh
7 import sys, os
8 echo merging for `basename $1`
8 print "merging for", os.path.basename(sys.argv[1])
9 EOF
9 EOF
10 chmod +x merge
10 HGMERGE="python ../merge"; export HGMERGE
11
11
12 echo creating base
12 echo creating base
13 hg init a
13 hg init a
14 cd a
14 cd a
15 echo 1 > foo
15 echo 1 > foo
16 echo 1 > bar
16 echo 1 > bar
17 echo 1 > baz
17 echo 1 > baz
18 echo 1 > quux
18 echo 1 > quux
19 hg add foo bar baz quux
19 hg add foo bar baz quux
20 hg commit -m "base" -d "1000000 0"
20 hg commit -m "base" -d "1000000 0"
21
21
22 cd ..
22 cd ..
23 hg clone a b
23 hg clone a b
24
24
25 echo creating branch a
25 echo creating branch a
26 cd a
26 cd a
27 echo 2a > foo
27 echo 2a > foo
28 echo 2a > bar
28 echo 2a > bar
29 hg commit -m "branch a" -d "1000000 0"
29 hg commit -m "branch a" -d "1000000 0"
30
30
31 echo creating branch b
31 echo creating branch b
32
32
33 cd ..
33 cd ..
34 cd b
34 cd b
35 echo 2b > foo
35 echo 2b > foo
36 echo 2b > baz
36 echo 2b > baz
37 hg commit -m "branch b" -d "1000000 0"
37 hg commit -m "branch b" -d "1000000 0"
38
38
39 echo "we shouldn't have anything but n state here"
39 echo "we shouldn't have anything but n state here"
40 hg debugstate | cut -b 1-16,35-
40 hg debugstate | cut -b 1-16,35-
41
41
42 echo merging
42 echo merging
43 hg pull ../a
43 hg pull ../a
44 env HGMERGE=../merge hg merge -v
44 hg merge -v
45
45
46 echo 2m > foo
46 echo 2m > foo
47 echo 2b > baz
47 echo 2b > baz
48 echo new > quux
48 echo new > quux
49
49
50 echo "we shouldn't have anything but foo in merge state here"
50 echo "we shouldn't have anything but foo in merge state here"
51 hg debugstate | cut -b 1-16,35- | grep "^m"
51 hg debugstate | cut -b 1-16,35- | grep "^m"
52
52
53 hg ci -m "merge" -d "1000000 0"
53 hg ci -m "merge" -d "1000000 0"
54
54
55 echo "main: we should have a merge here"
55 echo "main: we should have a merge here"
56 hg debugindex .hg/store/00changelog.i
56 hg debugindex .hg/store/00changelog.i
57
57
58 echo "log should show foo and quux changed"
58 echo "log should show foo and quux changed"
59 hg log -v -r tip
59 hg log -v -r tip
60
60
61 echo "foo: we should have a merge here"
61 echo "foo: we should have a merge here"
62 hg debugindex .hg/store/data/foo.i
62 hg debugindex .hg/store/data/foo.i
63
63
64 echo "bar: we shouldn't have a merge here"
64 echo "bar: we shouldn't have a merge here"
65 hg debugindex .hg/store/data/bar.i
65 hg debugindex .hg/store/data/bar.i
66
66
67 echo "baz: we shouldn't have a merge here"
67 echo "baz: we shouldn't have a merge here"
68 hg debugindex .hg/store/data/baz.i
68 hg debugindex .hg/store/data/baz.i
69
69
70 echo "quux: we shouldn't have a merge here"
70 echo "quux: we shouldn't have a merge here"
71 hg debugindex .hg/store/data/quux.i
71 hg debugindex .hg/store/data/quux.i
72
72
73 echo "manifest entries should match tips of all files"
73 echo "manifest entries should match tips of all files"
74 hg manifest --debug
74 hg manifest --debug
75
75
76 echo "everything should be clean now"
76 echo "everything should be clean now"
77 hg status
77 hg status
78
78
79 hg verify
79 hg verify
General Comments 0
You need to be logged in to leave comments. Login now