##// END OF EJS Templates
test-commandserver: make runcommand message bolder...
Yuya Nishihara -
r22572:cc3d9f77 default
parent child Browse files
Show More
@@ -32,7 +32,7 b' def sep(text):'
32
32
33 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None,
33 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None,
34 outfilter=lambda x: x):
34 outfilter=lambda x: x):
35 print ' runcommand', ' '.join(args)
35 print '*** runcommand', ' '.join(args)
36 sys.stdout.flush()
36 sys.stdout.flush()
37 server.stdin.write('runcommand\n')
37 server.stdin.write('runcommand\n')
38 writeblock(server, '\0'.join(args))
38 writeblock(server, '\0'.join(args))
@@ -17,7 +17,7 b''
17 ... # sends isn't part of the hello message
17 ... # sends isn't part of the hello message
18 ... runcommand(server, ['id'])
18 ... runcommand(server, ['id'])
19 o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
19 o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
20 runcommand id
20 *** runcommand id
21 000000000000 tip
21 000000000000 tip
22
22
23 >>> from hgclient import check
23 >>> from hgclient import check
@@ -49,7 +49,7 b''
49 ...
49 ...
50 ... # negative return code should be masked
50 ... # negative return code should be masked
51 ... runcommand(server, ['id', '-runknown'])
51 ... runcommand(server, ['id', '-runknown'])
52 runcommand
52 *** runcommand
53 Mercurial Distributed SCM
53 Mercurial Distributed SCM
54
54
55 basic commands:
55 basic commands:
@@ -73,15 +73,15 b''
73 update update working directory (or switch revisions)
73 update update working directory (or switch revisions)
74
74
75 (use "hg help" for the full list of commands or "hg -v" for details)
75 (use "hg help" for the full list of commands or "hg -v" for details)
76 runcommand id --quiet
76 *** runcommand id --quiet
77 000000000000
77 000000000000
78 runcommand id
78 *** runcommand id
79 000000000000 tip
79 000000000000 tip
80 runcommand id --config ui.quiet=True
80 *** runcommand id --config ui.quiet=True
81 000000000000
81 000000000000
82 runcommand id
82 *** runcommand id
83 000000000000 tip
83 000000000000 tip
84 runcommand id -runknown
84 *** runcommand id -runknown
85 abort: unknown revision 'unknown'!
85 abort: unknown revision 'unknown'!
86 [255]
86 [255]
87
87
@@ -120,9 +120,9 b''
120 ...
120 ...
121 ... runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))
121 ... runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))
122 ... runcommand(server, ['log'])
122 ... runcommand(server, ['log'])
123 runcommand import -
123 *** runcommand import -
124 applying patch from stdin
124 applying patch from stdin
125 runcommand log
125 *** runcommand log
126 changeset: 0:eff892de26ec
126 changeset: 0:eff892de26ec
127 tag: tip
127 tag: tip
128 user: test
128 user: test
@@ -140,9 +140,9 b" check that --cwd doesn't persist between"
140 ... readchannel(server)
140 ... readchannel(server)
141 ... runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
141 ... runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
142 ... runcommand(server, ['st', 'foo/bar'])
142 ... runcommand(server, ['st', 'foo/bar'])
143 runcommand --cwd foo st bar
143 *** runcommand --cwd foo st bar
144 ? bar
144 ? bar
145 runcommand st foo/bar
145 *** runcommand st foo/bar
146 ? foo/bar
146 ? foo/bar
147
147
148 $ rm foo/bar
148 $ rm foo/bar
@@ -167,7 +167,7 b' check that local configs for the cached '
167 ... # but not for this repo
167 ... # but not for this repo
168 ... runcommand(server, ['init', 'foo'])
168 ... runcommand(server, ['init', 'foo'])
169 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
169 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
170 runcommand showconfig
170 *** runcommand showconfig
171 bundle.mainreporoot=$TESTTMP/repo
171 bundle.mainreporoot=$TESTTMP/repo
172 defaults.backout=-d "0 0"
172 defaults.backout=-d "0 0"
173 defaults.commit=-d "0 0"
173 defaults.commit=-d "0 0"
@@ -178,8 +178,8 b' check that local configs for the cached '
178 ui.mergemarkers=detailed
178 ui.mergemarkers=detailed
179 ui.foo=bar
179 ui.foo=bar
180 ui.nontty=true
180 ui.nontty=true
181 runcommand init foo
181 *** runcommand init foo
182 runcommand -R foo showconfig ui defaults
182 *** runcommand -R foo showconfig ui defaults
183 defaults.backout=-d "0 0"
183 defaults.backout=-d "0 0"
184 defaults.commit=-d "0 0"
184 defaults.commit=-d "0 0"
185 defaults.shelve=--date "0 0"
185 defaults.shelve=--date "0 0"
@@ -213,7 +213,7 b' check that local configs for the cached '
213 ... 'hooks.pre-identify=python:hook.hook',
213 ... 'hooks.pre-identify=python:hook.hook',
214 ... 'id'],
214 ... 'id'],
215 ... input=cStringIO.StringIO('some input'))
215 ... input=cStringIO.StringIO('some input'))
216 runcommand --config hooks.pre-identify=python:hook.hook id
216 *** runcommand --config hooks.pre-identify=python:hook.hook id
217 hook talking
217 hook talking
218 now try to read something: 'some input'
218 now try to read something: 'some input'
219 eff892de26ec tip
219 eff892de26ec tip
@@ -230,16 +230,16 b' check that local configs for the cached '
230 ... os.system('hg ci -Am2')
230 ... os.system('hg ci -Am2')
231 ... runcommand(server, ['tip'])
231 ... runcommand(server, ['tip'])
232 ... runcommand(server, ['status'])
232 ... runcommand(server, ['status'])
233 runcommand status
233 *** runcommand status
234 M a
234 M a
235 runcommand tip
235 *** runcommand tip
236 changeset: 1:d3a0a68be6de
236 changeset: 1:d3a0a68be6de
237 tag: tip
237 tag: tip
238 user: test
238 user: test
239 date: Thu Jan 01 00:00:00 1970 +0000
239 date: Thu Jan 01 00:00:00 1970 +0000
240 summary: 2
240 summary: 2
241
241
242 runcommand status
242 *** runcommand status
243
243
244 >>> import os
244 >>> import os
245 >>> from hgclient import readchannel, runcommand, check
245 >>> from hgclient import readchannel, runcommand, check
@@ -263,17 +263,17 b' check that local configs for the cached '
263 ... f.close()
263 ... f.close()
264 ... runcommand(server, ['commit', '-Amm'])
264 ... runcommand(server, ['commit', '-Amm'])
265 ... runcommand(server, ['bookmarks'])
265 ... runcommand(server, ['bookmarks'])
266 runcommand bookmarks
266 *** runcommand bookmarks
267 no bookmarks set
267 no bookmarks set
268 runcommand bookmarks
268 *** runcommand bookmarks
269 bm1 1:d3a0a68be6de
269 bm1 1:d3a0a68be6de
270 bm2 1:d3a0a68be6de
270 bm2 1:d3a0a68be6de
271 runcommand bookmarks
271 *** runcommand bookmarks
272 * bm1 1:d3a0a68be6de
272 * bm1 1:d3a0a68be6de
273 bm2 1:d3a0a68be6de
273 bm2 1:d3a0a68be6de
274 runcommand bookmarks bm3
274 *** runcommand bookmarks bm3
275 runcommand commit -Amm
275 *** runcommand commit -Amm
276 runcommand bookmarks
276 *** runcommand bookmarks
277 bm1 1:d3a0a68be6de
277 bm1 1:d3a0a68be6de
278 bm2 1:d3a0a68be6de
278 bm2 1:d3a0a68be6de
279 * bm3 2:aef17e88f5f0
279 * bm3 2:aef17e88f5f0
@@ -286,9 +286,9 b' check that local configs for the cached '
286 ... runcommand(server, ['id', '-t', '-r', '0'])
286 ... runcommand(server, ['id', '-t', '-r', '0'])
287 ... os.system('hg tag -r 0 foo')
287 ... os.system('hg tag -r 0 foo')
288 ... runcommand(server, ['id', '-t', '-r', '0'])
288 ... runcommand(server, ['id', '-t', '-r', '0'])
289 runcommand id -t -r 0
289 *** runcommand id -t -r 0
290
290
291 runcommand id -t -r 0
291 *** runcommand id -t -r 0
292 foo
292 foo
293
293
294 >>> import os
294 >>> import os
@@ -299,9 +299,9 b' check that local configs for the cached '
299 ... runcommand(server, ['phase', '-r', '.'])
299 ... runcommand(server, ['phase', '-r', '.'])
300 ... os.system('hg phase -r . -p')
300 ... os.system('hg phase -r . -p')
301 ... runcommand(server, ['phase', '-r', '.'])
301 ... runcommand(server, ['phase', '-r', '.'])
302 runcommand phase -r .
302 *** runcommand phase -r .
303 3: draft
303 3: draft
304 runcommand phase -r .
304 *** runcommand phase -r .
305 3: public
305 3: public
306
306
307 $ echo a >> a
307 $ echo a >> a
@@ -313,14 +313,14 b' check that local configs for the cached '
313 ... runcommand(server, ['commit', '-Am.'])
313 ... runcommand(server, ['commit', '-Am.'])
314 ... runcommand(server, ['rollback'])
314 ... runcommand(server, ['rollback'])
315 ... runcommand(server, ['phase', '-r', '.'])
315 ... runcommand(server, ['phase', '-r', '.'])
316 runcommand phase -r . -p
316 *** runcommand phase -r . -p
317 no phases changed
317 no phases changed
318 [1]
318 [1]
319 runcommand commit -Am.
319 *** runcommand commit -Am.
320 runcommand rollback
320 *** runcommand rollback
321 repository tip rolled back to revision 3 (undo commit)
321 repository tip rolled back to revision 3 (undo commit)
322 working directory now based on revision 3
322 working directory now based on revision 3
323 runcommand phase -r .
323 *** runcommand phase -r .
324 3: public
324 3: public
325
325
326 >>> import os
326 >>> import os
@@ -332,11 +332,11 b' check that local configs for the cached '
332 ... os.system('hg branch foo')
332 ... os.system('hg branch foo')
333 ... runcommand(server, ['branch'])
333 ... runcommand(server, ['branch'])
334 ... os.system('hg branch default')
334 ... os.system('hg branch default')
335 runcommand branch
335 *** runcommand branch
336 default
336 default
337 marked working directory as branch foo
337 marked working directory as branch foo
338 (branches are permanent and global, did you want a bookmark?)
338 (branches are permanent and global, did you want a bookmark?)
339 runcommand branch
339 *** runcommand branch
340 foo
340 foo
341 marked working directory as branch default
341 marked working directory as branch default
342 (branches are permanent and global, did you want a bookmark?)
342 (branches are permanent and global, did you want a bookmark?)
@@ -355,9 +355,9 b' check that local configs for the cached '
355 ... f.write('ignored-file')
355 ... f.write('ignored-file')
356 ... f.close()
356 ... f.close()
357 ... runcommand(server, ['status', '-i', '-u'])
357 ... runcommand(server, ['status', '-i', '-u'])
358 runcommand commit -Am.
358 *** runcommand commit -Am.
359 adding .hgignore
359 adding .hgignore
360 runcommand status -i -u
360 *** runcommand status -i -u
361 I ignored-file
361 I ignored-file
362
362
363 >>> import os
363 >>> import os
@@ -384,12 +384,12 b' check that local configs for the cached '
384 ...
384 ...
385 ... # shouldn't raise "7966c8e3734d: no node!"
385 ... # shouldn't raise "7966c8e3734d: no node!"
386 ... runcommand(server, ['branches'])
386 ... runcommand(server, ['branches'])
387 runcommand update -C 0
387 *** runcommand update -C 0
388 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
388 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
389 (leaving bookmark bm3)
389 (leaving bookmark bm3)
390 runcommand commit -Am. a
390 *** runcommand commit -Am. a
391 created new head
391 created new head
392 runcommand log -Gq
392 *** runcommand log -Gq
393 @ 5:731265503d86
393 @ 5:731265503d86
394 |
394 |
395 | o 4:7966c8e3734d
395 | o 4:7966c8e3734d
@@ -402,10 +402,10 b' check that local configs for the cached '
402 |/
402 |/
403 o 0:eff892de26ec
403 o 0:eff892de26ec
404
404
405 runcommand phase -p .
405 *** runcommand phase -p .
406 runcommand phase .
406 *** runcommand phase .
407 5: public
407 5: public
408 runcommand branches
408 *** runcommand branches
409 default 1:731265503d86
409 default 1:731265503d86
410
410
411 $ cat <<EOF > obs.py
411 $ cat <<EOF > obs.py
@@ -431,10 +431,10 b' check that local configs for the cached '
431 ... os.system(cmd)
431 ... os.system(cmd)
432 ... runcommand(server, ['log', '--hidden'])
432 ... runcommand(server, ['log', '--hidden'])
433 ... runcommand(server, ['log'])
433 ... runcommand(server, ['log'])
434 runcommand up null
434 *** runcommand up null
435 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
435 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
436 runcommand phase -df tip
436 *** runcommand phase -df tip
437 runcommand log --hidden
437 *** runcommand log --hidden
438 changeset: 1:731265503d86
438 changeset: 1:731265503d86
439 tag: tip
439 tag: tip
440 user: test
440 user: test
@@ -449,7 +449,7 b' check that local configs for the cached '
449 date: Thu Jan 01 00:00:00 1970 +0000
449 date: Thu Jan 01 00:00:00 1970 +0000
450 summary: 1
450 summary: 1
451
451
452 runcommand log
452 *** runcommand log
453 changeset: 0:eff892de26ec
453 changeset: 0:eff892de26ec
454 bookmark: bm1
454 bookmark: bm1
455 bookmark: bm2
455 bookmark: bm2
@@ -481,13 +481,13 b' check that local configs for the cached '
481 ... os.system('hg qqueue --create foo')
481 ... os.system('hg qqueue --create foo')
482 ... # repo.mq should be recreated to point to new queue
482 ... # repo.mq should be recreated to point to new queue
483 ... runcommand(server, ['qqueue', '--active'])
483 ... runcommand(server, ['qqueue', '--active'])
484 runcommand qapplied
484 *** runcommand qapplied
485 runcommand qapplied
485 *** runcommand qapplied
486 0.diff
486 0.diff
487 runcommand qpop --all
487 *** runcommand qpop --all
488 popping 0.diff
488 popping 0.diff
489 patch queue now empty
489 patch queue now empty
490 runcommand qqueue --active
490 *** runcommand qqueue --active
491 foo
491 foo
492
492
493 $ cat <<EOF > dbgui.py
493 $ cat <<EOF > dbgui.py
@@ -511,7 +511,7 b' check that local configs for the cached '
511 ... runcommand(server, ['debuggetpass', '--config',
511 ... runcommand(server, ['debuggetpass', '--config',
512 ... 'ui.interactive=True'],
512 ... 'ui.interactive=True'],
513 ... input=cStringIO.StringIO('1234\n'))
513 ... input=cStringIO.StringIO('1234\n'))
514 runcommand debuggetpass --config ui.interactive=True
514 *** runcommand debuggetpass --config ui.interactive=True
515 password: 1234
515 password: 1234
516
516
517
517
@@ -528,7 +528,7 b' start without repository:'
528 ... # sends isn't part of the hello message
528 ... # sends isn't part of the hello message
529 ... runcommand(server, ['id'])
529 ... runcommand(server, ['id'])
530 o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
530 o, 'capabilities: getencoding runcommand\nencoding: *' (glob)
531 runcommand id
531 *** runcommand id
532 abort: there is no Mercurial repository here (.hg not found)
532 abort: there is no Mercurial repository here (.hg not found)
533 [255]
533 [255]
534
534
@@ -538,6 +538,6 b' start without repository:'
538 ... readchannel(server)
538 ... readchannel(server)
539 ... runcommand(server, ['init', 'repo2'])
539 ... runcommand(server, ['init', 'repo2'])
540 ... runcommand(server, ['id', '-R', 'repo2'])
540 ... runcommand(server, ['id', '-R', 'repo2'])
541 runcommand init repo2
541 *** runcommand init repo2
542 runcommand id -R repo2
542 *** runcommand id -R repo2
543 000000000000 tip
543 000000000000 tip
General Comments 0
You need to be logged in to leave comments. Login now