annotate tests/test-commandserver.t @ 30986:f07ca071a058

runtests: set web.ipv6 if we use IPv6 As explained by the previous patch, we need to set "web.ipv6=True" if we decide to use IPv6. Otherwise "hg serve" will still try to listen on IPv4. This patch makes it so by appending web.ipv6 to "extra configs". This patch was tested in a Linux system with IPv6, by the following steps: 1. Change hgweb/server.py temporarily to write a file if IPv6HTTPServer.__init__ is called. 2. run-tests.py -l --keep-tmpdir test-serve.t 3. Check the generated .hgrc, make sure it sets web.ipv6=1. 4. Check the log file to make sure IPv6HTTPServer.__init__ is called.
author Jun Wu <quark@fb.com>
date Wed, 15 Feb 2017 16:43:27 -0800
parents b96c57c1f860
children 161ab32b44a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
16 >>> from __future__ import print_function
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
17 >>> 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
18 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
19 ... def hellomessage(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
20 ... ch, data = readchannel(server)
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
21 ... 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
22 ... # 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
23 ... # 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
24 ... runcommand(server, ['id'])
23036
19f5273c9f3e cmdserver: include pid of server handling requests in hello message
Yuya Nishihara <yuya@tcha.org>
parents: 22994
diff changeset
25 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
26 *** 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
27 000000000000 tip
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
28
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
29 >>> from hgclient import check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
30 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
31 ... def unknowncommand(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
32 ... 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
33 abort: unknown command unknowncommand
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
34
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
35 >>> 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
36 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
37 ... def checkruncommand(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
38 ... # hello block
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
39 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
40 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
41 ... # no args
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
42 ... runcommand(server, [])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
43 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
44 ... # global options
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
45 ... runcommand(server, ['id', '--quiet'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
46 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
47 ... # make sure 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
48 ... runcommand(server, ['id'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
49 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
50 ... # --config
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
51 ... 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
52 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
53 ... # 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
54 ... runcommand(server, ['id'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
55 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
56 ... # 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
57 ... runcommand(server, ['id', '-runknown'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
58 *** 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
59 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
60
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
61 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
62
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
63 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
64 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
65 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
66 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
67 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
68 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
69 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
70 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
71 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
72 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
73 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
74 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
75 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
76 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
77 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
78 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
79 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
80
29974
7109d5ddeb0c help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents: 29485
diff changeset
81 (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
82 *** 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
83 000000000000
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
84 *** 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
85 000000000000 tip
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
86 *** 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
87 000000000000
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
88 *** 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
89 000000000000 tip
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
90 *** 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
91 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
92 [255]
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
93
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
94 >>> from hgclient import readchannel, check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
95 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
96 ... def inputeof(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
97 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
98 ... server.stdin.write('runcommand\n')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
99 ... # 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
100 ... server.stdin.close()
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
101 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
102 ... # server exits with 1 if the pipe closed while reading the command
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
103 ... 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
104 server exit code = 1
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
105
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
106 >>> from hgclient import readchannel, runcommand, check, stringio
22568
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 ...
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
126 ... runcommand(server, ['import', '-'], input=stringio(patch))
22568
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
30262
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
138 check that "histedit --commands=-" can read rules from the input channel:
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
139
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
140 >>> import cStringIO
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
141 >>> from hgclient import readchannel, runcommand, check
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
142 >>> @check
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
143 ... def serverinput(server):
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
144 ... readchannel(server)
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
145 ... rules = 'pick eff892de26ec\n'
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
146 ... runcommand(server, ['histedit', '0', '--commands=-',
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
147 ... '--config', 'extensions.histedit='],
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
148 ... input=cStringIO.StringIO(rules))
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
149 *** runcommand histedit 0 --commands=- --config extensions.histedit=
bc5d0e6fd9f3 histedit: use ui.fin to read commands from stdin
Yuya Nishihara <yuya@tcha.org>
parents: 29974
diff changeset
150
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
151 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
152
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
153 $ mkdir foo
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
154 $ touch foo/bar
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
155 >>> 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
156 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
157 ... def cwd(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
158 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
159 ... 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
160 ... runcommand(server, ['st', 'foo/bar'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
161 *** 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
162 ? bar
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
163 *** 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
164 ? foo/bar
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
165
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
166 $ rm foo/bar
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
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
169 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
170
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
171 $ cat <<EOF >> .hg/hgrc
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
172 > [ui]
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
173 > foo = bar
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
174 > EOF
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
175
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
176 >>> 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
177 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
178 ... def localhgrc(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
179 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
180 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
181 ... # 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
182 ... # show it
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
183 ... runcommand(server, ['showconfig'], outfilter=sep)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
184 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
185 ... # but not for this repo
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
186 ... runcommand(server, ['init', 'foo'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
187 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
188 *** 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
189 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
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"
25290
8f88f768e24c devel: rename 'all' to 'all-warnings' (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24751
diff changeset
194 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
195 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
196 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
197 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
198 ui.mergemarkers=detailed
28996
b74ca9ace65e tests: tolerate http2
timeless <timeless@mozdev.org>
parents: 28836
diff changeset
199 ui.usehttp2=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
200 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
201 ui.nontty=true
30986
f07ca071a058 runtests: set web.ipv6 if we use IPv6
Jun Wu <quark@fb.com>
parents: 30814
diff changeset
202 web.ipv6=True (?)
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
203 *** runcommand init foo
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
204 *** 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
205 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
206 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
207 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
208 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
209 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
210 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
211 ui.mergemarkers=detailed
28996
b74ca9ace65e tests: tolerate http2
timeless <timeless@mozdev.org>
parents: 28836
diff changeset
212 ui.usehttp2=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
213 ui.nontty=true
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
214
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
215 $ rm -R foo
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
216
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
217 #if windows
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
218 $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH"
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
219 #else
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
220 $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH"
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
221 #endif
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
222
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
223 $ cat <<EOF > hook.py
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
224 > from __future__ import print_function
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
225 > import sys
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
226 > def hook(**args):
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
227 > print('hook talking')
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
228 > print('now try to read something: %r' % sys.stdin.read())
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
229 > EOF
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
230
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
231 >>> from hgclient import readchannel, runcommand, check, stringio
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
232 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
233 ... def hookoutput(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
234 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
235 ... runcommand(server, ['--config',
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
236 ... '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
237 ... 'id'],
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
238 ... input=stringio('some input'))
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
239 *** 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
240 eff892de26ec tip
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
241
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
242 $ rm hook.py*
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
243
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
244 $ echo a >> a
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
245 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
246 >>> 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
247 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
248 ... def outsidechanges(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
249 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
250 ... runcommand(server, ['status'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
251 ... os.system('hg ci -Am2')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
252 ... runcommand(server, ['tip'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
253 ... runcommand(server, ['status'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
254 *** 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
255 M a
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
256 *** 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
257 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
258 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
259 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
260 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
261 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
262
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
263 *** runcommand status
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
264
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
265 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
266 >>> 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
267 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
268 ... def bookmarks(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
269 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
270 ... runcommand(server, ['bookmarks'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
271 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
272 ... # changes .hg/bookmarks
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
273 ... 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
274 ... 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
275 ... runcommand(server, ['bookmarks'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
276 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
277 ... # changes .hg/bookmarks.current
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
278 ... 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
279 ... runcommand(server, ['bookmarks'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
280 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
281 ... runcommand(server, ['bookmarks', 'bm3'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
282 ... f = open('a', 'ab')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
283 ... f.write('a\n')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
284 ... f.close()
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
285 ... runcommand(server, ['commit', '-Amm'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
286 ... runcommand(server, ['bookmarks'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
287 *** 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
288 no bookmarks set
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
289 *** 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
290 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
291 bm2 1:d3a0a68be6de
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
292 *** 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
293 * 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
294 bm2 1:d3a0a68be6de
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
295 *** runcommand bookmarks bm3
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
296 *** runcommand commit -Amm
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
297 *** 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
298 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
299 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
300 * bm3 2:aef17e88f5f0
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
301
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
302 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
303 >>> 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
304 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
305 ... def tagscache(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
306 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
307 ... 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
308 ... 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
309 ... runcommand(server, ['id', '-t', '-r', '0'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
310 *** 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
311
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
312 *** 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
313 foo
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
314
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
315 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
316 >>> 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
317 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
318 ... def setphase(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
319 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
320 ... runcommand(server, ['phase', '-r', '.'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
321 ... 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
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 .
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 3: draft
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
325 *** 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
326 3: public
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
327
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
328 $ echo a >> a
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
329 >>> 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
330 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
331 ... def rollback(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
332 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
333 ... runcommand(server, ['phase', '-r', '.', '-p'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
334 ... runcommand(server, ['commit', '-Am.'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
335 ... runcommand(server, ['rollback'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
336 ... runcommand(server, ['phase', '-r', '.'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
337 *** 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
338 no phases changed
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
339 *** runcommand commit -Am.
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
340 *** 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
341 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
342 working directory now based on revision 3
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
343 *** 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
344 3: public
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
345
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
346 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
347 >>> 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
348 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
349 ... def branch(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
350 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
351 ... runcommand(server, ['branch'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
352 ... os.system('hg branch foo')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
353 ... runcommand(server, ['branch'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
354 ... os.system('hg branch default')
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
355 *** 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
356 default
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
357 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
358 (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
359 *** 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
360 foo
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
361 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
362 (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
363
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
364 $ touch .hgignore
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
365 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
366 >>> 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
367 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
368 ... def hgignore(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
369 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
370 ... runcommand(server, ['commit', '-Am.'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
371 ... f = open('ignored-file', 'ab')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
372 ... f.write('')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
373 ... f.close()
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
374 ... f = open('.hgignore', 'ab')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
375 ... f.write('ignored-file')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
376 ... f.close()
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
377 ... runcommand(server, ['status', '-i', '-u'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
378 *** 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
379 adding .hgignore
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
380 *** 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
381 I ignored-file
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
382
26405
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
383 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
384 (issue4855):
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
385
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
386 >>> import os
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
387 >>> from hgclient import readchannel, runcommand, check
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
388 >>> @check
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
389 ... def phasesetscacheaftercommit(server):
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
390 ... readchannel(server)
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
391 ... # load _phasecache._phaserevs and _phasesets
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
392 ... runcommand(server, ['log', '-qr', 'draft()'])
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
393 ... # create draft commits by another process
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
394 ... for i in xrange(5, 7):
26431
46984a5308a0 test-commandserver: generate files with a fixed EOL for test stability
Matt Harbison <matt_harbison@yahoo.com>
parents: 26409
diff changeset
395 ... f = open('a', 'ab')
46984a5308a0 test-commandserver: generate files with a fixed EOL for test stability
Matt Harbison <matt_harbison@yahoo.com>
parents: 26409
diff changeset
396 ... f.seek(0, os.SEEK_END)
46984a5308a0 test-commandserver: generate files with a fixed EOL for test stability
Matt Harbison <matt_harbison@yahoo.com>
parents: 26409
diff changeset
397 ... f.write('a\n')
46984a5308a0 test-commandserver: generate files with a fixed EOL for test stability
Matt Harbison <matt_harbison@yahoo.com>
parents: 26409
diff changeset
398 ... f.close()
26405
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
399 ... 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
400 ... # 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
401 ... runcommand(server, ['log', '-qr', 'draft()'])
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
402 *** runcommand log -qr draft()
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
403 4:7966c8e3734d
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
404 *** runcommand log -qr draft()
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
405 4:7966c8e3734d
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
406 5:41f6602d1c4f
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
407 6:10501e202c35
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
408
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
409 >>> import os
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
410 >>> from hgclient import readchannel, runcommand, check
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
411 >>> @check
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
412 ... def phasesetscacheafterstrip(server):
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
413 ... readchannel(server)
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
414 ... # load _phasecache._phaserevs and _phasesets
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
415 ... runcommand(server, ['log', '-qr', 'draft()'])
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
416 ... # strip cached revisions by another process
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
417 ... 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
418 ... # 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
419 ... runcommand(server, ['log', '-qr', 'draft()'])
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
420 *** runcommand log -qr draft()
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
421 4:7966c8e3734d
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
422 5:41f6602d1c4f
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
423 6:10501e202c35
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
424 *** runcommand log -qr draft()
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
425 4:7966c8e3734d
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
426
c15d8f84343e localrepo: recreate phasecache if changelog was modified (issue4855)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
427 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
428
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
429 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
430 >>> 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
431 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
432 ... def phasecacheafterstrip(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
433 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
434 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
435 ... # create new head, 5:731265503d86
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
436 ... runcommand(server, ['update', '-C', '0'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
437 ... f = open('a', 'ab')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
438 ... f.write('a\n')
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
439 ... f.close()
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
440 ... runcommand(server, ['commit', '-Am.', 'a'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
441 ... runcommand(server, ['log', '-Gq'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
442 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
443 ... # 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
444 ... runcommand(server, ['phase', '-p', '.'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
445 ... # load _phasecache.phaseroots
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
446 ... runcommand(server, ['phase', '.'], outfilter=sep)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
447 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
448 ... # strip 1::4 outside server
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
449 ... 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
450 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
451 ... # 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
452 ... runcommand(server, ['branches'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
453 *** 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
454 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
455 (leaving bookmark bm3)
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
456 *** 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
457 created new head
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
458 *** 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
459 @ 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
460 |
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
461 | 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
462 | |
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
463 | 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
464 | |
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
465 | 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
466 | |
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
467 | 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
468 |/
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
469 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
470
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
471 *** runcommand phase -p .
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
472 *** 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
473 5: public
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
474 *** 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
475 default 1:731265503d86
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
476
26251
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
477 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
478 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
479
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
480 $ echo a >> a
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
481 >>> 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
482 >>> @check
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
483 ... def txabort(server):
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
484 ... readchannel(server)
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
485 ... 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
486 ... '-mfoo'])
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
487 ... runcommand(server, ['verify'])
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
488 *** 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
489 transaction abort!
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
490 rollback completed
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
491 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
492 [255]
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
493 *** runcommand verify
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
494 checking changesets
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
495 checking manifests
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
496 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
497 checking files
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
498 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
499 $ hg revert --no-backup -aq
5c0f5db65c6b localrepo: refresh filecache stats only if transaction finished successfully
Yuya Nishihara <yuya@tcha.org>
parents: 26142
diff changeset
500
22955
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 22783
diff changeset
501 $ cat >> .hg/hgrc << EOF
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 22783
diff changeset
502 > [experimental]
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 22783
diff changeset
503 > evolution=createmarkers
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
504 > EOF
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
505
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
506 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
507 >>> from hgclient import readchannel, runcommand, check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
508 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
509 ... def obsolete(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
510 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
511 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
512 ... runcommand(server, ['up', 'null'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
513 ... runcommand(server, ['phase', '-df', 'tip'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
514 ... 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
515 ... if os.name == 'nt':
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
516 ... 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
517 ... os.system(cmd)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
518 ... runcommand(server, ['log', '--hidden'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
519 ... runcommand(server, ['log'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
520 *** 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
521 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
522 *** runcommand phase -df tip
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
523 *** 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
524 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
525 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
526 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
527 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
528 summary: .
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
529
f9a4a035003d test-commandserver: add stub for .t test by copying .out with 2-space indent
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
530 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
531 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
532 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
533 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
534 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
535 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
536 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
537
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
538 *** 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
539 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
540 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
541 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
542 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
543 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
544 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
545 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
546 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
547
22568
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 $ cat <<EOF >> .hg/hgrc
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
550 > [extensions]
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
551 > mq =
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
552 > EOF
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
553
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
554 >>> import os
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
555 >>> 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
556 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
557 ... def mqoutsidechanges(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
558 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
559 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
560 ... # load repo.mq
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
561 ... runcommand(server, ['qapplied'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
562 ... 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
563 ... # repo.mq should be invalidated
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
564 ... runcommand(server, ['qapplied'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
565 ...
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
566 ... runcommand(server, ['qpop', '--all'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
567 ... 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
568 ... # 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
569 ... runcommand(server, ['qqueue', '--active'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
570 *** runcommand qapplied
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
571 *** 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
572 0.diff
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
573 *** 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
574 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
575 patch queue now empty
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
576 *** 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
577 foo
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
578
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
579 $ 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
580 > import os, sys
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
581 > from mercurial import cmdutil, commands
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
582 > cmdtable = {}
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
583 > command = cmdutil.command(cmdtable)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
584 > @command("debuggetpass", norepo=True)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
585 > def debuggetpass(ui):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
586 > 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
587 > @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
588 > 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
589 > 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
590 > @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
591 > def debugreadstdin(ui):
69f86b937035 cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents: 23322
diff changeset
592 > 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
593 > @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
594 > def debugwritestdout(ui):
69f86b937035 cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents: 23322
diff changeset
595 > 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
596 > 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
597 > sys.stdout.flush()
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
598 > EOF
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
599 $ cat <<EOF >> .hg/hgrc
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
600 > [extensions]
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
601 > dbgui = dbgui.py
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
602 > EOF
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
603
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
604 >>> from hgclient import readchannel, runcommand, check, stringio
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
605 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
606 ... def getpass(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
607 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
608 ... runcommand(server, ['debuggetpass', '--config',
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
609 ... 'ui.interactive=True'],
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
610 ... input=stringio('1234\n'))
30814
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
611 ... runcommand(server, ['debuggetpass', '--config',
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
612 ... 'ui.interactive=True'],
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
613 ... input=stringio('\n'))
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
614 ... runcommand(server, ['debuggetpass', '--config',
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
615 ... 'ui.interactive=True'],
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
616 ... input=stringio(''))
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
617 ... 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
618 ... 'ui.interactive=True'],
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
619 ... input=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
620 ... runcommand(server, ['debugreadstdin'])
69f86b937035 cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents: 23322
diff changeset
621 ... runcommand(server, ['debugwritestdout'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
622 *** 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
623 password: 1234
30814
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
624 *** runcommand debuggetpass --config ui.interactive=True
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
625 password:
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
626 *** runcommand debuggetpass --config ui.interactive=True
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
627 password: abort: response expected
b96c57c1f860 ui: check EOF of getpass() response read from command-server channel
Yuya Nishihara <yuya@tcha.org>
parents: 30363
diff changeset
628 [255]
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
629 *** 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
630 prompt: 5678
23324
69f86b937035 cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents: 23322
diff changeset
631 *** runcommand debugreadstdin
69f86b937035 cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents: 23322
diff changeset
632 read: ''
69f86b937035 cmdserver: protect pipe server streams against corruption caused by direct io
Yuya Nishihara <yuya@tcha.org>
parents: 23322
diff changeset
633 *** runcommand debugwritestdout
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
634
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
635
23322
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
636 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
637
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
638 >>> from __future__ import print_function
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
639 >>> from hgclient import readchannel, runcommand, check, stringio
23322
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
640 >>> @check
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
641 ... def nested(server):
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
642 ... print('%c, %r' % readchannel(server))
23322
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
643 ... class nestedserver(object):
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
644 ... stdin = stringio('getencoding\n')
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
645 ... stdout = stringio()
23322
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
646 ... 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
647 ... 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
648 ... nestedserver.stdout.seek(0)
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
649 ... print('%c, %r' % readchannel(nestedserver)) # hello
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
650 ... print('%c, %r' % readchannel(nestedserver)) # getencoding
23322
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
651 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
652 *** runcommand serve --cmdserver pipe
000cfc8b3913 cmdserver: use given streams as pipe channels like other commands
Yuya Nishihara <yuya@tcha.org>
parents: 23095
diff changeset
653 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
654 r, '*' (glob)
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
655
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
656
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
657 start without repository:
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
658
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
659 $ cd ..
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
660
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
661 >>> from __future__ import print_function
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
662 >>> 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
663 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
664 ... def hellomessage(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
665 ... ch, data = readchannel(server)
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
666 ... 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
667 ... # 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
668 ... # 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
669 ... runcommand(server, ['id'])
23036
19f5273c9f3e cmdserver: include pid of server handling requests in hello message
Yuya Nishihara <yuya@tcha.org>
parents: 22994
diff changeset
670 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
671 *** 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
672 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
673 [255]
22568
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
674
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
675 >>> 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
676 >>> @check
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
677 ... def startwithoutrepo(server):
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
678 ... readchannel(server)
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
679 ... runcommand(server, ['init', 'repo2'])
78b99149ed8a test-commandserver: port test functions from .py to .t
Yuya Nishihara <yuya@tcha.org>
parents: 22567
diff changeset
680 ... runcommand(server, ['id', '-R', 'repo2'])
22572
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
681 *** runcommand init repo2
cc3d9f776632 test-commandserver: make runcommand message bolder
Yuya Nishihara <yuya@tcha.org>
parents: 22571
diff changeset
682 *** 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
683 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
684
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
685
26142
7332bf4ae959 dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
686 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
687
7332bf4ae959 dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
688 $ cd repo
7332bf4ae959 dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
689 $ 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
690 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
691 [255]
7332bf4ae959 dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
692 $ cd ..
7332bf4ae959 dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
693
7332bf4ae959 dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 25290
diff changeset
694
22994
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
695 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
696
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
697 $ cd repo
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
698 $ 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
699
23095
ac827031fe05 tests: don't try to test unix sockets on vfat
Matt Mackall <mpm@selenic.com>
parents: 23053
diff changeset
700 #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
701
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
702 >>> from __future__ import print_function
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
703 >>> from hgclient import unixserver, readchannel, runcommand, check, stringio
22994
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
704 >>> 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
705 >>> 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
706 ... ch, data = readchannel(conn)
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
707 ... print('%c, %r' % (ch, data))
22994
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
708 ... 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
709 >>> 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
710 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
711 *** runcommand id
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
712 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
713 >>> 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
714 ... readchannel(conn)
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
715 ... 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
716 >>> 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
717 >>> 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
718 ... readchannel(conn)
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
719 ... patch = """
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
720 ... # 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
721 ... # User test
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
722 ... # 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
723 ... 2
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
724 ...
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
725 ... 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
726 ... --- a/a
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
727 ... +++ b/a
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
728 ... @@ -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
729 ... 1
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
730 ... +2
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
731 ... """
28836
3f45488d70df test-commandserver: handle cStringIO.StringIO/io.StringIO divergence
timeless <timeless@mozdev.org>
parents: 28511
diff changeset
732 ... runcommand(conn, ['import', '-'], input=stringio(patch))
22994
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
733 ... 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
734 >>> 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
735 *** runcommand import -
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
736 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
737 *** 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
738 2:1ed24be7e7a0
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
739 >>> server.shutdown()
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
740
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
741 $ 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
742 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
743 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
744 killed!
28511
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
745 $ rm .hg/server.log
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
746
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
747 if server crashed before hello, traceback will be sent to 'e' channel as
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
748 last ditch:
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
749
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
750 $ cat <<EOF >> .hg/hgrc
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
751 > [cmdserver]
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
752 > log = inexistent/path.log
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
753 > EOF
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
754 >>> from __future__ import print_function
28511
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
755 >>> from hgclient import unixserver, readchannel, check
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
756 >>> server = unixserver('.hg/server.sock', '.hg/server.log')
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
757 >>> def earlycrash(conn):
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
758 ... while True:
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
759 ... try:
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
760 ... ch, data = readchannel(conn)
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
761 ... if not data.startswith(' '):
29485
6a98f9408a50 py3: make files use absolute_import and print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28996
diff changeset
762 ... print('%c, %r' % (ch, data))
28511
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
763 ... except EOFError:
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
764 ... break
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
765 >>> check(earlycrash, server.connect)
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
766 e, 'Traceback (most recent call last):\n'
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
767 e, "IOError: *" (glob)
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
768 >>> server.shutdown()
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
769
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
770 $ cat .hg/server.log | grep -v '^ '
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
771 listening at .hg/server.sock
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
772 Traceback (most recent call last):
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
773 IOError: * (glob)
ff5f923fca3c cmdserver: write early exception to 'e' channel in 'unix' mode
Yuya Nishihara <yuya@tcha.org>
parents: 28265
diff changeset
774 killed!
23095
ac827031fe05 tests: don't try to test unix sockets on vfat
Matt Mackall <mpm@selenic.com>
parents: 23053
diff changeset
775 #endif
ac827031fe05 tests: don't try to test unix sockets on vfat
Matt Mackall <mpm@selenic.com>
parents: 23053
diff changeset
776 #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
777
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
778 $ 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
779 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
780 [255]
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
781
840be5ca03e1 cmdserver: add service that listens on unix domain socket and forks process
Yuya Nishihara <yuya@tcha.org>
parents: 22955
diff changeset
782 #endif
28265
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
783
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
784 $ cd ..
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
785
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
786 Test that accessing to invalid changelog cache is avoided at
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
787 subsequent operations even if repo object is reused even after failure
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
788 of transaction (see 0a7610758c42 also)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
789
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
790 "hg log" after failure of transaction is needed to detect invalid
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
791 cache in repoview: this can't detect by "hg verify" only.
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
792
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
793 Combination of "finalization" and "empty-ness of changelog" (2 x 2 =
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
794 4) are tested, because '00changelog.i' are differently changed in each
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
795 cases.
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
796
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
797 $ cat > $TESTTMP/failafterfinalize.py <<EOF
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
798 > # extension to abort transaction after finalization forcibly
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
799 > from mercurial import commands, error, extensions, lock as lockmod
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
800 > def fail(tr):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
801 > raise error.Abort('fail after finalization')
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
802 > def reposetup(ui, repo):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
803 > class failrepo(repo.__class__):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
804 > def commitctx(self, ctx, error=False):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
805 > if self.ui.configbool('failafterfinalize', 'fail'):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
806 > # 'sorted()' by ASCII code on category names causes
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
807 > # invoking 'fail' after finalization of changelog
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
808 > # using "'cl-%i' % id(self)" as category name
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
809 > self.currenttransaction().addfinalize('zzzzzzzz', fail)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
810 > return super(failrepo, self).commitctx(ctx, error)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
811 > repo.__class__ = failrepo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
812 > EOF
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
813
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
814 $ hg init repo3
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
815 $ cd repo3
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
816
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
817 $ cat <<EOF >> $HGRCPATH
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
818 > [ui]
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
819 > logtemplate = {rev} {desc|firstline} ({files})\n
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
820 >
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
821 > [extensions]
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
822 > failafterfinalize = $TESTTMP/failafterfinalize.py
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
823 > EOF
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
824
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
825 - test failure with "empty changelog"
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
826
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
827 $ echo foo > foo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
828 $ hg add foo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
829
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 30262
diff changeset
830 (failure before finalization)
28265
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
831
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
832 >>> from hgclient import readchannel, runcommand, check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
833 >>> @check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
834 ... def abort(server):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
835 ... readchannel(server)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
836 ... runcommand(server, ['commit',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
837 ... '--config', 'hooks.pretxncommit=false',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
838 ... '-mfoo'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
839 ... runcommand(server, ['log'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
840 ... runcommand(server, ['verify', '-q'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
841 *** runcommand commit --config hooks.pretxncommit=false -mfoo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
842 transaction abort!
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
843 rollback completed
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
844 abort: pretxncommit hook exited with status 1
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
845 [255]
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
846 *** runcommand log
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
847 *** runcommand verify -q
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
848
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 30262
diff changeset
849 (failure after finalization)
28265
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
850
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
851 >>> from hgclient import readchannel, runcommand, check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
852 >>> @check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
853 ... def abort(server):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
854 ... readchannel(server)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
855 ... runcommand(server, ['commit',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
856 ... '--config', 'failafterfinalize.fail=true',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
857 ... '-mfoo'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
858 ... runcommand(server, ['log'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
859 ... runcommand(server, ['verify', '-q'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
860 *** runcommand commit --config failafterfinalize.fail=true -mfoo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
861 transaction abort!
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
862 rollback completed
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
863 abort: fail after finalization
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
864 [255]
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
865 *** runcommand log
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
866 *** runcommand verify -q
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
867
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
868 - test failure with "not-empty changelog"
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
869
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
870 $ echo bar > bar
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
871 $ hg add bar
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
872 $ hg commit -mbar bar
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
873
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
874 (failure before finalization)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
875
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
876 >>> from hgclient import readchannel, runcommand, check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
877 >>> @check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
878 ... def abort(server):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
879 ... readchannel(server)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
880 ... runcommand(server, ['commit',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
881 ... '--config', 'hooks.pretxncommit=false',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
882 ... '-mfoo', 'foo'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
883 ... runcommand(server, ['log'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
884 ... runcommand(server, ['verify', '-q'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
885 *** runcommand commit --config hooks.pretxncommit=false -mfoo foo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
886 transaction abort!
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
887 rollback completed
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
888 abort: pretxncommit hook exited with status 1
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
889 [255]
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
890 *** runcommand log
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
891 0 bar (bar)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
892 *** runcommand verify -q
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
893
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
894 (failure after finalization)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
895
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
896 >>> from hgclient import readchannel, runcommand, check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
897 >>> @check
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
898 ... def abort(server):
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
899 ... readchannel(server)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
900 ... runcommand(server, ['commit',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
901 ... '--config', 'failafterfinalize.fail=true',
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
902 ... '-mfoo', 'foo'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
903 ... runcommand(server, ['log'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
904 ... runcommand(server, ['verify', '-q'])
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
905 *** runcommand commit --config failafterfinalize.fail=true -mfoo foo
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
906 transaction abort!
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
907 rollback completed
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
908 abort: fail after finalization
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
909 [255]
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
910 *** runcommand log
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
911 0 bar (bar)
332926212ef8 repoview: discard filtered changelog if index isn't shared with unfiltered
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26431
diff changeset
912 *** runcommand verify -q