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