Show More
@@ -63,9 +63,6 b' def runcommand(server, args, output=sys.' | |||
|
63 | 63 | return |
|
64 | 64 | |
|
65 | 65 | def check(func, repopath=None): |
|
66 | ||
|
67 | print 'testing %s:' % func.__name__ | |
|
68 | ||
|
69 | 66 | sys.stdout.flush() |
|
70 | 67 | server = connect(repopath) |
|
71 | 68 | try: |
@@ -20,9 +20,6 b'' | |||
|
20 | 20 | ... # run an arbitrary command to make sure the next thing the server |
|
21 | 21 | ... # sends isn't part of the hello message |
|
22 | 22 | ... runcommand(server, ['id']) |
|
23 | ||
|
24 | testing hellomessage: | |
|
25 | ||
|
26 | 23 | o, 'capabilities: getencoding runcommand\nencoding: ***' |
|
27 | 24 | runcommand id |
|
28 | 25 | 000000000000 tip |
@@ -31,9 +28,6 b'' | |||
|
31 | 28 | >>> @check |
|
32 | 29 | ... def unknowncommand(server): |
|
33 | 30 | ... server.stdin.write('unknowncommand\n') |
|
34 | ||
|
35 | testing unknowncommand: | |
|
36 | ||
|
37 | 31 | abort: unknown command unknowncommand |
|
38 | 32 | |
|
39 | 33 | >>> from hgclient import readchannel, runcommand, check |
@@ -59,9 +53,6 b'' | |||
|
59 | 53 | ... |
|
60 | 54 | ... # negative return code should be masked |
|
61 | 55 | ... runcommand(server, ['id', '-runknown']) |
|
62 | ||
|
63 | testing checkruncommand: | |
|
64 | ||
|
65 | 56 | runcommand |
|
66 | 57 | Mercurial Distributed SCM |
|
67 | 58 | |
@@ -108,9 +99,6 b'' | |||
|
108 | 99 | ... |
|
109 | 100 | ... # server exits with 1 if the pipe closed while reading the command |
|
110 | 101 | ... print 'server exit code =', server.wait() |
|
111 | ||
|
112 | testing inputeof: | |
|
113 | ||
|
114 | 102 | server exit code = 1 |
|
115 | 103 | |
|
116 | 104 | >>> import cStringIO |
@@ -136,9 +124,6 b'' | |||
|
136 | 124 | ... |
|
137 | 125 | ... runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch)) |
|
138 | 126 | ... runcommand(server, ['log']) |
|
139 | ||
|
140 | testing serverinput: | |
|
141 | ||
|
142 | 127 | runcommand import - |
|
143 | 128 | applying patch from stdin |
|
144 | 129 | runcommand log |
@@ -159,9 +144,6 b" check that --cwd doesn't persist between" | |||
|
159 | 144 | ... readchannel(server) |
|
160 | 145 | ... runcommand(server, ['--cwd', 'foo', 'st', 'bar']) |
|
161 | 146 | ... runcommand(server, ['st', 'foo/bar']) |
|
162 | ||
|
163 | testing cwd: | |
|
164 | ||
|
165 | 147 | runcommand --cwd foo st bar |
|
166 | 148 | ? bar |
|
167 | 149 | runcommand st foo/bar |
@@ -189,9 +171,6 b' check that local configs for the cached ' | |||
|
189 | 171 | ... # but not for this repo |
|
190 | 172 | ... runcommand(server, ['init', 'foo']) |
|
191 | 173 | ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) |
|
192 | ||
|
193 | testing localhgrc: | |
|
194 | ||
|
195 | 174 | runcommand showconfig |
|
196 | 175 | bundle.mainreporoot=$TESTTMP/repo |
|
197 | 176 | defaults.backout=-d "0 0" |
@@ -238,9 +217,6 b' check that local configs for the cached ' | |||
|
238 | 217 | ... 'hooks.pre-identify=python:hook.hook', |
|
239 | 218 | ... 'id'], |
|
240 | 219 | ... input=cStringIO.StringIO('some input')) |
|
241 | ||
|
242 | testing hookoutput: | |
|
243 | ||
|
244 | 220 | runcommand --config hooks.pre-identify=python:hook.hook id |
|
245 | 221 | hook talking |
|
246 | 222 | now try to read something: 'some input' |
@@ -258,9 +234,6 b' check that local configs for the cached ' | |||
|
258 | 234 | ... os.system('hg ci -Am2') |
|
259 | 235 | ... runcommand(server, ['tip']) |
|
260 | 236 | ... runcommand(server, ['status']) |
|
261 | ||
|
262 | testing outsidechanges: | |
|
263 | ||
|
264 | 237 | runcommand status |
|
265 | 238 | M a |
|
266 | 239 | runcommand tip |
@@ -294,9 +267,6 b' check that local configs for the cached ' | |||
|
294 | 267 | ... f.close() |
|
295 | 268 | ... runcommand(server, ['commit', '-Amm']) |
|
296 | 269 | ... runcommand(server, ['bookmarks']) |
|
297 | ||
|
298 | testing bookmarks: | |
|
299 | ||
|
300 | 270 | runcommand bookmarks |
|
301 | 271 | no bookmarks set |
|
302 | 272 | runcommand bookmarks |
@@ -320,9 +290,6 b' check that local configs for the cached ' | |||
|
320 | 290 | ... runcommand(server, ['id', '-t', '-r', '0']) |
|
321 | 291 | ... os.system('hg tag -r 0 foo') |
|
322 | 292 | ... runcommand(server, ['id', '-t', '-r', '0']) |
|
323 | ||
|
324 | testing tagscache: | |
|
325 | ||
|
326 | 293 | runcommand id -t -r 0 |
|
327 | 294 | |
|
328 | 295 | runcommand id -t -r 0 |
@@ -336,9 +303,6 b' check that local configs for the cached ' | |||
|
336 | 303 | ... runcommand(server, ['phase', '-r', '.']) |
|
337 | 304 | ... os.system('hg phase -r . -p') |
|
338 | 305 | ... runcommand(server, ['phase', '-r', '.']) |
|
339 | ||
|
340 | testing setphase: | |
|
341 | ||
|
342 | 306 | runcommand phase -r . |
|
343 | 307 | 3: draft |
|
344 | 308 | runcommand phase -r . |
@@ -353,9 +317,6 b' check that local configs for the cached ' | |||
|
353 | 317 | ... runcommand(server, ['commit', '-Am.']) |
|
354 | 318 | ... runcommand(server, ['rollback']) |
|
355 | 319 | ... runcommand(server, ['phase', '-r', '.']) |
|
356 | ||
|
357 | testing rollback: | |
|
358 | ||
|
359 | 320 | runcommand phase -r . -p |
|
360 | 321 | no phases changed |
|
361 | 322 | [1] |
@@ -375,9 +336,6 b' check that local configs for the cached ' | |||
|
375 | 336 | ... os.system('hg branch foo') |
|
376 | 337 | ... runcommand(server, ['branch']) |
|
377 | 338 | ... os.system('hg branch default') |
|
378 | ||
|
379 | testing branch: | |
|
380 | ||
|
381 | 339 | runcommand branch |
|
382 | 340 | default |
|
383 | 341 | marked working directory as branch foo |
@@ -401,9 +359,6 b' check that local configs for the cached ' | |||
|
401 | 359 | ... f.write('ignored-file') |
|
402 | 360 | ... f.close() |
|
403 | 361 | ... runcommand(server, ['status', '-i', '-u']) |
|
404 | ||
|
405 | testing hgignore: | |
|
406 | ||
|
407 | 362 | runcommand commit -Am. |
|
408 | 363 | adding .hgignore |
|
409 | 364 | runcommand status -i -u |
@@ -433,9 +388,6 b' check that local configs for the cached ' | |||
|
433 | 388 | ... |
|
434 | 389 | ... # shouldn't raise "7966c8e3734d: no node!" |
|
435 | 390 | ... runcommand(server, ['branches']) |
|
436 | ||
|
437 | testing phasecacheafterstrip: | |
|
438 | ||
|
439 | 391 | runcommand update -C 0 |
|
440 | 392 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
441 | 393 | (leaving bookmark bm3) |
@@ -483,9 +435,6 b' check that local configs for the cached ' | |||
|
483 | 435 | ... os.system(cmd) |
|
484 | 436 | ... runcommand(server, ['log', '--hidden']) |
|
485 | 437 | ... runcommand(server, ['log']) |
|
486 | ||
|
487 | testing obsolete: | |
|
488 | ||
|
489 | 438 | runcommand up null |
|
490 | 439 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
491 | 440 | runcommand phase -df tip |
@@ -536,9 +485,6 b' check that local configs for the cached ' | |||
|
536 | 485 | ... os.system('hg qqueue --create foo') |
|
537 | 486 | ... # repo.mq should be recreated to point to new queue |
|
538 | 487 | ... runcommand(server, ['qqueue', '--active']) |
|
539 | ||
|
540 | testing mqoutsidechanges: | |
|
541 | ||
|
542 | 488 | runcommand qapplied |
|
543 | 489 | runcommand qapplied |
|
544 | 490 | 0.diff |
@@ -569,9 +515,6 b' check that local configs for the cached ' | |||
|
569 | 515 | ... runcommand(server, ['debuggetpass', '--config', |
|
570 | 516 | ... 'ui.interactive=True'], |
|
571 | 517 | ... input=cStringIO.StringIO('1234\n')) |
|
572 | ||
|
573 | testing getpass: | |
|
574 | ||
|
575 | 518 | runcommand debuggetpass --config ui.interactive=True |
|
576 | 519 | password: 1234 |
|
577 | 520 | |
@@ -592,9 +535,6 b' start without repository:' | |||
|
592 | 535 | ... # run an arbitrary command to make sure the next thing the server |
|
593 | 536 | ... # sends isn't part of the hello message |
|
594 | 537 | ... runcommand(server, ['id']) |
|
595 | ||
|
596 | testing hellomessage: | |
|
597 | ||
|
598 | 538 | o, 'capabilities: getencoding runcommand\nencoding: ***' |
|
599 | 539 | runcommand id |
|
600 | 540 | abort: there is no Mercurial repository here (.hg not found) |
@@ -606,9 +546,6 b' start without repository:' | |||
|
606 | 546 | ... readchannel(server) |
|
607 | 547 | ... runcommand(server, ['init', 'repo2']) |
|
608 | 548 | ... runcommand(server, ['id', '-R', 'repo2']) |
|
609 | ||
|
610 | testing startwithoutrepo: | |
|
611 | ||
|
612 | 549 | runcommand init repo2 |
|
613 | 550 | runcommand id -R repo2 |
|
614 | 551 | 000000000000 tip |
General Comments 0
You need to be logged in to leave comments.
Login now