Show More
@@ -13,8 +13,10 b' typical client does not want echo-back m' | |||
|
13 | 13 | $ hg init repo |
|
14 | 14 | $ cd repo |
|
15 | 15 | |
|
16 | >>> from __future__ import print_function | |
|
17 | >>> from hgclient import readchannel, runcommand, check | |
|
16 | >>> from __future__ import absolute_import, print_function | |
|
17 | >>> import os | |
|
18 | >>> import sys | |
|
19 | >>> from hgclient import check, readchannel, runcommand | |
|
18 | 20 | >>> @check |
|
19 | 21 | ... def hellomessage(server): |
|
20 | 22 | ... ch, data = readchannel(server) |
@@ -32,7 +34,7 b' typical client does not want echo-back m' | |||
|
32 | 34 | ... server.stdin.write('unknowncommand\n') |
|
33 | 35 | abort: unknown command unknowncommand |
|
34 | 36 | |
|
35 |
>>> from hgclient import readchannel, runcommand |
|
|
37 | >>> from hgclient import check, readchannel, runcommand | |
|
36 | 38 | >>> @check |
|
37 | 39 | ... def checkruncommand(server): |
|
38 | 40 | ... # hello block |
@@ -91,7 +93,7 b' typical client does not want echo-back m' | |||
|
91 | 93 | abort: unknown revision 'unknown'! |
|
92 | 94 | [255] |
|
93 | 95 | |
|
94 |
>>> from hgclient import readchannel |
|
|
96 | >>> from hgclient import check, readchannel | |
|
95 | 97 | >>> @check |
|
96 | 98 | ... def inputeof(server): |
|
97 | 99 | ... readchannel(server) |
@@ -103,7 +105,7 b' typical client does not want echo-back m' | |||
|
103 | 105 | ... print('server exit code =', server.wait()) |
|
104 | 106 | server exit code = 1 |
|
105 | 107 | |
|
106 |
>>> from hgclient import readchannel, runcommand |
|
|
108 | >>> from hgclient import check, readchannel, runcommand, stringio | |
|
107 | 109 | >>> @check |
|
108 | 110 | ... def serverinput(server): |
|
109 | 111 | ... readchannel(server) |
@@ -138,7 +140,7 b' typical client does not want echo-back m' | |||
|
138 | 140 | check that "histedit --commands=-" can read rules from the input channel: |
|
139 | 141 | |
|
140 | 142 | >>> import cStringIO |
|
141 |
>>> from hgclient import readchannel, runcommand |
|
|
143 | >>> from hgclient import check, readchannel, runcommand | |
|
142 | 144 | >>> @check |
|
143 | 145 | ... def serverinput(server): |
|
144 | 146 | ... readchannel(server) |
@@ -152,7 +154,7 b" check that --cwd doesn't persist between" | |||
|
152 | 154 | |
|
153 | 155 | $ mkdir foo |
|
154 | 156 | $ touch foo/bar |
|
155 |
>>> from hgclient import readchannel, runcommand |
|
|
157 | >>> from hgclient import check, readchannel, runcommand | |
|
156 | 158 | >>> @check |
|
157 | 159 | ... def cwd(server): |
|
158 | 160 | ... readchannel(server) |
@@ -173,7 +175,7 b' check that local configs for the cached ' | |||
|
173 | 175 | > foo = bar |
|
174 | 176 | > EOF |
|
175 | 177 | |
|
176 |
>>> from hgclient import readchannel, |
|
|
178 | >>> from hgclient import check, readchannel, runcommand, sep | |
|
177 | 179 | >>> @check |
|
178 | 180 | ... def localhgrc(server): |
|
179 | 181 | ... readchannel(server) |
@@ -223,7 +225,7 b' check that local configs for the cached ' | |||
|
223 | 225 | > print('now try to read something: %r' % sys.stdin.read()) |
|
224 | 226 | > EOF |
|
225 | 227 | |
|
226 |
>>> from hgclient import readchannel, runcommand |
|
|
228 | >>> from hgclient import check, readchannel, runcommand, stringio | |
|
227 | 229 | >>> @check |
|
228 | 230 | ... def hookoutput(server): |
|
229 | 231 | ... readchannel(server) |
@@ -240,7 +242,7 b' Clean hook cached version' | |||
|
240 | 242 | |
|
241 | 243 | $ echo a >> a |
|
242 | 244 | >>> import os |
|
243 |
>>> from hgclient import readchannel, runcommand |
|
|
245 | >>> from hgclient import check, readchannel, runcommand | |
|
244 | 246 | >>> @check |
|
245 | 247 | ... def outsidechanges(server): |
|
246 | 248 | ... readchannel(server) |
@@ -260,7 +262,7 b' Clean hook cached version' | |||
|
260 | 262 | *** runcommand status |
|
261 | 263 | |
|
262 | 264 | >>> import os |
|
263 |
>>> from hgclient import readchannel, runcommand |
|
|
265 | >>> from hgclient import check, readchannel, runcommand | |
|
264 | 266 | >>> @check |
|
265 | 267 | ... def bookmarks(server): |
|
266 | 268 | ... readchannel(server) |
@@ -299,7 +301,7 b' Clean hook cached version' | |||
|
299 | 301 | |
|
300 | 302 | |
|
301 | 303 | >>> import os |
|
302 |
>>> from hgclient import readchannel, runcommand |
|
|
304 | >>> from hgclient import check, readchannel, runcommand | |
|
303 | 305 | >>> @check |
|
304 | 306 | ... def tagscache(server): |
|
305 | 307 | ... readchannel(server) |
@@ -312,7 +314,7 b' Clean hook cached version' | |||
|
312 | 314 | foo |
|
313 | 315 | |
|
314 | 316 | >>> import os |
|
315 |
>>> from hgclient import readchannel, runcommand |
|
|
317 | >>> from hgclient import check, readchannel, runcommand | |
|
316 | 318 | >>> @check |
|
317 | 319 | ... def setphase(server): |
|
318 | 320 | ... readchannel(server) |
@@ -325,7 +327,7 b' Clean hook cached version' | |||
|
325 | 327 | 3: public |
|
326 | 328 | |
|
327 | 329 | $ echo a >> a |
|
328 |
>>> from hgclient import readchannel, runcommand |
|
|
330 | >>> from hgclient import check, readchannel, runcommand | |
|
329 | 331 | >>> @check |
|
330 | 332 | ... def rollback(server): |
|
331 | 333 | ... readchannel(server) |
@@ -345,7 +347,7 b' Clean hook cached version' | |||
|
345 | 347 | |
|
346 | 348 | |
|
347 | 349 | >>> import os |
|
348 |
>>> from hgclient import readchannel, runcommand |
|
|
350 | >>> from hgclient import check, readchannel, runcommand | |
|
349 | 351 | >>> @check |
|
350 | 352 | ... def branch(server): |
|
351 | 353 | ... readchannel(server) |
@@ -364,7 +366,7 b' Clean hook cached version' | |||
|
364 | 366 | |
|
365 | 367 | $ touch .hgignore |
|
366 | 368 | >>> import os |
|
367 |
>>> from hgclient import readchannel, runcommand |
|
|
369 | >>> from hgclient import check, readchannel, runcommand | |
|
368 | 370 | >>> @check |
|
369 | 371 | ... def hgignore(server): |
|
370 | 372 | ... readchannel(server) |
@@ -387,7 +389,7 b' cache of non-public revisions should be ' | |||
|
387 | 389 | (issue4855): |
|
388 | 390 | |
|
389 | 391 | >>> import os |
|
390 |
>>> from hgclient import readchannel, runcommand |
|
|
392 | >>> from hgclient import check, readchannel, runcommand | |
|
391 | 393 | >>> @check |
|
392 | 394 | ... def phasesetscacheaftercommit(server): |
|
393 | 395 | ... readchannel(server) |
@@ -412,7 +414,7 b' cache of non-public revisions should be ' | |||
|
412 | 414 | |
|
413 | 415 | |
|
414 | 416 | >>> import os |
|
415 |
>>> from hgclient import readchannel, runcommand |
|
|
417 | >>> from hgclient import check, readchannel, runcommand | |
|
416 | 418 | >>> @check |
|
417 | 419 | ... def phasesetscacheafterstrip(server): |
|
418 | 420 | ... readchannel(server) |
@@ -434,7 +436,7 b' cache of non-public revisions should be ' | |||
|
434 | 436 | cache of phase roots should be invalidated on strip (issue3827): |
|
435 | 437 | |
|
436 | 438 | >>> import os |
|
437 |
>>> from hgclient import |
|
|
439 | >>> from hgclient import check, readchannel, runcommand, sep | |
|
438 | 440 | >>> @check |
|
439 | 441 | ... def phasecacheafterstrip(server): |
|
440 | 442 | ... readchannel(server) |
@@ -485,7 +487,7 b' in-memory cache must be reloaded if tran' | |||
|
485 | 487 | changelog and manifest would have invalid node: |
|
486 | 488 | |
|
487 | 489 | $ echo a >> a |
|
488 |
>>> from hgclient import readchannel, runcommand |
|
|
490 | >>> from hgclient import check, readchannel, runcommand | |
|
489 | 491 | >>> @check |
|
490 | 492 | ... def txabort(server): |
|
491 | 493 | ... readchannel(server) |
@@ -511,7 +513,7 b' changelog and manifest would have invali' | |||
|
511 | 513 | > EOF |
|
512 | 514 | |
|
513 | 515 | >>> import os |
|
514 |
>>> from hgclient import readchannel, runcommand |
|
|
516 | >>> from hgclient import check, readchannel, runcommand | |
|
515 | 517 | >>> @check |
|
516 | 518 | ... def obsolete(server): |
|
517 | 519 | ... readchannel(server) |
@@ -560,7 +562,7 b' changelog and manifest would have invali' | |||
|
560 | 562 | > EOF |
|
561 | 563 | |
|
562 | 564 | >>> import os |
|
563 |
>>> from hgclient import readchannel, runcommand |
|
|
565 | >>> from hgclient import check, readchannel, runcommand | |
|
564 | 566 | >>> @check |
|
565 | 567 | ... def mqoutsidechanges(server): |
|
566 | 568 | ... readchannel(server) |
@@ -585,7 +587,8 b' changelog and manifest would have invali' | |||
|
585 | 587 | foo |
|
586 | 588 | |
|
587 | 589 | $ cat <<EOF > dbgui.py |
|
588 |
> import os |
|
|
590 | > import os | |
|
591 | > import sys | |
|
589 | 592 | > from mercurial import commands, registrar |
|
590 | 593 | > cmdtable = {} |
|
591 | 594 | > command = registrar.command(cmdtable) |
@@ -609,7 +612,7 b' changelog and manifest would have invali' | |||
|
609 | 612 | > dbgui = dbgui.py |
|
610 | 613 | > EOF |
|
611 | 614 | |
|
612 |
>>> from hgclient import readchannel, runcommand |
|
|
615 | >>> from hgclient import check, readchannel, runcommand, stringio | |
|
613 | 616 | >>> @check |
|
614 | 617 | ... def getpass(server): |
|
615 | 618 | ... readchannel(server) |
@@ -644,7 +647,7 b' changelog and manifest would have invali' | |||
|
644 | 647 | run commandserver in commandserver, which is silly but should work: |
|
645 | 648 | |
|
646 | 649 | >>> from __future__ import print_function |
|
647 |
>>> from hgclient import readchannel, runcommand |
|
|
650 | >>> from hgclient import check, readchannel, runcommand, stringio | |
|
648 | 651 | >>> @check |
|
649 | 652 | ... def nested(server): |
|
650 | 653 | ... print('%c, %r' % readchannel(server)) |
@@ -667,7 +670,7 b' start without repository:' | |||
|
667 | 670 | $ cd .. |
|
668 | 671 | |
|
669 | 672 | >>> from __future__ import print_function |
|
670 |
>>> from hgclient import readchannel, runcommand |
|
|
673 | >>> from hgclient import check, readchannel, runcommand | |
|
671 | 674 | >>> @check |
|
672 | 675 | ... def hellomessage(server): |
|
673 | 676 | ... ch, data = readchannel(server) |
@@ -680,7 +683,7 b' start without repository:' | |||
|
680 | 683 | abort: there is no Mercurial repository here (.hg not found) |
|
681 | 684 | [255] |
|
682 | 685 | |
|
683 |
>>> from hgclient import readchannel, runcommand |
|
|
686 | >>> from hgclient import check, readchannel, runcommand | |
|
684 | 687 | >>> @check |
|
685 | 688 | ... def startwithoutrepo(server): |
|
686 | 689 | ... readchannel(server) |
@@ -708,7 +711,7 b' unix domain socket:' | |||
|
708 | 711 | #if unix-socket unix-permissions |
|
709 | 712 | |
|
710 | 713 | >>> from __future__ import print_function |
|
711 |
>>> from hgclient import |
|
|
714 | >>> from hgclient import check, readchannel, runcommand, stringio, unixserver | |
|
712 | 715 | >>> server = unixserver('.hg/server.sock', '.hg/server.log') |
|
713 | 716 | >>> def hellomessage(conn): |
|
714 | 717 | ... ch, data = readchannel(conn) |
@@ -760,7 +763,7 b' unix domain socket:' | |||
|
760 | 763 | > log = inexistent/path.log |
|
761 | 764 | > EOF |
|
762 | 765 | >>> from __future__ import print_function |
|
763 |
>>> from hgclient import |
|
|
766 | >>> from hgclient import check, readchannel, unixserver | |
|
764 | 767 | >>> server = unixserver('.hg/server.sock', '.hg/server.log') |
|
765 | 768 | >>> def earlycrash(conn): |
|
766 | 769 | ... while True: |
@@ -837,7 +840,7 b' cases.' | |||
|
837 | 840 | |
|
838 | 841 | (failure before finalization) |
|
839 | 842 | |
|
840 |
>>> from hgclient import readchannel, runcommand |
|
|
843 | >>> from hgclient import check, readchannel, runcommand | |
|
841 | 844 | >>> @check |
|
842 | 845 | ... def abort(server): |
|
843 | 846 | ... readchannel(server) |
@@ -856,7 +859,7 b' cases.' | |||
|
856 | 859 | |
|
857 | 860 | (failure after finalization) |
|
858 | 861 | |
|
859 |
>>> from hgclient import readchannel, runcommand |
|
|
862 | >>> from hgclient import check, readchannel, runcommand | |
|
860 | 863 | >>> @check |
|
861 | 864 | ... def abort(server): |
|
862 | 865 | ... readchannel(server) |
@@ -881,7 +884,7 b' cases.' | |||
|
881 | 884 | |
|
882 | 885 | (failure before finalization) |
|
883 | 886 | |
|
884 |
>>> from hgclient import readchannel, runcommand |
|
|
887 | >>> from hgclient import check, readchannel, runcommand | |
|
885 | 888 | >>> @check |
|
886 | 889 | ... def abort(server): |
|
887 | 890 | ... readchannel(server) |
@@ -901,7 +904,7 b' cases.' | |||
|
901 | 904 | |
|
902 | 905 | (failure after finalization) |
|
903 | 906 | |
|
904 |
>>> from hgclient import readchannel, runcommand |
|
|
907 | >>> from hgclient import check, readchannel, runcommand | |
|
905 | 908 | >>> @check |
|
906 | 909 | ... def abort(server): |
|
907 | 910 | ... readchannel(server) |
@@ -951,7 +954,7 b' try trivial merge after update: cache of' | |||
|
951 | 954 | and the merge should fail (issue5628) |
|
952 | 955 | |
|
953 | 956 | $ hg up -q null |
|
954 |
>>> from hgclient import readchannel, runcommand |
|
|
957 | >>> from hgclient import check, readchannel, runcommand | |
|
955 | 958 | >>> @check |
|
956 | 959 | ... def merge(server): |
|
957 | 960 | ... readchannel(server) |
@@ -972,7 +975,7 b' symlinks:' | |||
|
972 | 975 | |
|
973 | 976 | $ hg up -qC 0 |
|
974 | 977 | $ touch ../merge-symlink-out/poisoned |
|
975 |
>>> from hgclient import readchannel, runcommand |
|
|
978 | >>> from hgclient import check, readchannel, runcommand | |
|
976 | 979 | >>> @check |
|
977 | 980 | ... def files(server): |
|
978 | 981 | ... readchannel(server) |
General Comments 0
You need to be logged in to leave comments.
Login now