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