##// END OF EJS Templates
tests: define norepo in command decorator
Gregory Szorc -
r21773:26d2fb89 default
parent child Browse files
Show More
@@ -1,358 +1,357 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 sep(text):
28 def sep(text):
29 return text.replace('\\', '/')
29 return text.replace('\\', '/')
30
30
31 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None,
31 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None,
32 outfilter=lambda x: x):
32 outfilter=lambda x: x):
33 print ' runcommand', ' '.join(args)
33 print ' runcommand', ' '.join(args)
34 sys.stdout.flush()
34 sys.stdout.flush()
35 server.stdin.write('runcommand\n')
35 server.stdin.write('runcommand\n')
36 writeblock(server, '\0'.join(args))
36 writeblock(server, '\0'.join(args))
37
37
38 if not input:
38 if not input:
39 input = cStringIO.StringIO()
39 input = cStringIO.StringIO()
40
40
41 while True:
41 while True:
42 ch, data = readchannel(server)
42 ch, data = readchannel(server)
43 if ch == 'o':
43 if ch == 'o':
44 output.write(outfilter(data))
44 output.write(outfilter(data))
45 output.flush()
45 output.flush()
46 elif ch == 'e':
46 elif ch == 'e':
47 error.write(data)
47 error.write(data)
48 error.flush()
48 error.flush()
49 elif ch == 'I':
49 elif ch == 'I':
50 writeblock(server, input.read(data))
50 writeblock(server, input.read(data))
51 elif ch == 'L':
51 elif ch == 'L':
52 writeblock(server, input.readline(data))
52 writeblock(server, input.readline(data))
53 elif ch == 'r':
53 elif ch == 'r':
54 ret, = struct.unpack('>i', data)
54 ret, = struct.unpack('>i', data)
55 if ret != 0:
55 if ret != 0:
56 print ' [%d]' % ret
56 print ' [%d]' % ret
57 return ret
57 return ret
58 else:
58 else:
59 print "unexpected channel %c: %r" % (ch, data)
59 print "unexpected channel %c: %r" % (ch, data)
60 if ch.isupper():
60 if ch.isupper():
61 return
61 return
62
62
63 def check(func, repopath=None):
63 def check(func, repopath=None):
64 print
64 print
65 print 'testing %s:' % func.__name__
65 print 'testing %s:' % func.__name__
66 print
66 print
67 sys.stdout.flush()
67 sys.stdout.flush()
68 server = connect(repopath)
68 server = connect(repopath)
69 try:
69 try:
70 return func(server)
70 return func(server)
71 finally:
71 finally:
72 server.stdin.close()
72 server.stdin.close()
73 server.wait()
73 server.wait()
74
74
75 def unknowncommand(server):
75 def unknowncommand(server):
76 server.stdin.write('unknowncommand\n')
76 server.stdin.write('unknowncommand\n')
77
77
78 def hellomessage(server):
78 def hellomessage(server):
79 ch, data = readchannel(server)
79 ch, data = readchannel(server)
80 # escaping python tests output not supported
80 # escaping python tests output not supported
81 print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***',
81 print '%c, %r' % (ch, re.sub('encoding: [a-zA-Z0-9-]+', 'encoding: ***',
82 data))
82 data))
83
83
84 # run an arbitrary command to make sure the next thing the server sends
84 # run an arbitrary command to make sure the next thing the server sends
85 # isn't part of the hello message
85 # isn't part of the hello message
86 runcommand(server, ['id'])
86 runcommand(server, ['id'])
87
87
88 def checkruncommand(server):
88 def checkruncommand(server):
89 # hello block
89 # hello block
90 readchannel(server)
90 readchannel(server)
91
91
92 # no args
92 # no args
93 runcommand(server, [])
93 runcommand(server, [])
94
94
95 # global options
95 # global options
96 runcommand(server, ['id', '--quiet'])
96 runcommand(server, ['id', '--quiet'])
97
97
98 # make sure global options don't stick through requests
98 # make sure global options don't stick through requests
99 runcommand(server, ['id'])
99 runcommand(server, ['id'])
100
100
101 # --config
101 # --config
102 runcommand(server, ['id', '--config', 'ui.quiet=True'])
102 runcommand(server, ['id', '--config', 'ui.quiet=True'])
103
103
104 # make sure --config doesn't stick
104 # make sure --config doesn't stick
105 runcommand(server, ['id'])
105 runcommand(server, ['id'])
106
106
107 # negative return code should be masked
107 # negative return code should be masked
108 runcommand(server, ['id', '-runknown'])
108 runcommand(server, ['id', '-runknown'])
109
109
110 def inputeof(server):
110 def inputeof(server):
111 readchannel(server)
111 readchannel(server)
112 server.stdin.write('runcommand\n')
112 server.stdin.write('runcommand\n')
113 # close stdin while server is waiting for input
113 # close stdin while server is waiting for input
114 server.stdin.close()
114 server.stdin.close()
115
115
116 # server exits with 1 if the pipe closed while reading the command
116 # server exits with 1 if the pipe closed while reading the command
117 print 'server exit code =', server.wait()
117 print 'server exit code =', server.wait()
118
118
119 def serverinput(server):
119 def serverinput(server):
120 readchannel(server)
120 readchannel(server)
121
121
122 patch = """
122 patch = """
123 # HG changeset patch
123 # HG changeset patch
124 # User test
124 # User test
125 # Date 0 0
125 # Date 0 0
126 # Node ID c103a3dec114d882c98382d684d8af798d09d857
126 # Node ID c103a3dec114d882c98382d684d8af798d09d857
127 # Parent 0000000000000000000000000000000000000000
127 # Parent 0000000000000000000000000000000000000000
128 1
128 1
129
129
130 diff -r 000000000000 -r c103a3dec114 a
130 diff -r 000000000000 -r c103a3dec114 a
131 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
131 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
132 +++ b/a Thu Jan 01 00:00:00 1970 +0000
132 +++ b/a Thu Jan 01 00:00:00 1970 +0000
133 @@ -0,0 +1,1 @@
133 @@ -0,0 +1,1 @@
134 +1
134 +1
135 """
135 """
136
136
137 runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))
137 runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))
138 runcommand(server, ['log'])
138 runcommand(server, ['log'])
139
139
140 def cwd(server):
140 def cwd(server):
141 """ check that --cwd doesn't persist between requests """
141 """ check that --cwd doesn't persist between requests """
142 readchannel(server)
142 readchannel(server)
143 os.mkdir('foo')
143 os.mkdir('foo')
144 f = open('foo/bar', 'wb')
144 f = open('foo/bar', 'wb')
145 f.write('a')
145 f.write('a')
146 f.close()
146 f.close()
147 runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
147 runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
148 runcommand(server, ['st', 'foo/bar'])
148 runcommand(server, ['st', 'foo/bar'])
149 os.remove('foo/bar')
149 os.remove('foo/bar')
150
150
151 def localhgrc(server):
151 def localhgrc(server):
152 """ check that local configs for the cached repo aren't inherited when -R
152 """ check that local configs for the cached repo aren't inherited when -R
153 is used """
153 is used """
154 readchannel(server)
154 readchannel(server)
155
155
156 # the cached repo local hgrc contains ui.foo=bar, so showconfig should
156 # the cached repo local hgrc contains ui.foo=bar, so showconfig should
157 # show it
157 # show it
158 runcommand(server, ['showconfig'])
158 runcommand(server, ['showconfig'])
159
159
160 # but not for this repo
160 # but not for this repo
161 runcommand(server, ['init', 'foo'])
161 runcommand(server, ['init', 'foo'])
162 runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
162 runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
163 shutil.rmtree('foo')
163 shutil.rmtree('foo')
164
164
165 def hook(**args):
165 def hook(**args):
166 print 'hook talking'
166 print 'hook talking'
167 print 'now try to read something: %r' % sys.stdin.read()
167 print 'now try to read something: %r' % sys.stdin.read()
168
168
169 def hookoutput(server):
169 def hookoutput(server):
170 readchannel(server)
170 readchannel(server)
171 runcommand(server, ['--config',
171 runcommand(server, ['--config',
172 'hooks.pre-identify=python:test-commandserver.hook',
172 'hooks.pre-identify=python:test-commandserver.hook',
173 'id'],
173 'id'],
174 input=cStringIO.StringIO('some input'))
174 input=cStringIO.StringIO('some input'))
175
175
176 def outsidechanges(server):
176 def outsidechanges(server):
177 readchannel(server)
177 readchannel(server)
178 f = open('a', 'ab')
178 f = open('a', 'ab')
179 f.write('a\n')
179 f.write('a\n')
180 f.close()
180 f.close()
181 runcommand(server, ['status'])
181 runcommand(server, ['status'])
182 os.system('hg ci -Am2')
182 os.system('hg ci -Am2')
183 runcommand(server, ['tip'])
183 runcommand(server, ['tip'])
184 runcommand(server, ['status'])
184 runcommand(server, ['status'])
185
185
186 def bookmarks(server):
186 def bookmarks(server):
187 readchannel(server)
187 readchannel(server)
188 runcommand(server, ['bookmarks'])
188 runcommand(server, ['bookmarks'])
189
189
190 # changes .hg/bookmarks
190 # changes .hg/bookmarks
191 os.system('hg bookmark -i bm1')
191 os.system('hg bookmark -i bm1')
192 os.system('hg bookmark -i bm2')
192 os.system('hg bookmark -i bm2')
193 runcommand(server, ['bookmarks'])
193 runcommand(server, ['bookmarks'])
194
194
195 # changes .hg/bookmarks.current
195 # changes .hg/bookmarks.current
196 os.system('hg upd bm1 -q')
196 os.system('hg upd bm1 -q')
197 runcommand(server, ['bookmarks'])
197 runcommand(server, ['bookmarks'])
198
198
199 runcommand(server, ['bookmarks', 'bm3'])
199 runcommand(server, ['bookmarks', 'bm3'])
200 f = open('a', 'ab')
200 f = open('a', 'ab')
201 f.write('a\n')
201 f.write('a\n')
202 f.close()
202 f.close()
203 runcommand(server, ['commit', '-Amm'])
203 runcommand(server, ['commit', '-Amm'])
204 runcommand(server, ['bookmarks'])
204 runcommand(server, ['bookmarks'])
205
205
206 def tagscache(server):
206 def tagscache(server):
207 readchannel(server)
207 readchannel(server)
208 runcommand(server, ['id', '-t', '-r', '0'])
208 runcommand(server, ['id', '-t', '-r', '0'])
209 os.system('hg tag -r 0 foo')
209 os.system('hg tag -r 0 foo')
210 runcommand(server, ['id', '-t', '-r', '0'])
210 runcommand(server, ['id', '-t', '-r', '0'])
211
211
212 def setphase(server):
212 def setphase(server):
213 readchannel(server)
213 readchannel(server)
214 runcommand(server, ['phase', '-r', '.'])
214 runcommand(server, ['phase', '-r', '.'])
215 os.system('hg phase -r . -p')
215 os.system('hg phase -r . -p')
216 runcommand(server, ['phase', '-r', '.'])
216 runcommand(server, ['phase', '-r', '.'])
217
217
218 def rollback(server):
218 def rollback(server):
219 readchannel(server)
219 readchannel(server)
220 runcommand(server, ['phase', '-r', '.', '-p'])
220 runcommand(server, ['phase', '-r', '.', '-p'])
221 f = open('a', 'ab')
221 f = open('a', 'ab')
222 f.write('a\n')
222 f.write('a\n')
223 f.close()
223 f.close()
224 runcommand(server, ['commit', '-Am.'])
224 runcommand(server, ['commit', '-Am.'])
225 runcommand(server, ['rollback'])
225 runcommand(server, ['rollback'])
226 runcommand(server, ['phase', '-r', '.'])
226 runcommand(server, ['phase', '-r', '.'])
227
227
228 def branch(server):
228 def branch(server):
229 readchannel(server)
229 readchannel(server)
230 runcommand(server, ['branch'])
230 runcommand(server, ['branch'])
231 os.system('hg branch foo')
231 os.system('hg branch foo')
232 runcommand(server, ['branch'])
232 runcommand(server, ['branch'])
233 os.system('hg branch default')
233 os.system('hg branch default')
234
234
235 def hgignore(server):
235 def hgignore(server):
236 readchannel(server)
236 readchannel(server)
237 f = open('.hgignore', 'ab')
237 f = open('.hgignore', 'ab')
238 f.write('')
238 f.write('')
239 f.close()
239 f.close()
240 runcommand(server, ['commit', '-Am.'])
240 runcommand(server, ['commit', '-Am.'])
241 f = open('ignored-file', 'ab')
241 f = open('ignored-file', 'ab')
242 f.write('')
242 f.write('')
243 f.close()
243 f.close()
244 f = open('.hgignore', 'ab')
244 f = open('.hgignore', 'ab')
245 f.write('ignored-file')
245 f.write('ignored-file')
246 f.close()
246 f.close()
247 runcommand(server, ['status', '-i', '-u'])
247 runcommand(server, ['status', '-i', '-u'])
248
248
249 def phasecacheafterstrip(server):
249 def phasecacheafterstrip(server):
250 readchannel(server)
250 readchannel(server)
251
251
252 # create new head, 5:731265503d86
252 # create new head, 5:731265503d86
253 runcommand(server, ['update', '-C', '0'])
253 runcommand(server, ['update', '-C', '0'])
254 f = open('a', 'ab')
254 f = open('a', 'ab')
255 f.write('a\n')
255 f.write('a\n')
256 f.close()
256 f.close()
257 runcommand(server, ['commit', '-Am.', 'a'])
257 runcommand(server, ['commit', '-Am.', 'a'])
258 runcommand(server, ['log', '-Gq'])
258 runcommand(server, ['log', '-Gq'])
259
259
260 # make it public; draft marker moves to 4:7966c8e3734d
260 # make it public; draft marker moves to 4:7966c8e3734d
261 runcommand(server, ['phase', '-p', '.'])
261 runcommand(server, ['phase', '-p', '.'])
262 # load _phasecache.phaseroots
262 # load _phasecache.phaseroots
263 runcommand(server, ['phase', '.'], outfilter=sep)
263 runcommand(server, ['phase', '.'], outfilter=sep)
264
264
265 # strip 1::4 outside server
265 # strip 1::4 outside server
266 os.system('hg -q --config extensions.mq= strip 1')
266 os.system('hg -q --config extensions.mq= strip 1')
267
267
268 # shouldn't raise "7966c8e3734d: no node!"
268 # shouldn't raise "7966c8e3734d: no node!"
269 runcommand(server, ['branches'])
269 runcommand(server, ['branches'])
270
270
271 def obsolete(server):
271 def obsolete(server):
272 readchannel(server)
272 readchannel(server)
273
273
274 runcommand(server, ['up', 'null'])
274 runcommand(server, ['up', 'null'])
275 runcommand(server, ['phase', '-df', 'tip'])
275 runcommand(server, ['phase', '-df', 'tip'])
276 cmd = 'hg debugobsolete `hg log -r tip --template {node}`'
276 cmd = 'hg debugobsolete `hg log -r tip --template {node}`'
277 if os.name == 'nt':
277 if os.name == 'nt':
278 cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe
278 cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe
279 os.system(cmd)
279 os.system(cmd)
280 runcommand(server, ['log', '--hidden'])
280 runcommand(server, ['log', '--hidden'])
281 runcommand(server, ['log'])
281 runcommand(server, ['log'])
282
282
283 def mqoutsidechanges(server):
283 def mqoutsidechanges(server):
284 readchannel(server)
284 readchannel(server)
285
285
286 # load repo.mq
286 # load repo.mq
287 runcommand(server, ['qapplied'])
287 runcommand(server, ['qapplied'])
288 os.system('hg qnew 0.diff')
288 os.system('hg qnew 0.diff')
289 # repo.mq should be invalidated
289 # repo.mq should be invalidated
290 runcommand(server, ['qapplied'])
290 runcommand(server, ['qapplied'])
291
291
292 runcommand(server, ['qpop', '--all'])
292 runcommand(server, ['qpop', '--all'])
293 os.system('hg qqueue --create foo')
293 os.system('hg qqueue --create foo')
294 # repo.mq should be recreated to point to new queue
294 # repo.mq should be recreated to point to new queue
295 runcommand(server, ['qqueue', '--active'])
295 runcommand(server, ['qqueue', '--active'])
296
296
297 def getpass(server):
297 def getpass(server):
298 readchannel(server)
298 readchannel(server)
299 runcommand(server, ['debuggetpass', '--config', 'ui.interactive=True'],
299 runcommand(server, ['debuggetpass', '--config', 'ui.interactive=True'],
300 input=cStringIO.StringIO('1234\n'))
300 input=cStringIO.StringIO('1234\n'))
301
301
302 def startwithoutrepo(server):
302 def startwithoutrepo(server):
303 readchannel(server)
303 readchannel(server)
304 runcommand(server, ['init', 'repo2'])
304 runcommand(server, ['init', 'repo2'])
305 runcommand(server, ['id', '-R', 'repo2'])
305 runcommand(server, ['id', '-R', 'repo2'])
306
306
307 if __name__ == '__main__':
307 if __name__ == '__main__':
308 os.system('hg init repo')
308 os.system('hg init repo')
309 os.chdir('repo')
309 os.chdir('repo')
310
310
311 check(hellomessage)
311 check(hellomessage)
312 check(unknowncommand)
312 check(unknowncommand)
313 check(checkruncommand)
313 check(checkruncommand)
314 check(inputeof)
314 check(inputeof)
315 check(serverinput)
315 check(serverinput)
316 check(cwd)
316 check(cwd)
317
317
318 hgrc = open('.hg/hgrc', 'a')
318 hgrc = open('.hg/hgrc', 'a')
319 hgrc.write('[ui]\nfoo=bar\n')
319 hgrc.write('[ui]\nfoo=bar\n')
320 hgrc.close()
320 hgrc.close()
321 check(localhgrc)
321 check(localhgrc)
322 check(hookoutput)
322 check(hookoutput)
323 check(outsidechanges)
323 check(outsidechanges)
324 check(bookmarks)
324 check(bookmarks)
325 check(tagscache)
325 check(tagscache)
326 check(setphase)
326 check(setphase)
327 check(rollback)
327 check(rollback)
328 check(branch)
328 check(branch)
329 check(hgignore)
329 check(hgignore)
330 check(phasecacheafterstrip)
330 check(phasecacheafterstrip)
331 obs = open('obs.py', 'w')
331 obs = open('obs.py', 'w')
332 obs.write('import mercurial.obsolete\nmercurial.obsolete._enabled = True\n')
332 obs.write('import mercurial.obsolete\nmercurial.obsolete._enabled = True\n')
333 obs.close()
333 obs.close()
334 hgrc = open('.hg/hgrc', 'a')
334 hgrc = open('.hg/hgrc', 'a')
335 hgrc.write('[extensions]\nobs=obs.py\n')
335 hgrc.write('[extensions]\nobs=obs.py\n')
336 hgrc.close()
336 hgrc.close()
337 check(obsolete)
337 check(obsolete)
338 hgrc = open('.hg/hgrc', 'a')
338 hgrc = open('.hg/hgrc', 'a')
339 hgrc.write('[extensions]\nmq=\n')
339 hgrc.write('[extensions]\nmq=\n')
340 hgrc.close()
340 hgrc.close()
341 check(mqoutsidechanges)
341 check(mqoutsidechanges)
342 dbg = open('dbgui.py', 'w')
342 dbg = open('dbgui.py', 'w')
343 dbg.write('from mercurial import cmdutil, commands\n'
343 dbg.write('from mercurial import cmdutil, commands\n'
344 'commands.norepo += " debuggetpass"\n'
345 'cmdtable = {}\n'
344 'cmdtable = {}\n'
346 'command = cmdutil.command(cmdtable)\n'
345 'command = cmdutil.command(cmdtable)\n'
347 '@command("debuggetpass")\n'
346 '@command("debuggetpass", norepo=True)\n'
348 'def debuggetpass(ui):\n'
347 'def debuggetpass(ui):\n'
349 ' ui.write("%s\\n" % ui.getpass())\n')
348 ' ui.write("%s\\n" % ui.getpass())\n')
350 dbg.close()
349 dbg.close()
351 hgrc = open('.hg/hgrc', 'a')
350 hgrc = open('.hg/hgrc', 'a')
352 hgrc.write('[extensions]\ndbgui=dbgui.py\n')
351 hgrc.write('[extensions]\ndbgui=dbgui.py\n')
353 hgrc.close()
352 hgrc.close()
354 check(getpass)
353 check(getpass)
355
354
356 os.chdir('..')
355 os.chdir('..')
357 check(hellomessage)
356 check(hellomessage)
358 check(startwithoutrepo)
357 check(startwithoutrepo)
@@ -1,850 +1,846 b''
1 Test basic extension support
1 Test basic extension support
2
2
3 $ cat > foobar.py <<EOF
3 $ cat > foobar.py <<EOF
4 > import os
4 > import os
5 > from mercurial import cmdutil, commands
5 > from mercurial import cmdutil, commands
6 >
6 >
7 > cmdtable = {}
7 > cmdtable = {}
8 > command = cmdutil.command(cmdtable)
8 > command = cmdutil.command(cmdtable)
9 >
9 >
10 > def uisetup(ui):
10 > def uisetup(ui):
11 > ui.write("uisetup called\\n")
11 > ui.write("uisetup called\\n")
12 >
12 >
13 > def reposetup(ui, repo):
13 > def reposetup(ui, repo):
14 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
14 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
15 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
15 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
16 >
16 >
17 > @command('foo', [], 'hg foo')
17 > @command('foo', [], 'hg foo')
18 > def foo(ui, *args, **kwargs):
18 > def foo(ui, *args, **kwargs):
19 > ui.write("Foo\\n")
19 > ui.write("Foo\\n")
20 >
20 >
21 > @command('bar', [], 'hg bar')
21 > @command('bar', [], 'hg bar', norepo=True)
22 > def bar(ui, *args, **kwargs):
22 > def bar(ui, *args, **kwargs):
23 > ui.write("Bar\\n")
23 > ui.write("Bar\\n")
24 >
24 >
25 > commands.norepo += ' bar'
26 > EOF
25 > EOF
27 $ abspath=`pwd`/foobar.py
26 $ abspath=`pwd`/foobar.py
28
27
29 $ mkdir barfoo
28 $ mkdir barfoo
30 $ cp foobar.py barfoo/__init__.py
29 $ cp foobar.py barfoo/__init__.py
31 $ barfoopath=`pwd`/barfoo
30 $ barfoopath=`pwd`/barfoo
32
31
33 $ hg init a
32 $ hg init a
34 $ cd a
33 $ cd a
35 $ echo foo > file
34 $ echo foo > file
36 $ hg add file
35 $ hg add file
37 $ hg commit -m 'add file'
36 $ hg commit -m 'add file'
38
37
39 $ echo '[extensions]' >> $HGRCPATH
38 $ echo '[extensions]' >> $HGRCPATH
40 $ echo "foobar = $abspath" >> $HGRCPATH
39 $ echo "foobar = $abspath" >> $HGRCPATH
41 $ hg foo
40 $ hg foo
42 uisetup called
41 uisetup called
43 reposetup called for a
42 reposetup called for a
44 ui == repo.ui
43 ui == repo.ui
45 Foo
44 Foo
46
45
47 $ cd ..
46 $ cd ..
48 $ hg clone a b
47 $ hg clone a b
49 uisetup called
48 uisetup called
50 reposetup called for a
49 reposetup called for a
51 ui == repo.ui
50 ui == repo.ui
52 reposetup called for b
51 reposetup called for b
53 ui == repo.ui
52 ui == repo.ui
54 updating to branch default
53 updating to branch default
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56
55
57 $ hg bar
56 $ hg bar
58 uisetup called
57 uisetup called
59 Bar
58 Bar
60 $ echo 'foobar = !' >> $HGRCPATH
59 $ echo 'foobar = !' >> $HGRCPATH
61
60
62 module/__init__.py-style
61 module/__init__.py-style
63
62
64 $ echo "barfoo = $barfoopath" >> $HGRCPATH
63 $ echo "barfoo = $barfoopath" >> $HGRCPATH
65 $ cd a
64 $ cd a
66 $ hg foo
65 $ hg foo
67 uisetup called
66 uisetup called
68 reposetup called for a
67 reposetup called for a
69 ui == repo.ui
68 ui == repo.ui
70 Foo
69 Foo
71 $ echo 'barfoo = !' >> $HGRCPATH
70 $ echo 'barfoo = !' >> $HGRCPATH
72
71
73 Check that extensions are loaded in phases:
72 Check that extensions are loaded in phases:
74
73
75 $ cat > foo.py <<EOF
74 $ cat > foo.py <<EOF
76 > import os
75 > import os
77 > name = os.path.basename(__file__).rsplit('.', 1)[0]
76 > name = os.path.basename(__file__).rsplit('.', 1)[0]
78 > print "1) %s imported" % name
77 > print "1) %s imported" % name
79 > def uisetup(ui):
78 > def uisetup(ui):
80 > print "2) %s uisetup" % name
79 > print "2) %s uisetup" % name
81 > def extsetup():
80 > def extsetup():
82 > print "3) %s extsetup" % name
81 > print "3) %s extsetup" % name
83 > def reposetup(ui, repo):
82 > def reposetup(ui, repo):
84 > print "4) %s reposetup" % name
83 > print "4) %s reposetup" % name
85 > EOF
84 > EOF
86
85
87 $ cp foo.py bar.py
86 $ cp foo.py bar.py
88 $ echo 'foo = foo.py' >> $HGRCPATH
87 $ echo 'foo = foo.py' >> $HGRCPATH
89 $ echo 'bar = bar.py' >> $HGRCPATH
88 $ echo 'bar = bar.py' >> $HGRCPATH
90
89
91 Command with no output, we just want to see the extensions loaded:
90 Command with no output, we just want to see the extensions loaded:
92
91
93 $ hg paths
92 $ hg paths
94 1) foo imported
93 1) foo imported
95 1) bar imported
94 1) bar imported
96 2) foo uisetup
95 2) foo uisetup
97 2) bar uisetup
96 2) bar uisetup
98 3) foo extsetup
97 3) foo extsetup
99 3) bar extsetup
98 3) bar extsetup
100 4) foo reposetup
99 4) foo reposetup
101 4) bar reposetup
100 4) bar reposetup
102
101
103 Check hgweb's load order:
102 Check hgweb's load order:
104
103
105 $ cat > hgweb.cgi <<EOF
104 $ cat > hgweb.cgi <<EOF
106 > #!/usr/bin/env python
105 > #!/usr/bin/env python
107 > from mercurial import demandimport; demandimport.enable()
106 > from mercurial import demandimport; demandimport.enable()
108 > from mercurial.hgweb import hgweb
107 > from mercurial.hgweb import hgweb
109 > from mercurial.hgweb import wsgicgi
108 > from mercurial.hgweb import wsgicgi
110 >
109 >
111 > application = hgweb('.', 'test repo')
110 > application = hgweb('.', 'test repo')
112 > wsgicgi.launch(application)
111 > wsgicgi.launch(application)
113 > EOF
112 > EOF
114
113
115 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
114 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
116 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
115 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
117 > | grep '^[0-9]) ' # ignores HTML output
116 > | grep '^[0-9]) ' # ignores HTML output
118 1) foo imported
117 1) foo imported
119 1) bar imported
118 1) bar imported
120 2) foo uisetup
119 2) foo uisetup
121 2) bar uisetup
120 2) bar uisetup
122 3) foo extsetup
121 3) foo extsetup
123 3) bar extsetup
122 3) bar extsetup
124 4) foo reposetup
123 4) foo reposetup
125 4) bar reposetup
124 4) bar reposetup
126 4) foo reposetup
125 4) foo reposetup
127 4) bar reposetup
126 4) bar reposetup
128
127
129 $ echo 'foo = !' >> $HGRCPATH
128 $ echo 'foo = !' >> $HGRCPATH
130 $ echo 'bar = !' >> $HGRCPATH
129 $ echo 'bar = !' >> $HGRCPATH
131
130
132 Check "from __future__ import absolute_import" support for external libraries
131 Check "from __future__ import absolute_import" support for external libraries
133
132
134 #if windows
133 #if windows
135 $ PATHSEP=";"
134 $ PATHSEP=";"
136 #else
135 #else
137 $ PATHSEP=":"
136 $ PATHSEP=":"
138 #endif
137 #endif
139 $ export PATHSEP
138 $ export PATHSEP
140
139
141 $ mkdir $TESTTMP/libroot
140 $ mkdir $TESTTMP/libroot
142 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
141 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
143 $ mkdir $TESTTMP/libroot/mod
142 $ mkdir $TESTTMP/libroot/mod
144 $ touch $TESTTMP/libroot/mod/__init__.py
143 $ touch $TESTTMP/libroot/mod/__init__.py
145 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
144 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
146
145
147 #if absimport
146 #if absimport
148 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
147 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
149 > from __future__ import absolute_import
148 > from __future__ import absolute_import
150 > import ambig # should load "libroot/ambig.py"
149 > import ambig # should load "libroot/ambig.py"
151 > s = ambig.s
150 > s = ambig.s
152 > EOF
151 > EOF
153 $ cat > loadabs.py <<EOF
152 $ cat > loadabs.py <<EOF
154 > import mod.ambigabs as ambigabs
153 > import mod.ambigabs as ambigabs
155 > def extsetup():
154 > def extsetup():
156 > print 'ambigabs.s=%s' % ambigabs.s
155 > print 'ambigabs.s=%s' % ambigabs.s
157 > EOF
156 > EOF
158 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
157 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
159 ambigabs.s=libroot/ambig.py
158 ambigabs.s=libroot/ambig.py
160 $TESTTMP/a (glob)
159 $TESTTMP/a (glob)
161 #endif
160 #endif
162
161
163 #if no-py3k
162 #if no-py3k
164 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
163 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
165 > import ambig # should load "libroot/mod/ambig.py"
164 > import ambig # should load "libroot/mod/ambig.py"
166 > s = ambig.s
165 > s = ambig.s
167 > EOF
166 > EOF
168 $ cat > loadrel.py <<EOF
167 $ cat > loadrel.py <<EOF
169 > import mod.ambigrel as ambigrel
168 > import mod.ambigrel as ambigrel
170 > def extsetup():
169 > def extsetup():
171 > print 'ambigrel.s=%s' % ambigrel.s
170 > print 'ambigrel.s=%s' % ambigrel.s
172 > EOF
171 > EOF
173 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
172 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
174 ambigrel.s=libroot/mod/ambig.py
173 ambigrel.s=libroot/mod/ambig.py
175 $TESTTMP/a (glob)
174 $TESTTMP/a (glob)
176 #endif
175 #endif
177
176
178 Check absolute/relative import of extension specific modules
177 Check absolute/relative import of extension specific modules
179
178
180 $ mkdir $TESTTMP/extroot
179 $ mkdir $TESTTMP/extroot
181 $ cat > $TESTTMP/extroot/bar.py <<EOF
180 $ cat > $TESTTMP/extroot/bar.py <<EOF
182 > s = 'this is extroot.bar'
181 > s = 'this is extroot.bar'
183 > EOF
182 > EOF
184 $ mkdir $TESTTMP/extroot/sub1
183 $ mkdir $TESTTMP/extroot/sub1
185 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
184 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
186 > s = 'this is extroot.sub1.__init__'
185 > s = 'this is extroot.sub1.__init__'
187 > EOF
186 > EOF
188 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
187 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
189 > s = 'this is extroot.sub1.baz'
188 > s = 'this is extroot.sub1.baz'
190 > EOF
189 > EOF
191 $ cat > $TESTTMP/extroot/__init__.py <<EOF
190 $ cat > $TESTTMP/extroot/__init__.py <<EOF
192 > s = 'this is extroot.__init__'
191 > s = 'this is extroot.__init__'
193 > import foo
192 > import foo
194 > def extsetup(ui):
193 > def extsetup(ui):
195 > ui.write('(extroot) ', foo.func(), '\n')
194 > ui.write('(extroot) ', foo.func(), '\n')
196 > EOF
195 > EOF
197
196
198 $ cat > $TESTTMP/extroot/foo.py <<EOF
197 $ cat > $TESTTMP/extroot/foo.py <<EOF
199 > # test absolute import
198 > # test absolute import
200 > buf = []
199 > buf = []
201 > def func():
200 > def func():
202 > # "not locals" case
201 > # "not locals" case
203 > import extroot.bar
202 > import extroot.bar
204 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
203 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
205 >
204 >
206 > return '\n(extroot) '.join(buf)
205 > return '\n(extroot) '.join(buf)
207 >
206 >
208 > # "fromlist == ('*',)" case
207 > # "fromlist == ('*',)" case
209 > from extroot.bar import *
208 > from extroot.bar import *
210 > buf.append('from extroot.bar import *: %s' % s)
209 > buf.append('from extroot.bar import *: %s' % s)
211 >
210 >
212 > # "not fromlist" and "if '.' in name" case
211 > # "not fromlist" and "if '.' in name" case
213 > import extroot.sub1.baz
212 > import extroot.sub1.baz
214 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
213 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
215 >
214 >
216 > # "not fromlist" and NOT "if '.' in name" case
215 > # "not fromlist" and NOT "if '.' in name" case
217 > import extroot
216 > import extroot
218 > buf.append('import extroot: %s' % extroot.s)
217 > buf.append('import extroot: %s' % extroot.s)
219 >
218 >
220 > # NOT "not fromlist" and NOT "level != -1" case
219 > # NOT "not fromlist" and NOT "level != -1" case
221 > from extroot.bar import s
220 > from extroot.bar import s
222 > buf.append('from extroot.bar import s: %s' % s)
221 > buf.append('from extroot.bar import s: %s' % s)
223 > EOF
222 > EOF
224 $ hg --config extensions.extroot=$TESTTMP/extroot root
223 $ hg --config extensions.extroot=$TESTTMP/extroot root
225 (extroot) from extroot.bar import *: this is extroot.bar
224 (extroot) from extroot.bar import *: this is extroot.bar
226 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
225 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
227 (extroot) import extroot: this is extroot.__init__
226 (extroot) import extroot: this is extroot.__init__
228 (extroot) from extroot.bar import s: this is extroot.bar
227 (extroot) from extroot.bar import s: this is extroot.bar
229 (extroot) import extroot.bar in func(): this is extroot.bar
228 (extroot) import extroot.bar in func(): this is extroot.bar
230 $TESTTMP/a (glob)
229 $TESTTMP/a (glob)
231
230
232 #if no-py3k
231 #if no-py3k
233 $ rm "$TESTTMP"/extroot/foo.*
232 $ rm "$TESTTMP"/extroot/foo.*
234 $ cat > $TESTTMP/extroot/foo.py <<EOF
233 $ cat > $TESTTMP/extroot/foo.py <<EOF
235 > # test relative import
234 > # test relative import
236 > buf = []
235 > buf = []
237 > def func():
236 > def func():
238 > # "not locals" case
237 > # "not locals" case
239 > import bar
238 > import bar
240 > buf.append('import bar in func(): %s' % bar.s)
239 > buf.append('import bar in func(): %s' % bar.s)
241 >
240 >
242 > return '\n(extroot) '.join(buf)
241 > return '\n(extroot) '.join(buf)
243 >
242 >
244 > # "fromlist == ('*',)" case
243 > # "fromlist == ('*',)" case
245 > from bar import *
244 > from bar import *
246 > buf.append('from bar import *: %s' % s)
245 > buf.append('from bar import *: %s' % s)
247 >
246 >
248 > # "not fromlist" and "if '.' in name" case
247 > # "not fromlist" and "if '.' in name" case
249 > import sub1.baz
248 > import sub1.baz
250 > buf.append('import sub1.baz: %s' % sub1.baz.s)
249 > buf.append('import sub1.baz: %s' % sub1.baz.s)
251 >
250 >
252 > # "not fromlist" and NOT "if '.' in name" case
251 > # "not fromlist" and NOT "if '.' in name" case
253 > import sub1
252 > import sub1
254 > buf.append('import sub1: %s' % sub1.s)
253 > buf.append('import sub1: %s' % sub1.s)
255 >
254 >
256 > # NOT "not fromlist" and NOT "level != -1" case
255 > # NOT "not fromlist" and NOT "level != -1" case
257 > from bar import s
256 > from bar import s
258 > buf.append('from bar import s: %s' % s)
257 > buf.append('from bar import s: %s' % s)
259 > EOF
258 > EOF
260 $ hg --config extensions.extroot=$TESTTMP/extroot root
259 $ hg --config extensions.extroot=$TESTTMP/extroot root
261 (extroot) from bar import *: this is extroot.bar
260 (extroot) from bar import *: this is extroot.bar
262 (extroot) import sub1.baz: this is extroot.sub1.baz
261 (extroot) import sub1.baz: this is extroot.sub1.baz
263 (extroot) import sub1: this is extroot.sub1.__init__
262 (extroot) import sub1: this is extroot.sub1.__init__
264 (extroot) from bar import s: this is extroot.bar
263 (extroot) from bar import s: this is extroot.bar
265 (extroot) import bar in func(): this is extroot.bar
264 (extroot) import bar in func(): this is extroot.bar
266 $TESTTMP/a (glob)
265 $TESTTMP/a (glob)
267 #endif
266 #endif
268
267
269 $ cd ..
268 $ cd ..
270
269
271 hide outer repo
270 hide outer repo
272 $ hg init
271 $ hg init
273
272
274 $ cat > empty.py <<EOF
273 $ cat > empty.py <<EOF
275 > '''empty cmdtable
274 > '''empty cmdtable
276 > '''
275 > '''
277 > cmdtable = {}
276 > cmdtable = {}
278 > EOF
277 > EOF
279 $ emptypath=`pwd`/empty.py
278 $ emptypath=`pwd`/empty.py
280 $ echo "empty = $emptypath" >> $HGRCPATH
279 $ echo "empty = $emptypath" >> $HGRCPATH
281 $ hg help empty
280 $ hg help empty
282 empty extension - empty cmdtable
281 empty extension - empty cmdtable
283
282
284 no commands defined
283 no commands defined
285
284
286 $ echo 'empty = !' >> $HGRCPATH
285 $ echo 'empty = !' >> $HGRCPATH
287
286
288 $ cat > debugextension.py <<EOF
287 $ cat > debugextension.py <<EOF
289 > '''only debugcommands
288 > '''only debugcommands
290 > '''
289 > '''
291 > from mercurial import cmdutil
290 > from mercurial import cmdutil
292 > cmdtable = {}
291 > cmdtable = {}
293 > command = cmdutil.command(cmdtable)
292 > command = cmdutil.command(cmdtable)
294 >
293 >
295 > @command('debugfoobar', [], 'hg debugfoobar')
294 > @command('debugfoobar', [], 'hg debugfoobar')
296 > def debugfoobar(ui, repo, *args, **opts):
295 > def debugfoobar(ui, repo, *args, **opts):
297 > "yet another debug command"
296 > "yet another debug command"
298 > pass
297 > pass
299 >
298 >
300 > @command('foo', [], 'hg foo')
299 > @command('foo', [], 'hg foo')
301 > def foo(ui, repo, *args, **opts):
300 > def foo(ui, repo, *args, **opts):
302 > """yet another foo command
301 > """yet another foo command
303 >
302 >
304 > This command has been DEPRECATED since forever.
303 > This command has been DEPRECATED since forever.
305 > """
304 > """
306 > pass
305 > pass
307 > EOF
306 > EOF
308 $ debugpath=`pwd`/debugextension.py
307 $ debugpath=`pwd`/debugextension.py
309 $ echo "debugextension = $debugpath" >> $HGRCPATH
308 $ echo "debugextension = $debugpath" >> $HGRCPATH
310
309
311 $ hg help debugextension
310 $ hg help debugextension
312 debugextension extension - only debugcommands
311 debugextension extension - only debugcommands
313
312
314 no commands defined
313 no commands defined
315
314
316 $ hg --verbose help debugextension
315 $ hg --verbose help debugextension
317 debugextension extension - only debugcommands
316 debugextension extension - only debugcommands
318
317
319 list of commands:
318 list of commands:
320
319
321 foo yet another foo command
320 foo yet another foo command
322
321
323 global options:
322 global options:
324
323
325 -R --repository REPO repository root directory or name of overlay bundle
324 -R --repository REPO repository root directory or name of overlay bundle
326 file
325 file
327 --cwd DIR change working directory
326 --cwd DIR change working directory
328 -y --noninteractive do not prompt, automatically pick the first choice for
327 -y --noninteractive do not prompt, automatically pick the first choice for
329 all prompts
328 all prompts
330 -q --quiet suppress output
329 -q --quiet suppress output
331 -v --verbose enable additional output
330 -v --verbose enable additional output
332 --config CONFIG [+] set/override config option (use 'section.name=value')
331 --config CONFIG [+] set/override config option (use 'section.name=value')
333 --debug enable debugging output
332 --debug enable debugging output
334 --debugger start debugger
333 --debugger start debugger
335 --encoding ENCODE set the charset encoding (default: ascii)
334 --encoding ENCODE set the charset encoding (default: ascii)
336 --encodingmode MODE set the charset encoding mode (default: strict)
335 --encodingmode MODE set the charset encoding mode (default: strict)
337 --traceback always print a traceback on exception
336 --traceback always print a traceback on exception
338 --time time how long the command takes
337 --time time how long the command takes
339 --profile print command execution profile
338 --profile print command execution profile
340 --version output version information and exit
339 --version output version information and exit
341 -h --help display help and exit
340 -h --help display help and exit
342 --hidden consider hidden changesets
341 --hidden consider hidden changesets
343
342
344 [+] marked option can be specified multiple times
343 [+] marked option can be specified multiple times
345
344
346 $ hg --debug help debugextension
345 $ hg --debug help debugextension
347 debugextension extension - only debugcommands
346 debugextension extension - only debugcommands
348
347
349 list of commands:
348 list of commands:
350
349
351 debugfoobar yet another debug command
350 debugfoobar yet another debug command
352 foo yet another foo command
351 foo yet another foo command
353
352
354 global options:
353 global options:
355
354
356 -R --repository REPO repository root directory or name of overlay bundle
355 -R --repository REPO repository root directory or name of overlay bundle
357 file
356 file
358 --cwd DIR change working directory
357 --cwd DIR change working directory
359 -y --noninteractive do not prompt, automatically pick the first choice for
358 -y --noninteractive do not prompt, automatically pick the first choice for
360 all prompts
359 all prompts
361 -q --quiet suppress output
360 -q --quiet suppress output
362 -v --verbose enable additional output
361 -v --verbose enable additional output
363 --config CONFIG [+] set/override config option (use 'section.name=value')
362 --config CONFIG [+] set/override config option (use 'section.name=value')
364 --debug enable debugging output
363 --debug enable debugging output
365 --debugger start debugger
364 --debugger start debugger
366 --encoding ENCODE set the charset encoding (default: ascii)
365 --encoding ENCODE set the charset encoding (default: ascii)
367 --encodingmode MODE set the charset encoding mode (default: strict)
366 --encodingmode MODE set the charset encoding mode (default: strict)
368 --traceback always print a traceback on exception
367 --traceback always print a traceback on exception
369 --time time how long the command takes
368 --time time how long the command takes
370 --profile print command execution profile
369 --profile print command execution profile
371 --version output version information and exit
370 --version output version information and exit
372 -h --help display help and exit
371 -h --help display help and exit
373 --hidden consider hidden changesets
372 --hidden consider hidden changesets
374
373
375 [+] marked option can be specified multiple times
374 [+] marked option can be specified multiple times
376 $ echo 'debugextension = !' >> $HGRCPATH
375 $ echo 'debugextension = !' >> $HGRCPATH
377
376
378 Extension module help vs command help:
377 Extension module help vs command help:
379
378
380 $ echo 'extdiff =' >> $HGRCPATH
379 $ echo 'extdiff =' >> $HGRCPATH
381 $ hg help extdiff
380 $ hg help extdiff
382 hg extdiff [OPT]... [FILE]...
381 hg extdiff [OPT]... [FILE]...
383
382
384 use external program to diff repository (or selected files)
383 use external program to diff repository (or selected files)
385
384
386 Show differences between revisions for the specified files, using an
385 Show differences between revisions for the specified files, using an
387 external program. The default program used is diff, with default options
386 external program. The default program used is diff, with default options
388 "-Npru".
387 "-Npru".
389
388
390 To select a different program, use the -p/--program option. The program
389 To select a different program, use the -p/--program option. The program
391 will be passed the names of two directories to compare. To pass additional
390 will be passed the names of two directories to compare. To pass additional
392 options to the program, use -o/--option. These will be passed before the
391 options to the program, use -o/--option. These will be passed before the
393 names of the directories to compare.
392 names of the directories to compare.
394
393
395 When two revision arguments are given, then changes are shown between
394 When two revision arguments are given, then changes are shown between
396 those revisions. If only one revision is specified then that revision is
395 those revisions. If only one revision is specified then that revision is
397 compared to the working directory, and, when no revisions are specified,
396 compared to the working directory, and, when no revisions are specified,
398 the working directory files are compared to its parent.
397 the working directory files are compared to its parent.
399
398
400 use "hg help -e extdiff" to show help for the extdiff extension
399 use "hg help -e extdiff" to show help for the extdiff extension
401
400
402 options:
401 options:
403
402
404 -p --program CMD comparison program to run
403 -p --program CMD comparison program to run
405 -o --option OPT [+] pass option to comparison program
404 -o --option OPT [+] pass option to comparison program
406 -r --rev REV [+] revision
405 -r --rev REV [+] revision
407 -c --change REV change made by revision
406 -c --change REV change made by revision
408 -I --include PATTERN [+] include names matching the given patterns
407 -I --include PATTERN [+] include names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
408 -X --exclude PATTERN [+] exclude names matching the given patterns
410
409
411 [+] marked option can be specified multiple times
410 [+] marked option can be specified multiple times
412
411
413 use "hg -v help extdiff" to show the global options
412 use "hg -v help extdiff" to show the global options
414
413
415 $ hg help --extension extdiff
414 $ hg help --extension extdiff
416 extdiff extension - command to allow external programs to compare revisions
415 extdiff extension - command to allow external programs to compare revisions
417
416
418 The extdiff Mercurial extension allows you to use external programs to compare
417 The extdiff Mercurial extension allows you to use external programs to compare
419 revisions, or revision with working directory. The external diff programs are
418 revisions, or revision with working directory. The external diff programs are
420 called with a configurable set of options and two non-option arguments: paths
419 called with a configurable set of options and two non-option arguments: paths
421 to directories containing snapshots of files to compare.
420 to directories containing snapshots of files to compare.
422
421
423 The extdiff extension also allows you to configure new diff commands, so you
422 The extdiff extension also allows you to configure new diff commands, so you
424 do not need to type "hg extdiff -p kdiff3" always.
423 do not need to type "hg extdiff -p kdiff3" always.
425
424
426 [extdiff]
425 [extdiff]
427 # add new command that runs GNU diff(1) in 'context diff' mode
426 # add new command that runs GNU diff(1) in 'context diff' mode
428 cdiff = gdiff -Nprc5
427 cdiff = gdiff -Nprc5
429 ## or the old way:
428 ## or the old way:
430 #cmd.cdiff = gdiff
429 #cmd.cdiff = gdiff
431 #opts.cdiff = -Nprc5
430 #opts.cdiff = -Nprc5
432
431
433 # add new command called vdiff, runs kdiff3
432 # add new command called vdiff, runs kdiff3
434 vdiff = kdiff3
433 vdiff = kdiff3
435
434
436 # add new command called meld, runs meld (no need to name twice)
435 # add new command called meld, runs meld (no need to name twice)
437 meld =
436 meld =
438
437
439 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
438 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
440 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
439 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
441 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
440 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
442 # your .vimrc
441 # your .vimrc
443 vimdiff = gvim -f "+next" \
442 vimdiff = gvim -f "+next" \
444 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
443 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
445
444
446 Tool arguments can include variables that are expanded at runtime:
445 Tool arguments can include variables that are expanded at runtime:
447
446
448 $parent1, $plabel1 - filename, descriptive label of first parent
447 $parent1, $plabel1 - filename, descriptive label of first parent
449 $child, $clabel - filename, descriptive label of child revision
448 $child, $clabel - filename, descriptive label of child revision
450 $parent2, $plabel2 - filename, descriptive label of second parent
449 $parent2, $plabel2 - filename, descriptive label of second parent
451 $root - repository root
450 $root - repository root
452 $parent is an alias for $parent1.
451 $parent is an alias for $parent1.
453
452
454 The extdiff extension will look in your [diff-tools] and [merge-tools]
453 The extdiff extension will look in your [diff-tools] and [merge-tools]
455 sections for diff tool arguments, when none are specified in [extdiff].
454 sections for diff tool arguments, when none are specified in [extdiff].
456
455
457 [extdiff]
456 [extdiff]
458 kdiff3 =
457 kdiff3 =
459
458
460 [diff-tools]
459 [diff-tools]
461 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
460 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
462
461
463 You can use -I/-X and list of file or directory names like normal "hg diff"
462 You can use -I/-X and list of file or directory names like normal "hg diff"
464 command. The extdiff extension makes snapshots of only needed files, so
463 command. The extdiff extension makes snapshots of only needed files, so
465 running the external diff program will actually be pretty fast (at least
464 running the external diff program will actually be pretty fast (at least
466 faster than having to compare the entire tree).
465 faster than having to compare the entire tree).
467
466
468 list of commands:
467 list of commands:
469
468
470 extdiff use external program to diff repository (or selected files)
469 extdiff use external program to diff repository (or selected files)
471
470
472 use "hg -v help extdiff" to show builtin aliases and global options
471 use "hg -v help extdiff" to show builtin aliases and global options
473
472
474 $ echo 'extdiff = !' >> $HGRCPATH
473 $ echo 'extdiff = !' >> $HGRCPATH
475
474
476 Test help topic with same name as extension
475 Test help topic with same name as extension
477
476
478 $ cat > multirevs.py <<EOF
477 $ cat > multirevs.py <<EOF
479 > from mercurial import cmdutil, commands
478 > from mercurial import cmdutil, commands
480 > cmdtable = {}
479 > cmdtable = {}
481 > command = cmdutil.command(cmdtable)
480 > command = cmdutil.command(cmdtable)
482 > """multirevs extension
481 > """multirevs extension
483 > Big multi-line module docstring."""
482 > Big multi-line module docstring."""
484 > @command('multirevs', [], 'ARG')
483 > @command('multirevs', [], 'ARG', norepo=True)
485 > def multirevs(ui, repo, arg, *args, **opts):
484 > def multirevs(ui, repo, arg, *args, **opts):
486 > """multirevs command"""
485 > """multirevs command"""
487 > pass
486 > pass
488 > commands.norepo += ' multirevs'
489 > EOF
487 > EOF
490 $ echo "multirevs = multirevs.py" >> $HGRCPATH
488 $ echo "multirevs = multirevs.py" >> $HGRCPATH
491
489
492 $ hg help multirevs
490 $ hg help multirevs
493 Specifying Multiple Revisions
491 Specifying Multiple Revisions
494 """""""""""""""""""""""""""""
492 """""""""""""""""""""""""""""
495
493
496 When Mercurial accepts more than one revision, they may be specified
494 When Mercurial accepts more than one revision, they may be specified
497 individually, or provided as a topologically continuous range, separated
495 individually, or provided as a topologically continuous range, separated
498 by the ":" character.
496 by the ":" character.
499
497
500 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
498 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
501 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
499 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
502 specified, it defaults to revision number 0. If END is not specified, it
500 specified, it defaults to revision number 0. If END is not specified, it
503 defaults to the tip. The range ":" thus means "all revisions".
501 defaults to the tip. The range ":" thus means "all revisions".
504
502
505 If BEGIN is greater than END, revisions are treated in reverse order.
503 If BEGIN is greater than END, revisions are treated in reverse order.
506
504
507 A range acts as a closed interval. This means that a range of 3:5 gives 3,
505 A range acts as a closed interval. This means that a range of 3:5 gives 3,
508 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
506 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
509
507
510 use "hg help -c multirevs" to see help for the multirevs command
508 use "hg help -c multirevs" to see help for the multirevs command
511
509
512 $ hg help -c multirevs
510 $ hg help -c multirevs
513 hg multirevs ARG
511 hg multirevs ARG
514
512
515 multirevs command
513 multirevs command
516
514
517 use "hg -v help multirevs" to show the global options
515 use "hg -v help multirevs" to show the global options
518
516
519 $ hg multirevs
517 $ hg multirevs
520 hg multirevs: invalid arguments
518 hg multirevs: invalid arguments
521 hg multirevs ARG
519 hg multirevs ARG
522
520
523 multirevs command
521 multirevs command
524
522
525 use "hg help multirevs" to show the full help text
523 use "hg help multirevs" to show the full help text
526 [255]
524 [255]
527
525
528 $ echo "multirevs = !" >> $HGRCPATH
526 $ echo "multirevs = !" >> $HGRCPATH
529
527
530 Issue811: Problem loading extensions twice (by site and by user)
528 Issue811: Problem loading extensions twice (by site and by user)
531
529
532 $ debugpath=`pwd`/debugissue811.py
530 $ debugpath=`pwd`/debugissue811.py
533 $ cat > debugissue811.py <<EOF
531 $ cat > debugissue811.py <<EOF
534 > '''show all loaded extensions
532 > '''show all loaded extensions
535 > '''
533 > '''
536 > from mercurial import cmdutil, commands, extensions
534 > from mercurial import cmdutil, commands, extensions
537 > cmdtable = {}
535 > cmdtable = {}
538 > command = cmdutil.command(cmdtable)
536 > command = cmdutil.command(cmdtable)
539 >
537 >
540 > @command('debugextensions', [], 'hg debugextensions')
538 > @command('debugextensions', [], 'hg debugextensions', norepo=True)
541 > def debugextensions(ui):
539 > def debugextensions(ui):
542 > "yet another debug command"
540 > "yet another debug command"
543 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
541 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
544 >
542 >
545 > commands.norepo += " debugextensions"
546 > EOF
543 > EOF
547 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
544 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
548 $ echo "mq=" >> $HGRCPATH
545 $ echo "mq=" >> $HGRCPATH
549 $ echo "strip=" >> $HGRCPATH
546 $ echo "strip=" >> $HGRCPATH
550 $ echo "hgext.mq=" >> $HGRCPATH
547 $ echo "hgext.mq=" >> $HGRCPATH
551 $ echo "hgext/mq=" >> $HGRCPATH
548 $ echo "hgext/mq=" >> $HGRCPATH
552
549
553 Show extensions:
550 Show extensions:
554 (note that mq force load strip, also checking it's not loaded twice)
551 (note that mq force load strip, also checking it's not loaded twice)
555
552
556 $ hg debugextensions
553 $ hg debugextensions
557 debugissue811
554 debugissue811
558 strip
555 strip
559 mq
556 mq
560
557
561 Disabled extension commands:
558 Disabled extension commands:
562
559
563 $ ORGHGRCPATH=$HGRCPATH
560 $ ORGHGRCPATH=$HGRCPATH
564 $ HGRCPATH=
561 $ HGRCPATH=
565 $ export HGRCPATH
562 $ export HGRCPATH
566 $ hg help email
563 $ hg help email
567 'email' is provided by the following extension:
564 'email' is provided by the following extension:
568
565
569 patchbomb command to send changesets as (a series of) patch emails
566 patchbomb command to send changesets as (a series of) patch emails
570
567
571 use "hg help extensions" for information on enabling extensions
568 use "hg help extensions" for information on enabling extensions
572 $ hg qdel
569 $ hg qdel
573 hg: unknown command 'qdel'
570 hg: unknown command 'qdel'
574 'qdelete' is provided by the following extension:
571 'qdelete' is provided by the following extension:
575
572
576 mq manage a stack of patches
573 mq manage a stack of patches
577
574
578 use "hg help extensions" for information on enabling extensions
575 use "hg help extensions" for information on enabling extensions
579 [255]
576 [255]
580 $ hg churn
577 $ hg churn
581 hg: unknown command 'churn'
578 hg: unknown command 'churn'
582 'churn' is provided by the following extension:
579 'churn' is provided by the following extension:
583
580
584 churn command to display statistics about repository history
581 churn command to display statistics about repository history
585
582
586 use "hg help extensions" for information on enabling extensions
583 use "hg help extensions" for information on enabling extensions
587 [255]
584 [255]
588
585
589 Disabled extensions:
586 Disabled extensions:
590
587
591 $ hg help churn
588 $ hg help churn
592 churn extension - command to display statistics about repository history
589 churn extension - command to display statistics about repository history
593
590
594 use "hg help extensions" for information on enabling extensions
591 use "hg help extensions" for information on enabling extensions
595 $ hg help patchbomb
592 $ hg help patchbomb
596 patchbomb extension - command to send changesets as (a series of) patch emails
593 patchbomb extension - command to send changesets as (a series of) patch emails
597
594
598 use "hg help extensions" for information on enabling extensions
595 use "hg help extensions" for information on enabling extensions
599
596
600 Broken disabled extension and command:
597 Broken disabled extension and command:
601
598
602 $ mkdir hgext
599 $ mkdir hgext
603 $ echo > hgext/__init__.py
600 $ echo > hgext/__init__.py
604 $ cat > hgext/broken.py <<EOF
601 $ cat > hgext/broken.py <<EOF
605 > "broken extension'
602 > "broken extension'
606 > EOF
603 > EOF
607 $ cat > path.py <<EOF
604 $ cat > path.py <<EOF
608 > import os, sys
605 > import os, sys
609 > sys.path.insert(0, os.environ['HGEXTPATH'])
606 > sys.path.insert(0, os.environ['HGEXTPATH'])
610 > EOF
607 > EOF
611 $ HGEXTPATH=`pwd`
608 $ HGEXTPATH=`pwd`
612 $ export HGEXTPATH
609 $ export HGEXTPATH
613
610
614 $ hg --config extensions.path=./path.py help broken
611 $ hg --config extensions.path=./path.py help broken
615 broken extension - (no help text available)
612 broken extension - (no help text available)
616
613
617 use "hg help extensions" for information on enabling extensions
614 use "hg help extensions" for information on enabling extensions
618
615
619 $ cat > hgext/forest.py <<EOF
616 $ cat > hgext/forest.py <<EOF
620 > cmdtable = None
617 > cmdtable = None
621 > EOF
618 > EOF
622 $ hg --config extensions.path=./path.py help foo > /dev/null
619 $ hg --config extensions.path=./path.py help foo > /dev/null
623 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
620 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
624 abort: no such help topic: foo
621 abort: no such help topic: foo
625 (try "hg help --keyword foo")
622 (try "hg help --keyword foo")
626 [255]
623 [255]
627
624
628 $ cat > throw.py <<EOF
625 $ cat > throw.py <<EOF
629 > from mercurial import cmdutil, commands
626 > from mercurial import cmdutil, commands
630 > cmdtable = {}
627 > cmdtable = {}
631 > command = cmdutil.command(cmdtable)
628 > command = cmdutil.command(cmdtable)
632 > class Bogon(Exception): pass
629 > class Bogon(Exception): pass
633 >
630 >
634 > @command('throw', [], 'hg throw')
631 > @command('throw', [], 'hg throw', norepo=True)
635 > def throw(ui, **opts):
632 > def throw(ui, **opts):
636 > """throws an exception"""
633 > """throws an exception"""
637 > raise Bogon()
634 > raise Bogon()
638 > commands.norepo += " throw"
639 > EOF
635 > EOF
640 No declared supported version, extension complains:
636 No declared supported version, extension complains:
641 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
637 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
642 ** Unknown exception encountered with possibly-broken third-party extension throw
638 ** Unknown exception encountered with possibly-broken third-party extension throw
643 ** which supports versions unknown of Mercurial.
639 ** which supports versions unknown of Mercurial.
644 ** Please disable throw and try your action again.
640 ** Please disable throw and try your action again.
645 ** If that fixes the bug please report it to the extension author.
641 ** If that fixes the bug please report it to the extension author.
646 ** Python * (glob)
642 ** Python * (glob)
647 ** Mercurial Distributed SCM * (glob)
643 ** Mercurial Distributed SCM * (glob)
648 ** Extensions loaded: throw
644 ** Extensions loaded: throw
649 empty declaration of supported version, extension complains:
645 empty declaration of supported version, extension complains:
650 $ echo "testedwith = ''" >> throw.py
646 $ echo "testedwith = ''" >> throw.py
651 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
647 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
652 ** Unknown exception encountered with possibly-broken third-party extension throw
648 ** Unknown exception encountered with possibly-broken third-party extension throw
653 ** which supports versions unknown of Mercurial.
649 ** which supports versions unknown of Mercurial.
654 ** Please disable throw and try your action again.
650 ** Please disable throw and try your action again.
655 ** If that fixes the bug please report it to the extension author.
651 ** If that fixes the bug please report it to the extension author.
656 ** Python * (glob)
652 ** Python * (glob)
657 ** Mercurial Distributed SCM (*) (glob)
653 ** Mercurial Distributed SCM (*) (glob)
658 ** Extensions loaded: throw
654 ** Extensions loaded: throw
659 If the extension specifies a buglink, show that:
655 If the extension specifies a buglink, show that:
660 $ echo 'buglink = "http://example.com/bts"' >> throw.py
656 $ echo 'buglink = "http://example.com/bts"' >> throw.py
661 $ rm -f throw.pyc throw.pyo
657 $ rm -f throw.pyc throw.pyo
662 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
658 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
663 ** Unknown exception encountered with possibly-broken third-party extension throw
659 ** Unknown exception encountered with possibly-broken third-party extension throw
664 ** which supports versions unknown of Mercurial.
660 ** which supports versions unknown of Mercurial.
665 ** Please disable throw and try your action again.
661 ** Please disable throw and try your action again.
666 ** If that fixes the bug please report it to http://example.com/bts
662 ** If that fixes the bug please report it to http://example.com/bts
667 ** Python * (glob)
663 ** Python * (glob)
668 ** Mercurial Distributed SCM (*) (glob)
664 ** Mercurial Distributed SCM (*) (glob)
669 ** Extensions loaded: throw
665 ** Extensions loaded: throw
670 If the extensions declare outdated versions, accuse the older extension first:
666 If the extensions declare outdated versions, accuse the older extension first:
671 $ echo "from mercurial import util" >> older.py
667 $ echo "from mercurial import util" >> older.py
672 $ echo "util.version = lambda:'2.2'" >> older.py
668 $ echo "util.version = lambda:'2.2'" >> older.py
673 $ echo "testedwith = '1.9.3'" >> older.py
669 $ echo "testedwith = '1.9.3'" >> older.py
674 $ echo "testedwith = '2.1.1'" >> throw.py
670 $ echo "testedwith = '2.1.1'" >> throw.py
675 $ rm -f throw.pyc throw.pyo
671 $ rm -f throw.pyc throw.pyo
676 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
672 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
677 > throw 2>&1 | egrep '^\*\*'
673 > throw 2>&1 | egrep '^\*\*'
678 ** Unknown exception encountered with possibly-broken third-party extension older
674 ** Unknown exception encountered with possibly-broken third-party extension older
679 ** which supports versions 1.9.3 of Mercurial.
675 ** which supports versions 1.9.3 of Mercurial.
680 ** Please disable older and try your action again.
676 ** Please disable older and try your action again.
681 ** If that fixes the bug please report it to the extension author.
677 ** If that fixes the bug please report it to the extension author.
682 ** Python * (glob)
678 ** Python * (glob)
683 ** Mercurial Distributed SCM (version 2.2)
679 ** Mercurial Distributed SCM (version 2.2)
684 ** Extensions loaded: throw, older
680 ** Extensions loaded: throw, older
685 One extension only tested with older, one only with newer versions:
681 One extension only tested with older, one only with newer versions:
686 $ echo "util.version = lambda:'2.1.0'" >> older.py
682 $ echo "util.version = lambda:'2.1.0'" >> older.py
687 $ rm -f older.pyc older.pyo
683 $ rm -f older.pyc older.pyo
688 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
684 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
689 > throw 2>&1 | egrep '^\*\*'
685 > throw 2>&1 | egrep '^\*\*'
690 ** Unknown exception encountered with possibly-broken third-party extension older
686 ** Unknown exception encountered with possibly-broken third-party extension older
691 ** which supports versions 1.9.3 of Mercurial.
687 ** which supports versions 1.9.3 of Mercurial.
692 ** Please disable older and try your action again.
688 ** Please disable older and try your action again.
693 ** If that fixes the bug please report it to the extension author.
689 ** If that fixes the bug please report it to the extension author.
694 ** Python * (glob)
690 ** Python * (glob)
695 ** Mercurial Distributed SCM (version 2.1.0)
691 ** Mercurial Distributed SCM (version 2.1.0)
696 ** Extensions loaded: throw, older
692 ** Extensions loaded: throw, older
697 Older extension is tested with current version, the other only with newer:
693 Older extension is tested with current version, the other only with newer:
698 $ echo "util.version = lambda:'1.9.3'" >> older.py
694 $ echo "util.version = lambda:'1.9.3'" >> older.py
699 $ rm -f older.pyc older.pyo
695 $ rm -f older.pyc older.pyo
700 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
696 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
701 > throw 2>&1 | egrep '^\*\*'
697 > throw 2>&1 | egrep '^\*\*'
702 ** Unknown exception encountered with possibly-broken third-party extension throw
698 ** Unknown exception encountered with possibly-broken third-party extension throw
703 ** which supports versions 2.1.1 of Mercurial.
699 ** which supports versions 2.1.1 of Mercurial.
704 ** Please disable throw and try your action again.
700 ** Please disable throw and try your action again.
705 ** If that fixes the bug please report it to http://example.com/bts
701 ** If that fixes the bug please report it to http://example.com/bts
706 ** Python * (glob)
702 ** Python * (glob)
707 ** Mercurial Distributed SCM (version 1.9.3)
703 ** Mercurial Distributed SCM (version 1.9.3)
708 ** Extensions loaded: throw, older
704 ** Extensions loaded: throw, older
709
705
710 Declare the version as supporting this hg version, show regular bts link:
706 Declare the version as supporting this hg version, show regular bts link:
711 $ hgver=`python -c 'from mercurial import util; print util.version().split("+")[0]'`
707 $ hgver=`python -c 'from mercurial import util; print util.version().split("+")[0]'`
712 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
708 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
713 $ rm -f throw.pyc throw.pyo
709 $ rm -f throw.pyc throw.pyo
714 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
710 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
715 ** unknown exception encountered, please report by visiting
711 ** unknown exception encountered, please report by visiting
716 ** http://mercurial.selenic.com/wiki/BugTracker
712 ** http://mercurial.selenic.com/wiki/BugTracker
717 ** Python * (glob)
713 ** Python * (glob)
718 ** Mercurial Distributed SCM (*) (glob)
714 ** Mercurial Distributed SCM (*) (glob)
719 ** Extensions loaded: throw
715 ** Extensions loaded: throw
720
716
721 Restore HGRCPATH
717 Restore HGRCPATH
722
718
723 $ HGRCPATH=$ORGHGRCPATH
719 $ HGRCPATH=$ORGHGRCPATH
724 $ export HGRCPATH
720 $ export HGRCPATH
725
721
726 Commands handling multiple repositories at a time should invoke only
722 Commands handling multiple repositories at a time should invoke only
727 "reposetup()" of extensions enabling in the target repository.
723 "reposetup()" of extensions enabling in the target repository.
728
724
729 $ mkdir reposetup-test
725 $ mkdir reposetup-test
730 $ cd reposetup-test
726 $ cd reposetup-test
731
727
732 $ cat > $TESTTMP/reposetuptest.py <<EOF
728 $ cat > $TESTTMP/reposetuptest.py <<EOF
733 > from mercurial import extensions
729 > from mercurial import extensions
734 > def reposetup(ui, repo):
730 > def reposetup(ui, repo):
735 > ui.write('reposetup() for %s\n' % (repo.root))
731 > ui.write('reposetup() for %s\n' % (repo.root))
736 > EOF
732 > EOF
737 $ hg init src
733 $ hg init src
738 $ echo a > src/a
734 $ echo a > src/a
739 $ hg -R src commit -Am '#0 at src/a'
735 $ hg -R src commit -Am '#0 at src/a'
740 adding a
736 adding a
741 $ echo '[extensions]' >> src/.hg/hgrc
737 $ echo '[extensions]' >> src/.hg/hgrc
742 $ echo '# enable extension locally' >> src/.hg/hgrc
738 $ echo '# enable extension locally' >> src/.hg/hgrc
743 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
739 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
744 $ hg -R src status
740 $ hg -R src status
745 reposetup() for $TESTTMP/reposetup-test/src (glob)
741 reposetup() for $TESTTMP/reposetup-test/src (glob)
746
742
747 $ hg clone -U src clone-dst1
743 $ hg clone -U src clone-dst1
748 reposetup() for $TESTTMP/reposetup-test/src (glob)
744 reposetup() for $TESTTMP/reposetup-test/src (glob)
749 $ hg init push-dst1
745 $ hg init push-dst1
750 $ hg -q -R src push push-dst1
746 $ hg -q -R src push push-dst1
751 reposetup() for $TESTTMP/reposetup-test/src (glob)
747 reposetup() for $TESTTMP/reposetup-test/src (glob)
752 $ hg init pull-src1
748 $ hg init pull-src1
753 $ hg -q -R pull-src1 pull src
749 $ hg -q -R pull-src1 pull src
754 reposetup() for $TESTTMP/reposetup-test/src (glob)
750 reposetup() for $TESTTMP/reposetup-test/src (glob)
755
751
756 $ echo '[extensions]' >> $HGRCPATH
752 $ echo '[extensions]' >> $HGRCPATH
757 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
753 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
758 $ echo 'reposetuptest = !' >> $HGRCPATH
754 $ echo 'reposetuptest = !' >> $HGRCPATH
759 $ hg clone -U src clone-dst2
755 $ hg clone -U src clone-dst2
760 reposetup() for $TESTTMP/reposetup-test/src (glob)
756 reposetup() for $TESTTMP/reposetup-test/src (glob)
761 $ hg init push-dst2
757 $ hg init push-dst2
762 $ hg -q -R src push push-dst2
758 $ hg -q -R src push push-dst2
763 reposetup() for $TESTTMP/reposetup-test/src (glob)
759 reposetup() for $TESTTMP/reposetup-test/src (glob)
764 $ hg init pull-src2
760 $ hg init pull-src2
765 $ hg -q -R pull-src2 pull src
761 $ hg -q -R pull-src2 pull src
766 reposetup() for $TESTTMP/reposetup-test/src (glob)
762 reposetup() for $TESTTMP/reposetup-test/src (glob)
767
763
768 $ echo '[extensions]' >> $HGRCPATH
764 $ echo '[extensions]' >> $HGRCPATH
769 $ echo '# enable extension globally' >> $HGRCPATH
765 $ echo '# enable extension globally' >> $HGRCPATH
770 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
766 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
771 $ hg clone -U src clone-dst3
767 $ hg clone -U src clone-dst3
772 reposetup() for $TESTTMP/reposetup-test/src (glob)
768 reposetup() for $TESTTMP/reposetup-test/src (glob)
773 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
769 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
774 $ hg init push-dst3
770 $ hg init push-dst3
775 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
771 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
776 $ hg -q -R src push push-dst3
772 $ hg -q -R src push push-dst3
777 reposetup() for $TESTTMP/reposetup-test/src (glob)
773 reposetup() for $TESTTMP/reposetup-test/src (glob)
778 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
774 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
779 $ hg init pull-src3
775 $ hg init pull-src3
780 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
776 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
781 $ hg -q -R pull-src3 pull src
777 $ hg -q -R pull-src3 pull src
782 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
778 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
783 reposetup() for $TESTTMP/reposetup-test/src (glob)
779 reposetup() for $TESTTMP/reposetup-test/src (glob)
784
780
785 $ echo '[extensions]' >> src/.hg/hgrc
781 $ echo '[extensions]' >> src/.hg/hgrc
786 $ echo '# disable extension locally' >> src/.hg/hgrc
782 $ echo '# disable extension locally' >> src/.hg/hgrc
787 $ echo 'reposetuptest = !' >> src/.hg/hgrc
783 $ echo 'reposetuptest = !' >> src/.hg/hgrc
788 $ hg clone -U src clone-dst4
784 $ hg clone -U src clone-dst4
789 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
785 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
790 $ hg init push-dst4
786 $ hg init push-dst4
791 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
787 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
792 $ hg -q -R src push push-dst4
788 $ hg -q -R src push push-dst4
793 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
789 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
794 $ hg init pull-src4
790 $ hg init pull-src4
795 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
791 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
796 $ hg -q -R pull-src4 pull src
792 $ hg -q -R pull-src4 pull src
797 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
793 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
798
794
799 disabling in command line overlays with all configuration
795 disabling in command line overlays with all configuration
800 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
796 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
801 $ hg --config extensions.reposetuptest=! init push-dst5
797 $ hg --config extensions.reposetuptest=! init push-dst5
802 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
798 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
803 $ hg --config extensions.reposetuptest=! init pull-src5
799 $ hg --config extensions.reposetuptest=! init pull-src5
804 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
800 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
805
801
806 $ echo '[extensions]' >> $HGRCPATH
802 $ echo '[extensions]' >> $HGRCPATH
807 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
803 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
808 $ echo 'reposetuptest = !' >> $HGRCPATH
804 $ echo 'reposetuptest = !' >> $HGRCPATH
809 $ hg init parent
805 $ hg init parent
810 $ hg init parent/sub1
806 $ hg init parent/sub1
811 $ echo 1 > parent/sub1/1
807 $ echo 1 > parent/sub1/1
812 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
808 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
813 adding 1
809 adding 1
814 $ hg init parent/sub2
810 $ hg init parent/sub2
815 $ hg init parent/sub2/sub21
811 $ hg init parent/sub2/sub21
816 $ echo 21 > parent/sub2/sub21/21
812 $ echo 21 > parent/sub2/sub21/21
817 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
813 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
818 adding 21
814 adding 21
819 $ cat > parent/sub2/.hgsub <<EOF
815 $ cat > parent/sub2/.hgsub <<EOF
820 > sub21 = sub21
816 > sub21 = sub21
821 > EOF
817 > EOF
822 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
818 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
823 adding .hgsub
819 adding .hgsub
824 $ hg init parent/sub3
820 $ hg init parent/sub3
825 $ echo 3 > parent/sub3/3
821 $ echo 3 > parent/sub3/3
826 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
822 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
827 adding 3
823 adding 3
828 $ cat > parent/.hgsub <<EOF
824 $ cat > parent/.hgsub <<EOF
829 > sub1 = sub1
825 > sub1 = sub1
830 > sub2 = sub2
826 > sub2 = sub2
831 > sub3 = sub3
827 > sub3 = sub3
832 > EOF
828 > EOF
833 $ hg -R parent commit -Am '#0 at parent'
829 $ hg -R parent commit -Am '#0 at parent'
834 adding .hgsub
830 adding .hgsub
835 $ echo '[extensions]' >> parent/.hg/hgrc
831 $ echo '[extensions]' >> parent/.hg/hgrc
836 $ echo '# enable extension locally' >> parent/.hg/hgrc
832 $ echo '# enable extension locally' >> parent/.hg/hgrc
837 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
833 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
838 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
834 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
839 $ hg -R parent status -S -A
835 $ hg -R parent status -S -A
840 reposetup() for $TESTTMP/reposetup-test/parent (glob)
836 reposetup() for $TESTTMP/reposetup-test/parent (glob)
841 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
837 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
842 C .hgsub
838 C .hgsub
843 C .hgsubstate
839 C .hgsubstate
844 C sub1/1
840 C sub1/1
845 C sub2/.hgsub
841 C sub2/.hgsub
846 C sub2/.hgsubstate
842 C sub2/.hgsubstate
847 C sub2/sub21/21
843 C sub2/sub21/21
848 C sub3/3
844 C sub3/3
849
845
850 $ cd ..
846 $ cd ..
@@ -1,2087 +1,2087 b''
1 Short help:
1 Short help:
2
2
3 $ hg
3 $ hg
4 Mercurial Distributed SCM
4 Mercurial Distributed SCM
5
5
6 basic commands:
6 basic commands:
7
7
8 add add the specified files on the next commit
8 add add the specified files on the next commit
9 annotate show changeset information by line for each file
9 annotate show changeset information by line for each file
10 clone make a copy of an existing repository
10 clone make a copy of an existing repository
11 commit commit the specified files or all outstanding changes
11 commit commit the specified files or all outstanding changes
12 diff diff repository (or selected files)
12 diff diff repository (or selected files)
13 export dump the header and diffs for one or more changesets
13 export dump the header and diffs for one or more changesets
14 forget forget the specified files on the next commit
14 forget forget the specified files on the next commit
15 init create a new repository in the given directory
15 init create a new repository in the given directory
16 log show revision history of entire repository or files
16 log show revision history of entire repository or files
17 merge merge working directory with another revision
17 merge merge working directory with another revision
18 pull pull changes from the specified source
18 pull pull changes from the specified source
19 push push changes to the specified destination
19 push push changes to the specified destination
20 remove remove the specified files on the next commit
20 remove remove the specified files on the next commit
21 serve start stand-alone webserver
21 serve start stand-alone webserver
22 status show changed files in the working directory
22 status show changed files in the working directory
23 summary summarize working directory state
23 summary summarize working directory state
24 update update working directory (or switch revisions)
24 update update working directory (or switch revisions)
25
25
26 use "hg help" for the full list of commands or "hg -v" for details
26 use "hg help" for the full list of commands or "hg -v" for details
27
27
28 $ hg -q
28 $ hg -q
29 add add the specified files on the next commit
29 add add the specified files on the next commit
30 annotate show changeset information by line for each file
30 annotate show changeset information by line for each file
31 clone make a copy of an existing repository
31 clone make a copy of an existing repository
32 commit commit the specified files or all outstanding changes
32 commit commit the specified files or all outstanding changes
33 diff diff repository (or selected files)
33 diff diff repository (or selected files)
34 export dump the header and diffs for one or more changesets
34 export dump the header and diffs for one or more changesets
35 forget forget the specified files on the next commit
35 forget forget the specified files on the next commit
36 init create a new repository in the given directory
36 init create a new repository in the given directory
37 log show revision history of entire repository or files
37 log show revision history of entire repository or files
38 merge merge working directory with another revision
38 merge merge working directory with another revision
39 pull pull changes from the specified source
39 pull pull changes from the specified source
40 push push changes to the specified destination
40 push push changes to the specified destination
41 remove remove the specified files on the next commit
41 remove remove the specified files on the next commit
42 serve start stand-alone webserver
42 serve start stand-alone webserver
43 status show changed files in the working directory
43 status show changed files in the working directory
44 summary summarize working directory state
44 summary summarize working directory state
45 update update working directory (or switch revisions)
45 update update working directory (or switch revisions)
46
46
47 $ hg help
47 $ hg help
48 Mercurial Distributed SCM
48 Mercurial Distributed SCM
49
49
50 list of commands:
50 list of commands:
51
51
52 add add the specified files on the next commit
52 add add the specified files on the next commit
53 addremove add all new files, delete all missing files
53 addremove add all new files, delete all missing files
54 annotate show changeset information by line for each file
54 annotate show changeset information by line for each file
55 archive create an unversioned archive of a repository revision
55 archive create an unversioned archive of a repository revision
56 backout reverse effect of earlier changeset
56 backout reverse effect of earlier changeset
57 bisect subdivision search of changesets
57 bisect subdivision search of changesets
58 bookmarks create a new bookmark or list existing bookmarks
58 bookmarks create a new bookmark or list existing bookmarks
59 branch set or show the current branch name
59 branch set or show the current branch name
60 branches list repository named branches
60 branches list repository named branches
61 bundle create a changegroup file
61 bundle create a changegroup file
62 cat output the current or given revision of files
62 cat output the current or given revision of files
63 clone make a copy of an existing repository
63 clone make a copy of an existing repository
64 commit commit the specified files or all outstanding changes
64 commit commit the specified files or all outstanding changes
65 config show combined config settings from all hgrc files
65 config show combined config settings from all hgrc files
66 copy mark files as copied for the next commit
66 copy mark files as copied for the next commit
67 diff diff repository (or selected files)
67 diff diff repository (or selected files)
68 export dump the header and diffs for one or more changesets
68 export dump the header and diffs for one or more changesets
69 forget forget the specified files on the next commit
69 forget forget the specified files on the next commit
70 graft copy changes from other branches onto the current branch
70 graft copy changes from other branches onto the current branch
71 grep search for a pattern in specified files and revisions
71 grep search for a pattern in specified files and revisions
72 heads show branch heads
72 heads show branch heads
73 help show help for a given topic or a help overview
73 help show help for a given topic or a help overview
74 identify identify the working copy or specified revision
74 identify identify the working copy or specified revision
75 import import an ordered set of patches
75 import import an ordered set of patches
76 incoming show new changesets found in source
76 incoming show new changesets found in source
77 init create a new repository in the given directory
77 init create a new repository in the given directory
78 locate locate files matching specific patterns
78 locate locate files matching specific patterns
79 log show revision history of entire repository or files
79 log show revision history of entire repository or files
80 manifest output the current or given revision of the project manifest
80 manifest output the current or given revision of the project manifest
81 merge merge working directory with another revision
81 merge merge working directory with another revision
82 outgoing show changesets not found in the destination
82 outgoing show changesets not found in the destination
83 parents show the parents of the working directory or revision
83 parents show the parents of the working directory or revision
84 paths show aliases for remote repositories
84 paths show aliases for remote repositories
85 phase set or show the current phase name
85 phase set or show the current phase name
86 pull pull changes from the specified source
86 pull pull changes from the specified source
87 push push changes to the specified destination
87 push push changes to the specified destination
88 recover roll back an interrupted transaction
88 recover roll back an interrupted transaction
89 remove remove the specified files on the next commit
89 remove remove the specified files on the next commit
90 rename rename files; equivalent of copy + remove
90 rename rename files; equivalent of copy + remove
91 resolve redo merges or set/view the merge status of files
91 resolve redo merges or set/view the merge status of files
92 revert restore files to their checkout state
92 revert restore files to their checkout state
93 root print the root (top) of the current working directory
93 root print the root (top) of the current working directory
94 serve start stand-alone webserver
94 serve start stand-alone webserver
95 status show changed files in the working directory
95 status show changed files in the working directory
96 summary summarize working directory state
96 summary summarize working directory state
97 tag add one or more tags for the current or given revision
97 tag add one or more tags for the current or given revision
98 tags list repository tags
98 tags list repository tags
99 unbundle apply one or more changegroup files
99 unbundle apply one or more changegroup files
100 update update working directory (or switch revisions)
100 update update working directory (or switch revisions)
101 verify verify the integrity of the repository
101 verify verify the integrity of the repository
102 version output version and copyright information
102 version output version and copyright information
103
103
104 additional help topics:
104 additional help topics:
105
105
106 config Configuration Files
106 config Configuration Files
107 dates Date Formats
107 dates Date Formats
108 diffs Diff Formats
108 diffs Diff Formats
109 environment Environment Variables
109 environment Environment Variables
110 extensions Using Additional Features
110 extensions Using Additional Features
111 filesets Specifying File Sets
111 filesets Specifying File Sets
112 glossary Glossary
112 glossary Glossary
113 hgignore Syntax for Mercurial Ignore Files
113 hgignore Syntax for Mercurial Ignore Files
114 hgweb Configuring hgweb
114 hgweb Configuring hgweb
115 merge-tools Merge Tools
115 merge-tools Merge Tools
116 multirevs Specifying Multiple Revisions
116 multirevs Specifying Multiple Revisions
117 patterns File Name Patterns
117 patterns File Name Patterns
118 phases Working with Phases
118 phases Working with Phases
119 revisions Specifying Single Revisions
119 revisions Specifying Single Revisions
120 revsets Specifying Revision Sets
120 revsets Specifying Revision Sets
121 subrepos Subrepositories
121 subrepos Subrepositories
122 templating Template Usage
122 templating Template Usage
123 urls URL Paths
123 urls URL Paths
124
124
125 use "hg -v help" to show builtin aliases and global options
125 use "hg -v help" to show builtin aliases and global options
126
126
127 $ hg -q help
127 $ hg -q help
128 add add the specified files on the next commit
128 add add the specified files on the next commit
129 addremove add all new files, delete all missing files
129 addremove add all new files, delete all missing files
130 annotate show changeset information by line for each file
130 annotate show changeset information by line for each file
131 archive create an unversioned archive of a repository revision
131 archive create an unversioned archive of a repository revision
132 backout reverse effect of earlier changeset
132 backout reverse effect of earlier changeset
133 bisect subdivision search of changesets
133 bisect subdivision search of changesets
134 bookmarks create a new bookmark or list existing bookmarks
134 bookmarks create a new bookmark or list existing bookmarks
135 branch set or show the current branch name
135 branch set or show the current branch name
136 branches list repository named branches
136 branches list repository named branches
137 bundle create a changegroup file
137 bundle create a changegroup file
138 cat output the current or given revision of files
138 cat output the current or given revision of files
139 clone make a copy of an existing repository
139 clone make a copy of an existing repository
140 commit commit the specified files or all outstanding changes
140 commit commit the specified files or all outstanding changes
141 config show combined config settings from all hgrc files
141 config show combined config settings from all hgrc files
142 copy mark files as copied for the next commit
142 copy mark files as copied for the next commit
143 diff diff repository (or selected files)
143 diff diff repository (or selected files)
144 export dump the header and diffs for one or more changesets
144 export dump the header and diffs for one or more changesets
145 forget forget the specified files on the next commit
145 forget forget the specified files on the next commit
146 graft copy changes from other branches onto the current branch
146 graft copy changes from other branches onto the current branch
147 grep search for a pattern in specified files and revisions
147 grep search for a pattern in specified files and revisions
148 heads show branch heads
148 heads show branch heads
149 help show help for a given topic or a help overview
149 help show help for a given topic or a help overview
150 identify identify the working copy or specified revision
150 identify identify the working copy or specified revision
151 import import an ordered set of patches
151 import import an ordered set of patches
152 incoming show new changesets found in source
152 incoming show new changesets found in source
153 init create a new repository in the given directory
153 init create a new repository in the given directory
154 locate locate files matching specific patterns
154 locate locate files matching specific patterns
155 log show revision history of entire repository or files
155 log show revision history of entire repository or files
156 manifest output the current or given revision of the project manifest
156 manifest output the current or given revision of the project manifest
157 merge merge working directory with another revision
157 merge merge working directory with another revision
158 outgoing show changesets not found in the destination
158 outgoing show changesets not found in the destination
159 parents show the parents of the working directory or revision
159 parents show the parents of the working directory or revision
160 paths show aliases for remote repositories
160 paths show aliases for remote repositories
161 phase set or show the current phase name
161 phase set or show the current phase name
162 pull pull changes from the specified source
162 pull pull changes from the specified source
163 push push changes to the specified destination
163 push push changes to the specified destination
164 recover roll back an interrupted transaction
164 recover roll back an interrupted transaction
165 remove remove the specified files on the next commit
165 remove remove the specified files on the next commit
166 rename rename files; equivalent of copy + remove
166 rename rename files; equivalent of copy + remove
167 resolve redo merges or set/view the merge status of files
167 resolve redo merges or set/view the merge status of files
168 revert restore files to their checkout state
168 revert restore files to their checkout state
169 root print the root (top) of the current working directory
169 root print the root (top) of the current working directory
170 serve start stand-alone webserver
170 serve start stand-alone webserver
171 status show changed files in the working directory
171 status show changed files in the working directory
172 summary summarize working directory state
172 summary summarize working directory state
173 tag add one or more tags for the current or given revision
173 tag add one or more tags for the current or given revision
174 tags list repository tags
174 tags list repository tags
175 unbundle apply one or more changegroup files
175 unbundle apply one or more changegroup files
176 update update working directory (or switch revisions)
176 update update working directory (or switch revisions)
177 verify verify the integrity of the repository
177 verify verify the integrity of the repository
178 version output version and copyright information
178 version output version and copyright information
179
179
180 additional help topics:
180 additional help topics:
181
181
182 config Configuration Files
182 config Configuration Files
183 dates Date Formats
183 dates Date Formats
184 diffs Diff Formats
184 diffs Diff Formats
185 environment Environment Variables
185 environment Environment Variables
186 extensions Using Additional Features
186 extensions Using Additional Features
187 filesets Specifying File Sets
187 filesets Specifying File Sets
188 glossary Glossary
188 glossary Glossary
189 hgignore Syntax for Mercurial Ignore Files
189 hgignore Syntax for Mercurial Ignore Files
190 hgweb Configuring hgweb
190 hgweb Configuring hgweb
191 merge-tools Merge Tools
191 merge-tools Merge Tools
192 multirevs Specifying Multiple Revisions
192 multirevs Specifying Multiple Revisions
193 patterns File Name Patterns
193 patterns File Name Patterns
194 phases Working with Phases
194 phases Working with Phases
195 revisions Specifying Single Revisions
195 revisions Specifying Single Revisions
196 revsets Specifying Revision Sets
196 revsets Specifying Revision Sets
197 subrepos Subrepositories
197 subrepos Subrepositories
198 templating Template Usage
198 templating Template Usage
199 urls URL Paths
199 urls URL Paths
200
200
201 Test extension help:
201 Test extension help:
202 $ hg help extensions --config extensions.rebase= --config extensions.children=
202 $ hg help extensions --config extensions.rebase= --config extensions.children=
203 Using Additional Features
203 Using Additional Features
204 """""""""""""""""""""""""
204 """""""""""""""""""""""""
205
205
206 Mercurial has the ability to add new features through the use of
206 Mercurial has the ability to add new features through the use of
207 extensions. Extensions may add new commands, add options to existing
207 extensions. Extensions may add new commands, add options to existing
208 commands, change the default behavior of commands, or implement hooks.
208 commands, change the default behavior of commands, or implement hooks.
209
209
210 To enable the "foo" extension, either shipped with Mercurial or in the
210 To enable the "foo" extension, either shipped with Mercurial or in the
211 Python search path, create an entry for it in your configuration file,
211 Python search path, create an entry for it in your configuration file,
212 like this:
212 like this:
213
213
214 [extensions]
214 [extensions]
215 foo =
215 foo =
216
216
217 You may also specify the full path to an extension:
217 You may also specify the full path to an extension:
218
218
219 [extensions]
219 [extensions]
220 myfeature = ~/.hgext/myfeature.py
220 myfeature = ~/.hgext/myfeature.py
221
221
222 See "hg help config" for more information on configuration files.
222 See "hg help config" for more information on configuration files.
223
223
224 Extensions are not loaded by default for a variety of reasons: they can
224 Extensions are not loaded by default for a variety of reasons: they can
225 increase startup overhead; they may be meant for advanced usage only; they
225 increase startup overhead; they may be meant for advanced usage only; they
226 may provide potentially dangerous abilities (such as letting you destroy
226 may provide potentially dangerous abilities (such as letting you destroy
227 or modify history); they might not be ready for prime time; or they may
227 or modify history); they might not be ready for prime time; or they may
228 alter some usual behaviors of stock Mercurial. It is thus up to the user
228 alter some usual behaviors of stock Mercurial. It is thus up to the user
229 to activate extensions as needed.
229 to activate extensions as needed.
230
230
231 To explicitly disable an extension enabled in a configuration file of
231 To explicitly disable an extension enabled in a configuration file of
232 broader scope, prepend its path with !:
232 broader scope, prepend its path with !:
233
233
234 [extensions]
234 [extensions]
235 # disabling extension bar residing in /path/to/extension/bar.py
235 # disabling extension bar residing in /path/to/extension/bar.py
236 bar = !/path/to/extension/bar.py
236 bar = !/path/to/extension/bar.py
237 # ditto, but no path was supplied for extension baz
237 # ditto, but no path was supplied for extension baz
238 baz = !
238 baz = !
239
239
240 enabled extensions:
240 enabled extensions:
241
241
242 children command to display child changesets (DEPRECATED)
242 children command to display child changesets (DEPRECATED)
243 rebase command to move sets of revisions to a different ancestor
243 rebase command to move sets of revisions to a different ancestor
244
244
245 disabled extensions:
245 disabled extensions:
246
246
247 acl hooks for controlling repository access
247 acl hooks for controlling repository access
248 blackbox log repository events to a blackbox for debugging
248 blackbox log repository events to a blackbox for debugging
249 bugzilla hooks for integrating with the Bugzilla bug tracker
249 bugzilla hooks for integrating with the Bugzilla bug tracker
250 churn command to display statistics about repository history
250 churn command to display statistics about repository history
251 color colorize output from some commands
251 color colorize output from some commands
252 convert import revisions from foreign VCS repositories into
252 convert import revisions from foreign VCS repositories into
253 Mercurial
253 Mercurial
254 eol automatically manage newlines in repository files
254 eol automatically manage newlines in repository files
255 extdiff command to allow external programs to compare revisions
255 extdiff command to allow external programs to compare revisions
256 factotum http authentication with factotum
256 factotum http authentication with factotum
257 gpg commands to sign and verify changesets
257 gpg commands to sign and verify changesets
258 hgcia hooks for integrating with the CIA.vc notification service
258 hgcia hooks for integrating with the CIA.vc notification service
259 hgk browse the repository in a graphical way
259 hgk browse the repository in a graphical way
260 highlight syntax highlighting for hgweb (requires Pygments)
260 highlight syntax highlighting for hgweb (requires Pygments)
261 histedit interactive history editing
261 histedit interactive history editing
262 keyword expand keywords in tracked files
262 keyword expand keywords in tracked files
263 largefiles track large binary files
263 largefiles track large binary files
264 mq manage a stack of patches
264 mq manage a stack of patches
265 notify hooks for sending email push notifications
265 notify hooks for sending email push notifications
266 pager browse command output with an external pager
266 pager browse command output with an external pager
267 patchbomb command to send changesets as (a series of) patch emails
267 patchbomb command to send changesets as (a series of) patch emails
268 progress show progress bars for some actions
268 progress show progress bars for some actions
269 purge command to delete untracked files from the working
269 purge command to delete untracked files from the working
270 directory
270 directory
271 record commands to interactively select changes for
271 record commands to interactively select changes for
272 commit/qrefresh
272 commit/qrefresh
273 relink recreates hardlinks between repository clones
273 relink recreates hardlinks between repository clones
274 schemes extend schemes with shortcuts to repository swarms
274 schemes extend schemes with shortcuts to repository swarms
275 share share a common history between several working directories
275 share share a common history between several working directories
276 shelve save and restore changes to the working directory
276 shelve save and restore changes to the working directory
277 strip strip changesets and their descendents from history
277 strip strip changesets and their descendents from history
278 transplant command to transplant changesets from another branch
278 transplant command to transplant changesets from another branch
279 win32mbcs allow the use of MBCS paths with problematic encodings
279 win32mbcs allow the use of MBCS paths with problematic encodings
280 zeroconf discover and advertise repositories on the local network
280 zeroconf discover and advertise repositories on the local network
281 Test short command list with verbose option
281 Test short command list with verbose option
282
282
283 $ hg -v help shortlist
283 $ hg -v help shortlist
284 Mercurial Distributed SCM
284 Mercurial Distributed SCM
285
285
286 basic commands:
286 basic commands:
287
287
288 add add the specified files on the next commit
288 add add the specified files on the next commit
289 annotate, blame
289 annotate, blame
290 show changeset information by line for each file
290 show changeset information by line for each file
291 clone make a copy of an existing repository
291 clone make a copy of an existing repository
292 commit, ci commit the specified files or all outstanding changes
292 commit, ci commit the specified files or all outstanding changes
293 diff diff repository (or selected files)
293 diff diff repository (or selected files)
294 export dump the header and diffs for one or more changesets
294 export dump the header and diffs for one or more changesets
295 forget forget the specified files on the next commit
295 forget forget the specified files on the next commit
296 init create a new repository in the given directory
296 init create a new repository in the given directory
297 log, history show revision history of entire repository or files
297 log, history show revision history of entire repository or files
298 merge merge working directory with another revision
298 merge merge working directory with another revision
299 pull pull changes from the specified source
299 pull pull changes from the specified source
300 push push changes to the specified destination
300 push push changes to the specified destination
301 remove, rm remove the specified files on the next commit
301 remove, rm remove the specified files on the next commit
302 serve start stand-alone webserver
302 serve start stand-alone webserver
303 status, st show changed files in the working directory
303 status, st show changed files in the working directory
304 summary, sum summarize working directory state
304 summary, sum summarize working directory state
305 update, up, checkout, co
305 update, up, checkout, co
306 update working directory (or switch revisions)
306 update working directory (or switch revisions)
307
307
308 global options:
308 global options:
309
309
310 -R --repository REPO repository root directory or name of overlay bundle
310 -R --repository REPO repository root directory or name of overlay bundle
311 file
311 file
312 --cwd DIR change working directory
312 --cwd DIR change working directory
313 -y --noninteractive do not prompt, automatically pick the first choice for
313 -y --noninteractive do not prompt, automatically pick the first choice for
314 all prompts
314 all prompts
315 -q --quiet suppress output
315 -q --quiet suppress output
316 -v --verbose enable additional output
316 -v --verbose enable additional output
317 --config CONFIG [+] set/override config option (use 'section.name=value')
317 --config CONFIG [+] set/override config option (use 'section.name=value')
318 --debug enable debugging output
318 --debug enable debugging output
319 --debugger start debugger
319 --debugger start debugger
320 --encoding ENCODE set the charset encoding (default: ascii)
320 --encoding ENCODE set the charset encoding (default: ascii)
321 --encodingmode MODE set the charset encoding mode (default: strict)
321 --encodingmode MODE set the charset encoding mode (default: strict)
322 --traceback always print a traceback on exception
322 --traceback always print a traceback on exception
323 --time time how long the command takes
323 --time time how long the command takes
324 --profile print command execution profile
324 --profile print command execution profile
325 --version output version information and exit
325 --version output version information and exit
326 -h --help display help and exit
326 -h --help display help and exit
327 --hidden consider hidden changesets
327 --hidden consider hidden changesets
328
328
329 [+] marked option can be specified multiple times
329 [+] marked option can be specified multiple times
330
330
331 use "hg help" for the full list of commands
331 use "hg help" for the full list of commands
332
332
333 $ hg add -h
333 $ hg add -h
334 hg add [OPTION]... [FILE]...
334 hg add [OPTION]... [FILE]...
335
335
336 add the specified files on the next commit
336 add the specified files on the next commit
337
337
338 Schedule files to be version controlled and added to the repository.
338 Schedule files to be version controlled and added to the repository.
339
339
340 The files will be added to the repository at the next commit. To undo an
340 The files will be added to the repository at the next commit. To undo an
341 add before that, see "hg forget".
341 add before that, see "hg forget".
342
342
343 If no names are given, add all files to the repository.
343 If no names are given, add all files to the repository.
344
344
345 Returns 0 if all files are successfully added.
345 Returns 0 if all files are successfully added.
346
346
347 options:
347 options:
348
348
349 -I --include PATTERN [+] include names matching the given patterns
349 -I --include PATTERN [+] include names matching the given patterns
350 -X --exclude PATTERN [+] exclude names matching the given patterns
350 -X --exclude PATTERN [+] exclude names matching the given patterns
351 -S --subrepos recurse into subrepositories
351 -S --subrepos recurse into subrepositories
352 -n --dry-run do not perform actions, just print output
352 -n --dry-run do not perform actions, just print output
353
353
354 [+] marked option can be specified multiple times
354 [+] marked option can be specified multiple times
355
355
356 use "hg -v help add" to show more complete help and the global options
356 use "hg -v help add" to show more complete help and the global options
357
357
358 Verbose help for add
358 Verbose help for add
359
359
360 $ hg add -hv
360 $ hg add -hv
361 hg add [OPTION]... [FILE]...
361 hg add [OPTION]... [FILE]...
362
362
363 add the specified files on the next commit
363 add the specified files on the next commit
364
364
365 Schedule files to be version controlled and added to the repository.
365 Schedule files to be version controlled and added to the repository.
366
366
367 The files will be added to the repository at the next commit. To undo an
367 The files will be added to the repository at the next commit. To undo an
368 add before that, see "hg forget".
368 add before that, see "hg forget".
369
369
370 If no names are given, add all files to the repository.
370 If no names are given, add all files to the repository.
371
371
372 An example showing how new (unknown) files are added automatically by "hg
372 An example showing how new (unknown) files are added automatically by "hg
373 add":
373 add":
374
374
375 $ ls
375 $ ls
376 foo.c
376 foo.c
377 $ hg status
377 $ hg status
378 ? foo.c
378 ? foo.c
379 $ hg add
379 $ hg add
380 adding foo.c
380 adding foo.c
381 $ hg status
381 $ hg status
382 A foo.c
382 A foo.c
383
383
384 Returns 0 if all files are successfully added.
384 Returns 0 if all files are successfully added.
385
385
386 options:
386 options:
387
387
388 -I --include PATTERN [+] include names matching the given patterns
388 -I --include PATTERN [+] include names matching the given patterns
389 -X --exclude PATTERN [+] exclude names matching the given patterns
389 -X --exclude PATTERN [+] exclude names matching the given patterns
390 -S --subrepos recurse into subrepositories
390 -S --subrepos recurse into subrepositories
391 -n --dry-run do not perform actions, just print output
391 -n --dry-run do not perform actions, just print output
392
392
393 [+] marked option can be specified multiple times
393 [+] marked option can be specified multiple times
394
394
395 global options:
395 global options:
396
396
397 -R --repository REPO repository root directory or name of overlay bundle
397 -R --repository REPO repository root directory or name of overlay bundle
398 file
398 file
399 --cwd DIR change working directory
399 --cwd DIR change working directory
400 -y --noninteractive do not prompt, automatically pick the first choice for
400 -y --noninteractive do not prompt, automatically pick the first choice for
401 all prompts
401 all prompts
402 -q --quiet suppress output
402 -q --quiet suppress output
403 -v --verbose enable additional output
403 -v --verbose enable additional output
404 --config CONFIG [+] set/override config option (use 'section.name=value')
404 --config CONFIG [+] set/override config option (use 'section.name=value')
405 --debug enable debugging output
405 --debug enable debugging output
406 --debugger start debugger
406 --debugger start debugger
407 --encoding ENCODE set the charset encoding (default: ascii)
407 --encoding ENCODE set the charset encoding (default: ascii)
408 --encodingmode MODE set the charset encoding mode (default: strict)
408 --encodingmode MODE set the charset encoding mode (default: strict)
409 --traceback always print a traceback on exception
409 --traceback always print a traceback on exception
410 --time time how long the command takes
410 --time time how long the command takes
411 --profile print command execution profile
411 --profile print command execution profile
412 --version output version information and exit
412 --version output version information and exit
413 -h --help display help and exit
413 -h --help display help and exit
414 --hidden consider hidden changesets
414 --hidden consider hidden changesets
415
415
416 [+] marked option can be specified multiple times
416 [+] marked option can be specified multiple times
417
417
418 Test help option with version option
418 Test help option with version option
419
419
420 $ hg add -h --version
420 $ hg add -h --version
421 Mercurial Distributed SCM (version *) (glob)
421 Mercurial Distributed SCM (version *) (glob)
422 (see http://mercurial.selenic.com for more information)
422 (see http://mercurial.selenic.com for more information)
423
423
424 Copyright (C) 2005-2014 Matt Mackall and others
424 Copyright (C) 2005-2014 Matt Mackall and others
425 This is free software; see the source for copying conditions. There is NO
425 This is free software; see the source for copying conditions. There is NO
426 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
426 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
427
427
428 $ hg add --skjdfks
428 $ hg add --skjdfks
429 hg add: option --skjdfks not recognized
429 hg add: option --skjdfks not recognized
430 hg add [OPTION]... [FILE]...
430 hg add [OPTION]... [FILE]...
431
431
432 add the specified files on the next commit
432 add the specified files on the next commit
433
433
434 options:
434 options:
435
435
436 -I --include PATTERN [+] include names matching the given patterns
436 -I --include PATTERN [+] include names matching the given patterns
437 -X --exclude PATTERN [+] exclude names matching the given patterns
437 -X --exclude PATTERN [+] exclude names matching the given patterns
438 -S --subrepos recurse into subrepositories
438 -S --subrepos recurse into subrepositories
439 -n --dry-run do not perform actions, just print output
439 -n --dry-run do not perform actions, just print output
440
440
441 [+] marked option can be specified multiple times
441 [+] marked option can be specified multiple times
442
442
443 use "hg help add" to show the full help text
443 use "hg help add" to show the full help text
444 [255]
444 [255]
445
445
446 Test ambiguous command help
446 Test ambiguous command help
447
447
448 $ hg help ad
448 $ hg help ad
449 list of commands:
449 list of commands:
450
450
451 add add the specified files on the next commit
451 add add the specified files on the next commit
452 addremove add all new files, delete all missing files
452 addremove add all new files, delete all missing files
453
453
454 use "hg -v help ad" to show builtin aliases and global options
454 use "hg -v help ad" to show builtin aliases and global options
455
455
456 Test command without options
456 Test command without options
457
457
458 $ hg help verify
458 $ hg help verify
459 hg verify
459 hg verify
460
460
461 verify the integrity of the repository
461 verify the integrity of the repository
462
462
463 Verify the integrity of the current repository.
463 Verify the integrity of the current repository.
464
464
465 This will perform an extensive check of the repository's integrity,
465 This will perform an extensive check of the repository's integrity,
466 validating the hashes and checksums of each entry in the changelog,
466 validating the hashes and checksums of each entry in the changelog,
467 manifest, and tracked files, as well as the integrity of their crosslinks
467 manifest, and tracked files, as well as the integrity of their crosslinks
468 and indices.
468 and indices.
469
469
470 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more
470 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more
471 information about recovery from corruption of the repository.
471 information about recovery from corruption of the repository.
472
472
473 Returns 0 on success, 1 if errors are encountered.
473 Returns 0 on success, 1 if errors are encountered.
474
474
475 use "hg -v help verify" to show the global options
475 use "hg -v help verify" to show the global options
476
476
477 $ hg help diff
477 $ hg help diff
478 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
478 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
479
479
480 diff repository (or selected files)
480 diff repository (or selected files)
481
481
482 Show differences between revisions for the specified files.
482 Show differences between revisions for the specified files.
483
483
484 Differences between files are shown using the unified diff format.
484 Differences between files are shown using the unified diff format.
485
485
486 Note:
486 Note:
487 diff may generate unexpected results for merges, as it will default to
487 diff may generate unexpected results for merges, as it will default to
488 comparing against the working directory's first parent changeset if no
488 comparing against the working directory's first parent changeset if no
489 revisions are specified.
489 revisions are specified.
490
490
491 When two revision arguments are given, then changes are shown between
491 When two revision arguments are given, then changes are shown between
492 those revisions. If only one revision is specified then that revision is
492 those revisions. If only one revision is specified then that revision is
493 compared to the working directory, and, when no revisions are specified,
493 compared to the working directory, and, when no revisions are specified,
494 the working directory files are compared to its parent.
494 the working directory files are compared to its parent.
495
495
496 Alternatively you can specify -c/--change with a revision to see the
496 Alternatively you can specify -c/--change with a revision to see the
497 changes in that changeset relative to its first parent.
497 changes in that changeset relative to its first parent.
498
498
499 Without the -a/--text option, diff will avoid generating diffs of files it
499 Without the -a/--text option, diff will avoid generating diffs of files it
500 detects as binary. With -a, diff will generate a diff anyway, probably
500 detects as binary. With -a, diff will generate a diff anyway, probably
501 with undesirable results.
501 with undesirable results.
502
502
503 Use the -g/--git option to generate diffs in the git extended diff format.
503 Use the -g/--git option to generate diffs in the git extended diff format.
504 For more information, read "hg help diffs".
504 For more information, read "hg help diffs".
505
505
506 Returns 0 on success.
506 Returns 0 on success.
507
507
508 options:
508 options:
509
509
510 -r --rev REV [+] revision
510 -r --rev REV [+] revision
511 -c --change REV change made by revision
511 -c --change REV change made by revision
512 -a --text treat all files as text
512 -a --text treat all files as text
513 -g --git use git extended diff format
513 -g --git use git extended diff format
514 --nodates omit dates from diff headers
514 --nodates omit dates from diff headers
515 -p --show-function show which function each change is in
515 -p --show-function show which function each change is in
516 --reverse produce a diff that undoes the changes
516 --reverse produce a diff that undoes the changes
517 -w --ignore-all-space ignore white space when comparing lines
517 -w --ignore-all-space ignore white space when comparing lines
518 -b --ignore-space-change ignore changes in the amount of white space
518 -b --ignore-space-change ignore changes in the amount of white space
519 -B --ignore-blank-lines ignore changes whose lines are all blank
519 -B --ignore-blank-lines ignore changes whose lines are all blank
520 -U --unified NUM number of lines of context to show
520 -U --unified NUM number of lines of context to show
521 --stat output diffstat-style summary of changes
521 --stat output diffstat-style summary of changes
522 -I --include PATTERN [+] include names matching the given patterns
522 -I --include PATTERN [+] include names matching the given patterns
523 -X --exclude PATTERN [+] exclude names matching the given patterns
523 -X --exclude PATTERN [+] exclude names matching the given patterns
524 -S --subrepos recurse into subrepositories
524 -S --subrepos recurse into subrepositories
525
525
526 [+] marked option can be specified multiple times
526 [+] marked option can be specified multiple times
527
527
528 use "hg -v help diff" to show more complete help and the global options
528 use "hg -v help diff" to show more complete help and the global options
529
529
530 $ hg help status
530 $ hg help status
531 hg status [OPTION]... [FILE]...
531 hg status [OPTION]... [FILE]...
532
532
533 aliases: st
533 aliases: st
534
534
535 show changed files in the working directory
535 show changed files in the working directory
536
536
537 Show status of files in the repository. If names are given, only files
537 Show status of files in the repository. If names are given, only files
538 that match are shown. Files that are clean or ignored or the source of a
538 that match are shown. Files that are clean or ignored or the source of a
539 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
539 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
540 -C/--copies or -A/--all are given. Unless options described with "show
540 -C/--copies or -A/--all are given. Unless options described with "show
541 only ..." are given, the options -mardu are used.
541 only ..." are given, the options -mardu are used.
542
542
543 Option -q/--quiet hides untracked (unknown and ignored) files unless
543 Option -q/--quiet hides untracked (unknown and ignored) files unless
544 explicitly requested with -u/--unknown or -i/--ignored.
544 explicitly requested with -u/--unknown or -i/--ignored.
545
545
546 Note:
546 Note:
547 status may appear to disagree with diff if permissions have changed or
547 status may appear to disagree with diff if permissions have changed or
548 a merge has occurred. The standard diff format does not report
548 a merge has occurred. The standard diff format does not report
549 permission changes and diff only reports changes relative to one merge
549 permission changes and diff only reports changes relative to one merge
550 parent.
550 parent.
551
551
552 If one revision is given, it is used as the base revision. If two
552 If one revision is given, it is used as the base revision. If two
553 revisions are given, the differences between them are shown. The --change
553 revisions are given, the differences between them are shown. The --change
554 option can also be used as a shortcut to list the changed files of a
554 option can also be used as a shortcut to list the changed files of a
555 revision from its first parent.
555 revision from its first parent.
556
556
557 The codes used to show the status of files are:
557 The codes used to show the status of files are:
558
558
559 M = modified
559 M = modified
560 A = added
560 A = added
561 R = removed
561 R = removed
562 C = clean
562 C = clean
563 ! = missing (deleted by non-hg command, but still tracked)
563 ! = missing (deleted by non-hg command, but still tracked)
564 ? = not tracked
564 ? = not tracked
565 I = ignored
565 I = ignored
566 = origin of the previous file (with --copies)
566 = origin of the previous file (with --copies)
567
567
568 Returns 0 on success.
568 Returns 0 on success.
569
569
570 options:
570 options:
571
571
572 -A --all show status of all files
572 -A --all show status of all files
573 -m --modified show only modified files
573 -m --modified show only modified files
574 -a --added show only added files
574 -a --added show only added files
575 -r --removed show only removed files
575 -r --removed show only removed files
576 -d --deleted show only deleted (but tracked) files
576 -d --deleted show only deleted (but tracked) files
577 -c --clean show only files without changes
577 -c --clean show only files without changes
578 -u --unknown show only unknown (not tracked) files
578 -u --unknown show only unknown (not tracked) files
579 -i --ignored show only ignored files
579 -i --ignored show only ignored files
580 -n --no-status hide status prefix
580 -n --no-status hide status prefix
581 -C --copies show source of copied files
581 -C --copies show source of copied files
582 -0 --print0 end filenames with NUL, for use with xargs
582 -0 --print0 end filenames with NUL, for use with xargs
583 --rev REV [+] show difference from revision
583 --rev REV [+] show difference from revision
584 --change REV list the changed files of a revision
584 --change REV list the changed files of a revision
585 -I --include PATTERN [+] include names matching the given patterns
585 -I --include PATTERN [+] include names matching the given patterns
586 -X --exclude PATTERN [+] exclude names matching the given patterns
586 -X --exclude PATTERN [+] exclude names matching the given patterns
587 -S --subrepos recurse into subrepositories
587 -S --subrepos recurse into subrepositories
588
588
589 [+] marked option can be specified multiple times
589 [+] marked option can be specified multiple times
590
590
591 use "hg -v help status" to show more complete help and the global options
591 use "hg -v help status" to show more complete help and the global options
592
592
593 $ hg -q help status
593 $ hg -q help status
594 hg status [OPTION]... [FILE]...
594 hg status [OPTION]... [FILE]...
595
595
596 show changed files in the working directory
596 show changed files in the working directory
597
597
598 $ hg help foo
598 $ hg help foo
599 abort: no such help topic: foo
599 abort: no such help topic: foo
600 (try "hg help --keyword foo")
600 (try "hg help --keyword foo")
601 [255]
601 [255]
602
602
603 $ hg skjdfks
603 $ hg skjdfks
604 hg: unknown command 'skjdfks'
604 hg: unknown command 'skjdfks'
605 Mercurial Distributed SCM
605 Mercurial Distributed SCM
606
606
607 basic commands:
607 basic commands:
608
608
609 add add the specified files on the next commit
609 add add the specified files on the next commit
610 annotate show changeset information by line for each file
610 annotate show changeset information by line for each file
611 clone make a copy of an existing repository
611 clone make a copy of an existing repository
612 commit commit the specified files or all outstanding changes
612 commit commit the specified files or all outstanding changes
613 diff diff repository (or selected files)
613 diff diff repository (or selected files)
614 export dump the header and diffs for one or more changesets
614 export dump the header and diffs for one or more changesets
615 forget forget the specified files on the next commit
615 forget forget the specified files on the next commit
616 init create a new repository in the given directory
616 init create a new repository in the given directory
617 log show revision history of entire repository or files
617 log show revision history of entire repository or files
618 merge merge working directory with another revision
618 merge merge working directory with another revision
619 pull pull changes from the specified source
619 pull pull changes from the specified source
620 push push changes to the specified destination
620 push push changes to the specified destination
621 remove remove the specified files on the next commit
621 remove remove the specified files on the next commit
622 serve start stand-alone webserver
622 serve start stand-alone webserver
623 status show changed files in the working directory
623 status show changed files in the working directory
624 summary summarize working directory state
624 summary summarize working directory state
625 update update working directory (or switch revisions)
625 update update working directory (or switch revisions)
626
626
627 use "hg help" for the full list of commands or "hg -v" for details
627 use "hg help" for the full list of commands or "hg -v" for details
628 [255]
628 [255]
629
629
630
630
631 $ cat > helpext.py <<EOF
631 $ cat > helpext.py <<EOF
632 > import os
632 > import os
633 > from mercurial import cmdutil, commands
633 > from mercurial import cmdutil, commands
634 >
634 >
635 > cmdtable = {}
635 > cmdtable = {}
636 > command = cmdutil.command(cmdtable)
636 > command = cmdutil.command(cmdtable)
637 >
637 >
638 > @command('nohelp',
638 > @command('nohelp',
639 > [('', 'longdesc', 3, 'x'*90),
639 > [('', 'longdesc', 3, 'x'*90),
640 > ('n', '', None, 'normal desc'),
640 > ('n', '', None, 'normal desc'),
641 > ('', 'newline', '', 'line1\nline2')],
641 > ('', 'newline', '', 'line1\nline2')],
642 > 'hg nohelp')
642 > 'hg nohelp',
643 > norepo=True)
643 > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')])
644 > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')])
644 > def nohelp(ui, *args, **kwargs):
645 > def nohelp(ui, *args, **kwargs):
645 > pass
646 > pass
646 >
647 >
647 > commands.norepo += ' nohelp'
648 > EOF
648 > EOF
649 $ echo '[extensions]' >> $HGRCPATH
649 $ echo '[extensions]' >> $HGRCPATH
650 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
650 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
651
651
652 Test command with no help text
652 Test command with no help text
653
653
654 $ hg help nohelp
654 $ hg help nohelp
655 hg nohelp
655 hg nohelp
656
656
657 (no help text available)
657 (no help text available)
658
658
659 options:
659 options:
660
660
661 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
661 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
662 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
662 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
663 -n -- normal desc
663 -n -- normal desc
664 --newline VALUE line1 line2
664 --newline VALUE line1 line2
665
665
666 use "hg -v help nohelp" to show the global options
666 use "hg -v help nohelp" to show the global options
667
667
668 $ hg help -k nohelp
668 $ hg help -k nohelp
669 Commands:
669 Commands:
670
670
671 nohelp hg nohelp
671 nohelp hg nohelp
672
672
673 Extension Commands:
673 Extension Commands:
674
674
675 nohelp (no help text available)
675 nohelp (no help text available)
676
676
677 Test that default list of commands omits extension commands
677 Test that default list of commands omits extension commands
678
678
679 $ hg help
679 $ hg help
680 Mercurial Distributed SCM
680 Mercurial Distributed SCM
681
681
682 list of commands:
682 list of commands:
683
683
684 add add the specified files on the next commit
684 add add the specified files on the next commit
685 addremove add all new files, delete all missing files
685 addremove add all new files, delete all missing files
686 annotate show changeset information by line for each file
686 annotate show changeset information by line for each file
687 archive create an unversioned archive of a repository revision
687 archive create an unversioned archive of a repository revision
688 backout reverse effect of earlier changeset
688 backout reverse effect of earlier changeset
689 bisect subdivision search of changesets
689 bisect subdivision search of changesets
690 bookmarks create a new bookmark or list existing bookmarks
690 bookmarks create a new bookmark or list existing bookmarks
691 branch set or show the current branch name
691 branch set or show the current branch name
692 branches list repository named branches
692 branches list repository named branches
693 bundle create a changegroup file
693 bundle create a changegroup file
694 cat output the current or given revision of files
694 cat output the current or given revision of files
695 clone make a copy of an existing repository
695 clone make a copy of an existing repository
696 commit commit the specified files or all outstanding changes
696 commit commit the specified files or all outstanding changes
697 config show combined config settings from all hgrc files
697 config show combined config settings from all hgrc files
698 copy mark files as copied for the next commit
698 copy mark files as copied for the next commit
699 diff diff repository (or selected files)
699 diff diff repository (or selected files)
700 export dump the header and diffs for one or more changesets
700 export dump the header and diffs for one or more changesets
701 forget forget the specified files on the next commit
701 forget forget the specified files on the next commit
702 graft copy changes from other branches onto the current branch
702 graft copy changes from other branches onto the current branch
703 grep search for a pattern in specified files and revisions
703 grep search for a pattern in specified files and revisions
704 heads show branch heads
704 heads show branch heads
705 help show help for a given topic or a help overview
705 help show help for a given topic or a help overview
706 identify identify the working copy or specified revision
706 identify identify the working copy or specified revision
707 import import an ordered set of patches
707 import import an ordered set of patches
708 incoming show new changesets found in source
708 incoming show new changesets found in source
709 init create a new repository in the given directory
709 init create a new repository in the given directory
710 locate locate files matching specific patterns
710 locate locate files matching specific patterns
711 log show revision history of entire repository or files
711 log show revision history of entire repository or files
712 manifest output the current or given revision of the project manifest
712 manifest output the current or given revision of the project manifest
713 merge merge working directory with another revision
713 merge merge working directory with another revision
714 outgoing show changesets not found in the destination
714 outgoing show changesets not found in the destination
715 parents show the parents of the working directory or revision
715 parents show the parents of the working directory or revision
716 paths show aliases for remote repositories
716 paths show aliases for remote repositories
717 phase set or show the current phase name
717 phase set or show the current phase name
718 pull pull changes from the specified source
718 pull pull changes from the specified source
719 push push changes to the specified destination
719 push push changes to the specified destination
720 recover roll back an interrupted transaction
720 recover roll back an interrupted transaction
721 remove remove the specified files on the next commit
721 remove remove the specified files on the next commit
722 rename rename files; equivalent of copy + remove
722 rename rename files; equivalent of copy + remove
723 resolve redo merges or set/view the merge status of files
723 resolve redo merges or set/view the merge status of files
724 revert restore files to their checkout state
724 revert restore files to their checkout state
725 root print the root (top) of the current working directory
725 root print the root (top) of the current working directory
726 serve start stand-alone webserver
726 serve start stand-alone webserver
727 status show changed files in the working directory
727 status show changed files in the working directory
728 summary summarize working directory state
728 summary summarize working directory state
729 tag add one or more tags for the current or given revision
729 tag add one or more tags for the current or given revision
730 tags list repository tags
730 tags list repository tags
731 unbundle apply one or more changegroup files
731 unbundle apply one or more changegroup files
732 update update working directory (or switch revisions)
732 update update working directory (or switch revisions)
733 verify verify the integrity of the repository
733 verify verify the integrity of the repository
734 version output version and copyright information
734 version output version and copyright information
735
735
736 enabled extensions:
736 enabled extensions:
737
737
738 helpext (no help text available)
738 helpext (no help text available)
739
739
740 additional help topics:
740 additional help topics:
741
741
742 config Configuration Files
742 config Configuration Files
743 dates Date Formats
743 dates Date Formats
744 diffs Diff Formats
744 diffs Diff Formats
745 environment Environment Variables
745 environment Environment Variables
746 extensions Using Additional Features
746 extensions Using Additional Features
747 filesets Specifying File Sets
747 filesets Specifying File Sets
748 glossary Glossary
748 glossary Glossary
749 hgignore Syntax for Mercurial Ignore Files
749 hgignore Syntax for Mercurial Ignore Files
750 hgweb Configuring hgweb
750 hgweb Configuring hgweb
751 merge-tools Merge Tools
751 merge-tools Merge Tools
752 multirevs Specifying Multiple Revisions
752 multirevs Specifying Multiple Revisions
753 patterns File Name Patterns
753 patterns File Name Patterns
754 phases Working with Phases
754 phases Working with Phases
755 revisions Specifying Single Revisions
755 revisions Specifying Single Revisions
756 revsets Specifying Revision Sets
756 revsets Specifying Revision Sets
757 subrepos Subrepositories
757 subrepos Subrepositories
758 templating Template Usage
758 templating Template Usage
759 urls URL Paths
759 urls URL Paths
760
760
761 use "hg -v help" to show builtin aliases and global options
761 use "hg -v help" to show builtin aliases and global options
762
762
763
763
764 Test list of internal help commands
764 Test list of internal help commands
765
765
766 $ hg help debug
766 $ hg help debug
767 debug commands (internal and unsupported):
767 debug commands (internal and unsupported):
768
768
769 debugancestor
769 debugancestor
770 find the ancestor revision of two revisions in a given index
770 find the ancestor revision of two revisions in a given index
771 debugbuilddag
771 debugbuilddag
772 builds a repo with a given DAG from scratch in the current
772 builds a repo with a given DAG from scratch in the current
773 empty repo
773 empty repo
774 debugbundle lists the contents of a bundle
774 debugbundle lists the contents of a bundle
775 debugcheckstate
775 debugcheckstate
776 validate the correctness of the current dirstate
776 validate the correctness of the current dirstate
777 debugcommands
777 debugcommands
778 list all available commands and options
778 list all available commands and options
779 debugcomplete
779 debugcomplete
780 returns the completion list associated with the given command
780 returns the completion list associated with the given command
781 debugdag format the changelog or an index DAG as a concise textual
781 debugdag format the changelog or an index DAG as a concise textual
782 description
782 description
783 debugdata dump the contents of a data file revision
783 debugdata dump the contents of a data file revision
784 debugdate parse and display a date
784 debugdate parse and display a date
785 debugdirstate
785 debugdirstate
786 show the contents of the current dirstate
786 show the contents of the current dirstate
787 debugdiscovery
787 debugdiscovery
788 runs the changeset discovery protocol in isolation
788 runs the changeset discovery protocol in isolation
789 debugfileset parse and apply a fileset specification
789 debugfileset parse and apply a fileset specification
790 debugfsinfo show information detected about current filesystem
790 debugfsinfo show information detected about current filesystem
791 debuggetbundle
791 debuggetbundle
792 retrieves a bundle from a repo
792 retrieves a bundle from a repo
793 debugignore display the combined ignore pattern
793 debugignore display the combined ignore pattern
794 debugindex dump the contents of an index file
794 debugindex dump the contents of an index file
795 debugindexdot
795 debugindexdot
796 dump an index DAG as a graphviz dot file
796 dump an index DAG as a graphviz dot file
797 debuginstall test Mercurial installation
797 debuginstall test Mercurial installation
798 debugknown test whether node ids are known to a repo
798 debugknown test whether node ids are known to a repo
799 debuglabelcomplete
799 debuglabelcomplete
800 complete "labels" - tags, open branch names, bookmark names
800 complete "labels" - tags, open branch names, bookmark names
801 debugobsolete
801 debugobsolete
802 create arbitrary obsolete marker
802 create arbitrary obsolete marker
803 debugoptDEP (no help text available)
803 debugoptDEP (no help text available)
804 debugpathcomplete
804 debugpathcomplete
805 complete part or all of a tracked path
805 complete part or all of a tracked path
806 debugpushkey access the pushkey key/value protocol
806 debugpushkey access the pushkey key/value protocol
807 debugpvec (no help text available)
807 debugpvec (no help text available)
808 debugrebuilddirstate
808 debugrebuilddirstate
809 rebuild the dirstate as it would look like for the given
809 rebuild the dirstate as it would look like for the given
810 revision
810 revision
811 debugrename dump rename information
811 debugrename dump rename information
812 debugrevlog show data and statistics about a revlog
812 debugrevlog show data and statistics about a revlog
813 debugrevspec parse and apply a revision specification
813 debugrevspec parse and apply a revision specification
814 debugsetparents
814 debugsetparents
815 manually set the parents of the current working directory
815 manually set the parents of the current working directory
816 debugsub (no help text available)
816 debugsub (no help text available)
817 debugsuccessorssets
817 debugsuccessorssets
818 show set of successors for revision
818 show set of successors for revision
819 debugwalk show how files match on given patterns
819 debugwalk show how files match on given patterns
820 debugwireargs
820 debugwireargs
821 (no help text available)
821 (no help text available)
822
822
823 use "hg -v help debug" to show builtin aliases and global options
823 use "hg -v help debug" to show builtin aliases and global options
824
824
825
825
826 Test list of commands with command with no help text
826 Test list of commands with command with no help text
827
827
828 $ hg help helpext
828 $ hg help helpext
829 helpext extension - no help text available
829 helpext extension - no help text available
830
830
831 list of commands:
831 list of commands:
832
832
833 nohelp (no help text available)
833 nohelp (no help text available)
834
834
835 use "hg -v help helpext" to show builtin aliases and global options
835 use "hg -v help helpext" to show builtin aliases and global options
836
836
837
837
838 test deprecated option is hidden in command help
838 test deprecated option is hidden in command help
839 $ hg help debugoptDEP
839 $ hg help debugoptDEP
840 hg debugoptDEP
840 hg debugoptDEP
841
841
842 (no help text available)
842 (no help text available)
843
843
844 options:
844 options:
845
845
846 use "hg -v help debugoptDEP" to show the global options
846 use "hg -v help debugoptDEP" to show the global options
847
847
848 test deprecated option is shown with -v
848 test deprecated option is shown with -v
849 $ hg help -v debugoptDEP | grep dopt
849 $ hg help -v debugoptDEP | grep dopt
850 --dopt option is DEPRECATED
850 --dopt option is DEPRECATED
851
851
852 #if gettext
852 #if gettext
853 test deprecated option is hidden with translation with untranslated description
853 test deprecated option is hidden with translation with untranslated description
854 (use many globy for not failing on changed transaction)
854 (use many globy for not failing on changed transaction)
855 $ LANGUAGE=sv hg help debugoptDEP
855 $ LANGUAGE=sv hg help debugoptDEP
856 hg debugoptDEP
856 hg debugoptDEP
857
857
858 (*) (glob)
858 (*) (glob)
859
859
860 flaggor:
860 flaggor:
861
861
862 *"hg -v help debugoptDEP"* (glob)
862 *"hg -v help debugoptDEP"* (glob)
863 #endif
863 #endif
864
864
865 Test a help topic
865 Test a help topic
866
866
867 $ hg help revs
867 $ hg help revs
868 Specifying Single Revisions
868 Specifying Single Revisions
869 """""""""""""""""""""""""""
869 """""""""""""""""""""""""""
870
870
871 Mercurial supports several ways to specify individual revisions.
871 Mercurial supports several ways to specify individual revisions.
872
872
873 A plain integer is treated as a revision number. Negative integers are
873 A plain integer is treated as a revision number. Negative integers are
874 treated as sequential offsets from the tip, with -1 denoting the tip, -2
874 treated as sequential offsets from the tip, with -1 denoting the tip, -2
875 denoting the revision prior to the tip, and so forth.
875 denoting the revision prior to the tip, and so forth.
876
876
877 A 40-digit hexadecimal string is treated as a unique revision identifier.
877 A 40-digit hexadecimal string is treated as a unique revision identifier.
878
878
879 A hexadecimal string less than 40 characters long is treated as a unique
879 A hexadecimal string less than 40 characters long is treated as a unique
880 revision identifier and is referred to as a short-form identifier. A
880 revision identifier and is referred to as a short-form identifier. A
881 short-form identifier is only valid if it is the prefix of exactly one
881 short-form identifier is only valid if it is the prefix of exactly one
882 full-length identifier.
882 full-length identifier.
883
883
884 Any other string is treated as a bookmark, tag, or branch name. A bookmark
884 Any other string is treated as a bookmark, tag, or branch name. A bookmark
885 is a movable pointer to a revision. A tag is a permanent name associated
885 is a movable pointer to a revision. A tag is a permanent name associated
886 with a revision. A branch name denotes the tipmost open branch head of
886 with a revision. A branch name denotes the tipmost open branch head of
887 that branch - or if they are all closed, the tipmost closed head of the
887 that branch - or if they are all closed, the tipmost closed head of the
888 branch. Bookmark, tag, and branch names must not contain the ":"
888 branch. Bookmark, tag, and branch names must not contain the ":"
889 character.
889 character.
890
890
891 The reserved name "tip" always identifies the most recent revision.
891 The reserved name "tip" always identifies the most recent revision.
892
892
893 The reserved name "null" indicates the null revision. This is the revision
893 The reserved name "null" indicates the null revision. This is the revision
894 of an empty repository, and the parent of revision 0.
894 of an empty repository, and the parent of revision 0.
895
895
896 The reserved name "." indicates the working directory parent. If no
896 The reserved name "." indicates the working directory parent. If no
897 working directory is checked out, it is equivalent to null. If an
897 working directory is checked out, it is equivalent to null. If an
898 uncommitted merge is in progress, "." is the revision of the first parent.
898 uncommitted merge is in progress, "." is the revision of the first parent.
899
899
900 Test templating help
900 Test templating help
901
901
902 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
902 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
903 desc String. The text of the changeset description.
903 desc String. The text of the changeset description.
904 diffstat String. Statistics of changes with the following format:
904 diffstat String. Statistics of changes with the following format:
905 firstline Any text. Returns the first line of text.
905 firstline Any text. Returns the first line of text.
906 nonempty Any text. Returns '(none)' if the string is empty.
906 nonempty Any text. Returns '(none)' if the string is empty.
907
907
908 Test help hooks
908 Test help hooks
909
909
910 $ cat > helphook1.py <<EOF
910 $ cat > helphook1.py <<EOF
911 > from mercurial import help
911 > from mercurial import help
912 >
912 >
913 > def rewrite(topic, doc):
913 > def rewrite(topic, doc):
914 > return doc + '\nhelphook1\n'
914 > return doc + '\nhelphook1\n'
915 >
915 >
916 > def extsetup(ui):
916 > def extsetup(ui):
917 > help.addtopichook('revsets', rewrite)
917 > help.addtopichook('revsets', rewrite)
918 > EOF
918 > EOF
919 $ cat > helphook2.py <<EOF
919 $ cat > helphook2.py <<EOF
920 > from mercurial import help
920 > from mercurial import help
921 >
921 >
922 > def rewrite(topic, doc):
922 > def rewrite(topic, doc):
923 > return doc + '\nhelphook2\n'
923 > return doc + '\nhelphook2\n'
924 >
924 >
925 > def extsetup(ui):
925 > def extsetup(ui):
926 > help.addtopichook('revsets', rewrite)
926 > help.addtopichook('revsets', rewrite)
927 > EOF
927 > EOF
928 $ echo '[extensions]' >> $HGRCPATH
928 $ echo '[extensions]' >> $HGRCPATH
929 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
929 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
930 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
930 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
931 $ hg help revsets | grep helphook
931 $ hg help revsets | grep helphook
932 helphook1
932 helphook1
933 helphook2
933 helphook2
934
934
935 Test keyword search help
935 Test keyword search help
936
936
937 $ cat > prefixedname.py <<EOF
937 $ cat > prefixedname.py <<EOF
938 > '''matched against word "clone"
938 > '''matched against word "clone"
939 > '''
939 > '''
940 > EOF
940 > EOF
941 $ echo '[extensions]' >> $HGRCPATH
941 $ echo '[extensions]' >> $HGRCPATH
942 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
942 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
943 $ hg help -k clone
943 $ hg help -k clone
944 Topics:
944 Topics:
945
945
946 config Configuration Files
946 config Configuration Files
947 extensions Using Additional Features
947 extensions Using Additional Features
948 glossary Glossary
948 glossary Glossary
949 phases Working with Phases
949 phases Working with Phases
950 subrepos Subrepositories
950 subrepos Subrepositories
951 urls URL Paths
951 urls URL Paths
952
952
953 Commands:
953 Commands:
954
954
955 bookmarks create a new bookmark or list existing bookmarks
955 bookmarks create a new bookmark or list existing bookmarks
956 clone make a copy of an existing repository
956 clone make a copy of an existing repository
957 paths show aliases for remote repositories
957 paths show aliases for remote repositories
958 update update working directory (or switch revisions)
958 update update working directory (or switch revisions)
959
959
960 Extensions:
960 Extensions:
961
961
962 prefixedname matched against word "clone"
962 prefixedname matched against word "clone"
963 relink recreates hardlinks between repository clones
963 relink recreates hardlinks between repository clones
964
964
965 Extension Commands:
965 Extension Commands:
966
966
967 qclone clone main and patch repository at same time
967 qclone clone main and patch repository at same time
968
968
969 Test unfound topic
969 Test unfound topic
970
970
971 $ hg help nonexistingtopicthatwillneverexisteverever
971 $ hg help nonexistingtopicthatwillneverexisteverever
972 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
972 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
973 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
973 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
974 [255]
974 [255]
975
975
976 Test unfound keyword
976 Test unfound keyword
977
977
978 $ hg help --keyword nonexistingwordthatwillneverexisteverever
978 $ hg help --keyword nonexistingwordthatwillneverexisteverever
979 abort: no matches
979 abort: no matches
980 (try "hg help" for a list of topics)
980 (try "hg help" for a list of topics)
981 [255]
981 [255]
982
982
983 Test omit indicating for help
983 Test omit indicating for help
984
984
985 $ cat > addverboseitems.py <<EOF
985 $ cat > addverboseitems.py <<EOF
986 > '''extension to test omit indicating.
986 > '''extension to test omit indicating.
987 >
987 >
988 > This paragraph is never omitted (for extension)
988 > This paragraph is never omitted (for extension)
989 >
989 >
990 > .. container:: verbose
990 > .. container:: verbose
991 >
991 >
992 > This paragraph is omitted,
992 > This paragraph is omitted,
993 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
993 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
994 >
994 >
995 > This paragraph is never omitted, too (for extension)
995 > This paragraph is never omitted, too (for extension)
996 > '''
996 > '''
997 >
997 >
998 > from mercurial import help, commands
998 > from mercurial import help, commands
999 > testtopic = """This paragraph is never omitted (for topic).
999 > testtopic = """This paragraph is never omitted (for topic).
1000 >
1000 >
1001 > .. container:: verbose
1001 > .. container:: verbose
1002 >
1002 >
1003 > This paragraph is omitted,
1003 > This paragraph is omitted,
1004 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
1004 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
1005 >
1005 >
1006 > This paragraph is never omitted, too (for topic)
1006 > This paragraph is never omitted, too (for topic)
1007 > """
1007 > """
1008 > def extsetup(ui):
1008 > def extsetup(ui):
1009 > help.helptable.append((["topic-containing-verbose"],
1009 > help.helptable.append((["topic-containing-verbose"],
1010 > "This is the topic to test omit indicating.",
1010 > "This is the topic to test omit indicating.",
1011 > lambda : testtopic))
1011 > lambda : testtopic))
1012 > EOF
1012 > EOF
1013 $ echo '[extensions]' >> $HGRCPATH
1013 $ echo '[extensions]' >> $HGRCPATH
1014 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1014 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1015 $ hg help addverboseitems
1015 $ hg help addverboseitems
1016 addverboseitems extension - extension to test omit indicating.
1016 addverboseitems extension - extension to test omit indicating.
1017
1017
1018 This paragraph is never omitted (for extension)
1018 This paragraph is never omitted (for extension)
1019
1019
1020 This paragraph is never omitted, too (for extension)
1020 This paragraph is never omitted, too (for extension)
1021
1021
1022 use "hg help -v addverboseitems" to show more complete help
1022 use "hg help -v addverboseitems" to show more complete help
1023
1023
1024 no commands defined
1024 no commands defined
1025 $ hg help -v addverboseitems
1025 $ hg help -v addverboseitems
1026 addverboseitems extension - extension to test omit indicating.
1026 addverboseitems extension - extension to test omit indicating.
1027
1027
1028 This paragraph is never omitted (for extension)
1028 This paragraph is never omitted (for extension)
1029
1029
1030 This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
1030 This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
1031
1031
1032 This paragraph is never omitted, too (for extension)
1032 This paragraph is never omitted, too (for extension)
1033
1033
1034 no commands defined
1034 no commands defined
1035 $ hg help topic-containing-verbose
1035 $ hg help topic-containing-verbose
1036 This is the topic to test omit indicating.
1036 This is the topic to test omit indicating.
1037 """"""""""""""""""""""""""""""""""""""""""
1037 """"""""""""""""""""""""""""""""""""""""""
1038
1038
1039 This paragraph is never omitted (for topic).
1039 This paragraph is never omitted (for topic).
1040
1040
1041 This paragraph is never omitted, too (for topic)
1041 This paragraph is never omitted, too (for topic)
1042
1042
1043 use "hg help -v topic-containing-verbose" to show more complete help
1043 use "hg help -v topic-containing-verbose" to show more complete help
1044 $ hg help -v topic-containing-verbose
1044 $ hg help -v topic-containing-verbose
1045 This is the topic to test omit indicating.
1045 This is the topic to test omit indicating.
1046 """"""""""""""""""""""""""""""""""""""""""
1046 """"""""""""""""""""""""""""""""""""""""""
1047
1047
1048 This paragraph is never omitted (for topic).
1048 This paragraph is never omitted (for topic).
1049
1049
1050 This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
1050 This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
1051
1051
1052 This paragraph is never omitted, too (for topic)
1052 This paragraph is never omitted, too (for topic)
1053
1053
1054 Test usage of section marks in help documents
1054 Test usage of section marks in help documents
1055
1055
1056 $ cd "$TESTDIR"/../doc
1056 $ cd "$TESTDIR"/../doc
1057 $ python check-seclevel.py
1057 $ python check-seclevel.py
1058 $ cd $TESTTMP
1058 $ cd $TESTTMP
1059
1059
1060 #if serve
1060 #if serve
1061
1061
1062 Test the help pages in hgweb.
1062 Test the help pages in hgweb.
1063
1063
1064 Dish up an empty repo; serve it cold.
1064 Dish up an empty repo; serve it cold.
1065
1065
1066 $ hg init "$TESTTMP/test"
1066 $ hg init "$TESTTMP/test"
1067 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1067 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1068 $ cat hg.pid >> $DAEMON_PIDS
1068 $ cat hg.pid >> $DAEMON_PIDS
1069
1069
1070 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
1070 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
1071 200 Script output follows
1071 200 Script output follows
1072
1072
1073 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1073 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1074 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1074 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1075 <head>
1075 <head>
1076 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1076 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1077 <meta name="robots" content="index, nofollow" />
1077 <meta name="robots" content="index, nofollow" />
1078 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1078 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1079 <script type="text/javascript" src="/static/mercurial.js"></script>
1079 <script type="text/javascript" src="/static/mercurial.js"></script>
1080
1080
1081 <title>Help: Index</title>
1081 <title>Help: Index</title>
1082 </head>
1082 </head>
1083 <body>
1083 <body>
1084
1084
1085 <div class="container">
1085 <div class="container">
1086 <div class="menu">
1086 <div class="menu">
1087 <div class="logo">
1087 <div class="logo">
1088 <a href="http://mercurial.selenic.com/">
1088 <a href="http://mercurial.selenic.com/">
1089 <img src="/static/hglogo.png" alt="mercurial" /></a>
1089 <img src="/static/hglogo.png" alt="mercurial" /></a>
1090 </div>
1090 </div>
1091 <ul>
1091 <ul>
1092 <li><a href="/shortlog">log</a></li>
1092 <li><a href="/shortlog">log</a></li>
1093 <li><a href="/graph">graph</a></li>
1093 <li><a href="/graph">graph</a></li>
1094 <li><a href="/tags">tags</a></li>
1094 <li><a href="/tags">tags</a></li>
1095 <li><a href="/bookmarks">bookmarks</a></li>
1095 <li><a href="/bookmarks">bookmarks</a></li>
1096 <li><a href="/branches">branches</a></li>
1096 <li><a href="/branches">branches</a></li>
1097 </ul>
1097 </ul>
1098 <ul>
1098 <ul>
1099 <li class="active">help</li>
1099 <li class="active">help</li>
1100 </ul>
1100 </ul>
1101 </div>
1101 </div>
1102
1102
1103 <div class="main">
1103 <div class="main">
1104 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1104 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1105 <form class="search" action="/log">
1105 <form class="search" action="/log">
1106
1106
1107 <p><input name="rev" id="search1" type="text" size="30" /></p>
1107 <p><input name="rev" id="search1" type="text" size="30" /></p>
1108 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1108 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1109 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1109 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1110 </form>
1110 </form>
1111 <table class="bigtable">
1111 <table class="bigtable">
1112 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1112 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1113
1113
1114 <tr><td>
1114 <tr><td>
1115 <a href="/help/config">
1115 <a href="/help/config">
1116 config
1116 config
1117 </a>
1117 </a>
1118 </td><td>
1118 </td><td>
1119 Configuration Files
1119 Configuration Files
1120 </td></tr>
1120 </td></tr>
1121 <tr><td>
1121 <tr><td>
1122 <a href="/help/dates">
1122 <a href="/help/dates">
1123 dates
1123 dates
1124 </a>
1124 </a>
1125 </td><td>
1125 </td><td>
1126 Date Formats
1126 Date Formats
1127 </td></tr>
1127 </td></tr>
1128 <tr><td>
1128 <tr><td>
1129 <a href="/help/diffs">
1129 <a href="/help/diffs">
1130 diffs
1130 diffs
1131 </a>
1131 </a>
1132 </td><td>
1132 </td><td>
1133 Diff Formats
1133 Diff Formats
1134 </td></tr>
1134 </td></tr>
1135 <tr><td>
1135 <tr><td>
1136 <a href="/help/environment">
1136 <a href="/help/environment">
1137 environment
1137 environment
1138 </a>
1138 </a>
1139 </td><td>
1139 </td><td>
1140 Environment Variables
1140 Environment Variables
1141 </td></tr>
1141 </td></tr>
1142 <tr><td>
1142 <tr><td>
1143 <a href="/help/extensions">
1143 <a href="/help/extensions">
1144 extensions
1144 extensions
1145 </a>
1145 </a>
1146 </td><td>
1146 </td><td>
1147 Using Additional Features
1147 Using Additional Features
1148 </td></tr>
1148 </td></tr>
1149 <tr><td>
1149 <tr><td>
1150 <a href="/help/filesets">
1150 <a href="/help/filesets">
1151 filesets
1151 filesets
1152 </a>
1152 </a>
1153 </td><td>
1153 </td><td>
1154 Specifying File Sets
1154 Specifying File Sets
1155 </td></tr>
1155 </td></tr>
1156 <tr><td>
1156 <tr><td>
1157 <a href="/help/glossary">
1157 <a href="/help/glossary">
1158 glossary
1158 glossary
1159 </a>
1159 </a>
1160 </td><td>
1160 </td><td>
1161 Glossary
1161 Glossary
1162 </td></tr>
1162 </td></tr>
1163 <tr><td>
1163 <tr><td>
1164 <a href="/help/hgignore">
1164 <a href="/help/hgignore">
1165 hgignore
1165 hgignore
1166 </a>
1166 </a>
1167 </td><td>
1167 </td><td>
1168 Syntax for Mercurial Ignore Files
1168 Syntax for Mercurial Ignore Files
1169 </td></tr>
1169 </td></tr>
1170 <tr><td>
1170 <tr><td>
1171 <a href="/help/hgweb">
1171 <a href="/help/hgweb">
1172 hgweb
1172 hgweb
1173 </a>
1173 </a>
1174 </td><td>
1174 </td><td>
1175 Configuring hgweb
1175 Configuring hgweb
1176 </td></tr>
1176 </td></tr>
1177 <tr><td>
1177 <tr><td>
1178 <a href="/help/merge-tools">
1178 <a href="/help/merge-tools">
1179 merge-tools
1179 merge-tools
1180 </a>
1180 </a>
1181 </td><td>
1181 </td><td>
1182 Merge Tools
1182 Merge Tools
1183 </td></tr>
1183 </td></tr>
1184 <tr><td>
1184 <tr><td>
1185 <a href="/help/multirevs">
1185 <a href="/help/multirevs">
1186 multirevs
1186 multirevs
1187 </a>
1187 </a>
1188 </td><td>
1188 </td><td>
1189 Specifying Multiple Revisions
1189 Specifying Multiple Revisions
1190 </td></tr>
1190 </td></tr>
1191 <tr><td>
1191 <tr><td>
1192 <a href="/help/patterns">
1192 <a href="/help/patterns">
1193 patterns
1193 patterns
1194 </a>
1194 </a>
1195 </td><td>
1195 </td><td>
1196 File Name Patterns
1196 File Name Patterns
1197 </td></tr>
1197 </td></tr>
1198 <tr><td>
1198 <tr><td>
1199 <a href="/help/phases">
1199 <a href="/help/phases">
1200 phases
1200 phases
1201 </a>
1201 </a>
1202 </td><td>
1202 </td><td>
1203 Working with Phases
1203 Working with Phases
1204 </td></tr>
1204 </td></tr>
1205 <tr><td>
1205 <tr><td>
1206 <a href="/help/revisions">
1206 <a href="/help/revisions">
1207 revisions
1207 revisions
1208 </a>
1208 </a>
1209 </td><td>
1209 </td><td>
1210 Specifying Single Revisions
1210 Specifying Single Revisions
1211 </td></tr>
1211 </td></tr>
1212 <tr><td>
1212 <tr><td>
1213 <a href="/help/revsets">
1213 <a href="/help/revsets">
1214 revsets
1214 revsets
1215 </a>
1215 </a>
1216 </td><td>
1216 </td><td>
1217 Specifying Revision Sets
1217 Specifying Revision Sets
1218 </td></tr>
1218 </td></tr>
1219 <tr><td>
1219 <tr><td>
1220 <a href="/help/subrepos">
1220 <a href="/help/subrepos">
1221 subrepos
1221 subrepos
1222 </a>
1222 </a>
1223 </td><td>
1223 </td><td>
1224 Subrepositories
1224 Subrepositories
1225 </td></tr>
1225 </td></tr>
1226 <tr><td>
1226 <tr><td>
1227 <a href="/help/templating">
1227 <a href="/help/templating">
1228 templating
1228 templating
1229 </a>
1229 </a>
1230 </td><td>
1230 </td><td>
1231 Template Usage
1231 Template Usage
1232 </td></tr>
1232 </td></tr>
1233 <tr><td>
1233 <tr><td>
1234 <a href="/help/urls">
1234 <a href="/help/urls">
1235 urls
1235 urls
1236 </a>
1236 </a>
1237 </td><td>
1237 </td><td>
1238 URL Paths
1238 URL Paths
1239 </td></tr>
1239 </td></tr>
1240 <tr><td>
1240 <tr><td>
1241 <a href="/help/topic-containing-verbose">
1241 <a href="/help/topic-containing-verbose">
1242 topic-containing-verbose
1242 topic-containing-verbose
1243 </a>
1243 </a>
1244 </td><td>
1244 </td><td>
1245 This is the topic to test omit indicating.
1245 This is the topic to test omit indicating.
1246 </td></tr>
1246 </td></tr>
1247
1247
1248 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1248 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1249
1249
1250 <tr><td>
1250 <tr><td>
1251 <a href="/help/add">
1251 <a href="/help/add">
1252 add
1252 add
1253 </a>
1253 </a>
1254 </td><td>
1254 </td><td>
1255 add the specified files on the next commit
1255 add the specified files on the next commit
1256 </td></tr>
1256 </td></tr>
1257 <tr><td>
1257 <tr><td>
1258 <a href="/help/annotate">
1258 <a href="/help/annotate">
1259 annotate
1259 annotate
1260 </a>
1260 </a>
1261 </td><td>
1261 </td><td>
1262 show changeset information by line for each file
1262 show changeset information by line for each file
1263 </td></tr>
1263 </td></tr>
1264 <tr><td>
1264 <tr><td>
1265 <a href="/help/clone">
1265 <a href="/help/clone">
1266 clone
1266 clone
1267 </a>
1267 </a>
1268 </td><td>
1268 </td><td>
1269 make a copy of an existing repository
1269 make a copy of an existing repository
1270 </td></tr>
1270 </td></tr>
1271 <tr><td>
1271 <tr><td>
1272 <a href="/help/commit">
1272 <a href="/help/commit">
1273 commit
1273 commit
1274 </a>
1274 </a>
1275 </td><td>
1275 </td><td>
1276 commit the specified files or all outstanding changes
1276 commit the specified files or all outstanding changes
1277 </td></tr>
1277 </td></tr>
1278 <tr><td>
1278 <tr><td>
1279 <a href="/help/diff">
1279 <a href="/help/diff">
1280 diff
1280 diff
1281 </a>
1281 </a>
1282 </td><td>
1282 </td><td>
1283 diff repository (or selected files)
1283 diff repository (or selected files)
1284 </td></tr>
1284 </td></tr>
1285 <tr><td>
1285 <tr><td>
1286 <a href="/help/export">
1286 <a href="/help/export">
1287 export
1287 export
1288 </a>
1288 </a>
1289 </td><td>
1289 </td><td>
1290 dump the header and diffs for one or more changesets
1290 dump the header and diffs for one or more changesets
1291 </td></tr>
1291 </td></tr>
1292 <tr><td>
1292 <tr><td>
1293 <a href="/help/forget">
1293 <a href="/help/forget">
1294 forget
1294 forget
1295 </a>
1295 </a>
1296 </td><td>
1296 </td><td>
1297 forget the specified files on the next commit
1297 forget the specified files on the next commit
1298 </td></tr>
1298 </td></tr>
1299 <tr><td>
1299 <tr><td>
1300 <a href="/help/init">
1300 <a href="/help/init">
1301 init
1301 init
1302 </a>
1302 </a>
1303 </td><td>
1303 </td><td>
1304 create a new repository in the given directory
1304 create a new repository in the given directory
1305 </td></tr>
1305 </td></tr>
1306 <tr><td>
1306 <tr><td>
1307 <a href="/help/log">
1307 <a href="/help/log">
1308 log
1308 log
1309 </a>
1309 </a>
1310 </td><td>
1310 </td><td>
1311 show revision history of entire repository or files
1311 show revision history of entire repository or files
1312 </td></tr>
1312 </td></tr>
1313 <tr><td>
1313 <tr><td>
1314 <a href="/help/merge">
1314 <a href="/help/merge">
1315 merge
1315 merge
1316 </a>
1316 </a>
1317 </td><td>
1317 </td><td>
1318 merge working directory with another revision
1318 merge working directory with another revision
1319 </td></tr>
1319 </td></tr>
1320 <tr><td>
1320 <tr><td>
1321 <a href="/help/pull">
1321 <a href="/help/pull">
1322 pull
1322 pull
1323 </a>
1323 </a>
1324 </td><td>
1324 </td><td>
1325 pull changes from the specified source
1325 pull changes from the specified source
1326 </td></tr>
1326 </td></tr>
1327 <tr><td>
1327 <tr><td>
1328 <a href="/help/push">
1328 <a href="/help/push">
1329 push
1329 push
1330 </a>
1330 </a>
1331 </td><td>
1331 </td><td>
1332 push changes to the specified destination
1332 push changes to the specified destination
1333 </td></tr>
1333 </td></tr>
1334 <tr><td>
1334 <tr><td>
1335 <a href="/help/remove">
1335 <a href="/help/remove">
1336 remove
1336 remove
1337 </a>
1337 </a>
1338 </td><td>
1338 </td><td>
1339 remove the specified files on the next commit
1339 remove the specified files on the next commit
1340 </td></tr>
1340 </td></tr>
1341 <tr><td>
1341 <tr><td>
1342 <a href="/help/serve">
1342 <a href="/help/serve">
1343 serve
1343 serve
1344 </a>
1344 </a>
1345 </td><td>
1345 </td><td>
1346 start stand-alone webserver
1346 start stand-alone webserver
1347 </td></tr>
1347 </td></tr>
1348 <tr><td>
1348 <tr><td>
1349 <a href="/help/status">
1349 <a href="/help/status">
1350 status
1350 status
1351 </a>
1351 </a>
1352 </td><td>
1352 </td><td>
1353 show changed files in the working directory
1353 show changed files in the working directory
1354 </td></tr>
1354 </td></tr>
1355 <tr><td>
1355 <tr><td>
1356 <a href="/help/summary">
1356 <a href="/help/summary">
1357 summary
1357 summary
1358 </a>
1358 </a>
1359 </td><td>
1359 </td><td>
1360 summarize working directory state
1360 summarize working directory state
1361 </td></tr>
1361 </td></tr>
1362 <tr><td>
1362 <tr><td>
1363 <a href="/help/update">
1363 <a href="/help/update">
1364 update
1364 update
1365 </a>
1365 </a>
1366 </td><td>
1366 </td><td>
1367 update working directory (or switch revisions)
1367 update working directory (or switch revisions)
1368 </td></tr>
1368 </td></tr>
1369
1369
1370 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1370 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1371
1371
1372 <tr><td>
1372 <tr><td>
1373 <a href="/help/addremove">
1373 <a href="/help/addremove">
1374 addremove
1374 addremove
1375 </a>
1375 </a>
1376 </td><td>
1376 </td><td>
1377 add all new files, delete all missing files
1377 add all new files, delete all missing files
1378 </td></tr>
1378 </td></tr>
1379 <tr><td>
1379 <tr><td>
1380 <a href="/help/archive">
1380 <a href="/help/archive">
1381 archive
1381 archive
1382 </a>
1382 </a>
1383 </td><td>
1383 </td><td>
1384 create an unversioned archive of a repository revision
1384 create an unversioned archive of a repository revision
1385 </td></tr>
1385 </td></tr>
1386 <tr><td>
1386 <tr><td>
1387 <a href="/help/backout">
1387 <a href="/help/backout">
1388 backout
1388 backout
1389 </a>
1389 </a>
1390 </td><td>
1390 </td><td>
1391 reverse effect of earlier changeset
1391 reverse effect of earlier changeset
1392 </td></tr>
1392 </td></tr>
1393 <tr><td>
1393 <tr><td>
1394 <a href="/help/bisect">
1394 <a href="/help/bisect">
1395 bisect
1395 bisect
1396 </a>
1396 </a>
1397 </td><td>
1397 </td><td>
1398 subdivision search of changesets
1398 subdivision search of changesets
1399 </td></tr>
1399 </td></tr>
1400 <tr><td>
1400 <tr><td>
1401 <a href="/help/bookmarks">
1401 <a href="/help/bookmarks">
1402 bookmarks
1402 bookmarks
1403 </a>
1403 </a>
1404 </td><td>
1404 </td><td>
1405 create a new bookmark or list existing bookmarks
1405 create a new bookmark or list existing bookmarks
1406 </td></tr>
1406 </td></tr>
1407 <tr><td>
1407 <tr><td>
1408 <a href="/help/branch">
1408 <a href="/help/branch">
1409 branch
1409 branch
1410 </a>
1410 </a>
1411 </td><td>
1411 </td><td>
1412 set or show the current branch name
1412 set or show the current branch name
1413 </td></tr>
1413 </td></tr>
1414 <tr><td>
1414 <tr><td>
1415 <a href="/help/branches">
1415 <a href="/help/branches">
1416 branches
1416 branches
1417 </a>
1417 </a>
1418 </td><td>
1418 </td><td>
1419 list repository named branches
1419 list repository named branches
1420 </td></tr>
1420 </td></tr>
1421 <tr><td>
1421 <tr><td>
1422 <a href="/help/bundle">
1422 <a href="/help/bundle">
1423 bundle
1423 bundle
1424 </a>
1424 </a>
1425 </td><td>
1425 </td><td>
1426 create a changegroup file
1426 create a changegroup file
1427 </td></tr>
1427 </td></tr>
1428 <tr><td>
1428 <tr><td>
1429 <a href="/help/cat">
1429 <a href="/help/cat">
1430 cat
1430 cat
1431 </a>
1431 </a>
1432 </td><td>
1432 </td><td>
1433 output the current or given revision of files
1433 output the current or given revision of files
1434 </td></tr>
1434 </td></tr>
1435 <tr><td>
1435 <tr><td>
1436 <a href="/help/config">
1436 <a href="/help/config">
1437 config
1437 config
1438 </a>
1438 </a>
1439 </td><td>
1439 </td><td>
1440 show combined config settings from all hgrc files
1440 show combined config settings from all hgrc files
1441 </td></tr>
1441 </td></tr>
1442 <tr><td>
1442 <tr><td>
1443 <a href="/help/copy">
1443 <a href="/help/copy">
1444 copy
1444 copy
1445 </a>
1445 </a>
1446 </td><td>
1446 </td><td>
1447 mark files as copied for the next commit
1447 mark files as copied for the next commit
1448 </td></tr>
1448 </td></tr>
1449 <tr><td>
1449 <tr><td>
1450 <a href="/help/graft">
1450 <a href="/help/graft">
1451 graft
1451 graft
1452 </a>
1452 </a>
1453 </td><td>
1453 </td><td>
1454 copy changes from other branches onto the current branch
1454 copy changes from other branches onto the current branch
1455 </td></tr>
1455 </td></tr>
1456 <tr><td>
1456 <tr><td>
1457 <a href="/help/grep">
1457 <a href="/help/grep">
1458 grep
1458 grep
1459 </a>
1459 </a>
1460 </td><td>
1460 </td><td>
1461 search for a pattern in specified files and revisions
1461 search for a pattern in specified files and revisions
1462 </td></tr>
1462 </td></tr>
1463 <tr><td>
1463 <tr><td>
1464 <a href="/help/heads">
1464 <a href="/help/heads">
1465 heads
1465 heads
1466 </a>
1466 </a>
1467 </td><td>
1467 </td><td>
1468 show branch heads
1468 show branch heads
1469 </td></tr>
1469 </td></tr>
1470 <tr><td>
1470 <tr><td>
1471 <a href="/help/help">
1471 <a href="/help/help">
1472 help
1472 help
1473 </a>
1473 </a>
1474 </td><td>
1474 </td><td>
1475 show help for a given topic or a help overview
1475 show help for a given topic or a help overview
1476 </td></tr>
1476 </td></tr>
1477 <tr><td>
1477 <tr><td>
1478 <a href="/help/identify">
1478 <a href="/help/identify">
1479 identify
1479 identify
1480 </a>
1480 </a>
1481 </td><td>
1481 </td><td>
1482 identify the working copy or specified revision
1482 identify the working copy or specified revision
1483 </td></tr>
1483 </td></tr>
1484 <tr><td>
1484 <tr><td>
1485 <a href="/help/import">
1485 <a href="/help/import">
1486 import
1486 import
1487 </a>
1487 </a>
1488 </td><td>
1488 </td><td>
1489 import an ordered set of patches
1489 import an ordered set of patches
1490 </td></tr>
1490 </td></tr>
1491 <tr><td>
1491 <tr><td>
1492 <a href="/help/incoming">
1492 <a href="/help/incoming">
1493 incoming
1493 incoming
1494 </a>
1494 </a>
1495 </td><td>
1495 </td><td>
1496 show new changesets found in source
1496 show new changesets found in source
1497 </td></tr>
1497 </td></tr>
1498 <tr><td>
1498 <tr><td>
1499 <a href="/help/locate">
1499 <a href="/help/locate">
1500 locate
1500 locate
1501 </a>
1501 </a>
1502 </td><td>
1502 </td><td>
1503 locate files matching specific patterns
1503 locate files matching specific patterns
1504 </td></tr>
1504 </td></tr>
1505 <tr><td>
1505 <tr><td>
1506 <a href="/help/manifest">
1506 <a href="/help/manifest">
1507 manifest
1507 manifest
1508 </a>
1508 </a>
1509 </td><td>
1509 </td><td>
1510 output the current or given revision of the project manifest
1510 output the current or given revision of the project manifest
1511 </td></tr>
1511 </td></tr>
1512 <tr><td>
1512 <tr><td>
1513 <a href="/help/nohelp">
1513 <a href="/help/nohelp">
1514 nohelp
1514 nohelp
1515 </a>
1515 </a>
1516 </td><td>
1516 </td><td>
1517 (no help text available)
1517 (no help text available)
1518 </td></tr>
1518 </td></tr>
1519 <tr><td>
1519 <tr><td>
1520 <a href="/help/outgoing">
1520 <a href="/help/outgoing">
1521 outgoing
1521 outgoing
1522 </a>
1522 </a>
1523 </td><td>
1523 </td><td>
1524 show changesets not found in the destination
1524 show changesets not found in the destination
1525 </td></tr>
1525 </td></tr>
1526 <tr><td>
1526 <tr><td>
1527 <a href="/help/parents">
1527 <a href="/help/parents">
1528 parents
1528 parents
1529 </a>
1529 </a>
1530 </td><td>
1530 </td><td>
1531 show the parents of the working directory or revision
1531 show the parents of the working directory or revision
1532 </td></tr>
1532 </td></tr>
1533 <tr><td>
1533 <tr><td>
1534 <a href="/help/paths">
1534 <a href="/help/paths">
1535 paths
1535 paths
1536 </a>
1536 </a>
1537 </td><td>
1537 </td><td>
1538 show aliases for remote repositories
1538 show aliases for remote repositories
1539 </td></tr>
1539 </td></tr>
1540 <tr><td>
1540 <tr><td>
1541 <a href="/help/phase">
1541 <a href="/help/phase">
1542 phase
1542 phase
1543 </a>
1543 </a>
1544 </td><td>
1544 </td><td>
1545 set or show the current phase name
1545 set or show the current phase name
1546 </td></tr>
1546 </td></tr>
1547 <tr><td>
1547 <tr><td>
1548 <a href="/help/recover">
1548 <a href="/help/recover">
1549 recover
1549 recover
1550 </a>
1550 </a>
1551 </td><td>
1551 </td><td>
1552 roll back an interrupted transaction
1552 roll back an interrupted transaction
1553 </td></tr>
1553 </td></tr>
1554 <tr><td>
1554 <tr><td>
1555 <a href="/help/rename">
1555 <a href="/help/rename">
1556 rename
1556 rename
1557 </a>
1557 </a>
1558 </td><td>
1558 </td><td>
1559 rename files; equivalent of copy + remove
1559 rename files; equivalent of copy + remove
1560 </td></tr>
1560 </td></tr>
1561 <tr><td>
1561 <tr><td>
1562 <a href="/help/resolve">
1562 <a href="/help/resolve">
1563 resolve
1563 resolve
1564 </a>
1564 </a>
1565 </td><td>
1565 </td><td>
1566 redo merges or set/view the merge status of files
1566 redo merges or set/view the merge status of files
1567 </td></tr>
1567 </td></tr>
1568 <tr><td>
1568 <tr><td>
1569 <a href="/help/revert">
1569 <a href="/help/revert">
1570 revert
1570 revert
1571 </a>
1571 </a>
1572 </td><td>
1572 </td><td>
1573 restore files to their checkout state
1573 restore files to their checkout state
1574 </td></tr>
1574 </td></tr>
1575 <tr><td>
1575 <tr><td>
1576 <a href="/help/root">
1576 <a href="/help/root">
1577 root
1577 root
1578 </a>
1578 </a>
1579 </td><td>
1579 </td><td>
1580 print the root (top) of the current working directory
1580 print the root (top) of the current working directory
1581 </td></tr>
1581 </td></tr>
1582 <tr><td>
1582 <tr><td>
1583 <a href="/help/tag">
1583 <a href="/help/tag">
1584 tag
1584 tag
1585 </a>
1585 </a>
1586 </td><td>
1586 </td><td>
1587 add one or more tags for the current or given revision
1587 add one or more tags for the current or given revision
1588 </td></tr>
1588 </td></tr>
1589 <tr><td>
1589 <tr><td>
1590 <a href="/help/tags">
1590 <a href="/help/tags">
1591 tags
1591 tags
1592 </a>
1592 </a>
1593 </td><td>
1593 </td><td>
1594 list repository tags
1594 list repository tags
1595 </td></tr>
1595 </td></tr>
1596 <tr><td>
1596 <tr><td>
1597 <a href="/help/unbundle">
1597 <a href="/help/unbundle">
1598 unbundle
1598 unbundle
1599 </a>
1599 </a>
1600 </td><td>
1600 </td><td>
1601 apply one or more changegroup files
1601 apply one or more changegroup files
1602 </td></tr>
1602 </td></tr>
1603 <tr><td>
1603 <tr><td>
1604 <a href="/help/verify">
1604 <a href="/help/verify">
1605 verify
1605 verify
1606 </a>
1606 </a>
1607 </td><td>
1607 </td><td>
1608 verify the integrity of the repository
1608 verify the integrity of the repository
1609 </td></tr>
1609 </td></tr>
1610 <tr><td>
1610 <tr><td>
1611 <a href="/help/version">
1611 <a href="/help/version">
1612 version
1612 version
1613 </a>
1613 </a>
1614 </td><td>
1614 </td><td>
1615 output version and copyright information
1615 output version and copyright information
1616 </td></tr>
1616 </td></tr>
1617 </table>
1617 </table>
1618 </div>
1618 </div>
1619 </div>
1619 </div>
1620
1620
1621 <script type="text/javascript">process_dates()</script>
1621 <script type="text/javascript">process_dates()</script>
1622
1622
1623
1623
1624 </body>
1624 </body>
1625 </html>
1625 </html>
1626
1626
1627
1627
1628 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
1628 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
1629 200 Script output follows
1629 200 Script output follows
1630
1630
1631 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1631 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1632 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1632 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1633 <head>
1633 <head>
1634 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1634 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1635 <meta name="robots" content="index, nofollow" />
1635 <meta name="robots" content="index, nofollow" />
1636 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1636 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1637 <script type="text/javascript" src="/static/mercurial.js"></script>
1637 <script type="text/javascript" src="/static/mercurial.js"></script>
1638
1638
1639 <title>Help: add</title>
1639 <title>Help: add</title>
1640 </head>
1640 </head>
1641 <body>
1641 <body>
1642
1642
1643 <div class="container">
1643 <div class="container">
1644 <div class="menu">
1644 <div class="menu">
1645 <div class="logo">
1645 <div class="logo">
1646 <a href="http://mercurial.selenic.com/">
1646 <a href="http://mercurial.selenic.com/">
1647 <img src="/static/hglogo.png" alt="mercurial" /></a>
1647 <img src="/static/hglogo.png" alt="mercurial" /></a>
1648 </div>
1648 </div>
1649 <ul>
1649 <ul>
1650 <li><a href="/shortlog">log</a></li>
1650 <li><a href="/shortlog">log</a></li>
1651 <li><a href="/graph">graph</a></li>
1651 <li><a href="/graph">graph</a></li>
1652 <li><a href="/tags">tags</a></li>
1652 <li><a href="/tags">tags</a></li>
1653 <li><a href="/bookmarks">bookmarks</a></li>
1653 <li><a href="/bookmarks">bookmarks</a></li>
1654 <li><a href="/branches">branches</a></li>
1654 <li><a href="/branches">branches</a></li>
1655 </ul>
1655 </ul>
1656 <ul>
1656 <ul>
1657 <li class="active"><a href="/help">help</a></li>
1657 <li class="active"><a href="/help">help</a></li>
1658 </ul>
1658 </ul>
1659 </div>
1659 </div>
1660
1660
1661 <div class="main">
1661 <div class="main">
1662 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1662 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1663 <h3>Help: add</h3>
1663 <h3>Help: add</h3>
1664
1664
1665 <form class="search" action="/log">
1665 <form class="search" action="/log">
1666
1666
1667 <p><input name="rev" id="search1" type="text" size="30" /></p>
1667 <p><input name="rev" id="search1" type="text" size="30" /></p>
1668 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1668 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1669 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1669 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1670 </form>
1670 </form>
1671 <div id="doc">
1671 <div id="doc">
1672 <p>
1672 <p>
1673 hg add [OPTION]... [FILE]...
1673 hg add [OPTION]... [FILE]...
1674 </p>
1674 </p>
1675 <p>
1675 <p>
1676 add the specified files on the next commit
1676 add the specified files on the next commit
1677 </p>
1677 </p>
1678 <p>
1678 <p>
1679 Schedule files to be version controlled and added to the
1679 Schedule files to be version controlled and added to the
1680 repository.
1680 repository.
1681 </p>
1681 </p>
1682 <p>
1682 <p>
1683 The files will be added to the repository at the next commit. To
1683 The files will be added to the repository at the next commit. To
1684 undo an add before that, see &quot;hg forget&quot;.
1684 undo an add before that, see &quot;hg forget&quot;.
1685 </p>
1685 </p>
1686 <p>
1686 <p>
1687 If no names are given, add all files to the repository.
1687 If no names are given, add all files to the repository.
1688 </p>
1688 </p>
1689 <p>
1689 <p>
1690 An example showing how new (unknown) files are added
1690 An example showing how new (unknown) files are added
1691 automatically by &quot;hg add&quot;:
1691 automatically by &quot;hg add&quot;:
1692 </p>
1692 </p>
1693 <pre>
1693 <pre>
1694 \$ ls (re)
1694 \$ ls (re)
1695 foo.c
1695 foo.c
1696 \$ hg status (re)
1696 \$ hg status (re)
1697 ? foo.c
1697 ? foo.c
1698 \$ hg add (re)
1698 \$ hg add (re)
1699 adding foo.c
1699 adding foo.c
1700 \$ hg status (re)
1700 \$ hg status (re)
1701 A foo.c
1701 A foo.c
1702 </pre>
1702 </pre>
1703 <p>
1703 <p>
1704 Returns 0 if all files are successfully added.
1704 Returns 0 if all files are successfully added.
1705 </p>
1705 </p>
1706 <p>
1706 <p>
1707 options:
1707 options:
1708 </p>
1708 </p>
1709 <table>
1709 <table>
1710 <tr><td>-I</td>
1710 <tr><td>-I</td>
1711 <td>--include PATTERN [+]</td>
1711 <td>--include PATTERN [+]</td>
1712 <td>include names matching the given patterns</td></tr>
1712 <td>include names matching the given patterns</td></tr>
1713 <tr><td>-X</td>
1713 <tr><td>-X</td>
1714 <td>--exclude PATTERN [+]</td>
1714 <td>--exclude PATTERN [+]</td>
1715 <td>exclude names matching the given patterns</td></tr>
1715 <td>exclude names matching the given patterns</td></tr>
1716 <tr><td>-S</td>
1716 <tr><td>-S</td>
1717 <td>--subrepos</td>
1717 <td>--subrepos</td>
1718 <td>recurse into subrepositories</td></tr>
1718 <td>recurse into subrepositories</td></tr>
1719 <tr><td>-n</td>
1719 <tr><td>-n</td>
1720 <td>--dry-run</td>
1720 <td>--dry-run</td>
1721 <td>do not perform actions, just print output</td></tr>
1721 <td>do not perform actions, just print output</td></tr>
1722 </table>
1722 </table>
1723 <p>
1723 <p>
1724 [+] marked option can be specified multiple times
1724 [+] marked option can be specified multiple times
1725 </p>
1725 </p>
1726 <p>
1726 <p>
1727 global options:
1727 global options:
1728 </p>
1728 </p>
1729 <table>
1729 <table>
1730 <tr><td>-R</td>
1730 <tr><td>-R</td>
1731 <td>--repository REPO</td>
1731 <td>--repository REPO</td>
1732 <td>repository root directory or name of overlay bundle file</td></tr>
1732 <td>repository root directory or name of overlay bundle file</td></tr>
1733 <tr><td></td>
1733 <tr><td></td>
1734 <td>--cwd DIR</td>
1734 <td>--cwd DIR</td>
1735 <td>change working directory</td></tr>
1735 <td>change working directory</td></tr>
1736 <tr><td>-y</td>
1736 <tr><td>-y</td>
1737 <td>--noninteractive</td>
1737 <td>--noninteractive</td>
1738 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1738 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1739 <tr><td>-q</td>
1739 <tr><td>-q</td>
1740 <td>--quiet</td>
1740 <td>--quiet</td>
1741 <td>suppress output</td></tr>
1741 <td>suppress output</td></tr>
1742 <tr><td>-v</td>
1742 <tr><td>-v</td>
1743 <td>--verbose</td>
1743 <td>--verbose</td>
1744 <td>enable additional output</td></tr>
1744 <td>enable additional output</td></tr>
1745 <tr><td></td>
1745 <tr><td></td>
1746 <td>--config CONFIG [+]</td>
1746 <td>--config CONFIG [+]</td>
1747 <td>set/override config option (use 'section.name=value')</td></tr>
1747 <td>set/override config option (use 'section.name=value')</td></tr>
1748 <tr><td></td>
1748 <tr><td></td>
1749 <td>--debug</td>
1749 <td>--debug</td>
1750 <td>enable debugging output</td></tr>
1750 <td>enable debugging output</td></tr>
1751 <tr><td></td>
1751 <tr><td></td>
1752 <td>--debugger</td>
1752 <td>--debugger</td>
1753 <td>start debugger</td></tr>
1753 <td>start debugger</td></tr>
1754 <tr><td></td>
1754 <tr><td></td>
1755 <td>--encoding ENCODE</td>
1755 <td>--encoding ENCODE</td>
1756 <td>set the charset encoding (default: ascii)</td></tr>
1756 <td>set the charset encoding (default: ascii)</td></tr>
1757 <tr><td></td>
1757 <tr><td></td>
1758 <td>--encodingmode MODE</td>
1758 <td>--encodingmode MODE</td>
1759 <td>set the charset encoding mode (default: strict)</td></tr>
1759 <td>set the charset encoding mode (default: strict)</td></tr>
1760 <tr><td></td>
1760 <tr><td></td>
1761 <td>--traceback</td>
1761 <td>--traceback</td>
1762 <td>always print a traceback on exception</td></tr>
1762 <td>always print a traceback on exception</td></tr>
1763 <tr><td></td>
1763 <tr><td></td>
1764 <td>--time</td>
1764 <td>--time</td>
1765 <td>time how long the command takes</td></tr>
1765 <td>time how long the command takes</td></tr>
1766 <tr><td></td>
1766 <tr><td></td>
1767 <td>--profile</td>
1767 <td>--profile</td>
1768 <td>print command execution profile</td></tr>
1768 <td>print command execution profile</td></tr>
1769 <tr><td></td>
1769 <tr><td></td>
1770 <td>--version</td>
1770 <td>--version</td>
1771 <td>output version information and exit</td></tr>
1771 <td>output version information and exit</td></tr>
1772 <tr><td>-h</td>
1772 <tr><td>-h</td>
1773 <td>--help</td>
1773 <td>--help</td>
1774 <td>display help and exit</td></tr>
1774 <td>display help and exit</td></tr>
1775 <tr><td></td>
1775 <tr><td></td>
1776 <td>--hidden</td>
1776 <td>--hidden</td>
1777 <td>consider hidden changesets</td></tr>
1777 <td>consider hidden changesets</td></tr>
1778 </table>
1778 </table>
1779 <p>
1779 <p>
1780 [+] marked option can be specified multiple times
1780 [+] marked option can be specified multiple times
1781 </p>
1781 </p>
1782
1782
1783 </div>
1783 </div>
1784 </div>
1784 </div>
1785 </div>
1785 </div>
1786
1786
1787 <script type="text/javascript">process_dates()</script>
1787 <script type="text/javascript">process_dates()</script>
1788
1788
1789
1789
1790 </body>
1790 </body>
1791 </html>
1791 </html>
1792
1792
1793
1793
1794 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
1794 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
1795 200 Script output follows
1795 200 Script output follows
1796
1796
1797 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1797 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1798 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1798 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1799 <head>
1799 <head>
1800 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1800 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1801 <meta name="robots" content="index, nofollow" />
1801 <meta name="robots" content="index, nofollow" />
1802 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1802 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1803 <script type="text/javascript" src="/static/mercurial.js"></script>
1803 <script type="text/javascript" src="/static/mercurial.js"></script>
1804
1804
1805 <title>Help: remove</title>
1805 <title>Help: remove</title>
1806 </head>
1806 </head>
1807 <body>
1807 <body>
1808
1808
1809 <div class="container">
1809 <div class="container">
1810 <div class="menu">
1810 <div class="menu">
1811 <div class="logo">
1811 <div class="logo">
1812 <a href="http://mercurial.selenic.com/">
1812 <a href="http://mercurial.selenic.com/">
1813 <img src="/static/hglogo.png" alt="mercurial" /></a>
1813 <img src="/static/hglogo.png" alt="mercurial" /></a>
1814 </div>
1814 </div>
1815 <ul>
1815 <ul>
1816 <li><a href="/shortlog">log</a></li>
1816 <li><a href="/shortlog">log</a></li>
1817 <li><a href="/graph">graph</a></li>
1817 <li><a href="/graph">graph</a></li>
1818 <li><a href="/tags">tags</a></li>
1818 <li><a href="/tags">tags</a></li>
1819 <li><a href="/bookmarks">bookmarks</a></li>
1819 <li><a href="/bookmarks">bookmarks</a></li>
1820 <li><a href="/branches">branches</a></li>
1820 <li><a href="/branches">branches</a></li>
1821 </ul>
1821 </ul>
1822 <ul>
1822 <ul>
1823 <li class="active"><a href="/help">help</a></li>
1823 <li class="active"><a href="/help">help</a></li>
1824 </ul>
1824 </ul>
1825 </div>
1825 </div>
1826
1826
1827 <div class="main">
1827 <div class="main">
1828 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1828 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1829 <h3>Help: remove</h3>
1829 <h3>Help: remove</h3>
1830
1830
1831 <form class="search" action="/log">
1831 <form class="search" action="/log">
1832
1832
1833 <p><input name="rev" id="search1" type="text" size="30" /></p>
1833 <p><input name="rev" id="search1" type="text" size="30" /></p>
1834 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1834 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1835 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1835 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1836 </form>
1836 </form>
1837 <div id="doc">
1837 <div id="doc">
1838 <p>
1838 <p>
1839 hg remove [OPTION]... FILE...
1839 hg remove [OPTION]... FILE...
1840 </p>
1840 </p>
1841 <p>
1841 <p>
1842 aliases: rm
1842 aliases: rm
1843 </p>
1843 </p>
1844 <p>
1844 <p>
1845 remove the specified files on the next commit
1845 remove the specified files on the next commit
1846 </p>
1846 </p>
1847 <p>
1847 <p>
1848 Schedule the indicated files for removal from the current branch.
1848 Schedule the indicated files for removal from the current branch.
1849 </p>
1849 </p>
1850 <p>
1850 <p>
1851 This command schedules the files to be removed at the next commit.
1851 This command schedules the files to be removed at the next commit.
1852 To undo a remove before that, see &quot;hg revert&quot;. To undo added
1852 To undo a remove before that, see &quot;hg revert&quot;. To undo added
1853 files, see &quot;hg forget&quot;.
1853 files, see &quot;hg forget&quot;.
1854 </p>
1854 </p>
1855 <p>
1855 <p>
1856 -A/--after can be used to remove only files that have already
1856 -A/--after can be used to remove only files that have already
1857 been deleted, -f/--force can be used to force deletion, and -Af
1857 been deleted, -f/--force can be used to force deletion, and -Af
1858 can be used to remove files from the next revision without
1858 can be used to remove files from the next revision without
1859 deleting them from the working directory.
1859 deleting them from the working directory.
1860 </p>
1860 </p>
1861 <p>
1861 <p>
1862 The following table details the behavior of remove for different
1862 The following table details the behavior of remove for different
1863 file states (columns) and option combinations (rows). The file
1863 file states (columns) and option combinations (rows). The file
1864 states are Added [A], Clean [C], Modified [M] and Missing [!]
1864 states are Added [A], Clean [C], Modified [M] and Missing [!]
1865 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
1865 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
1866 (from branch) and Delete (from disk):
1866 (from branch) and Delete (from disk):
1867 </p>
1867 </p>
1868 <table>
1868 <table>
1869 <tr><td>opt/state</td>
1869 <tr><td>opt/state</td>
1870 <td>A</td>
1870 <td>A</td>
1871 <td>C</td>
1871 <td>C</td>
1872 <td>M</td>
1872 <td>M</td>
1873 <td>!</td></tr>
1873 <td>!</td></tr>
1874 <tr><td>none</td>
1874 <tr><td>none</td>
1875 <td>W</td>
1875 <td>W</td>
1876 <td>RD</td>
1876 <td>RD</td>
1877 <td>W</td>
1877 <td>W</td>
1878 <td>R</td></tr>
1878 <td>R</td></tr>
1879 <tr><td>-f</td>
1879 <tr><td>-f</td>
1880 <td>R</td>
1880 <td>R</td>
1881 <td>RD</td>
1881 <td>RD</td>
1882 <td>RD</td>
1882 <td>RD</td>
1883 <td>R</td></tr>
1883 <td>R</td></tr>
1884 <tr><td>-A</td>
1884 <tr><td>-A</td>
1885 <td>W</td>
1885 <td>W</td>
1886 <td>W</td>
1886 <td>W</td>
1887 <td>W</td>
1887 <td>W</td>
1888 <td>R</td></tr>
1888 <td>R</td></tr>
1889 <tr><td>-Af</td>
1889 <tr><td>-Af</td>
1890 <td>R</td>
1890 <td>R</td>
1891 <td>R</td>
1891 <td>R</td>
1892 <td>R</td>
1892 <td>R</td>
1893 <td>R</td></tr>
1893 <td>R</td></tr>
1894 </table>
1894 </table>
1895 <p>
1895 <p>
1896 Note that remove never deletes files in Added [A] state from the
1896 Note that remove never deletes files in Added [A] state from the
1897 working directory, not even if option --force is specified.
1897 working directory, not even if option --force is specified.
1898 </p>
1898 </p>
1899 <p>
1899 <p>
1900 Returns 0 on success, 1 if any warnings encountered.
1900 Returns 0 on success, 1 if any warnings encountered.
1901 </p>
1901 </p>
1902 <p>
1902 <p>
1903 options:
1903 options:
1904 </p>
1904 </p>
1905 <table>
1905 <table>
1906 <tr><td>-A</td>
1906 <tr><td>-A</td>
1907 <td>--after</td>
1907 <td>--after</td>
1908 <td>record delete for missing files</td></tr>
1908 <td>record delete for missing files</td></tr>
1909 <tr><td>-f</td>
1909 <tr><td>-f</td>
1910 <td>--force</td>
1910 <td>--force</td>
1911 <td>remove (and delete) file even if added or modified</td></tr>
1911 <td>remove (and delete) file even if added or modified</td></tr>
1912 <tr><td>-I</td>
1912 <tr><td>-I</td>
1913 <td>--include PATTERN [+]</td>
1913 <td>--include PATTERN [+]</td>
1914 <td>include names matching the given patterns</td></tr>
1914 <td>include names matching the given patterns</td></tr>
1915 <tr><td>-X</td>
1915 <tr><td>-X</td>
1916 <td>--exclude PATTERN [+]</td>
1916 <td>--exclude PATTERN [+]</td>
1917 <td>exclude names matching the given patterns</td></tr>
1917 <td>exclude names matching the given patterns</td></tr>
1918 </table>
1918 </table>
1919 <p>
1919 <p>
1920 [+] marked option can be specified multiple times
1920 [+] marked option can be specified multiple times
1921 </p>
1921 </p>
1922 <p>
1922 <p>
1923 global options:
1923 global options:
1924 </p>
1924 </p>
1925 <table>
1925 <table>
1926 <tr><td>-R</td>
1926 <tr><td>-R</td>
1927 <td>--repository REPO</td>
1927 <td>--repository REPO</td>
1928 <td>repository root directory or name of overlay bundle file</td></tr>
1928 <td>repository root directory or name of overlay bundle file</td></tr>
1929 <tr><td></td>
1929 <tr><td></td>
1930 <td>--cwd DIR</td>
1930 <td>--cwd DIR</td>
1931 <td>change working directory</td></tr>
1931 <td>change working directory</td></tr>
1932 <tr><td>-y</td>
1932 <tr><td>-y</td>
1933 <td>--noninteractive</td>
1933 <td>--noninteractive</td>
1934 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1934 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1935 <tr><td>-q</td>
1935 <tr><td>-q</td>
1936 <td>--quiet</td>
1936 <td>--quiet</td>
1937 <td>suppress output</td></tr>
1937 <td>suppress output</td></tr>
1938 <tr><td>-v</td>
1938 <tr><td>-v</td>
1939 <td>--verbose</td>
1939 <td>--verbose</td>
1940 <td>enable additional output</td></tr>
1940 <td>enable additional output</td></tr>
1941 <tr><td></td>
1941 <tr><td></td>
1942 <td>--config CONFIG [+]</td>
1942 <td>--config CONFIG [+]</td>
1943 <td>set/override config option (use 'section.name=value')</td></tr>
1943 <td>set/override config option (use 'section.name=value')</td></tr>
1944 <tr><td></td>
1944 <tr><td></td>
1945 <td>--debug</td>
1945 <td>--debug</td>
1946 <td>enable debugging output</td></tr>
1946 <td>enable debugging output</td></tr>
1947 <tr><td></td>
1947 <tr><td></td>
1948 <td>--debugger</td>
1948 <td>--debugger</td>
1949 <td>start debugger</td></tr>
1949 <td>start debugger</td></tr>
1950 <tr><td></td>
1950 <tr><td></td>
1951 <td>--encoding ENCODE</td>
1951 <td>--encoding ENCODE</td>
1952 <td>set the charset encoding (default: ascii)</td></tr>
1952 <td>set the charset encoding (default: ascii)</td></tr>
1953 <tr><td></td>
1953 <tr><td></td>
1954 <td>--encodingmode MODE</td>
1954 <td>--encodingmode MODE</td>
1955 <td>set the charset encoding mode (default: strict)</td></tr>
1955 <td>set the charset encoding mode (default: strict)</td></tr>
1956 <tr><td></td>
1956 <tr><td></td>
1957 <td>--traceback</td>
1957 <td>--traceback</td>
1958 <td>always print a traceback on exception</td></tr>
1958 <td>always print a traceback on exception</td></tr>
1959 <tr><td></td>
1959 <tr><td></td>
1960 <td>--time</td>
1960 <td>--time</td>
1961 <td>time how long the command takes</td></tr>
1961 <td>time how long the command takes</td></tr>
1962 <tr><td></td>
1962 <tr><td></td>
1963 <td>--profile</td>
1963 <td>--profile</td>
1964 <td>print command execution profile</td></tr>
1964 <td>print command execution profile</td></tr>
1965 <tr><td></td>
1965 <tr><td></td>
1966 <td>--version</td>
1966 <td>--version</td>
1967 <td>output version information and exit</td></tr>
1967 <td>output version information and exit</td></tr>
1968 <tr><td>-h</td>
1968 <tr><td>-h</td>
1969 <td>--help</td>
1969 <td>--help</td>
1970 <td>display help and exit</td></tr>
1970 <td>display help and exit</td></tr>
1971 <tr><td></td>
1971 <tr><td></td>
1972 <td>--hidden</td>
1972 <td>--hidden</td>
1973 <td>consider hidden changesets</td></tr>
1973 <td>consider hidden changesets</td></tr>
1974 </table>
1974 </table>
1975 <p>
1975 <p>
1976 [+] marked option can be specified multiple times
1976 [+] marked option can be specified multiple times
1977 </p>
1977 </p>
1978
1978
1979 </div>
1979 </div>
1980 </div>
1980 </div>
1981 </div>
1981 </div>
1982
1982
1983 <script type="text/javascript">process_dates()</script>
1983 <script type="text/javascript">process_dates()</script>
1984
1984
1985
1985
1986 </body>
1986 </body>
1987 </html>
1987 </html>
1988
1988
1989
1989
1990 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
1990 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
1991 200 Script output follows
1991 200 Script output follows
1992
1992
1993 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1993 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1994 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1994 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1995 <head>
1995 <head>
1996 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1996 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1997 <meta name="robots" content="index, nofollow" />
1997 <meta name="robots" content="index, nofollow" />
1998 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1998 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1999 <script type="text/javascript" src="/static/mercurial.js"></script>
1999 <script type="text/javascript" src="/static/mercurial.js"></script>
2000
2000
2001 <title>Help: revisions</title>
2001 <title>Help: revisions</title>
2002 </head>
2002 </head>
2003 <body>
2003 <body>
2004
2004
2005 <div class="container">
2005 <div class="container">
2006 <div class="menu">
2006 <div class="menu">
2007 <div class="logo">
2007 <div class="logo">
2008 <a href="http://mercurial.selenic.com/">
2008 <a href="http://mercurial.selenic.com/">
2009 <img src="/static/hglogo.png" alt="mercurial" /></a>
2009 <img src="/static/hglogo.png" alt="mercurial" /></a>
2010 </div>
2010 </div>
2011 <ul>
2011 <ul>
2012 <li><a href="/shortlog">log</a></li>
2012 <li><a href="/shortlog">log</a></li>
2013 <li><a href="/graph">graph</a></li>
2013 <li><a href="/graph">graph</a></li>
2014 <li><a href="/tags">tags</a></li>
2014 <li><a href="/tags">tags</a></li>
2015 <li><a href="/bookmarks">bookmarks</a></li>
2015 <li><a href="/bookmarks">bookmarks</a></li>
2016 <li><a href="/branches">branches</a></li>
2016 <li><a href="/branches">branches</a></li>
2017 </ul>
2017 </ul>
2018 <ul>
2018 <ul>
2019 <li class="active"><a href="/help">help</a></li>
2019 <li class="active"><a href="/help">help</a></li>
2020 </ul>
2020 </ul>
2021 </div>
2021 </div>
2022
2022
2023 <div class="main">
2023 <div class="main">
2024 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2024 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2025 <h3>Help: revisions</h3>
2025 <h3>Help: revisions</h3>
2026
2026
2027 <form class="search" action="/log">
2027 <form class="search" action="/log">
2028
2028
2029 <p><input name="rev" id="search1" type="text" size="30" /></p>
2029 <p><input name="rev" id="search1" type="text" size="30" /></p>
2030 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2030 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2031 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2031 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2032 </form>
2032 </form>
2033 <div id="doc">
2033 <div id="doc">
2034 <h1>Specifying Single Revisions</h1>
2034 <h1>Specifying Single Revisions</h1>
2035 <p>
2035 <p>
2036 Mercurial supports several ways to specify individual revisions.
2036 Mercurial supports several ways to specify individual revisions.
2037 </p>
2037 </p>
2038 <p>
2038 <p>
2039 A plain integer is treated as a revision number. Negative integers are
2039 A plain integer is treated as a revision number. Negative integers are
2040 treated as sequential offsets from the tip, with -1 denoting the tip,
2040 treated as sequential offsets from the tip, with -1 denoting the tip,
2041 -2 denoting the revision prior to the tip, and so forth.
2041 -2 denoting the revision prior to the tip, and so forth.
2042 </p>
2042 </p>
2043 <p>
2043 <p>
2044 A 40-digit hexadecimal string is treated as a unique revision
2044 A 40-digit hexadecimal string is treated as a unique revision
2045 identifier.
2045 identifier.
2046 </p>
2046 </p>
2047 <p>
2047 <p>
2048 A hexadecimal string less than 40 characters long is treated as a
2048 A hexadecimal string less than 40 characters long is treated as a
2049 unique revision identifier and is referred to as a short-form
2049 unique revision identifier and is referred to as a short-form
2050 identifier. A short-form identifier is only valid if it is the prefix
2050 identifier. A short-form identifier is only valid if it is the prefix
2051 of exactly one full-length identifier.
2051 of exactly one full-length identifier.
2052 </p>
2052 </p>
2053 <p>
2053 <p>
2054 Any other string is treated as a bookmark, tag, or branch name. A
2054 Any other string is treated as a bookmark, tag, or branch name. A
2055 bookmark is a movable pointer to a revision. A tag is a permanent name
2055 bookmark is a movable pointer to a revision. A tag is a permanent name
2056 associated with a revision. A branch name denotes the tipmost open branch head
2056 associated with a revision. A branch name denotes the tipmost open branch head
2057 of that branch - or if they are all closed, the tipmost closed head of the
2057 of that branch - or if they are all closed, the tipmost closed head of the
2058 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2058 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2059 </p>
2059 </p>
2060 <p>
2060 <p>
2061 The reserved name &quot;tip&quot; always identifies the most recent revision.
2061 The reserved name &quot;tip&quot; always identifies the most recent revision.
2062 </p>
2062 </p>
2063 <p>
2063 <p>
2064 The reserved name &quot;null&quot; indicates the null revision. This is the
2064 The reserved name &quot;null&quot; indicates the null revision. This is the
2065 revision of an empty repository, and the parent of revision 0.
2065 revision of an empty repository, and the parent of revision 0.
2066 </p>
2066 </p>
2067 <p>
2067 <p>
2068 The reserved name &quot;.&quot; indicates the working directory parent. If no
2068 The reserved name &quot;.&quot; indicates the working directory parent. If no
2069 working directory is checked out, it is equivalent to null. If an
2069 working directory is checked out, it is equivalent to null. If an
2070 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2070 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2071 parent.
2071 parent.
2072 </p>
2072 </p>
2073
2073
2074 </div>
2074 </div>
2075 </div>
2075 </div>
2076 </div>
2076 </div>
2077
2077
2078 <script type="text/javascript">process_dates()</script>
2078 <script type="text/javascript">process_dates()</script>
2079
2079
2080
2080
2081 </body>
2081 </body>
2082 </html>
2082 </html>
2083
2083
2084
2084
2085 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2085 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2086
2086
2087 #endif
2087 #endif
@@ -1,240 +1,240 b''
1
1
2 $ cat > loop.py <<EOF
2 $ cat > loop.py <<EOF
3 > from mercurial import cmdutil, commands
3 > from mercurial import cmdutil, commands
4 > import time
4 > import time
5 >
5 >
6 > cmdtable = {}
6 > cmdtable = {}
7 > command = cmdutil.command(cmdtable)
7 > command = cmdutil.command(cmdtable)
8 >
8 >
9 > class incrementingtime(object):
9 > class incrementingtime(object):
10 > def __init__(self):
10 > def __init__(self):
11 > self._time = 0.0
11 > self._time = 0.0
12 > def __call__(self):
12 > def __call__(self):
13 > self._time += 0.25
13 > self._time += 0.25
14 > return self._time
14 > return self._time
15 > time.time = incrementingtime()
15 > time.time = incrementingtime()
16 >
16 >
17 > @command('loop',
17 > @command('loop',
18 > [('', 'total', '', 'override for total'),
18 > [('', 'total', '', 'override for total'),
19 > ('', 'nested', False, 'show nested results'),
19 > ('', 'nested', False, 'show nested results'),
20 > ('', 'parallel', False, 'show parallel sets of results')],
20 > ('', 'parallel', False, 'show parallel sets of results')],
21 > 'hg loop LOOPS')
21 > 'hg loop LOOPS',
22 > norepo=True)
22 > def loop(ui, loops, **opts):
23 > def loop(ui, loops, **opts):
23 > loops = int(loops)
24 > loops = int(loops)
24 > total = None
25 > total = None
25 > if loops >= 0:
26 > if loops >= 0:
26 > total = loops
27 > total = loops
27 > if opts.get('total', None):
28 > if opts.get('total', None):
28 > total = int(opts.get('total'))
29 > total = int(opts.get('total'))
29 > nested = False
30 > nested = False
30 > if opts.get('nested', None):
31 > if opts.get('nested', None):
31 > nested = True
32 > nested = True
32 > loops = abs(loops)
33 > loops = abs(loops)
33 >
34 >
34 > for i in range(loops):
35 > for i in range(loops):
35 > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total)
36 > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total)
36 > if opts.get('parallel'):
37 > if opts.get('parallel'):
37 > ui.progress('other', i, 'other.%d' % i, 'othernum', total)
38 > ui.progress('other', i, 'other.%d' % i, 'othernum', total)
38 > if nested:
39 > if nested:
39 > nested_steps = 2
40 > nested_steps = 2
40 > if i and i % 4 == 0:
41 > if i and i % 4 == 0:
41 > nested_steps = 5
42 > nested_steps = 5
42 > for j in range(nested_steps):
43 > for j in range(nested_steps):
43 > ui.progress(
44 > ui.progress(
44 > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps)
45 > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps)
45 > ui.progress(
46 > ui.progress(
46 > 'nested', None, 'nested.done', 'nestnum', nested_steps)
47 > 'nested', None, 'nested.done', 'nestnum', nested_steps)
47 > ui.progress('loop', None, 'loop.done', 'loopnum', total)
48 > ui.progress('loop', None, 'loop.done', 'loopnum', total)
48 >
49 >
49 > commands.norepo += " loop"
50 > EOF
50 > EOF
51
51
52 $ cp $HGRCPATH $HGRCPATH.orig
52 $ cp $HGRCPATH $HGRCPATH.orig
53 $ echo "[extensions]" >> $HGRCPATH
53 $ echo "[extensions]" >> $HGRCPATH
54 $ echo "progress=" >> $HGRCPATH
54 $ echo "progress=" >> $HGRCPATH
55 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
55 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
56 $ echo "[progress]" >> $HGRCPATH
56 $ echo "[progress]" >> $HGRCPATH
57 $ echo "format = topic bar number" >> $HGRCPATH
57 $ echo "format = topic bar number" >> $HGRCPATH
58 $ echo "assume-tty=1" >> $HGRCPATH
58 $ echo "assume-tty=1" >> $HGRCPATH
59 $ echo "width=60" >> $HGRCPATH
59 $ echo "width=60" >> $HGRCPATH
60
60
61 test default params, display nothing because of delay
61 test default params, display nothing because of delay
62
62
63 $ hg -y loop 3
63 $ hg -y loop 3
64 $ echo "delay=0" >> $HGRCPATH
64 $ echo "delay=0" >> $HGRCPATH
65 $ echo "refresh=0" >> $HGRCPATH
65 $ echo "refresh=0" >> $HGRCPATH
66
66
67 test with delay=0, refresh=0
67 test with delay=0, refresh=0
68
68
69 $ hg -y loop 3
69 $ hg -y loop 3
70 \r (no-eol) (esc)
70 \r (no-eol) (esc)
71 loop [ ] 0/3\r (no-eol) (esc)
71 loop [ ] 0/3\r (no-eol) (esc)
72 loop [===============> ] 1/3\r (no-eol) (esc)
72 loop [===============> ] 1/3\r (no-eol) (esc)
73 loop [===============================> ] 2/3\r (no-eol) (esc)
73 loop [===============================> ] 2/3\r (no-eol) (esc)
74 \r (no-eol) (esc)
74 \r (no-eol) (esc)
75
75
76
76
77 test nested short-lived topics (which shouldn't display with nestdelay):
77 test nested short-lived topics (which shouldn't display with nestdelay):
78
78
79 $ hg -y loop 3 --nested
79 $ hg -y loop 3 --nested
80 \r (no-eol) (esc)
80 \r (no-eol) (esc)
81 loop [ ] 0/3\r (no-eol) (esc)
81 loop [ ] 0/3\r (no-eol) (esc)
82 loop [===============> ] 1/3\r (no-eol) (esc)
82 loop [===============> ] 1/3\r (no-eol) (esc)
83 loop [===============================> ] 2/3\r (no-eol) (esc)
83 loop [===============================> ] 2/3\r (no-eol) (esc)
84 \r (no-eol) (esc)
84 \r (no-eol) (esc)
85
85
86 Test nested long-lived topic which has the same name as a short-lived
86 Test nested long-lived topic which has the same name as a short-lived
87 peer. We shouldn't get stuck showing the short-lived inner steps, and
87 peer. We shouldn't get stuck showing the short-lived inner steps, and
88 should go back to skipping the inner steps when the slow nested step
88 should go back to skipping the inner steps when the slow nested step
89 finishes.
89 finishes.
90
90
91 $ hg -y loop 7 --nested
91 $ hg -y loop 7 --nested
92 \r (no-eol) (esc)
92 \r (no-eol) (esc)
93 loop [ ] 0/7\r (no-eol) (esc)
93 loop [ ] 0/7\r (no-eol) (esc)
94 loop [=====> ] 1/7\r (no-eol) (esc)
94 loop [=====> ] 1/7\r (no-eol) (esc)
95 loop [============> ] 2/7\r (no-eol) (esc)
95 loop [============> ] 2/7\r (no-eol) (esc)
96 loop [===================> ] 3/7\r (no-eol) (esc)
96 loop [===================> ] 3/7\r (no-eol) (esc)
97 loop [==========================> ] 4/7\r (no-eol) (esc)
97 loop [==========================> ] 4/7\r (no-eol) (esc)
98 nested [==========================> ] 3/5\r (no-eol) (esc)
98 nested [==========================> ] 3/5\r (no-eol) (esc)
99 nested [===================================> ] 4/5\r (no-eol) (esc)
99 nested [===================================> ] 4/5\r (no-eol) (esc)
100 loop [=================================> ] 5/7\r (no-eol) (esc)
100 loop [=================================> ] 5/7\r (no-eol) (esc)
101 loop [========================================> ] 6/7\r (no-eol) (esc)
101 loop [========================================> ] 6/7\r (no-eol) (esc)
102 \r (no-eol) (esc)
102 \r (no-eol) (esc)
103
103
104
104
105 $ hg --config progress.changedelay=0 -y loop 3 --nested
105 $ hg --config progress.changedelay=0 -y loop 3 --nested
106 \r (no-eol) (esc)
106 \r (no-eol) (esc)
107 loop [ ] 0/3\r (no-eol) (esc)
107 loop [ ] 0/3\r (no-eol) (esc)
108 nested [ ] 0/2\r (no-eol) (esc)
108 nested [ ] 0/2\r (no-eol) (esc)
109 nested [======================> ] 1/2\r (no-eol) (esc)
109 nested [======================> ] 1/2\r (no-eol) (esc)
110 loop [===============> ] 1/3\r (no-eol) (esc)
110 loop [===============> ] 1/3\r (no-eol) (esc)
111 nested [ ] 0/2\r (no-eol) (esc)
111 nested [ ] 0/2\r (no-eol) (esc)
112 nested [======================> ] 1/2\r (no-eol) (esc)
112 nested [======================> ] 1/2\r (no-eol) (esc)
113 loop [===============================> ] 2/3\r (no-eol) (esc)
113 loop [===============================> ] 2/3\r (no-eol) (esc)
114 nested [ ] 0/2\r (no-eol) (esc)
114 nested [ ] 0/2\r (no-eol) (esc)
115 nested [======================> ] 1/2\r (no-eol) (esc)
115 nested [======================> ] 1/2\r (no-eol) (esc)
116 \r (no-eol) (esc)
116 \r (no-eol) (esc)
117
117
118
118
119 test two topics being printed in parallel (as when we're doing a local
119 test two topics being printed in parallel (as when we're doing a local
120 --pull clone, where you get the unbundle and bundle progress at the
120 --pull clone, where you get the unbundle and bundle progress at the
121 same time):
121 same time):
122 $ hg loop 3 --parallel
122 $ hg loop 3 --parallel
123 \r (no-eol) (esc)
123 \r (no-eol) (esc)
124 loop [ ] 0/3\r (no-eol) (esc)
124 loop [ ] 0/3\r (no-eol) (esc)
125 loop [===============> ] 1/3\r (no-eol) (esc)
125 loop [===============> ] 1/3\r (no-eol) (esc)
126 loop [===============================> ] 2/3\r (no-eol) (esc)
126 loop [===============================> ] 2/3\r (no-eol) (esc)
127 \r (no-eol) (esc)
127 \r (no-eol) (esc)
128 test refresh is taken in account
128 test refresh is taken in account
129
129
130 $ hg -y --config progress.refresh=100 loop 3
130 $ hg -y --config progress.refresh=100 loop 3
131
131
132 test format options 1
132 test format options 1
133
133
134 $ hg -y --config 'progress.format=number topic item+2' loop 2
134 $ hg -y --config 'progress.format=number topic item+2' loop 2
135 \r (no-eol) (esc)
135 \r (no-eol) (esc)
136 0/2 loop lo\r (no-eol) (esc)
136 0/2 loop lo\r (no-eol) (esc)
137 1/2 loop lo\r (no-eol) (esc)
137 1/2 loop lo\r (no-eol) (esc)
138 \r (no-eol) (esc)
138 \r (no-eol) (esc)
139
139
140 test format options 2
140 test format options 2
141
141
142 $ hg -y --config 'progress.format=number item-3 bar' loop 2
142 $ hg -y --config 'progress.format=number item-3 bar' loop 2
143 \r (no-eol) (esc)
143 \r (no-eol) (esc)
144 0/2 p.0 [ ]\r (no-eol) (esc)
144 0/2 p.0 [ ]\r (no-eol) (esc)
145 1/2 p.1 [=======================> ]\r (no-eol) (esc)
145 1/2 p.1 [=======================> ]\r (no-eol) (esc)
146 \r (no-eol) (esc)
146 \r (no-eol) (esc)
147
147
148 test format options and indeterminate progress
148 test format options and indeterminate progress
149
149
150 $ hg -y --config 'progress.format=number item bar' loop -- -2
150 $ hg -y --config 'progress.format=number item bar' loop -- -2
151 \r (no-eol) (esc)
151 \r (no-eol) (esc)
152 0 loop.0 [ <=> ]\r (no-eol) (esc)
152 0 loop.0 [ <=> ]\r (no-eol) (esc)
153 1 loop.1 [ <=> ]\r (no-eol) (esc)
153 1 loop.1 [ <=> ]\r (no-eol) (esc)
154 \r (no-eol) (esc)
154 \r (no-eol) (esc)
155
155
156 make sure things don't fall over if count > total
156 make sure things don't fall over if count > total
157
157
158 $ hg -y loop --total 4 6
158 $ hg -y loop --total 4 6
159 \r (no-eol) (esc)
159 \r (no-eol) (esc)
160 loop [ ] 0/4\r (no-eol) (esc)
160 loop [ ] 0/4\r (no-eol) (esc)
161 loop [===========> ] 1/4\r (no-eol) (esc)
161 loop [===========> ] 1/4\r (no-eol) (esc)
162 loop [=======================> ] 2/4\r (no-eol) (esc)
162 loop [=======================> ] 2/4\r (no-eol) (esc)
163 loop [===================================> ] 3/4\r (no-eol) (esc)
163 loop [===================================> ] 3/4\r (no-eol) (esc)
164 loop [===============================================>] 4/4\r (no-eol) (esc)
164 loop [===============================================>] 4/4\r (no-eol) (esc)
165 loop [ <=> ] 5/4\r (no-eol) (esc)
165 loop [ <=> ] 5/4\r (no-eol) (esc)
166 \r (no-eol) (esc)
166 \r (no-eol) (esc)
167
167
168 test immediate progress completion
168 test immediate progress completion
169
169
170 $ hg -y loop 0
170 $ hg -y loop 0
171
171
172 test delay time estimates
172 test delay time estimates
173
173
174 $ cat > mocktime.py <<EOF
174 $ cat > mocktime.py <<EOF
175 > import os
175 > import os
176 > import time
176 > import time
177 >
177 >
178 > class mocktime(object):
178 > class mocktime(object):
179 > def __init__(self, increment):
179 > def __init__(self, increment):
180 > self.time = 0
180 > self.time = 0
181 > self.increment = increment
181 > self.increment = increment
182 > def __call__(self):
182 > def __call__(self):
183 > self.time += self.increment
183 > self.time += self.increment
184 > return self.time
184 > return self.time
185 >
185 >
186 > def uisetup(ui):
186 > def uisetup(ui):
187 > time.time = mocktime(int(os.environ.get('MOCKTIME', '11')))
187 > time.time = mocktime(int(os.environ.get('MOCKTIME', '11')))
188 > EOF
188 > EOF
189
189
190 $ cp $HGRCPATH.orig $HGRCPATH
190 $ cp $HGRCPATH.orig $HGRCPATH
191 $ echo "[extensions]" >> $HGRCPATH
191 $ echo "[extensions]" >> $HGRCPATH
192 $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH
192 $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH
193 $ echo "progress=" >> $HGRCPATH
193 $ echo "progress=" >> $HGRCPATH
194 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
194 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
195 $ echo "[progress]" >> $HGRCPATH
195 $ echo "[progress]" >> $HGRCPATH
196 $ echo "assume-tty=1" >> $HGRCPATH
196 $ echo "assume-tty=1" >> $HGRCPATH
197 $ echo "delay=25" >> $HGRCPATH
197 $ echo "delay=25" >> $HGRCPATH
198 $ echo "width=60" >> $HGRCPATH
198 $ echo "width=60" >> $HGRCPATH
199
199
200 $ hg -y loop 8
200 $ hg -y loop 8
201 \r (no-eol) (esc)
201 \r (no-eol) (esc)
202 loop [=========> ] 2/8 1m07s\r (no-eol) (esc)
202 loop [=========> ] 2/8 1m07s\r (no-eol) (esc)
203 loop [===============> ] 3/8 56s\r (no-eol) (esc)
203 loop [===============> ] 3/8 56s\r (no-eol) (esc)
204 loop [=====================> ] 4/8 45s\r (no-eol) (esc)
204 loop [=====================> ] 4/8 45s\r (no-eol) (esc)
205 loop [==========================> ] 5/8 34s\r (no-eol) (esc)
205 loop [==========================> ] 5/8 34s\r (no-eol) (esc)
206 loop [================================> ] 6/8 23s\r (no-eol) (esc)
206 loop [================================> ] 6/8 23s\r (no-eol) (esc)
207 loop [=====================================> ] 7/8 12s\r (no-eol) (esc)
207 loop [=====================================> ] 7/8 12s\r (no-eol) (esc)
208 \r (no-eol) (esc)
208 \r (no-eol) (esc)
209
209
210 $ MOCKTIME=10000 hg -y loop 4
210 $ MOCKTIME=10000 hg -y loop 4
211 \r (no-eol) (esc)
211 \r (no-eol) (esc)
212 loop [ ] 0/4\r (no-eol) (esc)
212 loop [ ] 0/4\r (no-eol) (esc)
213 loop [=========> ] 1/4 8h21m\r (no-eol) (esc)
213 loop [=========> ] 1/4 8h21m\r (no-eol) (esc)
214 loop [====================> ] 2/4 5h34m\r (no-eol) (esc)
214 loop [====================> ] 2/4 5h34m\r (no-eol) (esc)
215 loop [==============================> ] 3/4 2h47m\r (no-eol) (esc)
215 loop [==============================> ] 3/4 2h47m\r (no-eol) (esc)
216 \r (no-eol) (esc)
216 \r (no-eol) (esc)
217
217
218 $ MOCKTIME=1000000 hg -y loop 4
218 $ MOCKTIME=1000000 hg -y loop 4
219 \r (no-eol) (esc)
219 \r (no-eol) (esc)
220 loop [ ] 0/4\r (no-eol) (esc)
220 loop [ ] 0/4\r (no-eol) (esc)
221 loop [=========> ] 1/4 5w00d\r (no-eol) (esc)
221 loop [=========> ] 1/4 5w00d\r (no-eol) (esc)
222 loop [====================> ] 2/4 3w03d\r (no-eol) (esc)
222 loop [====================> ] 2/4 3w03d\r (no-eol) (esc)
223 loop [=============================> ] 3/4 11d14h\r (no-eol) (esc)
223 loop [=============================> ] 3/4 11d14h\r (no-eol) (esc)
224 \r (no-eol) (esc)
224 \r (no-eol) (esc)
225
225
226
226
227 $ MOCKTIME=14000000 hg -y loop 4
227 $ MOCKTIME=14000000 hg -y loop 4
228 \r (no-eol) (esc)
228 \r (no-eol) (esc)
229 loop [ ] 0/4\r (no-eol) (esc)
229 loop [ ] 0/4\r (no-eol) (esc)
230 loop [=========> ] 1/4 1y18w\r (no-eol) (esc)
230 loop [=========> ] 1/4 1y18w\r (no-eol) (esc)
231 loop [===================> ] 2/4 46w03d\r (no-eol) (esc)
231 loop [===================> ] 2/4 46w03d\r (no-eol) (esc)
232 loop [=============================> ] 3/4 23w02d\r (no-eol) (esc)
232 loop [=============================> ] 3/4 23w02d\r (no-eol) (esc)
233 \r (no-eol) (esc)
233 \r (no-eol) (esc)
234
234
235 Time estimates should not fail when there's no end point:
235 Time estimates should not fail when there's no end point:
236 $ hg -y loop -- -4
236 $ hg -y loop -- -4
237 \r (no-eol) (esc)
237 \r (no-eol) (esc)
238 loop [ <=> ] 2\r (no-eol) (esc)
238 loop [ <=> ] 2\r (no-eol) (esc)
239 loop [ <=> ] 3\r (no-eol) (esc)
239 loop [ <=> ] 3\r (no-eol) (esc)
240 \r (no-eol) (esc)
240 \r (no-eol) (esc)
General Comments 0
You need to be logged in to leave comments. Login now