##// END OF EJS Templates
test-simplemerge-cmd.t: move all tests into test-contrib.t
Augie Fackler -
r14032:d98af142 default
parent child Browse files
Show More
@@ -1,105 +1,279 b''
1 1 Set vars:
2 2
3 3 $ CONTRIBDIR=$TESTDIR/../contrib
4 4
5 5 Prepare repo-a:
6 6
7 7 $ hg init repo-a
8 8 $ cd repo-a
9 9
10 10 $ echo this is file a > a
11 11 $ hg add a
12 12 $ hg commit -m first
13 13
14 14 $ echo adding to file a >> a
15 15 $ hg commit -m second
16 16
17 17 $ echo adding more to file a >> a
18 18 $ hg commit -m third
19 19
20 20 $ hg verify
21 21 checking changesets
22 22 checking manifests
23 23 crosschecking files in changesets and manifests
24 24 checking files
25 25 1 files, 3 changesets, 3 total revisions
26 26
27 27 Dumping revlog of file a to stdout:
28 28
29 29 $ python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
30 30 file: .hg/store/data/a.i
31 31 node: 183d2312b35066fb6b3b449b84efc370d50993d0
32 32 linkrev: 0
33 33 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
34 34 length: 15
35 35 -start-
36 36 this is file a
37 37
38 38 -end-
39 39 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
40 40 linkrev: 1
41 41 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
42 42 length: 32
43 43 -start-
44 44 this is file a
45 45 adding to file a
46 46
47 47 -end-
48 48 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
49 49 linkrev: 2
50 50 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
51 51 length: 54
52 52 -start-
53 53 this is file a
54 54 adding to file a
55 55 adding more to file a
56 56
57 57 -end-
58 58
59 59 Dump all revlogs to file repo.dump:
60 60
61 61 $ find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
62 62 $ cd ..
63 63
64 64 Undumping into repo-b:
65 65
66 66 $ hg init repo-b
67 67 $ cd repo-b
68 68 $ python $CONTRIBDIR/undumprevlog < ../repo.dump
69 69 .hg/store/00changelog.i
70 70 .hg/store/00manifest.i
71 71 .hg/store/data/a.i
72 72 $ cd ..
73 73
74 74 Rebuild fncache with clone --pull:
75 75
76 76 $ hg clone --pull -U repo-b repo-c
77 77 requesting all changes
78 78 adding changesets
79 79 adding manifests
80 80 adding file changes
81 81 added 3 changesets with 3 changes to 1 files
82 82
83 83 Verify:
84 84
85 85 $ hg -R repo-c verify
86 86 checking changesets
87 87 checking manifests
88 88 crosschecking files in changesets and manifests
89 89 checking files
90 90 1 files, 3 changesets, 3 total revisions
91 91
92 92 Compare repos:
93 93
94 94 $ hg -R repo-c incoming repo-a
95 95 comparing with repo-a
96 96 searching for changes
97 97 no changes found
98 98 [1]
99 99
100 100 $ hg -R repo-a incoming repo-c
101 101 comparing with repo-c
102 102 searching for changes
103 103 no changes found
104 104 [1]
105 105
106
107 Test simplemerge command:
108
109 $ cp "$CONTRIBDIR/simplemerge" .
110 $ echo base > base
111 $ echo local > local
112 $ cat base >> local
113 $ cp local orig
114 $ cat base > other
115 $ echo other >> other
116
117 changing local directly
118
119 $ python simplemerge local base other && echo "merge succeeded"
120 merge succeeded
121 $ cat local
122 local
123 base
124 other
125 $ cp orig local
126
127 printing to stdout
128
129 $ python simplemerge -p local base other
130 local
131 base
132 other
133
134 local:
135
136 $ cat local
137 local
138 base
139
140 conflicts
141
142 $ cp base conflict-local
143 $ cp other conflict-other
144 $ echo not other >> conflict-local
145 $ echo end >> conflict-local
146 $ echo end >> conflict-other
147 $ python simplemerge -p conflict-local base conflict-other
148 base
149 <<<<<<< conflict-local
150 not other
151 =======
152 other
153 >>>>>>> conflict-other
154 end
155 warning: conflicts during merge.
156 [1]
157
158 --no-minimal
159
160 $ python simplemerge -p --no-minimal conflict-local base conflict-other
161 base
162 <<<<<<< conflict-local
163 not other
164 end
165 =======
166 other
167 end
168 >>>>>>> conflict-other
169 warning: conflicts during merge.
170 [1]
171
172 1 label
173
174 $ python simplemerge -p -L foo conflict-local base conflict-other
175 base
176 <<<<<<< foo
177 not other
178 =======
179 other
180 >>>>>>> conflict-other
181 end
182 warning: conflicts during merge.
183 [1]
184
185 2 labels
186
187 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
188 base
189 <<<<<<< foo
190 not other
191 =======
192 other
193 >>>>>>> bar
194 end
195 warning: conflicts during merge.
196 [1]
197
198 too many labels
199
200 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
201 abort: can only specify two labels.
202 [255]
203
204 binary file
205
206 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
207 $ cat orig >> binary-local
208 $ python simplemerge -p binary-local base other
209 abort: binary-local looks like a binary file.
210 [255]
211
212 binary file --text
213
214 $ python simplemerge -a -p binary-local base other 2>&1
215 warning: binary-local looks like a binary file.
216 \x00local (esc)
217 base
218 other
219
220 help
221
222 $ python simplemerge --help
223 simplemerge [OPTS] LOCAL BASE OTHER
224
225 Simple three-way file merge utility with a minimal feature set.
226
227 Apply to LOCAL the changes necessary to go from BASE to OTHER.
228
229 By default, LOCAL is overwritten with the results of this operation.
230
231 options:
232 -L --label labels to use on conflict markers
233 -a --text treat all files as text
234 -p --print print results instead of overwriting LOCAL
235 --no-minimal do not try to minimize conflict regions
236 -h --help display help and exit
237 -q --quiet suppress output
238
239 wrong number of arguments
240
241 $ python simplemerge
242 simplemerge: wrong number of arguments
243 simplemerge [OPTS] LOCAL BASE OTHER
244
245 Simple three-way file merge utility with a minimal feature set.
246
247 Apply to LOCAL the changes necessary to go from BASE to OTHER.
248
249 By default, LOCAL is overwritten with the results of this operation.
250
251 options:
252 -L --label labels to use on conflict markers
253 -a --text treat all files as text
254 -p --print print results instead of overwriting LOCAL
255 --no-minimal do not try to minimize conflict regions
256 -h --help display help and exit
257 -q --quiet suppress output
258 [1]
259
260 bad option
261
262 $ python simplemerge --foo -p local base other
263 simplemerge: option --foo not recognized
264 simplemerge [OPTS] LOCAL BASE OTHER
265
266 Simple three-way file merge utility with a minimal feature set.
267
268 Apply to LOCAL the changes necessary to go from BASE to OTHER.
269
270 By default, LOCAL is overwritten with the results of this operation.
271
272 options:
273 -L --label labels to use on conflict markers
274 -a --text treat all files as text
275 -p --print print results instead of overwriting LOCAL
276 --no-minimal do not try to minimize conflict regions
277 -h --help display help and exit
278 -q --quiet suppress output
279 [1]
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now