Mercurial > hg
annotate tests/test-commandserver.t @ 22571:a9ff1b350f62
test-commandserver: rewrite manual substitution of output by (glob) match
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 28 Sep 2014 14:46:57 +0900 |
parents | db497a1ef1c1 |
children | cc3d9f776632 |
rev | line source |
---|---|
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
1 #if windows |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
2 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
3 #else |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
4 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
5 #endif |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
6 $ export PYTHONPATH |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
7 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
8 $ hg init repo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
9 $ cd repo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
10 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
11 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
12 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
13 ... def hellomessage(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
14 ... ch, data = readchannel(server) |
22571
a9ff1b350f62
test-commandserver: rewrite manual substitution of output by (glob) match
Yuya Nishihara <yuya@tcha.org>
parents:
22570
diff
changeset
|
15 ... print '%c, %r' % (ch, data) |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
16 ... # run an arbitrary command to make sure the next thing the server |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
17 ... # sends isn't part of the hello message |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
18 ... runcommand(server, ['id']) |
22571
a9ff1b350f62
test-commandserver: rewrite manual substitution of output by (glob) match
Yuya Nishihara <yuya@tcha.org>
parents:
22570
diff
changeset
|
19 o, 'capabilities: getencoding runcommand\nencoding: *' (glob) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
20 runcommand id |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
21 000000000000 tip |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
22 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
23 >>> from hgclient import check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
24 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
25 ... def unknowncommand(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
26 ... server.stdin.write('unknowncommand\n') |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
27 abort: unknown command unknowncommand |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
28 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
29 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
30 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
31 ... def checkruncommand(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
32 ... # hello block |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
33 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
34 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
35 ... # no args |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
36 ... runcommand(server, []) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
37 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
38 ... # global options |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
39 ... runcommand(server, ['id', '--quiet']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
40 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
41 ... # make sure global options don't stick through requests |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
42 ... runcommand(server, ['id']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
43 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
44 ... # --config |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
45 ... runcommand(server, ['id', '--config', 'ui.quiet=True']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
46 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
47 ... # make sure --config doesn't stick |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
48 ... runcommand(server, ['id']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
49 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
50 ... # negative return code should be masked |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
51 ... runcommand(server, ['id', '-runknown']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
52 runcommand |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
53 Mercurial Distributed SCM |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
54 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
55 basic commands: |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
56 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
57 add add the specified files on the next commit |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
58 annotate show changeset information by line for each file |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
59 clone make a copy of an existing repository |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
60 commit commit the specified files or all outstanding changes |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
61 diff diff repository (or selected files) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
62 export dump the header and diffs for one or more changesets |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
63 forget forget the specified files on the next commit |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
64 init create a new repository in the given directory |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
65 log show revision history of entire repository or files |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
66 merge merge working directory with another revision |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
67 pull pull changes from the specified source |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
68 push push changes to the specified destination |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
69 remove remove the specified files on the next commit |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
70 serve start stand-alone webserver |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
71 status show changed files in the working directory |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
72 summary summarize working directory state |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
73 update update working directory (or switch revisions) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
74 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
75 (use "hg help" for the full list of commands or "hg -v" for details) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
76 runcommand id --quiet |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
77 000000000000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
78 runcommand id |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
79 000000000000 tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
80 runcommand id --config ui.quiet=True |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
81 000000000000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
82 runcommand id |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
83 000000000000 tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
84 runcommand id -runknown |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
85 abort: unknown revision 'unknown'! |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
86 [255] |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
87 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
88 >>> from hgclient import readchannel, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
89 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
90 ... def inputeof(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
91 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
92 ... server.stdin.write('runcommand\n') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
93 ... # close stdin while server is waiting for input |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
94 ... server.stdin.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
95 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
96 ... # server exits with 1 if the pipe closed while reading the command |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
97 ... print 'server exit code =', server.wait() |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
98 server exit code = 1 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
99 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
100 >>> import cStringIO |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
101 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
102 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
103 ... def serverinput(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
104 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
105 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
106 ... patch = """ |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
107 ... # HG changeset patch |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
108 ... # User test |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
109 ... # Date 0 0 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
110 ... # Node ID c103a3dec114d882c98382d684d8af798d09d857 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
111 ... # Parent 0000000000000000000000000000000000000000 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
112 ... 1 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
113 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
114 ... diff -r 000000000000 -r c103a3dec114 a |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
115 ... --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
116 ... +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
117 ... @@ -0,0 +1,1 @@ |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
118 ... +1 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
119 ... """ |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
120 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
121 ... runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch)) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
122 ... runcommand(server, ['log']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
123 runcommand import - |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
124 applying patch from stdin |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
125 runcommand log |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
126 changeset: 0:eff892de26ec |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
127 tag: tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
128 user: test |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
129 date: Thu Jan 01 00:00:00 1970 +0000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
130 summary: 1 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
131 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
132 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
133 check that --cwd doesn't persist between requests: |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
134 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
135 $ mkdir foo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
136 $ touch foo/bar |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
137 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
138 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
139 ... def cwd(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
140 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
141 ... runcommand(server, ['--cwd', 'foo', 'st', 'bar']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
142 ... runcommand(server, ['st', 'foo/bar']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
143 runcommand --cwd foo st bar |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
144 ? bar |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
145 runcommand st foo/bar |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
146 ? foo/bar |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
147 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
148 $ rm foo/bar |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
149 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
150 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
151 check that local configs for the cached repo aren't inherited when -R is used: |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
152 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
153 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
154 > [ui] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
155 > foo = bar |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
156 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
157 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
158 >>> from hgclient import readchannel, sep, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
159 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
160 ... def localhgrc(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
161 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
162 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
163 ... # the cached repo local hgrc contains ui.foo=bar, so showconfig should |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
164 ... # show it |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
165 ... runcommand(server, ['showconfig'], outfilter=sep) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
166 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
167 ... # but not for this repo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
168 ... runcommand(server, ['init', 'foo']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
169 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
170 runcommand showconfig |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
171 bundle.mainreporoot=$TESTTMP/repo |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
172 defaults.backout=-d "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
173 defaults.commit=-d "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
174 defaults.shelve=--date "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
175 defaults.tag=-d "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
176 ui.slash=True |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
177 ui.interactive=False |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
178 ui.mergemarkers=detailed |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
179 ui.foo=bar |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
180 ui.nontty=true |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
181 runcommand init foo |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
182 runcommand -R foo showconfig ui defaults |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
183 defaults.backout=-d "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
184 defaults.commit=-d "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
185 defaults.shelve=--date "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
186 defaults.tag=-d "0 0" |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
187 ui.slash=True |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
188 ui.interactive=False |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
189 ui.mergemarkers=detailed |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
190 ui.nontty=true |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
191 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
192 $ rm -R foo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
193 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
194 #if windows |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
195 $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
196 #else |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
197 $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
198 #endif |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
199 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
200 $ cat <<EOF > hook.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
201 > import sys |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
202 > def hook(**args): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
203 > print 'hook talking' |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
204 > print 'now try to read something: %r' % sys.stdin.read() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
205 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
206 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
207 >>> import cStringIO |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
208 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
209 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
210 ... def hookoutput(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
211 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
212 ... runcommand(server, ['--config', |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
213 ... 'hooks.pre-identify=python:hook.hook', |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
214 ... 'id'], |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
215 ... input=cStringIO.StringIO('some input')) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
216 runcommand --config hooks.pre-identify=python:hook.hook id |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
217 hook talking |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
218 now try to read something: 'some input' |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
219 eff892de26ec tip |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
220 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
221 $ rm hook.py* |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
222 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
223 $ echo a >> a |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
224 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
225 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
226 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
227 ... def outsidechanges(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
228 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
229 ... runcommand(server, ['status']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
230 ... os.system('hg ci -Am2') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
231 ... runcommand(server, ['tip']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
232 ... runcommand(server, ['status']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
233 runcommand status |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
234 M a |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
235 runcommand tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
236 changeset: 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
237 tag: tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
238 user: test |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
239 date: Thu Jan 01 00:00:00 1970 +0000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
240 summary: 2 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
241 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
242 runcommand status |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
243 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
244 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
245 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
246 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
247 ... def bookmarks(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
248 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
249 ... runcommand(server, ['bookmarks']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
250 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
251 ... # changes .hg/bookmarks |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
252 ... os.system('hg bookmark -i bm1') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
253 ... os.system('hg bookmark -i bm2') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
254 ... runcommand(server, ['bookmarks']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
255 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
256 ... # changes .hg/bookmarks.current |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
257 ... os.system('hg upd bm1 -q') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
258 ... runcommand(server, ['bookmarks']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
259 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
260 ... runcommand(server, ['bookmarks', 'bm3']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
261 ... f = open('a', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
262 ... f.write('a\n') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
263 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
264 ... runcommand(server, ['commit', '-Amm']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
265 ... runcommand(server, ['bookmarks']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
266 runcommand bookmarks |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
267 no bookmarks set |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
268 runcommand bookmarks |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
269 bm1 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
270 bm2 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
271 runcommand bookmarks |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
272 * bm1 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
273 bm2 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
274 runcommand bookmarks bm3 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
275 runcommand commit -Amm |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
276 runcommand bookmarks |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
277 bm1 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
278 bm2 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
279 * bm3 2:aef17e88f5f0 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
280 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
281 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
282 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
283 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
284 ... def tagscache(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
285 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
286 ... runcommand(server, ['id', '-t', '-r', '0']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
287 ... os.system('hg tag -r 0 foo') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
288 ... runcommand(server, ['id', '-t', '-r', '0']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
289 runcommand id -t -r 0 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
290 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
291 runcommand id -t -r 0 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
292 foo |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
293 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
294 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
295 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
296 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
297 ... def setphase(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
298 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
299 ... runcommand(server, ['phase', '-r', '.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
300 ... os.system('hg phase -r . -p') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
301 ... runcommand(server, ['phase', '-r', '.']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
302 runcommand phase -r . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
303 3: draft |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
304 runcommand phase -r . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
305 3: public |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
306 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
307 $ echo a >> a |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
308 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
309 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
310 ... def rollback(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
311 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
312 ... runcommand(server, ['phase', '-r', '.', '-p']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
313 ... runcommand(server, ['commit', '-Am.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
314 ... runcommand(server, ['rollback']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
315 ... runcommand(server, ['phase', '-r', '.']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
316 runcommand phase -r . -p |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
317 no phases changed |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
318 [1] |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
319 runcommand commit -Am. |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
320 runcommand rollback |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
321 repository tip rolled back to revision 3 (undo commit) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
322 working directory now based on revision 3 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
323 runcommand phase -r . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
324 3: public |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
325 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
326 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
327 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
328 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
329 ... def branch(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
330 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
331 ... runcommand(server, ['branch']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
332 ... os.system('hg branch foo') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
333 ... runcommand(server, ['branch']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
334 ... os.system('hg branch default') |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
335 runcommand branch |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
336 default |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
337 marked working directory as branch foo |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
338 (branches are permanent and global, did you want a bookmark?) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
339 runcommand branch |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
340 foo |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
341 marked working directory as branch default |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
342 (branches are permanent and global, did you want a bookmark?) |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
343 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
344 $ touch .hgignore |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
345 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
346 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
347 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
348 ... def hgignore(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
349 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
350 ... runcommand(server, ['commit', '-Am.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
351 ... f = open('ignored-file', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
352 ... f.write('') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
353 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
354 ... f = open('.hgignore', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
355 ... f.write('ignored-file') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
356 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
357 ... runcommand(server, ['status', '-i', '-u']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
358 runcommand commit -Am. |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
359 adding .hgignore |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
360 runcommand status -i -u |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
361 I ignored-file |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
362 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
363 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
364 >>> from hgclient import readchannel, sep, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
365 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
366 ... def phasecacheafterstrip(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
367 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
368 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
369 ... # create new head, 5:731265503d86 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
370 ... runcommand(server, ['update', '-C', '0']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
371 ... f = open('a', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
372 ... f.write('a\n') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
373 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
374 ... runcommand(server, ['commit', '-Am.', 'a']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
375 ... runcommand(server, ['log', '-Gq']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
376 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
377 ... # make it public; draft marker moves to 4:7966c8e3734d |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
378 ... runcommand(server, ['phase', '-p', '.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
379 ... # load _phasecache.phaseroots |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
380 ... runcommand(server, ['phase', '.'], outfilter=sep) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
381 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
382 ... # strip 1::4 outside server |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
383 ... os.system('hg -q --config extensions.mq= strip 1') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
384 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
385 ... # shouldn't raise "7966c8e3734d: no node!" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
386 ... runcommand(server, ['branches']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
387 runcommand update -C 0 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
388 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
389 (leaving bookmark bm3) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
390 runcommand commit -Am. a |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
391 created new head |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
392 runcommand log -Gq |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
393 @ 5:731265503d86 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
394 | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
395 | o 4:7966c8e3734d |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
396 | | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
397 | o 3:b9b85890c400 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
398 | | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
399 | o 2:aef17e88f5f0 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
400 | | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
401 | o 1:d3a0a68be6de |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
402 |/ |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
403 o 0:eff892de26ec |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
404 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
405 runcommand phase -p . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
406 runcommand phase . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
407 5: public |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
408 runcommand branches |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
409 default 1:731265503d86 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
410 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
411 $ cat <<EOF > obs.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
412 > import mercurial.obsolete |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
413 > mercurial.obsolete._enabled = True |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
414 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
415 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
416 > [extensions] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
417 > obs = obs.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
418 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
419 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
420 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
421 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
422 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
423 ... def obsolete(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
424 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
425 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
426 ... runcommand(server, ['up', 'null']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
427 ... runcommand(server, ['phase', '-df', 'tip']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
428 ... cmd = 'hg debugobsolete `hg log -r tip --template {node}`' |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
429 ... if os.name == 'nt': |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
430 ... cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
431 ... os.system(cmd) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
432 ... runcommand(server, ['log', '--hidden']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
433 ... runcommand(server, ['log']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
434 runcommand up null |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
435 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
436 runcommand phase -df tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
437 runcommand log --hidden |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
438 changeset: 1:731265503d86 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
439 tag: tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
440 user: test |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
441 date: Thu Jan 01 00:00:00 1970 +0000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
442 summary: . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
443 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
444 changeset: 0:eff892de26ec |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
445 bookmark: bm1 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
446 bookmark: bm2 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
447 bookmark: bm3 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
448 user: test |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
449 date: Thu Jan 01 00:00:00 1970 +0000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
450 summary: 1 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
451 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
452 runcommand log |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
453 changeset: 0:eff892de26ec |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
454 bookmark: bm1 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
455 bookmark: bm2 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
456 bookmark: bm3 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
457 tag: tip |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
458 user: test |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
459 date: Thu Jan 01 00:00:00 1970 +0000 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
460 summary: 1 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
461 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
462 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
463 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
464 > [extensions] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
465 > mq = |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
466 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
467 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
468 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
469 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
470 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
471 ... def mqoutsidechanges(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
472 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
473 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
474 ... # load repo.mq |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
475 ... runcommand(server, ['qapplied']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
476 ... os.system('hg qnew 0.diff') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
477 ... # repo.mq should be invalidated |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
478 ... runcommand(server, ['qapplied']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
479 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
480 ... runcommand(server, ['qpop', '--all']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
481 ... os.system('hg qqueue --create foo') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
482 ... # repo.mq should be recreated to point to new queue |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
483 ... runcommand(server, ['qqueue', '--active']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
484 runcommand qapplied |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
485 runcommand qapplied |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
486 0.diff |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
487 runcommand qpop --all |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
488 popping 0.diff |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
489 patch queue now empty |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
490 runcommand qqueue --active |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
491 foo |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
492 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
493 $ cat <<EOF > dbgui.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
494 > from mercurial import cmdutil, commands |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
495 > cmdtable = {} |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
496 > command = cmdutil.command(cmdtable) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
497 > @command("debuggetpass", norepo=True) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
498 > def debuggetpass(ui): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
499 > ui.write("%s\\n" % ui.getpass()) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
500 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
501 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
502 > [extensions] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
503 > dbgui = dbgui.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
504 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
505 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
506 >>> import cStringIO |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
507 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
508 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
509 ... def getpass(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
510 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
511 ... runcommand(server, ['debuggetpass', '--config', |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
512 ... 'ui.interactive=True'], |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
513 ... input=cStringIO.StringIO('1234\n')) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
514 runcommand debuggetpass --config ui.interactive=True |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
515 password: 1234 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
516 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
517 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
518 start without repository: |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
519 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
520 $ cd .. |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
521 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
522 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
523 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
524 ... def hellomessage(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
525 ... ch, data = readchannel(server) |
22571
a9ff1b350f62
test-commandserver: rewrite manual substitution of output by (glob) match
Yuya Nishihara <yuya@tcha.org>
parents:
22570
diff
changeset
|
526 ... print '%c, %r' % (ch, data) |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
527 ... # run an arbitrary command to make sure the next thing the server |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
528 ... # sends isn't part of the hello message |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
529 ... runcommand(server, ['id']) |
22571
a9ff1b350f62
test-commandserver: rewrite manual substitution of output by (glob) match
Yuya Nishihara <yuya@tcha.org>
parents:
22570
diff
changeset
|
530 o, 'capabilities: getencoding runcommand\nencoding: *' (glob) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
531 runcommand id |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
532 abort: there is no Mercurial repository here (.hg not found) |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
533 [255] |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
534 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
535 >>> from hgclient import readchannel, runcommand, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
536 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
537 ... def startwithoutrepo(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
538 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
539 ... runcommand(server, ['init', 'repo2']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
540 ... runcommand(server, ['id', '-R', 'repo2']) |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
541 runcommand init repo2 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
542 runcommand id -R repo2 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
543 000000000000 tip |