Show More
@@ -1,282 +1,282 b'' | |||||
1 | import sys, os, struct, subprocess, cStringIO, re, shutil |
|
1 | import sys, os, struct, subprocess, cStringIO, re, shutil | |
2 |
|
2 | |||
3 | def connect(path=None): |
|
3 | def connect(path=None): | |
4 | cmdline = ['hg', 'serve', '--cmdserver', 'pipe'] |
|
4 | cmdline = ['hg', 'serve', '--cmdserver', 'pipe'] | |
5 | if path: |
|
5 | if path: | |
6 | cmdline += ['-R', path] |
|
6 | cmdline += ['-R', path] | |
7 |
|
7 | |||
8 | server = subprocess.Popen(cmdline, stdin=subprocess.PIPE, |
|
8 | server = subprocess.Popen(cmdline, stdin=subprocess.PIPE, | |
9 | stdout=subprocess.PIPE) |
|
9 | stdout=subprocess.PIPE) | |
10 |
|
10 | |||
11 | return server |
|
11 | return server | |
12 |
|
12 | |||
13 | def writeblock(server, data): |
|
13 | def writeblock(server, data): | |
14 | server.stdin.write(struct.pack('>I', len(data))) |
|
14 | server.stdin.write(struct.pack('>I', len(data))) | |
15 | server.stdin.write(data) |
|
15 | server.stdin.write(data) | |
16 | server.stdin.flush() |
|
16 | server.stdin.flush() | |
17 |
|
17 | |||
18 | def readchannel(server): |
|
18 | def readchannel(server): | |
19 | data = server.stdout.read(5) |
|
19 | data = server.stdout.read(5) | |
20 | if not data: |
|
20 | if not data: | |
21 | raise EOFError |
|
21 | raise EOFError | |
22 | channel, length = struct.unpack('>cI', data) |
|
22 | channel, length = struct.unpack('>cI', data) | |
23 | if channel in 'IL': |
|
23 | if channel in 'IL': | |
24 | return channel, length |
|
24 | return channel, length | |
25 | else: |
|
25 | else: | |
26 | return channel, server.stdout.read(length) |
|
26 | return channel, server.stdout.read(length) | |
27 |
|
27 | |||
28 | def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None): |
|
28 | def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None): | |
29 | print ' runcommand', ' '.join(args) |
|
29 | print ' runcommand', ' '.join(args) | |
30 | sys.stdout.flush() |
|
30 | sys.stdout.flush() | |
31 | server.stdin.write('runcommand\n') |
|
31 | server.stdin.write('runcommand\n') | |
32 | writeblock(server, '\0'.join(args)) |
|
32 | writeblock(server, '\0'.join(args)) | |
33 |
|
33 | |||
34 | if not input: |
|
34 | if not input: | |
35 | input = cStringIO.StringIO() |
|
35 | input = cStringIO.StringIO() | |
36 |
|
36 | |||
37 | while True: |
|
37 | while True: | |
38 | ch, data = readchannel(server) |
|
38 | ch, data = readchannel(server) | |
39 | if ch == 'o': |
|
39 | if ch == 'o': | |
40 | output.write(data) |
|
40 | output.write(data) | |
41 | output.flush() |
|
41 | output.flush() | |
42 | elif ch == 'e': |
|
42 | elif ch == 'e': | |
43 | error.write(data) |
|
43 | error.write(data) | |
44 | error.flush() |
|
44 | error.flush() | |
45 | elif ch == 'I': |
|
45 | elif ch == 'I': | |
46 | writeblock(server, input.read(data)) |
|
46 | writeblock(server, input.read(data)) | |
47 | elif ch == 'L': |
|
47 | elif ch == 'L': | |
48 | writeblock(server, input.readline(data)) |
|
48 | writeblock(server, input.readline(data)) | |
49 | elif ch == 'r': |
|
49 | elif ch == 'r': | |
50 | return struct.unpack('>i', data)[0] |
|
50 | return struct.unpack('>i', data)[0] | |
51 | else: |
|
51 | else: | |
52 | print "unexpected channel %c: %r" % (ch, data) |
|
52 | print "unexpected channel %c: %r" % (ch, data) | |
53 | if ch.isupper(): |
|
53 | if ch.isupper(): | |
54 | return |
|
54 | return | |
55 |
|
55 | |||
56 | def check(func, repopath=None): |
|
56 | def check(func, repopath=None): | |
57 |
|
57 | |||
58 | print 'testing %s:' % func.__name__ |
|
58 | print 'testing %s:' % func.__name__ | |
59 |
|
59 | |||
60 | sys.stdout.flush() |
|
60 | sys.stdout.flush() | |
61 | server = connect(repopath) |
|
61 | server = connect(repopath) | |
62 | try: |
|
62 | try: | |
63 | return func(server) |
|
63 | return func(server) | |
64 | finally: |
|
64 | finally: | |
65 | server.stdin.close() |
|
65 | server.stdin.close() | |
66 | server.wait() |
|
66 | server.wait() | |
67 |
|
67 | |||
68 | def unknowncommand(server): |
|
68 | def unknowncommand(server): | |
69 | server.stdin.write('unknowncommand\n') |
|
69 | server.stdin.write('unknowncommand\n') | |
70 |
|
70 | |||
71 | def hellomessage(server): |
|
71 | def hellomessage(server): | |
72 | ch, data = readchannel(server) |
|
72 | ch, data = readchannel(server) | |
73 | # escaping python tests output not supported |
|
73 | # escaping python tests output not supported | |
74 | print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', |
|
74 | print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***', | |
75 | data)) |
|
75 | data)) | |
76 |
|
76 | |||
77 | # run an arbitrary command to make sure the next thing the server sends |
|
77 | # run an arbitrary command to make sure the next thing the server sends | |
78 | # isn't part of the hello message |
|
78 | # isn't part of the hello message | |
79 | runcommand(server, ['id']) |
|
79 | runcommand(server, ['id']) | |
80 |
|
80 | |||
81 | def checkruncommand(server): |
|
81 | def checkruncommand(server): | |
82 | # hello block |
|
82 | # hello block | |
83 | readchannel(server) |
|
83 | readchannel(server) | |
84 |
|
84 | |||
85 | # no args |
|
85 | # no args | |
86 | runcommand(server, []) |
|
86 | runcommand(server, []) | |
87 |
|
87 | |||
88 | # global options |
|
88 | # global options | |
89 | runcommand(server, ['id', '--quiet']) |
|
89 | runcommand(server, ['id', '--quiet']) | |
90 |
|
90 | |||
91 | # make sure global options don't stick through requests |
|
91 | # make sure global options don't stick through requests | |
92 | runcommand(server, ['id']) |
|
92 | runcommand(server, ['id']) | |
93 |
|
93 | |||
94 | # --config |
|
94 | # --config | |
95 | runcommand(server, ['id', '--config', 'ui.quiet=True']) |
|
95 | runcommand(server, ['id', '--config', 'ui.quiet=True']) | |
96 |
|
96 | |||
97 | # make sure --config doesn't stick |
|
97 | # make sure --config doesn't stick | |
98 | runcommand(server, ['id']) |
|
98 | runcommand(server, ['id']) | |
99 |
|
99 | |||
100 | def inputeof(server): |
|
100 | def inputeof(server): | |
101 | readchannel(server) |
|
101 | readchannel(server) | |
102 | server.stdin.write('runcommand\n') |
|
102 | server.stdin.write('runcommand\n') | |
103 | # close stdin while server is waiting for input |
|
103 | # close stdin while server is waiting for input | |
104 | server.stdin.close() |
|
104 | server.stdin.close() | |
105 |
|
105 | |||
106 | # server exits with 1 if the pipe closed while reading the command |
|
106 | # server exits with 1 if the pipe closed while reading the command | |
107 | print 'server exit code =', server.wait() |
|
107 | print 'server exit code =', server.wait() | |
108 |
|
108 | |||
109 | def serverinput(server): |
|
109 | def serverinput(server): | |
110 | readchannel(server) |
|
110 | readchannel(server) | |
111 |
|
111 | |||
112 | patch = """ |
|
112 | patch = """ | |
113 | # HG changeset patch |
|
113 | # HG changeset patch | |
114 | # User test |
|
114 | # User test | |
115 | # Date 0 0 |
|
115 | # Date 0 0 | |
116 | # Node ID c103a3dec114d882c98382d684d8af798d09d857 |
|
116 | # Node ID c103a3dec114d882c98382d684d8af798d09d857 | |
117 | # Parent 0000000000000000000000000000000000000000 |
|
117 | # Parent 0000000000000000000000000000000000000000 | |
118 | 1 |
|
118 | 1 | |
119 |
|
119 | |||
120 | diff -r 000000000000 -r c103a3dec114 a |
|
120 | diff -r 000000000000 -r c103a3dec114 a | |
121 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
121 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
122 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
122 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
123 | @@ -0,0 +1,1 @@ |
|
123 | @@ -0,0 +1,1 @@ | |
124 | +1 |
|
124 | +1 | |
125 | """ |
|
125 | """ | |
126 |
|
126 | |||
127 | runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch)) |
|
127 | runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch)) | |
128 | runcommand(server, ['log']) |
|
128 | runcommand(server, ['log']) | |
129 |
|
129 | |||
130 | def cwd(server): |
|
130 | def cwd(server): | |
131 | """ check that --cwd doesn't persist between requests """ |
|
131 | """ check that --cwd doesn't persist between requests """ | |
132 | readchannel(server) |
|
132 | readchannel(server) | |
133 | os.mkdir('foo') |
|
133 | os.mkdir('foo') | |
134 | f = open('foo/bar', 'wb') |
|
134 | f = open('foo/bar', 'wb') | |
135 | f.write('a') |
|
135 | f.write('a') | |
136 | f.close() |
|
136 | f.close() | |
137 | runcommand(server, ['--cwd', 'foo', 'st', 'bar']) |
|
137 | runcommand(server, ['--cwd', 'foo', 'st', 'bar']) | |
138 | runcommand(server, ['st', 'foo/bar']) |
|
138 | runcommand(server, ['st', 'foo/bar']) | |
139 | os.remove('foo/bar') |
|
139 | os.remove('foo/bar') | |
140 |
|
140 | |||
141 | def localhgrc(server): |
|
141 | def localhgrc(server): | |
142 | """ check that local configs for the cached repo aren't inherited when -R |
|
142 | """ check that local configs for the cached repo aren't inherited when -R | |
143 | is used """ |
|
143 | is used """ | |
144 | readchannel(server) |
|
144 | readchannel(server) | |
145 |
|
145 | |||
146 | # the cached repo local hgrc contains ui.foo=bar, so showconfig should |
|
146 | # the cached repo local hgrc contains ui.foo=bar, so showconfig should | |
147 | # show it |
|
147 | # show it | |
148 | runcommand(server, ['showconfig']) |
|
148 | runcommand(server, ['showconfig']) | |
149 |
|
149 | |||
150 | # but not for this repo |
|
150 | # but not for this repo | |
151 | runcommand(server, ['init', 'foo']) |
|
151 | runcommand(server, ['init', 'foo']) | |
152 | runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) |
|
152 | runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults']) | |
153 | shutil.rmtree('foo') |
|
153 | shutil.rmtree('foo') | |
154 |
|
154 | |||
155 | def hook(**args): |
|
155 | def hook(**args): | |
156 | print 'hook talking' |
|
156 | print 'hook talking' | |
157 | print 'now try to read something: %r' % sys.stdin.read() |
|
157 | print 'now try to read something: %r' % sys.stdin.read() | |
158 |
|
158 | |||
159 | def hookoutput(server): |
|
159 | def hookoutput(server): | |
160 | readchannel(server) |
|
160 | readchannel(server) | |
161 | runcommand(server, ['--config', |
|
161 | runcommand(server, ['--config', | |
162 | 'hooks.pre-identify=python:test-commandserver.hook', |
|
162 | 'hooks.pre-identify=python:test-commandserver.hook', | |
163 | 'id'], |
|
163 | 'id'], | |
164 | input=cStringIO.StringIO('some input')) |
|
164 | input=cStringIO.StringIO('some input')) | |
165 |
|
165 | |||
166 | def outsidechanges(server): |
|
166 | def outsidechanges(server): | |
167 | readchannel(server) |
|
167 | readchannel(server) | |
168 | f = open('a', 'ab') |
|
168 | f = open('a', 'ab') | |
169 | f.write('a\n') |
|
169 | f.write('a\n') | |
170 | f.close() |
|
170 | f.close() | |
171 | runcommand(server, ['status']) |
|
171 | runcommand(server, ['status']) | |
172 | os.system('hg ci -Am2') |
|
172 | os.system('hg ci -Am2') | |
173 | runcommand(server, ['tip']) |
|
173 | runcommand(server, ['tip']) | |
174 | runcommand(server, ['status']) |
|
174 | runcommand(server, ['status']) | |
175 |
|
175 | |||
176 | def bookmarks(server): |
|
176 | def bookmarks(server): | |
177 | readchannel(server) |
|
177 | readchannel(server) | |
178 | runcommand(server, ['bookmarks']) |
|
178 | runcommand(server, ['bookmarks']) | |
179 |
|
179 | |||
180 | # changes .hg/bookmarks |
|
180 | # changes .hg/bookmarks | |
181 | os.system('hg bookmark -i bm1') |
|
181 | os.system('hg bookmark -i bm1') | |
182 | os.system('hg bookmark -i bm2') |
|
182 | os.system('hg bookmark -i bm2') | |
183 | runcommand(server, ['bookmarks']) |
|
183 | runcommand(server, ['bookmarks']) | |
184 |
|
184 | |||
185 | # changes .hg/bookmarks.current |
|
185 | # changes .hg/bookmarks.current | |
186 | os.system('hg upd bm1 -q') |
|
186 | os.system('hg upd bm1 -q') | |
187 | runcommand(server, ['bookmarks']) |
|
187 | runcommand(server, ['bookmarks']) | |
188 |
|
188 | |||
189 | runcommand(server, ['bookmarks', 'bm3']) |
|
189 | runcommand(server, ['bookmarks', 'bm3']) | |
190 | f = open('a', 'ab') |
|
190 | f = open('a', 'ab') | |
191 | f.write('a\n') |
|
191 | f.write('a\n') | |
192 | f.close() |
|
192 | f.close() | |
193 | runcommand(server, ['commit', '-Amm']) |
|
193 | runcommand(server, ['commit', '-Amm']) | |
194 | runcommand(server, ['bookmarks']) |
|
194 | runcommand(server, ['bookmarks']) | |
195 |
|
195 | |||
196 | def tagscache(server): |
|
196 | def tagscache(server): | |
197 | readchannel(server) |
|
197 | readchannel(server) | |
198 | runcommand(server, ['id', '-t', '-r', '0']) |
|
198 | runcommand(server, ['id', '-t', '-r', '0']) | |
199 | os.system('hg tag -r 0 foo') |
|
199 | os.system('hg tag -r 0 foo') | |
200 | runcommand(server, ['id', '-t', '-r', '0']) |
|
200 | runcommand(server, ['id', '-t', '-r', '0']) | |
201 |
|
201 | |||
202 | def setphase(server): |
|
202 | def setphase(server): | |
203 | readchannel(server) |
|
203 | readchannel(server) | |
204 | runcommand(server, ['phase', '-r', '.']) |
|
204 | runcommand(server, ['phase', '-r', '.']) | |
205 | os.system('hg phase -r . -p') |
|
205 | os.system('hg phase -r . -p') | |
206 | runcommand(server, ['phase', '-r', '.']) |
|
206 | runcommand(server, ['phase', '-r', '.']) | |
207 |
|
207 | |||
208 | def rollback(server): |
|
208 | def rollback(server): | |
209 | readchannel(server) |
|
209 | readchannel(server) | |
210 | runcommand(server, ['phase', '-r', '.', '-p']) |
|
210 | runcommand(server, ['phase', '-r', '.', '-p']) | |
211 | f = open('a', 'ab') |
|
211 | f = open('a', 'ab') | |
212 | f.write('a\n') |
|
212 | f.write('a\n') | |
213 | f.close() |
|
213 | f.close() | |
214 | runcommand(server, ['commit', '-Am.']) |
|
214 | runcommand(server, ['commit', '-Am.']) | |
215 | runcommand(server, ['rollback']) |
|
215 | runcommand(server, ['rollback']) | |
216 | runcommand(server, ['phase', '-r', '.']) |
|
216 | runcommand(server, ['phase', '-r', '.']) | |
217 |
|
217 | |||
218 | def branch(server): |
|
218 | def branch(server): | |
219 | readchannel(server) |
|
219 | readchannel(server) | |
220 | runcommand(server, ['branch']) |
|
220 | runcommand(server, ['branch']) | |
221 | os.system('hg branch foo') |
|
221 | os.system('hg branch foo') | |
222 | runcommand(server, ['branch']) |
|
222 | runcommand(server, ['branch']) | |
223 | os.system('hg branch default') |
|
223 | os.system('hg branch default') | |
224 |
|
224 | |||
225 | def hgignore(server): |
|
225 | def hgignore(server): | |
226 | readchannel(server) |
|
226 | readchannel(server) | |
227 | f = open('.hgignore', 'ab') |
|
227 | f = open('.hgignore', 'ab') | |
228 | f.write('') |
|
228 | f.write('') | |
229 | f.close() |
|
229 | f.close() | |
230 | runcommand(server, ['commit', '-Am.']) |
|
230 | runcommand(server, ['commit', '-Am.']) | |
231 | f = open('ignored-file', 'ab') |
|
231 | f = open('ignored-file', 'ab') | |
232 | f.write('') |
|
232 | f.write('') | |
233 | f.close() |
|
233 | f.close() | |
234 | f = open('.hgignore', 'ab') |
|
234 | f = open('.hgignore', 'ab') | |
235 | f.write('ignored-file') |
|
235 | f.write('ignored-file') | |
236 | f.close() |
|
236 | f.close() | |
237 | runcommand(server, ['status', '-i', '-u']) |
|
237 | runcommand(server, ['status', '-i', '-u']) | |
238 |
|
238 | |||
239 | def phasecacheafterstrip(server): |
|
239 | def phasecacheafterstrip(server): | |
240 | readchannel(server) |
|
240 | readchannel(server) | |
241 |
|
241 | |||
242 | # create new head, 5:731265503d86 |
|
242 | # create new head, 5:731265503d86 | |
243 | runcommand(server, ['update', '-C', '0']) |
|
243 | runcommand(server, ['update', '-C', '0']) | |
244 | f = open('a', 'ab') |
|
244 | f = open('a', 'ab') | |
245 | f.write('a\n') |
|
245 | f.write('a\n') | |
246 | f.close() |
|
246 | f.close() | |
247 | runcommand(server, ['commit', '-Am.', 'a']) |
|
247 | runcommand(server, ['commit', '-Am.', 'a']) | |
248 | runcommand(server, ['log', '-Gq']) |
|
248 | runcommand(server, ['log', '-Gq']) | |
249 |
|
249 | |||
250 | # make it public; draft marker moves to 4:7966c8e3734d |
|
250 | # make it public; draft marker moves to 4:7966c8e3734d | |
251 | runcommand(server, ['phase', '-p', '.']) |
|
251 | runcommand(server, ['phase', '-p', '.']) | |
252 | runcommand(server, ['phase', '.']) # load _phasecache.phaseroots |
|
252 | runcommand(server, ['phase', '.']) # load _phasecache.phaseroots | |
253 |
|
253 | |||
254 | # strip 1::4 outside server |
|
254 | # strip 1::4 outside server | |
255 | os.system('hg --config extensions.mq= strip 1') |
|
255 | os.system('hg -q --config extensions.mq= strip 1') | |
256 |
|
256 | |||
257 | # shouldn't raise "7966c8e3734d: no node!" |
|
257 | # shouldn't raise "7966c8e3734d: no node!" | |
258 | runcommand(server, ['branches']) |
|
258 | runcommand(server, ['branches']) | |
259 |
|
259 | |||
260 | if __name__ == '__main__': |
|
260 | if __name__ == '__main__': | |
261 | os.system('hg init') |
|
261 | os.system('hg init') | |
262 |
|
262 | |||
263 | check(hellomessage) |
|
263 | check(hellomessage) | |
264 | check(unknowncommand) |
|
264 | check(unknowncommand) | |
265 | check(checkruncommand) |
|
265 | check(checkruncommand) | |
266 | check(inputeof) |
|
266 | check(inputeof) | |
267 | check(serverinput) |
|
267 | check(serverinput) | |
268 | check(cwd) |
|
268 | check(cwd) | |
269 |
|
269 | |||
270 | hgrc = open('.hg/hgrc', 'a') |
|
270 | hgrc = open('.hg/hgrc', 'a') | |
271 | hgrc.write('[ui]\nfoo=bar\n') |
|
271 | hgrc.write('[ui]\nfoo=bar\n') | |
272 | hgrc.close() |
|
272 | hgrc.close() | |
273 | check(localhgrc) |
|
273 | check(localhgrc) | |
274 | check(hookoutput) |
|
274 | check(hookoutput) | |
275 | check(outsidechanges) |
|
275 | check(outsidechanges) | |
276 | check(bookmarks) |
|
276 | check(bookmarks) | |
277 | check(tagscache) |
|
277 | check(tagscache) | |
278 | check(setphase) |
|
278 | check(setphase) | |
279 | check(rollback) |
|
279 | check(rollback) | |
280 | check(branch) |
|
280 | check(branch) | |
281 | check(hgignore) |
|
281 | check(hgignore) | |
282 | check(phasecacheafterstrip) |
|
282 | check(phasecacheafterstrip) |
@@ -1,192 +1,191 b'' | |||||
1 |
|
1 | |||
2 | testing hellomessage: |
|
2 | testing hellomessage: | |
3 |
|
3 | |||
4 | o, 'capabilities: getencoding runcommand\nencoding: ***' |
|
4 | o, 'capabilities: getencoding runcommand\nencoding: ***' | |
5 | runcommand id |
|
5 | runcommand id | |
6 | 000000000000 tip |
|
6 | 000000000000 tip | |
7 |
|
7 | |||
8 | testing unknowncommand: |
|
8 | testing unknowncommand: | |
9 |
|
9 | |||
10 | abort: unknown command unknowncommand |
|
10 | abort: unknown command unknowncommand | |
11 |
|
11 | |||
12 | testing checkruncommand: |
|
12 | testing checkruncommand: | |
13 |
|
13 | |||
14 | runcommand |
|
14 | runcommand | |
15 | Mercurial Distributed SCM |
|
15 | Mercurial Distributed SCM | |
16 |
|
16 | |||
17 | basic commands: |
|
17 | basic commands: | |
18 |
|
18 | |||
19 | add add the specified files on the next commit |
|
19 | add add the specified files on the next commit | |
20 | annotate show changeset information by line for each file |
|
20 | annotate show changeset information by line for each file | |
21 | clone make a copy of an existing repository |
|
21 | clone make a copy of an existing repository | |
22 | commit commit the specified files or all outstanding changes |
|
22 | commit commit the specified files or all outstanding changes | |
23 | diff diff repository (or selected files) |
|
23 | diff diff repository (or selected files) | |
24 | export dump the header and diffs for one or more changesets |
|
24 | export dump the header and diffs for one or more changesets | |
25 | forget forget the specified files on the next commit |
|
25 | forget forget the specified files on the next commit | |
26 | init create a new repository in the given directory |
|
26 | init create a new repository in the given directory | |
27 | log show revision history of entire repository or files |
|
27 | log show revision history of entire repository or files | |
28 | merge merge working directory with another revision |
|
28 | merge merge working directory with another revision | |
29 | pull pull changes from the specified source |
|
29 | pull pull changes from the specified source | |
30 | push push changes to the specified destination |
|
30 | push push changes to the specified destination | |
31 | remove remove the specified files on the next commit |
|
31 | remove remove the specified files on the next commit | |
32 | serve start stand-alone webserver |
|
32 | serve start stand-alone webserver | |
33 | status show changed files in the working directory |
|
33 | status show changed files in the working directory | |
34 | summary summarize working directory state |
|
34 | summary summarize working directory state | |
35 | update update working directory (or switch revisions) |
|
35 | update update working directory (or switch revisions) | |
36 |
|
36 | |||
37 | use "hg help" for the full list of commands or "hg -v" for details |
|
37 | use "hg help" for the full list of commands or "hg -v" for details | |
38 | runcommand id --quiet |
|
38 | runcommand id --quiet | |
39 | 000000000000 |
|
39 | 000000000000 | |
40 | runcommand id |
|
40 | runcommand id | |
41 | 000000000000 tip |
|
41 | 000000000000 tip | |
42 | runcommand id --config ui.quiet=True |
|
42 | runcommand id --config ui.quiet=True | |
43 | 000000000000 |
|
43 | 000000000000 | |
44 | runcommand id |
|
44 | runcommand id | |
45 | 000000000000 tip |
|
45 | 000000000000 tip | |
46 |
|
46 | |||
47 | testing inputeof: |
|
47 | testing inputeof: | |
48 |
|
48 | |||
49 | server exit code = 1 |
|
49 | server exit code = 1 | |
50 |
|
50 | |||
51 | testing serverinput: |
|
51 | testing serverinput: | |
52 |
|
52 | |||
53 | runcommand import - |
|
53 | runcommand import - | |
54 | applying patch from stdin |
|
54 | applying patch from stdin | |
55 | runcommand log |
|
55 | runcommand log | |
56 | changeset: 0:eff892de26ec |
|
56 | changeset: 0:eff892de26ec | |
57 | tag: tip |
|
57 | tag: tip | |
58 | user: test |
|
58 | user: test | |
59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
59 | date: Thu Jan 01 00:00:00 1970 +0000 | |
60 | summary: 1 |
|
60 | summary: 1 | |
61 |
|
61 | |||
62 |
|
62 | |||
63 | testing cwd: |
|
63 | testing cwd: | |
64 |
|
64 | |||
65 | runcommand --cwd foo st bar |
|
65 | runcommand --cwd foo st bar | |
66 | ? bar |
|
66 | ? bar | |
67 | runcommand st foo/bar |
|
67 | runcommand st foo/bar | |
68 | ? foo/bar |
|
68 | ? foo/bar | |
69 |
|
69 | |||
70 | testing localhgrc: |
|
70 | testing localhgrc: | |
71 |
|
71 | |||
72 | runcommand showconfig |
|
72 | runcommand showconfig | |
73 | bundle.mainreporoot=$TESTTMP |
|
73 | bundle.mainreporoot=$TESTTMP | |
74 | defaults.backout=-d "0 0" |
|
74 | defaults.backout=-d "0 0" | |
75 | defaults.commit=-d "0 0" |
|
75 | defaults.commit=-d "0 0" | |
76 | defaults.tag=-d "0 0" |
|
76 | defaults.tag=-d "0 0" | |
77 | ui.slash=True |
|
77 | ui.slash=True | |
78 | ui.interactive=False |
|
78 | ui.interactive=False | |
79 | ui.foo=bar |
|
79 | ui.foo=bar | |
80 | runcommand init foo |
|
80 | runcommand init foo | |
81 | runcommand -R foo showconfig ui defaults |
|
81 | runcommand -R foo showconfig ui defaults | |
82 | defaults.backout=-d "0 0" |
|
82 | defaults.backout=-d "0 0" | |
83 | defaults.commit=-d "0 0" |
|
83 | defaults.commit=-d "0 0" | |
84 | defaults.tag=-d "0 0" |
|
84 | defaults.tag=-d "0 0" | |
85 | ui.slash=True |
|
85 | ui.slash=True | |
86 | ui.interactive=False |
|
86 | ui.interactive=False | |
87 |
|
87 | |||
88 | testing hookoutput: |
|
88 | testing hookoutput: | |
89 |
|
89 | |||
90 | runcommand --config hooks.pre-identify=python:test-commandserver.hook id |
|
90 | runcommand --config hooks.pre-identify=python:test-commandserver.hook id | |
91 | hook talking |
|
91 | hook talking | |
92 | now try to read something: 'some input' |
|
92 | now try to read something: 'some input' | |
93 | eff892de26ec tip |
|
93 | eff892de26ec tip | |
94 |
|
94 | |||
95 | testing outsidechanges: |
|
95 | testing outsidechanges: | |
96 |
|
96 | |||
97 | runcommand status |
|
97 | runcommand status | |
98 | M a |
|
98 | M a | |
99 | runcommand tip |
|
99 | runcommand tip | |
100 | changeset: 1:d3a0a68be6de |
|
100 | changeset: 1:d3a0a68be6de | |
101 | tag: tip |
|
101 | tag: tip | |
102 | user: test |
|
102 | user: test | |
103 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
103 | date: Thu Jan 01 00:00:00 1970 +0000 | |
104 | summary: 2 |
|
104 | summary: 2 | |
105 |
|
105 | |||
106 | runcommand status |
|
106 | runcommand status | |
107 |
|
107 | |||
108 | testing bookmarks: |
|
108 | testing bookmarks: | |
109 |
|
109 | |||
110 | runcommand bookmarks |
|
110 | runcommand bookmarks | |
111 | no bookmarks set |
|
111 | no bookmarks set | |
112 | runcommand bookmarks |
|
112 | runcommand bookmarks | |
113 | bm1 1:d3a0a68be6de |
|
113 | bm1 1:d3a0a68be6de | |
114 | bm2 1:d3a0a68be6de |
|
114 | bm2 1:d3a0a68be6de | |
115 | runcommand bookmarks |
|
115 | runcommand bookmarks | |
116 | * bm1 1:d3a0a68be6de |
|
116 | * bm1 1:d3a0a68be6de | |
117 | bm2 1:d3a0a68be6de |
|
117 | bm2 1:d3a0a68be6de | |
118 | runcommand bookmarks bm3 |
|
118 | runcommand bookmarks bm3 | |
119 | runcommand commit -Amm |
|
119 | runcommand commit -Amm | |
120 | runcommand bookmarks |
|
120 | runcommand bookmarks | |
121 | bm1 1:d3a0a68be6de |
|
121 | bm1 1:d3a0a68be6de | |
122 | bm2 1:d3a0a68be6de |
|
122 | bm2 1:d3a0a68be6de | |
123 | * bm3 2:aef17e88f5f0 |
|
123 | * bm3 2:aef17e88f5f0 | |
124 |
|
124 | |||
125 | testing tagscache: |
|
125 | testing tagscache: | |
126 |
|
126 | |||
127 | runcommand id -t -r 0 |
|
127 | runcommand id -t -r 0 | |
128 |
|
128 | |||
129 | runcommand id -t -r 0 |
|
129 | runcommand id -t -r 0 | |
130 | foo |
|
130 | foo | |
131 |
|
131 | |||
132 | testing setphase: |
|
132 | testing setphase: | |
133 |
|
133 | |||
134 | runcommand phase -r . |
|
134 | runcommand phase -r . | |
135 | 3: draft |
|
135 | 3: draft | |
136 | runcommand phase -r . |
|
136 | runcommand phase -r . | |
137 | 3: public |
|
137 | 3: public | |
138 |
|
138 | |||
139 | testing rollback: |
|
139 | testing rollback: | |
140 |
|
140 | |||
141 | runcommand phase -r . -p |
|
141 | runcommand phase -r . -p | |
142 | no phases changed |
|
142 | no phases changed | |
143 | runcommand commit -Am. |
|
143 | runcommand commit -Am. | |
144 | runcommand rollback |
|
144 | runcommand rollback | |
145 | repository tip rolled back to revision 3 (undo commit) |
|
145 | repository tip rolled back to revision 3 (undo commit) | |
146 | working directory now based on revision 3 |
|
146 | working directory now based on revision 3 | |
147 | runcommand phase -r . |
|
147 | runcommand phase -r . | |
148 | 3: public |
|
148 | 3: public | |
149 |
|
149 | |||
150 | testing branch: |
|
150 | testing branch: | |
151 |
|
151 | |||
152 | runcommand branch |
|
152 | runcommand branch | |
153 | default |
|
153 | default | |
154 | marked working directory as branch foo |
|
154 | marked working directory as branch foo | |
155 | (branches are permanent and global, did you want a bookmark?) |
|
155 | (branches are permanent and global, did you want a bookmark?) | |
156 | runcommand branch |
|
156 | runcommand branch | |
157 | foo |
|
157 | foo | |
158 | marked working directory as branch default |
|
158 | marked working directory as branch default | |
159 | (branches are permanent and global, did you want a bookmark?) |
|
159 | (branches are permanent and global, did you want a bookmark?) | |
160 |
|
160 | |||
161 | testing hgignore: |
|
161 | testing hgignore: | |
162 |
|
162 | |||
163 | runcommand commit -Am. |
|
163 | runcommand commit -Am. | |
164 | adding .hgignore |
|
164 | adding .hgignore | |
165 | runcommand status -i -u |
|
165 | runcommand status -i -u | |
166 | I ignored-file |
|
166 | I ignored-file | |
167 |
|
167 | |||
168 | testing phasecacheafterstrip: |
|
168 | testing phasecacheafterstrip: | |
169 |
|
169 | |||
170 | runcommand update -C 0 |
|
170 | runcommand update -C 0 | |
171 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
171 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
172 | runcommand commit -Am. a |
|
172 | runcommand commit -Am. a | |
173 | created new head |
|
173 | created new head | |
174 | runcommand log -Gq |
|
174 | runcommand log -Gq | |
175 | @ 5:731265503d86 |
|
175 | @ 5:731265503d86 | |
176 | | |
|
176 | | | |
177 | | o 4:7966c8e3734d |
|
177 | | o 4:7966c8e3734d | |
178 | | | |
|
178 | | | | |
179 | | o 3:b9b85890c400 |
|
179 | | o 3:b9b85890c400 | |
180 | | | |
|
180 | | | | |
181 | | o 2:aef17e88f5f0 |
|
181 | | o 2:aef17e88f5f0 | |
182 | | | |
|
182 | | | | |
183 | | o 1:d3a0a68be6de |
|
183 | | o 1:d3a0a68be6de | |
184 | |/ |
|
184 | |/ | |
185 | o 0:eff892de26ec |
|
185 | o 0:eff892de26ec | |
186 |
|
186 | |||
187 | runcommand phase -p . |
|
187 | runcommand phase -p . | |
188 | runcommand phase . |
|
188 | runcommand phase . | |
189 | 5: public |
|
189 | 5: public | |
190 | saved backup bundle to $TESTTMP/.hg/strip-backup/d3a0a68be6de-backup.hg |
|
|||
191 | runcommand branches |
|
190 | runcommand branches | |
192 | default 1:731265503d86 |
|
191 | default 1:731265503d86 |
General Comments 0
You need to be logged in to leave comments.
Login now