##// END OF EJS Templates
tests: unify test-merge1
Pradeepkumar Gayam -
r11975:21884b43 default
parent child Browse files
Show More
@@ -1,112 +1,165 b''
1 #!/bin/sh
2
3 cat <<EOF > merge
4 import sys, os
1 $ cat <<EOF > merge
2 > import sys, os
3 >
4 > try:
5 > import msvcrt
6 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
7 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
8 > except ImportError:
9 > pass
10 >
11 > print "merging for", os.path.basename(sys.argv[1])
12 > EOF
13 $ HGMERGE="python ../merge"; export HGMERGE
5 14
6 try:
7 import msvcrt
8 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
9 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
10 except ImportError:
11 pass
12
13 print "merging for", os.path.basename(sys.argv[1])
14 EOF
15 HGMERGE="python ../merge"; export HGMERGE
15 $ mkdir t
16 $ cd t
17 $ hg init
18 $ echo This is file a1 > a
19 $ hg add a
20 $ hg commit -m "commit #0" -d "1000000 0"
21 $ echo This is file b1 > b
22 $ hg add b
23 $ hg commit -m "commit #1" -d "1000000 0"
16 24
17 mkdir t
18 cd t
19 hg init
20 echo This is file a1 > a
21 hg add a
22 hg commit -m "commit #0" -d "1000000 0"
23 echo This is file b1 > b
24 hg add b
25 hg commit -m "commit #1" -d "1000000 0"
25 $ hg update 0
26 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 $ echo This is file c1 > c
28 $ hg add c
29 $ hg commit -m "commit #2" -d "1000000 0"
30 created new head
31 $ echo This is file b1 > b
32 no merges expected
33 $ hg merge -P 1
34 changeset: 1:4ee19afe4659
35 user: test
36 date: Mon Jan 12 13:46:40 1970 +0000
37 summary: commit #1
38
39 $ hg merge 1
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 (branch merge, don't forget to commit)
42 $ hg diff --nodates
43 diff -r d9e5953b9dec b
44 --- /dev/null
45 +++ b/b
46 @@ -0,0 +1,1 @@
47 +This is file b1
48 $ hg status
49 M b
50 $ cd ..; rm -r t
26 51
27 hg update 0
28 echo This is file c1 > c
29 hg add c
30 hg commit -m "commit #2" -d "1000000 0"
31 echo This is file b1 > b
32 echo %% no merges expected
33 hg merge -P 1
34 hg merge 1
35 hg diff --nodates
36 hg status
37 cd ..; rm -r t
38
39 mkdir t
40 cd t
41 hg init
42 echo This is file a1 > a
43 hg add a
44 hg commit -m "commit #0" -d "1000000 0"
45 echo This is file b1 > b
46 hg add b
47 hg commit -m "commit #1" -d "1000000 0"
52 $ mkdir t
53 $ cd t
54 $ hg init
55 $ echo This is file a1 > a
56 $ hg add a
57 $ hg commit -m "commit #0" -d "1000000 0"
58 $ echo This is file b1 > b
59 $ hg add b
60 $ hg commit -m "commit #1" -d "1000000 0"
48 61
49 hg update 0
50 echo This is file c1 > c
51 hg add c
52 hg commit -m "commit #2" -d "1000000 0"
53 echo This is file b2 > b
54 echo %% merge should fail
55 hg merge 1
56 echo %% merge of b expected
57 hg merge -f 1
58 hg diff --nodates
59 hg status
60 cd ..; rm -r t
61 echo %%
62 $ hg update 0
63 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
64 $ echo This is file c1 > c
65 $ hg add c
66 $ hg commit -m "commit #2" -d "1000000 0"
67 created new head
68 $ echo This is file b2 > b
69 merge should fail
70 $ hg merge 1
71 abort: untracked file in working directory differs from file in requested revision: 'b'
72 merge of b expected
73 $ hg merge -f 1
74 merging for b
75 merging b
76 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
77 (branch merge, don't forget to commit)
78 $ hg diff --nodates
79 diff -r d9e5953b9dec b
80 --- /dev/null
81 +++ b/b
82 @@ -0,0 +1,1 @@
83 +This is file b2
84 $ hg status
85 M b
86 $ cd ..; rm -r t
62 87
63 mkdir t
64 cd t
65 hg init
66 echo This is file a1 > a
67 hg add a
68 hg commit -m "commit #0" -d "1000000 0"
69 echo This is file b1 > b
70 hg add b
71 hg commit -m "commit #1" -d "1000000 0"
72 echo This is file b22 > b
73 hg commit -m "commit #2" -d "1000000 0"
74 hg update 1
75 echo This is file c1 > c
76 hg add c
77 hg commit -m "commit #3" -d "1000000 0"
88 $ mkdir t
89 $ cd t
90 $ hg init
91 $ echo This is file a1 > a
92 $ hg add a
93 $ hg commit -m "commit #0" -d "1000000 0"
94 $ echo This is file b1 > b
95 $ hg add b
96 $ hg commit -m "commit #1" -d "1000000 0"
97 $ echo This is file b22 > b
98 $ hg commit -m "commit #2" -d "1000000 0"
99 $ hg update 1
100 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 $ echo This is file c1 > c
102 $ hg add c
103 $ hg commit -m "commit #3" -d "1000000 0"
104 created new head
105
106 Contents of b should be "this is file b1"
107 $ cat b
108 This is file b1
78 109
79 echo 'Contents of b should be "this is file b1"'
80 cat b
81
82 echo This is file b22 > b
83 echo %% merge fails
84 hg merge 2
85 echo %% merge expected!
86 hg merge -f 2
87 hg diff --nodates
88 hg status
89 cd ..; rm -r t
110 $ echo This is file b22 > b
111 merge fails
112 $ hg merge 2
113 abort: outstanding uncommitted changes (use 'hg status' to list changes)
114 $ echo %% merge expected!
115 %% merge expected!
116 $ hg merge -f 2
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 (branch merge, don't forget to commit)
119 $ hg diff --nodates
120 diff -r c1dd73cbf59f b
121 --- a/b
122 +++ b/b
123 @@ -1,1 +1,1 @@
124 -This is file b1
125 +This is file b22
126 $ hg status
127 M b
128 $ cd ..; rm -r t
90 129
91 mkdir t
92 cd t
93 hg init
94 echo This is file a1 > a
95 hg add a
96 hg commit -m "commit #0" -d "1000000 0"
97 echo This is file b1 > b
98 hg add b
99 hg commit -m "commit #1" -d "1000000 0"
100 echo This is file b22 > b
101 hg commit -m "commit #2" -d "1000000 0"
102 hg update 1
103 echo This is file c1 > c
104 hg add c
105 hg commit -m "commit #3" -d "1000000 0"
106 echo This is file b33 > b
107 echo %% merge of b should fail
108 hg merge 2
109 echo %% merge of b expected
110 hg merge -f 2
111 hg diff --nodates
112 hg status
130 $ mkdir t
131 $ cd t
132 $ hg init
133 $ echo This is file a1 > a
134 $ hg add a
135 $ hg commit -m "commit #0" -d "1000000 0"
136 $ echo This is file b1 > b
137 $ hg add b
138 $ hg commit -m "commit #1" -d "1000000 0"
139 $ echo This is file b22 > b
140 $ hg commit -m "commit #2" -d "1000000 0"
141 $ hg update 1
142 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 $ echo This is file c1 > c
144 $ hg add c
145 $ hg commit -m "commit #3" -d "1000000 0"
146 created new head
147 $ echo This is file b33 > b
148 merge of b should fail
149 $ hg merge 2
150 abort: outstanding uncommitted changes (use 'hg status' to list changes)
151 merge of b expected
152 $ hg merge -f 2
153 merging for b
154 merging b
155 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
156 (branch merge, don't forget to commit)
157 $ hg diff --nodates
158 diff -r c1dd73cbf59f b
159 --- a/b
160 +++ b/b
161 @@ -1,1 +1,1 @@
162 -This is file b1
163 +This is file b33
164 $ hg status
165 M b
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now