Mercurial > hg
annotate tests/test-commandserver.t @ 26412:7e8e3c0920a6
gendoc: use real ui in place of stdout
ui attributes will be required by a help function, so a file object can't be
used as a fake ui.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 27 Sep 2015 23:34:37 +0900 |
parents | 19d946cf2a1b |
children | 46984a5308a0 |
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 |
23053
5ba11ab48fcf
ui: separate option to show prompt echo, enabled only in tests (issue4417)
Yuya Nishihara <yuya@tcha.org>
parents:
23036
diff
changeset
|
8 typical client does not want echo-back messages, so test without it: |
5ba11ab48fcf
ui: separate option to show prompt echo, enabled only in tests (issue4417)
Yuya Nishihara <yuya@tcha.org>
parents:
23036
diff
changeset
|
9 |
5ba11ab48fcf
ui: separate option to show prompt echo, enabled only in tests (issue4417)
Yuya Nishihara <yuya@tcha.org>
parents:
23036
diff
changeset
|
10 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new |
5ba11ab48fcf
ui: separate option to show prompt echo, enabled only in tests (issue4417)
Yuya Nishihara <yuya@tcha.org>
parents:
23036
diff
changeset
|
11 $ mv $HGRCPATH.new $HGRCPATH |
5ba11ab48fcf
ui: separate option to show prompt echo, enabled only in tests (issue4417)
Yuya Nishihara <yuya@tcha.org>
parents:
23036
diff
changeset
|
12 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
13 $ hg init repo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
14 $ cd repo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
15 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
16 >>> 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
|
17 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
18 ... def hellomessage(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
19 ... 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
|
20 ... 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
|
21 ... # 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
|
22 ... # 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
|
23 ... runcommand(server, ['id']) |
23036
19f5273c9f3e
cmdserver: include pid of server handling requests in hello message
Yuya Nishihara <yuya@tcha.org>
parents:
22994
diff
changeset
|
24 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
25 *** runcommand 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
|
26 000000000000 tip |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
27 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
28 >>> from hgclient import check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
29 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
30 ... def unknowncommand(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
31 ... 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
|
32 abort: unknown command unknowncommand |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
33 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
34 >>> 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
|
35 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
36 ... def checkruncommand(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
37 ... # hello block |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
38 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
39 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
40 ... # no args |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
41 ... runcommand(server, []) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
42 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
43 ... # global options |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
44 ... runcommand(server, ['id', '--quiet']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
45 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
46 ... # 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
|
47 ... runcommand(server, ['id']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
48 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
49 ... # --config |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
50 ... 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
|
51 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
52 ... # 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
|
53 ... runcommand(server, ['id']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
54 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
55 ... # 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
|
56 ... runcommand(server, ['id', '-runknown']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
57 *** runcommand |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
58 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
|
59 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
60 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
|
61 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
62 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
|
63 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
|
64 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
|
65 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
|
66 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
|
67 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
|
68 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
|
69 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
|
70 log show revision history of entire repository or files |
23400
3bd577a3283e
merge: be precise about what merged into what in short desc
anatoly techtonik <techtonik@gmail.com>
parents:
23095
diff
changeset
|
71 merge merge another revision into working directory |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
80 (use "hg help" for the full list of commands or "hg -v" for details) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
81 *** runcommand id --quiet |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
82 000000000000 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
83 *** runcommand 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
|
84 000000000000 tip |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
85 *** runcommand id --config ui.quiet=True |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
86 000000000000 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
87 *** runcommand 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
|
88 000000000000 tip |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
89 *** runcommand 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
|
90 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
|
91 [255] |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
92 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
93 >>> from hgclient import readchannel, check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
94 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
95 ... def inputeof(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
96 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
97 ... server.stdin.write('runcommand\n') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
98 ... # 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
|
99 ... server.stdin.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
100 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
101 ... # 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
|
102 ... 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
|
103 server exit code = 1 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
104 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
105 >>> import cStringIO |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
106 >>> 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
|
107 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
108 ... def serverinput(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
109 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
110 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
111 ... patch = """ |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
112 ... # HG changeset patch |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
113 ... # User test |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
114 ... # Date 0 0 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
115 ... # Node ID c103a3dec114d882c98382d684d8af798d09d857 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
116 ... # Parent 0000000000000000000000000000000000000000 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
117 ... 1 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
118 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
119 ... 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
|
120 ... --- /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
|
121 ... +++ 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
|
122 ... @@ -0,0 +1,1 @@ |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
123 ... +1 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
124 ... """ |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
125 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
126 ... 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
|
127 ... runcommand(server, ['log']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
128 *** runcommand import - |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
129 applying patch from stdin |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
130 *** runcommand 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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 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
|
136 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
137 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
138 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
|
139 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
140 $ mkdir foo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
141 $ touch foo/bar |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
142 >>> 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
|
143 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
144 ... def cwd(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
145 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
146 ... 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
|
147 ... runcommand(server, ['st', 'foo/bar']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
148 *** runcommand --cwd foo st 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
|
149 ? bar |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
150 *** runcommand 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
|
151 ? foo/bar |
22568
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 $ rm foo/bar |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
154 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
155 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
156 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
|
157 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
158 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
159 > [ui] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
160 > foo = bar |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
161 > EOF |
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 >>> 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
|
164 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
165 ... def localhgrc(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
166 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
167 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
168 ... # 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
|
169 ... # show it |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
170 ... runcommand(server, ['showconfig'], outfilter=sep) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
171 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
172 ... # but not for this repo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
173 ... runcommand(server, ['init', 'foo']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
174 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
175 *** runcommand showconfig |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
176 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
|
177 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
|
178 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
|
179 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
|
180 defaults.tag=-d "0 0" |
25290
8f88f768e24c
devel: rename 'all' to 'all-warnings' (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
24751
diff
changeset
|
181 devel.all-warnings=true |
23388
42ed0780ec4b
run-tests: set a default largefiles usercache in the default hgrc file
Matt Harbison <matt_harbison@yahoo.com>
parents:
23324
diff
changeset
|
182 largefiles.usercache=$TESTTMP/.cache/largefiles |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
183 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
|
184 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
|
185 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
|
186 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
|
187 ui.nontty=true |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
188 *** runcommand init foo |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
189 *** runcommand -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
|
190 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
|
191 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
|
192 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
|
193 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
|
194 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
|
195 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
|
196 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
|
197 ui.nontty=true |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
198 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
199 $ rm -R foo |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
200 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
201 #if windows |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
202 $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
203 #else |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
204 $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH" |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
205 #endif |
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 $ cat <<EOF > hook.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
208 > import sys |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
209 > def hook(**args): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
210 > print 'hook talking' |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
211 > 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
|
212 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
213 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
214 >>> import cStringIO |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
215 >>> 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
|
216 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
217 ... def hookoutput(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
218 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
219 ... runcommand(server, ['--config', |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
220 ... '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
|
221 ... 'id'], |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
222 ... input=cStringIO.StringIO('some input')) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
223 *** 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
|
224 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
|
225 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
|
226 eff892de26ec tip |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
227 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
228 $ rm hook.py* |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
229 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
230 $ echo a >> a |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
231 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
232 >>> 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
|
233 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
234 ... def outsidechanges(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
235 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
236 ... runcommand(server, ['status']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
237 ... os.system('hg ci -Am2') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
238 ... runcommand(server, ['tip']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
239 ... runcommand(server, ['status']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
240 *** runcommand 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
|
241 M a |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
242 *** runcommand tip |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
243 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
249 *** runcommand status |
22568
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 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
252 >>> 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
|
253 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
254 ... def bookmarks(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
255 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
256 ... runcommand(server, ['bookmarks']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
257 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
258 ... # changes .hg/bookmarks |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
259 ... 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
|
260 ... 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
|
261 ... runcommand(server, ['bookmarks']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
262 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
263 ... # changes .hg/bookmarks.current |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
264 ... 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
|
265 ... runcommand(server, ['bookmarks']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
266 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
267 ... runcommand(server, ['bookmarks', 'bm3']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
268 ... f = open('a', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
269 ... f.write('a\n') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
270 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
271 ... runcommand(server, ['commit', '-Amm']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
272 ... runcommand(server, ['bookmarks']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
273 *** runcommand 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
|
274 no bookmarks set |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
275 *** runcommand 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
|
276 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
|
277 bm2 1:d3a0a68be6de |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
278 *** runcommand 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
|
279 * 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
|
280 bm2 1:d3a0a68be6de |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
281 *** runcommand bookmarks bm3 |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
282 *** runcommand commit -Amm |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
283 *** runcommand 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
|
284 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
|
285 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
|
286 * bm3 2:aef17e88f5f0 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
287 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
288 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
289 >>> 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
|
290 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
291 ... def tagscache(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
292 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
293 ... 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
|
294 ... 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
|
295 ... runcommand(server, ['id', '-t', '-r', '0']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
296 *** runcommand 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
|
297 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
298 *** runcommand 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
|
299 foo |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
300 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
301 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
302 >>> 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
|
303 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
304 ... def setphase(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
305 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
306 ... runcommand(server, ['phase', '-r', '.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
307 ... 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
|
308 ... runcommand(server, ['phase', '-r', '.']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
309 *** runcommand 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
|
310 3: draft |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
311 *** runcommand 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
|
312 3: public |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
313 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
314 $ echo a >> a |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
315 >>> 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
|
316 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
317 ... def rollback(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
318 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
319 ... runcommand(server, ['phase', '-r', '.', '-p']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
320 ... runcommand(server, ['commit', '-Am.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
321 ... runcommand(server, ['rollback']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
322 ... runcommand(server, ['phase', '-r', '.']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
323 *** runcommand phase -r . -p |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
324 no phases changed |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
325 *** runcommand commit -Am. |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
326 *** runcommand rollback |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
327 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
|
328 working directory now based on revision 3 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
329 *** runcommand 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
|
330 3: public |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
331 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
332 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
333 >>> 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
|
334 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
335 ... def branch(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
336 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
337 ... runcommand(server, ['branch']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
338 ... os.system('hg branch foo') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
339 ... runcommand(server, ['branch']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
340 ... os.system('hg branch default') |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
341 *** runcommand branch |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
342 default |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
343 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
|
344 (branches are permanent and global, did you want a bookmark?) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
345 *** runcommand branch |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
346 foo |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
347 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
|
348 (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
|
349 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
350 $ touch .hgignore |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
351 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
352 >>> 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
|
353 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
354 ... def hgignore(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
355 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
356 ... runcommand(server, ['commit', '-Am.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
357 ... f = open('ignored-file', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
358 ... f.write('') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
359 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
360 ... f = open('.hgignore', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
361 ... f.write('ignored-file') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
362 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
363 ... runcommand(server, ['status', '-i', '-u']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
364 *** runcommand commit -Am. |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
365 adding .hgignore |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
366 *** runcommand 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
|
367 I ignored-file |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
368 |
26405
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
369 cache of non-public revisions should be invalidated on repository change |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
370 (issue4855): |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
371 |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
372 >>> import os |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
373 >>> from hgclient import readchannel, runcommand, check |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
374 >>> @check |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
375 ... def phasesetscacheaftercommit(server): |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
376 ... readchannel(server) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
377 ... # load _phasecache._phaserevs and _phasesets |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
378 ... runcommand(server, ['log', '-qr', 'draft()']) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
379 ... # create draft commits by another process |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
380 ... for i in xrange(5, 7): |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
381 ... os.system('echo a >> a') |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
382 ... os.system('hg commit -Aqm%d' % i) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
383 ... # new commits should be listed as draft revisions |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
384 ... runcommand(server, ['log', '-qr', 'draft()']) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
385 *** runcommand log -qr draft() |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
386 4:7966c8e3734d |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
387 *** runcommand log -qr draft() |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
388 4:7966c8e3734d |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
389 5:41f6602d1c4f |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
390 6:10501e202c35 |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
391 |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
392 >>> import os |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
393 >>> from hgclient import readchannel, runcommand, check |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
394 >>> @check |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
395 ... def phasesetscacheafterstrip(server): |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
396 ... readchannel(server) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
397 ... # load _phasecache._phaserevs and _phasesets |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
398 ... runcommand(server, ['log', '-qr', 'draft()']) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
399 ... # strip cached revisions by another process |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
400 ... os.system('hg --config extensions.strip= strip -q 5') |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
401 ... # shouldn't abort by "unknown revision '6'" |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
402 ... runcommand(server, ['log', '-qr', 'draft()']) |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
403 *** runcommand log -qr draft() |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
404 4:7966c8e3734d |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
405 5:41f6602d1c4f |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
406 6:10501e202c35 |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
407 *** runcommand log -qr draft() |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
408 4:7966c8e3734d |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
409 |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
410 cache of phase roots should be invalidated on strip (issue3827): |
c15d8f84343e
localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
411 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
412 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
413 >>> 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
|
414 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
415 ... def phasecacheafterstrip(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
416 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
417 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
418 ... # create new head, 5:731265503d86 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
419 ... runcommand(server, ['update', '-C', '0']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
420 ... f = open('a', 'ab') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
421 ... f.write('a\n') |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
422 ... f.close() |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
423 ... runcommand(server, ['commit', '-Am.', 'a']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
424 ... runcommand(server, ['log', '-Gq']) |
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 ... # 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
|
427 ... runcommand(server, ['phase', '-p', '.']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
428 ... # load _phasecache.phaseroots |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
429 ... runcommand(server, ['phase', '.'], outfilter=sep) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
430 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
431 ... # strip 1::4 outside server |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
432 ... 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
|
433 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
434 ... # 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
|
435 ... runcommand(server, ['branches']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
436 *** runcommand update -C 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
|
437 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
|
438 (leaving bookmark bm3) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
439 *** runcommand commit -Am. a |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
440 created new head |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
441 *** runcommand log -Gq |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
442 @ 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
|
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 | 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
|
445 | | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
446 | 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
|
447 | | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
448 | 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
|
449 | | |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
450 | 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
|
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 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
|
453 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
454 *** runcommand phase -p . |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
455 *** runcommand phase . |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
456 5: public |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
457 *** runcommand 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
|
458 default 1:731265503d86 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
459 |
26251
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
460 in-memory cache must be reloaded if transaction is aborted. otherwise |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
461 changelog and manifest would have invalid node: |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
462 |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
463 $ echo a >> a |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
464 >>> from hgclient import readchannel, runcommand, check |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
465 >>> @check |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
466 ... def txabort(server): |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
467 ... readchannel(server) |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
468 ... runcommand(server, ['commit', '--config', 'hooks.pretxncommit=false', |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
469 ... '-mfoo']) |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
470 ... runcommand(server, ['verify']) |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
471 *** runcommand commit --config hooks.pretxncommit=false -mfoo |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
472 transaction abort! |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
473 rollback completed |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
474 abort: pretxncommit hook exited with status 1 |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
475 [255] |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
476 *** runcommand verify |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
477 checking changesets |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
478 checking manifests |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
479 crosschecking files in changesets and manifests |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
480 checking files |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
481 1 files, 2 changesets, 2 total revisions |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
482 $ hg revert --no-backup -aq |
5c0f5db65c6b
localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents:
26142
diff
changeset
|
483 |
22955
fab9dda0f2a3
obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents:
22783
diff
changeset
|
484 $ cat >> .hg/hgrc << EOF |
fab9dda0f2a3
obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents:
22783
diff
changeset
|
485 > [experimental] |
fab9dda0f2a3
obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents:
22783
diff
changeset
|
486 > evolution=createmarkers |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
487 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
488 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
489 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
490 >>> 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
|
491 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
492 ... def obsolete(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
493 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
494 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
495 ... runcommand(server, ['up', 'null']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
496 ... runcommand(server, ['phase', '-df', 'tip']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
497 ... 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
|
498 ... if os.name == 'nt': |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
499 ... 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
|
500 ... os.system(cmd) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
501 ... runcommand(server, ['log', '--hidden']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
502 ... runcommand(server, ['log']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
503 *** runcommand up null |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
504 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
505 *** runcommand phase -df tip |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
506 *** runcommand log --hidden |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
507 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
|
508 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
|
509 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
|
510 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
|
511 summary: . |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
512 |
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
513 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
|
514 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
|
515 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
|
516 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
|
517 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
|
518 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
|
519 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
|
520 |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
521 *** runcommand 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
|
522 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
|
523 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
|
524 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
|
525 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
|
526 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
|
527 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
|
528 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
|
529 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
|
530 |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
531 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
532 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
533 > [extensions] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
534 > mq = |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
535 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
536 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
537 >>> import os |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
538 >>> 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
|
539 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
540 ... def mqoutsidechanges(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
541 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
542 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
543 ... # load repo.mq |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
544 ... runcommand(server, ['qapplied']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
545 ... 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
|
546 ... # repo.mq should be invalidated |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
547 ... runcommand(server, ['qapplied']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
548 ... |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
549 ... runcommand(server, ['qpop', '--all']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
550 ... 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
|
551 ... # 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
|
552 ... runcommand(server, ['qqueue', '--active']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
553 *** runcommand qapplied |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
554 *** runcommand qapplied |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
555 0.diff |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
556 *** runcommand qpop --all |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
557 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
|
558 patch queue now empty |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
559 *** runcommand 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
|
560 foo |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
561 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
562 $ cat <<EOF > dbgui.py |
23324
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
563 > import os, sys |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
564 > from mercurial import cmdutil, commands |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
565 > cmdtable = {} |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
566 > command = cmdutil.command(cmdtable) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
567 > @command("debuggetpass", norepo=True) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
568 > def debuggetpass(ui): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
569 > ui.write("%s\\n" % ui.getpass()) |
22783
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
570 > @command("debugprompt", norepo=True) |
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
571 > def debugprompt(ui): |
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
572 > ui.write("%s\\n" % ui.prompt("prompt:")) |
23324
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
573 > @command("debugreadstdin", norepo=True) |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
574 > def debugreadstdin(ui): |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
575 > ui.write("read: %r\n" % sys.stdin.read(1)) |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
576 > @command("debugwritestdout", norepo=True) |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
577 > def debugwritestdout(ui): |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
578 > os.write(1, "low-level stdout fd and\n") |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
579 > sys.stdout.write("stdout should be redirected to /dev/null\n") |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
580 > sys.stdout.flush() |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
581 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
582 $ cat <<EOF >> .hg/hgrc |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
583 > [extensions] |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
584 > dbgui = dbgui.py |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
585 > EOF |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
586 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
587 >>> import cStringIO |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
588 >>> 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
|
589 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
590 ... def getpass(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
591 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
592 ... runcommand(server, ['debuggetpass', '--config', |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
593 ... 'ui.interactive=True'], |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
594 ... input=cStringIO.StringIO('1234\n')) |
22783
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
595 ... runcommand(server, ['debugprompt', '--config', |
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
596 ... 'ui.interactive=True'], |
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
597 ... input=cStringIO.StringIO('5678\n')) |
23324
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
598 ... runcommand(server, ['debugreadstdin']) |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
599 ... runcommand(server, ['debugwritestdout']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
600 *** runcommand debuggetpass --config ui.interactive=True |
22567
f9a4a035003d
test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff
changeset
|
601 password: 1234 |
22783
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
602 *** runcommand debugprompt --config ui.interactive=True |
524b786bd54f
ui: disable echo back of prompt input if ui is set to non-tty purposely
Yuya Nishihara <yuya@tcha.org>
parents:
22572
diff
changeset
|
603 prompt: 5678 |
23324
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
604 *** runcommand debugreadstdin |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
605 read: '' |
69f86b937035
cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents:
23322
diff
changeset
|
606 *** runcommand debugwritestdout |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
607 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
608 |
23322
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
609 run commandserver in commandserver, which is silly but should work: |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
610 |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
611 >>> import cStringIO |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
612 >>> from hgclient import readchannel, runcommand, check |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
613 >>> @check |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
614 ... def nested(server): |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
615 ... print '%c, %r' % readchannel(server) |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
616 ... class nestedserver(object): |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
617 ... stdin = cStringIO.StringIO('getencoding\n') |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
618 ... stdout = cStringIO.StringIO() |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
619 ... runcommand(server, ['serve', '--cmdserver', 'pipe'], |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
620 ... output=nestedserver.stdout, input=nestedserver.stdin) |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
621 ... nestedserver.stdout.seek(0) |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
622 ... print '%c, %r' % readchannel(nestedserver) # hello |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
623 ... print '%c, %r' % readchannel(nestedserver) # getencoding |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
624 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
625 *** runcommand serve --cmdserver pipe |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
626 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
000cfc8b3913
cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents:
23095
diff
changeset
|
627 r, '*' (glob) |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
628 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
629 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
630 start without repository: |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
631 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
632 $ cd .. |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
633 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
634 >>> 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
|
635 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
636 ... def hellomessage(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
637 ... 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
|
638 ... 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
|
639 ... # 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
|
640 ... # 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
|
641 ... runcommand(server, ['id']) |
23036
19f5273c9f3e
cmdserver: include pid of server handling requests in hello message
Yuya Nishihara <yuya@tcha.org>
parents:
22994
diff
changeset
|
642 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
643 *** runcommand 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
|
644 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
|
645 [255] |
22568
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
646 |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
647 >>> 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
|
648 >>> @check |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
649 ... def startwithoutrepo(server): |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
650 ... readchannel(server) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
651 ... runcommand(server, ['init', 'repo2']) |
78b99149ed8a
test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents:
22567
diff
changeset
|
652 ... runcommand(server, ['id', '-R', 'repo2']) |
22572
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
653 *** runcommand init repo2 |
cc3d9f776632
test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents:
22571
diff
changeset
|
654 *** runcommand 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
|
655 000000000000 tip |
22994
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
656 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
657 |
26142
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
658 don't fall back to cwd if invalid -R path is specified (issue4805): |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
659 |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
660 $ cd repo |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
661 $ hg serve --cmdserver pipe -R ../nonexistent |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
662 abort: repository ../nonexistent not found! |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
663 [255] |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
664 $ cd .. |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
665 |
7332bf4ae959
dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
25290
diff
changeset
|
666 |
22994
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
667 unix domain socket: |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
668 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
669 $ cd repo |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
670 $ hg update -q |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
671 |
23095
ac827031fe05
tests: don't try to test unix sockets on vfat
Matt Mackall <mpm@selenic.com>
parents:
23053
diff
changeset
|
672 #if unix-socket unix-permissions |
22994
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
673 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
674 >>> import cStringIO |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
675 >>> from hgclient import unixserver, readchannel, runcommand, check |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
676 >>> server = unixserver('.hg/server.sock', '.hg/server.log') |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
677 >>> def hellomessage(conn): |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
678 ... ch, data = readchannel(conn) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
679 ... print '%c, %r' % (ch, data) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
680 ... runcommand(conn, ['id']) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
681 >>> check(hellomessage, server.connect) |
23036
19f5273c9f3e
cmdserver: include pid of server handling requests in hello message
Yuya Nishihara <yuya@tcha.org>
parents:
22994
diff
changeset
|
682 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob) |
22994
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
683 *** runcommand id |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
684 eff892de26ec tip bm1/bm2/bm3 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
685 >>> def unknowncommand(conn): |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
686 ... readchannel(conn) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
687 ... conn.stdin.write('unknowncommand\n') |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
688 >>> check(unknowncommand, server.connect) # error sent to server.log |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
689 >>> def serverinput(conn): |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
690 ... readchannel(conn) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
691 ... patch = """ |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
692 ... # HG changeset patch |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
693 ... # User test |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
694 ... # Date 0 0 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
695 ... 2 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
696 ... |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
697 ... diff -r eff892de26ec -r 1ed24be7e7a0 a |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
698 ... --- a/a |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
699 ... +++ b/a |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
700 ... @@ -1,1 +1,2 @@ |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
701 ... 1 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
702 ... +2 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
703 ... """ |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
704 ... runcommand(conn, ['import', '-'], input=cStringIO.StringIO(patch)) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
705 ... runcommand(conn, ['log', '-rtip', '-q']) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
706 >>> check(serverinput, server.connect) |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
707 *** runcommand import - |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
708 applying patch from stdin |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
709 *** runcommand log -rtip -q |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
710 2:1ed24be7e7a0 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
711 >>> server.shutdown() |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
712 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
713 $ cat .hg/server.log |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
714 listening at .hg/server.sock |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
715 abort: unknown command unknowncommand |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
716 killed! |
23095
ac827031fe05
tests: don't try to test unix sockets on vfat
Matt Mackall <mpm@selenic.com>
parents:
23053
diff
changeset
|
717 #endif |
ac827031fe05
tests: don't try to test unix sockets on vfat
Matt Mackall <mpm@selenic.com>
parents:
23053
diff
changeset
|
718 #if no-unix-socket |
22994
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
719 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
720 $ hg serve --cmdserver unix -a .hg/server.sock |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
721 abort: unsupported platform |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
722 [255] |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
723 |
840be5ca03e1
cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents:
22955
diff
changeset
|
724 #endif |