##// END OF EJS Templates
minirst: CGI escape strings prior to embedding it in the HTML
Dan Villiom Podlaski Christiansen -
r18750:c9d923f5 default
parent child Browse files
Show More
@@ -1,686 +1,691 b''
1 # minirst.py - minimal reStructuredText parser
1 # minirst.py - minimal reStructuredText parser
2 #
2 #
3 # Copyright 2009, 2010 Matt Mackall <mpm@selenic.com> and others
3 # Copyright 2009, 2010 Matt Mackall <mpm@selenic.com> and others
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 """simplified reStructuredText parser.
8 """simplified reStructuredText parser.
9
9
10 This parser knows just enough about reStructuredText to parse the
10 This parser knows just enough about reStructuredText to parse the
11 Mercurial docstrings.
11 Mercurial docstrings.
12
12
13 It cheats in a major way: nested blocks are not really nested. They
13 It cheats in a major way: nested blocks are not really nested. They
14 are just indented blocks that look like they are nested. This relies
14 are just indented blocks that look like they are nested. This relies
15 on the user to keep the right indentation for the blocks.
15 on the user to keep the right indentation for the blocks.
16
16
17 Remember to update http://mercurial.selenic.com/wiki/HelpStyleGuide
17 Remember to update http://mercurial.selenic.com/wiki/HelpStyleGuide
18 when adding support for new constructs.
18 when adding support for new constructs.
19 """
19 """
20
20
21 import re
21 import re
22 import util, encoding
22 import util, encoding
23 from i18n import _
23 from i18n import _
24
24
25 import cgi
26
25 def section(s):
27 def section(s):
26 return "%s\n%s\n\n" % (s, "\"" * encoding.colwidth(s))
28 return "%s\n%s\n\n" % (s, "\"" * encoding.colwidth(s))
27
29
28 def subsection(s):
30 def subsection(s):
29 return "%s\n%s\n\n" % (s, '=' * encoding.colwidth(s))
31 return "%s\n%s\n\n" % (s, '=' * encoding.colwidth(s))
30
32
31 def subsubsection(s):
33 def subsubsection(s):
32 return "%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))
34 return "%s\n%s\n\n" % (s, "-" * encoding.colwidth(s))
33
35
34 def subsubsubsection(s):
36 def subsubsubsection(s):
35 return "%s\n%s\n\n" % (s, "." * encoding.colwidth(s))
37 return "%s\n%s\n\n" % (s, "." * encoding.colwidth(s))
36
38
37 def replace(text, substs):
39 def replace(text, substs):
38 '''
40 '''
39 Apply a list of (find, replace) pairs to a text.
41 Apply a list of (find, replace) pairs to a text.
40
42
41 >>> replace("foo bar", [('f', 'F'), ('b', 'B')])
43 >>> replace("foo bar", [('f', 'F'), ('b', 'B')])
42 'Foo Bar'
44 'Foo Bar'
43 >>> encoding.encoding = 'latin1'
45 >>> encoding.encoding = 'latin1'
44 >>> replace('\\x81\\\\', [('\\\\', '/')])
46 >>> replace('\\x81\\\\', [('\\\\', '/')])
45 '\\x81/'
47 '\\x81/'
46 >>> encoding.encoding = 'shiftjis'
48 >>> encoding.encoding = 'shiftjis'
47 >>> replace('\\x81\\\\', [('\\\\', '/')])
49 >>> replace('\\x81\\\\', [('\\\\', '/')])
48 '\\x81\\\\'
50 '\\x81\\\\'
49 '''
51 '''
50
52
51 # some character encodings (cp932 for Japanese, at least) use
53 # some character encodings (cp932 for Japanese, at least) use
52 # ASCII characters other than control/alphabet/digit as a part of
54 # ASCII characters other than control/alphabet/digit as a part of
53 # multi-bytes characters, so direct replacing with such characters
55 # multi-bytes characters, so direct replacing with such characters
54 # on strings in local encoding causes invalid byte sequences.
56 # on strings in local encoding causes invalid byte sequences.
55 utext = text.decode(encoding.encoding)
57 utext = text.decode(encoding.encoding)
56 for f, t in substs:
58 for f, t in substs:
57 utext = utext.replace(f, t)
59 utext = utext.replace(f, t)
58 return utext.encode(encoding.encoding)
60 return utext.encode(encoding.encoding)
59
61
60 _blockre = re.compile(r"\n(?:\s*\n)+")
62 _blockre = re.compile(r"\n(?:\s*\n)+")
61
63
62 def findblocks(text):
64 def findblocks(text):
63 """Find continuous blocks of lines in text.
65 """Find continuous blocks of lines in text.
64
66
65 Returns a list of dictionaries representing the blocks. Each block
67 Returns a list of dictionaries representing the blocks. Each block
66 has an 'indent' field and a 'lines' field.
68 has an 'indent' field and a 'lines' field.
67 """
69 """
68 blocks = []
70 blocks = []
69 for b in _blockre.split(text.lstrip('\n').rstrip()):
71 for b in _blockre.split(text.lstrip('\n').rstrip()):
70 lines = b.splitlines()
72 lines = b.splitlines()
71 if lines:
73 if lines:
72 indent = min((len(l) - len(l.lstrip())) for l in lines)
74 indent = min((len(l) - len(l.lstrip())) for l in lines)
73 lines = [l[indent:] for l in lines]
75 lines = [l[indent:] for l in lines]
74 blocks.append(dict(indent=indent, lines=lines))
76 blocks.append(dict(indent=indent, lines=lines))
75 return blocks
77 return blocks
76
78
77 def findliteralblocks(blocks):
79 def findliteralblocks(blocks):
78 """Finds literal blocks and adds a 'type' field to the blocks.
80 """Finds literal blocks and adds a 'type' field to the blocks.
79
81
80 Literal blocks are given the type 'literal', all other blocks are
82 Literal blocks are given the type 'literal', all other blocks are
81 given type the 'paragraph'.
83 given type the 'paragraph'.
82 """
84 """
83 i = 0
85 i = 0
84 while i < len(blocks):
86 while i < len(blocks):
85 # Searching for a block that looks like this:
87 # Searching for a block that looks like this:
86 #
88 #
87 # +------------------------------+
89 # +------------------------------+
88 # | paragraph |
90 # | paragraph |
89 # | (ends with "::") |
91 # | (ends with "::") |
90 # +------------------------------+
92 # +------------------------------+
91 # +---------------------------+
93 # +---------------------------+
92 # | indented literal block |
94 # | indented literal block |
93 # +---------------------------+
95 # +---------------------------+
94 blocks[i]['type'] = 'paragraph'
96 blocks[i]['type'] = 'paragraph'
95 if blocks[i]['lines'][-1].endswith('::') and i + 1 < len(blocks):
97 if blocks[i]['lines'][-1].endswith('::') and i + 1 < len(blocks):
96 indent = blocks[i]['indent']
98 indent = blocks[i]['indent']
97 adjustment = blocks[i + 1]['indent'] - indent
99 adjustment = blocks[i + 1]['indent'] - indent
98
100
99 if blocks[i]['lines'] == ['::']:
101 if blocks[i]['lines'] == ['::']:
100 # Expanded form: remove block
102 # Expanded form: remove block
101 del blocks[i]
103 del blocks[i]
102 i -= 1
104 i -= 1
103 elif blocks[i]['lines'][-1].endswith(' ::'):
105 elif blocks[i]['lines'][-1].endswith(' ::'):
104 # Partially minimized form: remove space and both
106 # Partially minimized form: remove space and both
105 # colons.
107 # colons.
106 blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-3]
108 blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-3]
107 else:
109 else:
108 # Fully minimized form: remove just one colon.
110 # Fully minimized form: remove just one colon.
109 blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-1]
111 blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-1]
110
112
111 # List items are formatted with a hanging indent. We must
113 # List items are formatted with a hanging indent. We must
112 # correct for this here while we still have the original
114 # correct for this here while we still have the original
113 # information on the indentation of the subsequent literal
115 # information on the indentation of the subsequent literal
114 # blocks available.
116 # blocks available.
115 m = _bulletre.match(blocks[i]['lines'][0])
117 m = _bulletre.match(blocks[i]['lines'][0])
116 if m:
118 if m:
117 indent += m.end()
119 indent += m.end()
118 adjustment -= m.end()
120 adjustment -= m.end()
119
121
120 # Mark the following indented blocks.
122 # Mark the following indented blocks.
121 while i + 1 < len(blocks) and blocks[i + 1]['indent'] > indent:
123 while i + 1 < len(blocks) and blocks[i + 1]['indent'] > indent:
122 blocks[i + 1]['type'] = 'literal'
124 blocks[i + 1]['type'] = 'literal'
123 blocks[i + 1]['indent'] -= adjustment
125 blocks[i + 1]['indent'] -= adjustment
124 i += 1
126 i += 1
125 i += 1
127 i += 1
126 return blocks
128 return blocks
127
129
128 _bulletre = re.compile(r'(-|[0-9A-Za-z]+\.|\(?[0-9A-Za-z]+\)|\|) ')
130 _bulletre = re.compile(r'(-|[0-9A-Za-z]+\.|\(?[0-9A-Za-z]+\)|\|) ')
129 _optionre = re.compile(r'^(-([a-zA-Z0-9]), )?(--[a-z0-9-]+)'
131 _optionre = re.compile(r'^(-([a-zA-Z0-9]), )?(--[a-z0-9-]+)'
130 r'((.*) +)(.*)$')
132 r'((.*) +)(.*)$')
131 _fieldre = re.compile(r':(?![: ])([^:]*)(?<! ):[ ]+(.*)')
133 _fieldre = re.compile(r':(?![: ])([^:]*)(?<! ):[ ]+(.*)')
132 _definitionre = re.compile(r'[^ ]')
134 _definitionre = re.compile(r'[^ ]')
133 _tablere = re.compile(r'(=+\s+)*=+')
135 _tablere = re.compile(r'(=+\s+)*=+')
134
136
135 def splitparagraphs(blocks):
137 def splitparagraphs(blocks):
136 """Split paragraphs into lists."""
138 """Split paragraphs into lists."""
137 # Tuples with (list type, item regexp, single line items?). Order
139 # Tuples with (list type, item regexp, single line items?). Order
138 # matters: definition lists has the least specific regexp and must
140 # matters: definition lists has the least specific regexp and must
139 # come last.
141 # come last.
140 listtypes = [('bullet', _bulletre, True),
142 listtypes = [('bullet', _bulletre, True),
141 ('option', _optionre, True),
143 ('option', _optionre, True),
142 ('field', _fieldre, True),
144 ('field', _fieldre, True),
143 ('definition', _definitionre, False)]
145 ('definition', _definitionre, False)]
144
146
145 def match(lines, i, itemre, singleline):
147 def match(lines, i, itemre, singleline):
146 """Does itemre match an item at line i?
148 """Does itemre match an item at line i?
147
149
148 A list item can be followed by an indented line or another list
150 A list item can be followed by an indented line or another list
149 item (but only if singleline is True).
151 item (but only if singleline is True).
150 """
152 """
151 line1 = lines[i]
153 line1 = lines[i]
152 line2 = i + 1 < len(lines) and lines[i + 1] or ''
154 line2 = i + 1 < len(lines) and lines[i + 1] or ''
153 if not itemre.match(line1):
155 if not itemre.match(line1):
154 return False
156 return False
155 if singleline:
157 if singleline:
156 return line2 == '' or line2[0] == ' ' or itemre.match(line2)
158 return line2 == '' or line2[0] == ' ' or itemre.match(line2)
157 else:
159 else:
158 return line2.startswith(' ')
160 return line2.startswith(' ')
159
161
160 i = 0
162 i = 0
161 while i < len(blocks):
163 while i < len(blocks):
162 if blocks[i]['type'] == 'paragraph':
164 if blocks[i]['type'] == 'paragraph':
163 lines = blocks[i]['lines']
165 lines = blocks[i]['lines']
164 for type, itemre, singleline in listtypes:
166 for type, itemre, singleline in listtypes:
165 if match(lines, 0, itemre, singleline):
167 if match(lines, 0, itemre, singleline):
166 items = []
168 items = []
167 for j, line in enumerate(lines):
169 for j, line in enumerate(lines):
168 if match(lines, j, itemre, singleline):
170 if match(lines, j, itemre, singleline):
169 items.append(dict(type=type, lines=[],
171 items.append(dict(type=type, lines=[],
170 indent=blocks[i]['indent']))
172 indent=blocks[i]['indent']))
171 items[-1]['lines'].append(line)
173 items[-1]['lines'].append(line)
172 blocks[i:i + 1] = items
174 blocks[i:i + 1] = items
173 break
175 break
174 i += 1
176 i += 1
175 return blocks
177 return blocks
176
178
177 _fieldwidth = 14
179 _fieldwidth = 14
178
180
179 def updatefieldlists(blocks):
181 def updatefieldlists(blocks):
180 """Find key for field lists."""
182 """Find key for field lists."""
181 i = 0
183 i = 0
182 while i < len(blocks):
184 while i < len(blocks):
183 if blocks[i]['type'] != 'field':
185 if blocks[i]['type'] != 'field':
184 i += 1
186 i += 1
185 continue
187 continue
186
188
187 j = i
189 j = i
188 while j < len(blocks) and blocks[j]['type'] == 'field':
190 while j < len(blocks) and blocks[j]['type'] == 'field':
189 m = _fieldre.match(blocks[j]['lines'][0])
191 m = _fieldre.match(blocks[j]['lines'][0])
190 key, rest = m.groups()
192 key, rest = m.groups()
191 blocks[j]['lines'][0] = rest
193 blocks[j]['lines'][0] = rest
192 blocks[j]['key'] = key
194 blocks[j]['key'] = key
193 j += 1
195 j += 1
194
196
195 i = j + 1
197 i = j + 1
196
198
197 return blocks
199 return blocks
198
200
199 def updateoptionlists(blocks):
201 def updateoptionlists(blocks):
200 i = 0
202 i = 0
201 while i < len(blocks):
203 while i < len(blocks):
202 if blocks[i]['type'] != 'option':
204 if blocks[i]['type'] != 'option':
203 i += 1
205 i += 1
204 continue
206 continue
205
207
206 optstrwidth = 0
208 optstrwidth = 0
207 j = i
209 j = i
208 while j < len(blocks) and blocks[j]['type'] == 'option':
210 while j < len(blocks) and blocks[j]['type'] == 'option':
209 m = _optionre.match(blocks[j]['lines'][0])
211 m = _optionre.match(blocks[j]['lines'][0])
210
212
211 shortoption = m.group(2)
213 shortoption = m.group(2)
212 group3 = m.group(3)
214 group3 = m.group(3)
213 longoption = group3[2:].strip()
215 longoption = group3[2:].strip()
214 desc = m.group(6).strip()
216 desc = m.group(6).strip()
215 longoptionarg = m.group(5).strip()
217 longoptionarg = m.group(5).strip()
216 blocks[j]['lines'][0] = desc
218 blocks[j]['lines'][0] = desc
217
219
218 noshortop = ''
220 noshortop = ''
219 if not shortoption:
221 if not shortoption:
220 noshortop = ' '
222 noshortop = ' '
221
223
222 opt = "%s%s" % (shortoption and "-%s " % shortoption or '',
224 opt = "%s%s" % (shortoption and "-%s " % shortoption or '',
223 ("%s--%s %s") % (noshortop, longoption,
225 ("%s--%s %s") % (noshortop, longoption,
224 longoptionarg))
226 longoptionarg))
225 opt = opt.rstrip()
227 opt = opt.rstrip()
226 blocks[j]['optstr'] = opt
228 blocks[j]['optstr'] = opt
227 optstrwidth = max(optstrwidth, encoding.colwidth(opt))
229 optstrwidth = max(optstrwidth, encoding.colwidth(opt))
228 j += 1
230 j += 1
229
231
230 for block in blocks[i:j]:
232 for block in blocks[i:j]:
231 block['optstrwidth'] = optstrwidth
233 block['optstrwidth'] = optstrwidth
232 i = j + 1
234 i = j + 1
233 return blocks
235 return blocks
234
236
235 def prunecontainers(blocks, keep):
237 def prunecontainers(blocks, keep):
236 """Prune unwanted containers.
238 """Prune unwanted containers.
237
239
238 The blocks must have a 'type' field, i.e., they should have been
240 The blocks must have a 'type' field, i.e., they should have been
239 run through findliteralblocks first.
241 run through findliteralblocks first.
240 """
242 """
241 pruned = []
243 pruned = []
242 i = 0
244 i = 0
243 while i + 1 < len(blocks):
245 while i + 1 < len(blocks):
244 # Searching for a block that looks like this:
246 # Searching for a block that looks like this:
245 #
247 #
246 # +-------+---------------------------+
248 # +-------+---------------------------+
247 # | ".. container ::" type |
249 # | ".. container ::" type |
248 # +---+ |
250 # +---+ |
249 # | blocks |
251 # | blocks |
250 # +-------------------------------+
252 # +-------------------------------+
251 if (blocks[i]['type'] == 'paragraph' and
253 if (blocks[i]['type'] == 'paragraph' and
252 blocks[i]['lines'][0].startswith('.. container::')):
254 blocks[i]['lines'][0].startswith('.. container::')):
253 indent = blocks[i]['indent']
255 indent = blocks[i]['indent']
254 adjustment = blocks[i + 1]['indent'] - indent
256 adjustment = blocks[i + 1]['indent'] - indent
255 containertype = blocks[i]['lines'][0][15:]
257 containertype = blocks[i]['lines'][0][15:]
256 prune = containertype not in keep
258 prune = containertype not in keep
257 if prune:
259 if prune:
258 pruned.append(containertype)
260 pruned.append(containertype)
259
261
260 # Always delete "..container:: type" block
262 # Always delete "..container:: type" block
261 del blocks[i]
263 del blocks[i]
262 j = i
264 j = i
263 i -= 1
265 i -= 1
264 while j < len(blocks) and blocks[j]['indent'] > indent:
266 while j < len(blocks) and blocks[j]['indent'] > indent:
265 if prune:
267 if prune:
266 del blocks[j]
268 del blocks[j]
267 else:
269 else:
268 blocks[j]['indent'] -= adjustment
270 blocks[j]['indent'] -= adjustment
269 j += 1
271 j += 1
270 i += 1
272 i += 1
271 return blocks, pruned
273 return blocks, pruned
272
274
273 _sectionre = re.compile(r"""^([-=`:.'"~^_*+#])\1+$""")
275 _sectionre = re.compile(r"""^([-=`:.'"~^_*+#])\1+$""")
274
276
275 def findtables(blocks):
277 def findtables(blocks):
276 '''Find simple tables
278 '''Find simple tables
277
279
278 Only simple one-line table elements are supported
280 Only simple one-line table elements are supported
279 '''
281 '''
280
282
281 for block in blocks:
283 for block in blocks:
282 # Searching for a block that looks like this:
284 # Searching for a block that looks like this:
283 #
285 #
284 # === ==== ===
286 # === ==== ===
285 # A B C
287 # A B C
286 # === ==== === <- optional
288 # === ==== === <- optional
287 # 1 2 3
289 # 1 2 3
288 # x y z
290 # x y z
289 # === ==== ===
291 # === ==== ===
290 if (block['type'] == 'paragraph' and
292 if (block['type'] == 'paragraph' and
291 len(block['lines']) > 2 and
293 len(block['lines']) > 2 and
292 _tablere.match(block['lines'][0]) and
294 _tablere.match(block['lines'][0]) and
293 block['lines'][0] == block['lines'][-1]):
295 block['lines'][0] == block['lines'][-1]):
294 block['type'] = 'table'
296 block['type'] = 'table'
295 block['header'] = False
297 block['header'] = False
296 div = block['lines'][0]
298 div = block['lines'][0]
297
299
298 # column markers are ASCII so we can calculate column
300 # column markers are ASCII so we can calculate column
299 # position in bytes
301 # position in bytes
300 columns = [x for x in xrange(len(div))
302 columns = [x for x in xrange(len(div))
301 if div[x] == '=' and (x == 0 or div[x - 1] == ' ')]
303 if div[x] == '=' and (x == 0 or div[x - 1] == ' ')]
302 rows = []
304 rows = []
303 for l in block['lines'][1:-1]:
305 for l in block['lines'][1:-1]:
304 if l == div:
306 if l == div:
305 block['header'] = True
307 block['header'] = True
306 continue
308 continue
307 row = []
309 row = []
308 # we measure columns not in bytes or characters but in
310 # we measure columns not in bytes or characters but in
309 # colwidth which makes things tricky
311 # colwidth which makes things tricky
310 pos = columns[0] # leading whitespace is bytes
312 pos = columns[0] # leading whitespace is bytes
311 for n, start in enumerate(columns):
313 for n, start in enumerate(columns):
312 if n + 1 < len(columns):
314 if n + 1 < len(columns):
313 width = columns[n + 1] - start
315 width = columns[n + 1] - start
314 v = encoding.getcols(l, pos, width) # gather columns
316 v = encoding.getcols(l, pos, width) # gather columns
315 pos += len(v) # calculate byte position of end
317 pos += len(v) # calculate byte position of end
316 row.append(v.strip())
318 row.append(v.strip())
317 else:
319 else:
318 row.append(l[pos:].strip())
320 row.append(l[pos:].strip())
319 rows.append(row)
321 rows.append(row)
320
322
321 block['table'] = rows
323 block['table'] = rows
322
324
323 return blocks
325 return blocks
324
326
325 def findsections(blocks):
327 def findsections(blocks):
326 """Finds sections.
328 """Finds sections.
327
329
328 The blocks must have a 'type' field, i.e., they should have been
330 The blocks must have a 'type' field, i.e., they should have been
329 run through findliteralblocks first.
331 run through findliteralblocks first.
330 """
332 """
331 for block in blocks:
333 for block in blocks:
332 # Searching for a block that looks like this:
334 # Searching for a block that looks like this:
333 #
335 #
334 # +------------------------------+
336 # +------------------------------+
335 # | Section title |
337 # | Section title |
336 # | ------------- |
338 # | ------------- |
337 # +------------------------------+
339 # +------------------------------+
338 if (block['type'] == 'paragraph' and
340 if (block['type'] == 'paragraph' and
339 len(block['lines']) == 2 and
341 len(block['lines']) == 2 and
340 encoding.colwidth(block['lines'][0]) == len(block['lines'][1]) and
342 encoding.colwidth(block['lines'][0]) == len(block['lines'][1]) and
341 _sectionre.match(block['lines'][1])):
343 _sectionre.match(block['lines'][1])):
342 block['underline'] = block['lines'][1][0]
344 block['underline'] = block['lines'][1][0]
343 block['type'] = 'section'
345 block['type'] = 'section'
344 del block['lines'][1]
346 del block['lines'][1]
345 return blocks
347 return blocks
346
348
347 def inlineliterals(blocks):
349 def inlineliterals(blocks):
348 substs = [('``', '"')]
350 substs = [('``', '"')]
349 for b in blocks:
351 for b in blocks:
350 if b['type'] in ('paragraph', 'section'):
352 if b['type'] in ('paragraph', 'section'):
351 b['lines'] = [replace(l, substs) for l in b['lines']]
353 b['lines'] = [replace(l, substs) for l in b['lines']]
352 return blocks
354 return blocks
353
355
354 def hgrole(blocks):
356 def hgrole(blocks):
355 substs = [(':hg:`', '"hg '), ('`', '"')]
357 substs = [(':hg:`', '"hg '), ('`', '"')]
356 for b in blocks:
358 for b in blocks:
357 if b['type'] in ('paragraph', 'section'):
359 if b['type'] in ('paragraph', 'section'):
358 # Turn :hg:`command` into "hg command". This also works
360 # Turn :hg:`command` into "hg command". This also works
359 # when there is a line break in the command and relies on
361 # when there is a line break in the command and relies on
360 # the fact that we have no stray back-quotes in the input
362 # the fact that we have no stray back-quotes in the input
361 # (run the blocks through inlineliterals first).
363 # (run the blocks through inlineliterals first).
362 b['lines'] = [replace(l, substs) for l in b['lines']]
364 b['lines'] = [replace(l, substs) for l in b['lines']]
363 return blocks
365 return blocks
364
366
365 def addmargins(blocks):
367 def addmargins(blocks):
366 """Adds empty blocks for vertical spacing.
368 """Adds empty blocks for vertical spacing.
367
369
368 This groups bullets, options, and definitions together with no vertical
370 This groups bullets, options, and definitions together with no vertical
369 space between them, and adds an empty block between all other blocks.
371 space between them, and adds an empty block between all other blocks.
370 """
372 """
371 i = 1
373 i = 1
372 while i < len(blocks):
374 while i < len(blocks):
373 if (blocks[i]['type'] == blocks[i - 1]['type'] and
375 if (blocks[i]['type'] == blocks[i - 1]['type'] and
374 blocks[i]['type'] in ('bullet', 'option', 'field')):
376 blocks[i]['type'] in ('bullet', 'option', 'field')):
375 i += 1
377 i += 1
376 else:
378 else:
377 blocks.insert(i, dict(lines=[''], indent=0, type='margin'))
379 blocks.insert(i, dict(lines=[''], indent=0, type='margin'))
378 i += 2
380 i += 2
379 return blocks
381 return blocks
380
382
381 def prunecomments(blocks):
383 def prunecomments(blocks):
382 """Remove comments."""
384 """Remove comments."""
383 i = 0
385 i = 0
384 while i < len(blocks):
386 while i < len(blocks):
385 b = blocks[i]
387 b = blocks[i]
386 if b['type'] == 'paragraph' and (b['lines'][0].startswith('.. ') or
388 if b['type'] == 'paragraph' and (b['lines'][0].startswith('.. ') or
387 b['lines'] == ['..']):
389 b['lines'] == ['..']):
388 del blocks[i]
390 del blocks[i]
389 if i < len(blocks) and blocks[i]['type'] == 'margin':
391 if i < len(blocks) and blocks[i]['type'] == 'margin':
390 del blocks[i]
392 del blocks[i]
391 else:
393 else:
392 i += 1
394 i += 1
393 return blocks
395 return blocks
394
396
395 _admonitionre = re.compile(r"\.\. (admonition|attention|caution|danger|"
397 _admonitionre = re.compile(r"\.\. (admonition|attention|caution|danger|"
396 r"error|hint|important|note|tip|warning)::",
398 r"error|hint|important|note|tip|warning)::",
397 flags=re.IGNORECASE)
399 flags=re.IGNORECASE)
398
400
399 def findadmonitions(blocks):
401 def findadmonitions(blocks):
400 """
402 """
401 Makes the type of the block an admonition block if
403 Makes the type of the block an admonition block if
402 the first line is an admonition directive
404 the first line is an admonition directive
403 """
405 """
404 i = 0
406 i = 0
405 while i < len(blocks):
407 while i < len(blocks):
406 m = _admonitionre.match(blocks[i]['lines'][0])
408 m = _admonitionre.match(blocks[i]['lines'][0])
407 if m:
409 if m:
408 blocks[i]['type'] = 'admonition'
410 blocks[i]['type'] = 'admonition'
409 admonitiontitle = blocks[i]['lines'][0][3:m.end() - 2].lower()
411 admonitiontitle = blocks[i]['lines'][0][3:m.end() - 2].lower()
410
412
411 firstline = blocks[i]['lines'][0][m.end() + 1:]
413 firstline = blocks[i]['lines'][0][m.end() + 1:]
412 if firstline:
414 if firstline:
413 blocks[i]['lines'].insert(1, ' ' + firstline)
415 blocks[i]['lines'].insert(1, ' ' + firstline)
414
416
415 blocks[i]['admonitiontitle'] = admonitiontitle
417 blocks[i]['admonitiontitle'] = admonitiontitle
416 del blocks[i]['lines'][0]
418 del blocks[i]['lines'][0]
417 i = i + 1
419 i = i + 1
418 return blocks
420 return blocks
419
421
420 _admonitiontitles = {'attention': _('Attention:'),
422 _admonitiontitles = {'attention': _('Attention:'),
421 'caution': _('Caution:'),
423 'caution': _('Caution:'),
422 'danger': _('!Danger!') ,
424 'danger': _('!Danger!') ,
423 'error': _('Error:'),
425 'error': _('Error:'),
424 'hint': _('Hint:'),
426 'hint': _('Hint:'),
425 'important': _('Important:'),
427 'important': _('Important:'),
426 'note': _('Note:'),
428 'note': _('Note:'),
427 'tip': _('Tip:'),
429 'tip': _('Tip:'),
428 'warning': _('Warning!')}
430 'warning': _('Warning!')}
429
431
430 def formatoption(block, width):
432 def formatoption(block, width):
431 desc = ' '.join(map(str.strip, block['lines']))
433 desc = ' '.join(map(str.strip, block['lines']))
432 colwidth = encoding.colwidth(block['optstr'])
434 colwidth = encoding.colwidth(block['optstr'])
433 usablewidth = width - 1
435 usablewidth = width - 1
434 hanging = block['optstrwidth']
436 hanging = block['optstrwidth']
435 initindent = '%s%s ' % (block['optstr'], ' ' * ((hanging - colwidth)))
437 initindent = '%s%s ' % (block['optstr'], ' ' * ((hanging - colwidth)))
436 hangindent = ' ' * (encoding.colwidth(initindent) + 1)
438 hangindent = ' ' * (encoding.colwidth(initindent) + 1)
437 return ' %s\n' % (util.wrap(desc, usablewidth,
439 return ' %s\n' % (util.wrap(desc, usablewidth,
438 initindent=initindent,
440 initindent=initindent,
439 hangindent=hangindent))
441 hangindent=hangindent))
440
442
441 def formatblock(block, width):
443 def formatblock(block, width):
442 """Format a block according to width."""
444 """Format a block according to width."""
443 if width <= 0:
445 if width <= 0:
444 width = 78
446 width = 78
445 indent = ' ' * block['indent']
447 indent = ' ' * block['indent']
446 if block['type'] == 'admonition':
448 if block['type'] == 'admonition':
447 admonition = _admonitiontitles[block['admonitiontitle']]
449 admonition = _admonitiontitles[block['admonitiontitle']]
448 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
450 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
449
451
450 defindent = indent + hang * ' '
452 defindent = indent + hang * ' '
451 text = ' '.join(map(str.strip, block['lines']))
453 text = ' '.join(map(str.strip, block['lines']))
452 return '%s\n%s\n' % (indent + admonition,
454 return '%s\n%s\n' % (indent + admonition,
453 util.wrap(text, width=width,
455 util.wrap(text, width=width,
454 initindent=defindent,
456 initindent=defindent,
455 hangindent=defindent))
457 hangindent=defindent))
456 if block['type'] == 'margin':
458 if block['type'] == 'margin':
457 return '\n'
459 return '\n'
458 if block['type'] == 'literal':
460 if block['type'] == 'literal':
459 indent += ' '
461 indent += ' '
460 return indent + ('\n' + indent).join(block['lines']) + '\n'
462 return indent + ('\n' + indent).join(block['lines']) + '\n'
461 if block['type'] == 'section':
463 if block['type'] == 'section':
462 underline = encoding.colwidth(block['lines'][0]) * block['underline']
464 underline = encoding.colwidth(block['lines'][0]) * block['underline']
463 return "%s%s\n%s%s\n" % (indent, block['lines'][0],indent, underline)
465 return "%s%s\n%s%s\n" % (indent, block['lines'][0],indent, underline)
464 if block['type'] == 'table':
466 if block['type'] == 'table':
465 table = block['table']
467 table = block['table']
466 # compute column widths
468 # compute column widths
467 widths = [max([encoding.colwidth(e) for e in c]) for c in zip(*table)]
469 widths = [max([encoding.colwidth(e) for e in c]) for c in zip(*table)]
468 text = ''
470 text = ''
469 span = sum(widths) + len(widths) - 1
471 span = sum(widths) + len(widths) - 1
470 indent = ' ' * block['indent']
472 indent = ' ' * block['indent']
471 hang = ' ' * (len(indent) + span - widths[-1])
473 hang = ' ' * (len(indent) + span - widths[-1])
472
474
473 for row in table:
475 for row in table:
474 l = []
476 l = []
475 for w, v in zip(widths, row):
477 for w, v in zip(widths, row):
476 pad = ' ' * (w - encoding.colwidth(v))
478 pad = ' ' * (w - encoding.colwidth(v))
477 l.append(v + pad)
479 l.append(v + pad)
478 l = ' '.join(l)
480 l = ' '.join(l)
479 l = util.wrap(l, width=width, initindent=indent, hangindent=hang)
481 l = util.wrap(l, width=width, initindent=indent, hangindent=hang)
480 if not text and block['header']:
482 if not text and block['header']:
481 text = l + '\n' + indent + '-' * (min(width, span)) + '\n'
483 text = l + '\n' + indent + '-' * (min(width, span)) + '\n'
482 else:
484 else:
483 text += l + "\n"
485 text += l + "\n"
484 return text
486 return text
485 if block['type'] == 'definition':
487 if block['type'] == 'definition':
486 term = indent + block['lines'][0]
488 term = indent + block['lines'][0]
487 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
489 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
488 defindent = indent + hang * ' '
490 defindent = indent + hang * ' '
489 text = ' '.join(map(str.strip, block['lines'][1:]))
491 text = ' '.join(map(str.strip, block['lines'][1:]))
490 return '%s\n%s\n' % (term, util.wrap(text, width=width,
492 return '%s\n%s\n' % (term, util.wrap(text, width=width,
491 initindent=defindent,
493 initindent=defindent,
492 hangindent=defindent))
494 hangindent=defindent))
493 subindent = indent
495 subindent = indent
494 if block['type'] == 'bullet':
496 if block['type'] == 'bullet':
495 if block['lines'][0].startswith('| '):
497 if block['lines'][0].startswith('| '):
496 # Remove bullet for line blocks and add no extra
498 # Remove bullet for line blocks and add no extra
497 # indention.
499 # indention.
498 block['lines'][0] = block['lines'][0][2:]
500 block['lines'][0] = block['lines'][0][2:]
499 else:
501 else:
500 m = _bulletre.match(block['lines'][0])
502 m = _bulletre.match(block['lines'][0])
501 subindent = indent + m.end() * ' '
503 subindent = indent + m.end() * ' '
502 elif block['type'] == 'field':
504 elif block['type'] == 'field':
503 key = block['key']
505 key = block['key']
504 subindent = indent + _fieldwidth * ' '
506 subindent = indent + _fieldwidth * ' '
505 if len(key) + 2 > _fieldwidth:
507 if len(key) + 2 > _fieldwidth:
506 # key too large, use full line width
508 # key too large, use full line width
507 key = key.ljust(width)
509 key = key.ljust(width)
508 else:
510 else:
509 # key fits within field width
511 # key fits within field width
510 key = key.ljust(_fieldwidth)
512 key = key.ljust(_fieldwidth)
511 block['lines'][0] = key + block['lines'][0]
513 block['lines'][0] = key + block['lines'][0]
512 elif block['type'] == 'option':
514 elif block['type'] == 'option':
513 return formatoption(block, width)
515 return formatoption(block, width)
514
516
515 text = ' '.join(map(str.strip, block['lines']))
517 text = ' '.join(map(str.strip, block['lines']))
516 return util.wrap(text, width=width,
518 return util.wrap(text, width=width,
517 initindent=indent,
519 initindent=indent,
518 hangindent=subindent) + '\n'
520 hangindent=subindent) + '\n'
519
521
520 def formathtml(blocks):
522 def formathtml(blocks):
521 """Format RST blocks as HTML"""
523 """Format RST blocks as HTML"""
522
524
523 out = []
525 out = []
524 headernest = ''
526 headernest = ''
525 listnest = []
527 listnest = []
526
528
529 def escape(s):
530 return cgi.escape(s, True)
531
527 def openlist(start, level):
532 def openlist(start, level):
528 if not listnest or listnest[-1][0] != start:
533 if not listnest or listnest[-1][0] != start:
529 listnest.append((start, level))
534 listnest.append((start, level))
530 out.append('<%s>\n' % start)
535 out.append('<%s>\n' % start)
531
536
532 blocks = [b for b in blocks if b['type'] != 'margin']
537 blocks = [b for b in blocks if b['type'] != 'margin']
533
538
534 for pos, b in enumerate(blocks):
539 for pos, b in enumerate(blocks):
535 btype = b['type']
540 btype = b['type']
536 level = b['indent']
541 level = b['indent']
537 lines = b['lines']
542 lines = b['lines']
538
543
539 if btype == 'admonition':
544 if btype == 'admonition':
540 admonition = _admonitiontitles[b['admonitiontitle']]
545 admonition = escape(_admonitiontitles[b['admonitiontitle']])
541 text = ' '.join(map(str.strip, lines))
546 text = escape(' '.join(map(str.strip, lines)))
542 out.append('<p>\n<b>%s</b> %s\n</p>\n' % (admonition, text))
547 out.append('<p>\n<b>%s</b> %s\n</p>\n' % (admonition, text))
543 elif btype == 'paragraph':
548 elif btype == 'paragraph':
544 out.append('<p>\n%s\n</p>\n' % '\n'.join(lines))
549 out.append('<p>\n%s\n</p>\n' % escape('\n'.join(lines)))
545 elif btype == 'margin':
550 elif btype == 'margin':
546 pass
551 pass
547 elif btype == 'literal':
552 elif btype == 'literal':
548 out.append('<pre>\n%s\n</pre>\n' % '\n'.join(lines))
553 out.append('<pre>\n%s\n</pre>\n' % escape('\n'.join(lines)))
549 elif btype == 'section':
554 elif btype == 'section':
550 i = b['underline']
555 i = b['underline']
551 if i not in headernest:
556 if i not in headernest:
552 headernest += i
557 headernest += i
553 level = headernest.index(i) + 1
558 level = headernest.index(i) + 1
554 out.append('<h%d>%s</h%d>\n' % (level, lines[0], level))
559 out.append('<h%d>%s</h%d>\n' % (level, escape(lines[0]), level))
555 elif btype == 'table':
560 elif btype == 'table':
556 table = b['table']
561 table = b['table']
557 t = []
562 t = []
558 for row in table:
563 for row in table:
559 l = []
564 l = []
560 for v in zip(row):
565 for v in row:
561 l.append('<td>%s</td>' % v)
566 l.append('<td>%s</td>' % escape(v))
562 t.append(' <tr>%s</tr>\n' % ''.join(l))
567 t.append(' <tr>%s</tr>\n' % ''.join(l))
563 out.append('<table>\n%s</table>\n' % ''.join(t))
568 out.append('<table>\n%s</table>\n' % ''.join(t))
564 elif btype == 'definition':
569 elif btype == 'definition':
565 openlist('dl', level)
570 openlist('dl', level)
566 term = lines[0]
571 term = escape(lines[0])
567 text = ' '.join(map(str.strip, lines[1:]))
572 text = escape(' '.join(map(str.strip, lines[1:])))
568 out.append(' <dt>%s\n <dd>%s\n' % (term, text))
573 out.append(' <dt>%s\n <dd>%s\n' % (term, text))
569 elif btype == 'bullet':
574 elif btype == 'bullet':
570 bullet, head = lines[0].split(' ', 1)
575 bullet, head = lines[0].split(' ', 1)
571 if bullet == '-':
576 if bullet == '-':
572 openlist('ul', level)
577 openlist('ul', level)
573 else:
578 else:
574 openlist('ol', level)
579 openlist('ol', level)
575 out.append(' <li> %s\n' % ' '.join([head] + lines[1:]))
580 out.append(' <li> %s\n' % escape(' '.join([head] + lines[1:])))
576 elif btype == 'field':
581 elif btype == 'field':
577 openlist('dl', level)
582 openlist('dl', level)
578 key = b['key']
583 key = escape(b['key'])
579 text = ' '.join(map(str.strip, lines))
584 text = escape(' '.join(map(str.strip, lines)))
580 out.append(' <dt>%s\n <dd>%s\n' % (key, text))
585 out.append(' <dt>%s\n <dd>%s\n' % (key, text))
581 elif btype == 'option':
586 elif btype == 'option':
582 openlist('dl', level)
587 openlist('dl', level)
583 opt = b['optstr']
588 opt = escape(b['optstr'])
584 desc = ' '.join(map(str.strip, lines))
589 desc = escape(' '.join(map(str.strip, lines)))
585 out.append(' <dt>%s\n <dd>%s\n' % (opt, desc))
590 out.append(' <dt>%s\n <dd>%s\n' % (opt, desc))
586
591
587 # close lists if indent level of next block is lower
592 # close lists if indent level of next block is lower
588 if listnest:
593 if listnest:
589 start, level = listnest[-1]
594 start, level = listnest[-1]
590 if pos == len(blocks) - 1:
595 if pos == len(blocks) - 1:
591 out.append('</%s>\n' % start)
596 out.append('</%s>\n' % start)
592 listnest.pop()
597 listnest.pop()
593 else:
598 else:
594 nb = blocks[pos + 1]
599 nb = blocks[pos + 1]
595 ni = nb['indent']
600 ni = nb['indent']
596 if (ni < level or
601 if (ni < level or
597 (ni == level and
602 (ni == level and
598 nb['type'] not in 'definition bullet field option')):
603 nb['type'] not in 'definition bullet field option')):
599 out.append('</%s>\n' % start)
604 out.append('</%s>\n' % start)
600 listnest.pop()
605 listnest.pop()
601
606
602 return ''.join(out)
607 return ''.join(out)
603
608
604 def parse(text, indent=0, keep=None):
609 def parse(text, indent=0, keep=None):
605 """Parse text into a list of blocks"""
610 """Parse text into a list of blocks"""
606 pruned = []
611 pruned = []
607 blocks = findblocks(text)
612 blocks = findblocks(text)
608 for b in blocks:
613 for b in blocks:
609 b['indent'] += indent
614 b['indent'] += indent
610 blocks = findliteralblocks(blocks)
615 blocks = findliteralblocks(blocks)
611 blocks = findtables(blocks)
616 blocks = findtables(blocks)
612 blocks, pruned = prunecontainers(blocks, keep or [])
617 blocks, pruned = prunecontainers(blocks, keep or [])
613 blocks = findsections(blocks)
618 blocks = findsections(blocks)
614 blocks = inlineliterals(blocks)
619 blocks = inlineliterals(blocks)
615 blocks = hgrole(blocks)
620 blocks = hgrole(blocks)
616 blocks = splitparagraphs(blocks)
621 blocks = splitparagraphs(blocks)
617 blocks = updatefieldlists(blocks)
622 blocks = updatefieldlists(blocks)
618 blocks = updateoptionlists(blocks)
623 blocks = updateoptionlists(blocks)
619 blocks = addmargins(blocks)
624 blocks = addmargins(blocks)
620 blocks = prunecomments(blocks)
625 blocks = prunecomments(blocks)
621 blocks = findadmonitions(blocks)
626 blocks = findadmonitions(blocks)
622 return blocks, pruned
627 return blocks, pruned
623
628
624 def formatblocks(blocks, width):
629 def formatblocks(blocks, width):
625 text = ''.join(formatblock(b, width) for b in blocks)
630 text = ''.join(formatblock(b, width) for b in blocks)
626 return text
631 return text
627
632
628 def format(text, width=80, indent=0, keep=None, style='plain'):
633 def format(text, width=80, indent=0, keep=None, style='plain'):
629 """Parse and format the text according to width."""
634 """Parse and format the text according to width."""
630 blocks, pruned = parse(text, indent, keep or [])
635 blocks, pruned = parse(text, indent, keep or [])
631 if style == 'html':
636 if style == 'html':
632 text = formathtml(blocks)
637 text = formathtml(blocks)
633 else:
638 else:
634 text = ''.join(formatblock(b, width) for b in blocks)
639 text = ''.join(formatblock(b, width) for b in blocks)
635 if keep is None:
640 if keep is None:
636 return text
641 return text
637 else:
642 else:
638 return text, pruned
643 return text, pruned
639
644
640 def getsections(blocks):
645 def getsections(blocks):
641 '''return a list of (section name, nesting level, blocks) tuples'''
646 '''return a list of (section name, nesting level, blocks) tuples'''
642 nest = ""
647 nest = ""
643 level = 0
648 level = 0
644 secs = []
649 secs = []
645 for b in blocks:
650 for b in blocks:
646 if b['type'] == 'section':
651 if b['type'] == 'section':
647 i = b['underline']
652 i = b['underline']
648 if i not in nest:
653 if i not in nest:
649 nest += i
654 nest += i
650 level = nest.index(i) + 1
655 level = nest.index(i) + 1
651 nest = nest[:level]
656 nest = nest[:level]
652 secs.append((b['lines'][0], level, [b]))
657 secs.append((b['lines'][0], level, [b]))
653 else:
658 else:
654 if not secs:
659 if not secs:
655 # add an initial empty section
660 # add an initial empty section
656 secs = [('', 0, [])]
661 secs = [('', 0, [])]
657 secs[-1][2].append(b)
662 secs[-1][2].append(b)
658 return secs
663 return secs
659
664
660 def decorateblocks(blocks, width):
665 def decorateblocks(blocks, width):
661 '''generate a list of (section name, line text) pairs for search'''
666 '''generate a list of (section name, line text) pairs for search'''
662 lines = []
667 lines = []
663 for s in getsections(blocks):
668 for s in getsections(blocks):
664 section = s[0]
669 section = s[0]
665 text = formatblocks(s[2], width)
670 text = formatblocks(s[2], width)
666 lines.append([(section, l) for l in text.splitlines(True)])
671 lines.append([(section, l) for l in text.splitlines(True)])
667 return lines
672 return lines
668
673
669 def maketable(data, indent=0, header=False):
674 def maketable(data, indent=0, header=False):
670 '''Generate an RST table for the given table data as a list of lines'''
675 '''Generate an RST table for the given table data as a list of lines'''
671
676
672 widths = [max(encoding.colwidth(e) for e in c) for c in zip(*data)]
677 widths = [max(encoding.colwidth(e) for e in c) for c in zip(*data)]
673 indent = ' ' * indent
678 indent = ' ' * indent
674 div = indent + ' '.join('=' * w for w in widths) + '\n'
679 div = indent + ' '.join('=' * w for w in widths) + '\n'
675
680
676 out = [div]
681 out = [div]
677 for row in data:
682 for row in data:
678 l = []
683 l = []
679 for w, v in zip(widths, row):
684 for w, v in zip(widths, row):
680 pad = ' ' * (w - encoding.colwidth(v))
685 pad = ' ' * (w - encoding.colwidth(v))
681 l.append(v + pad)
686 l.append(v + pad)
682 out.append(indent + ' '.join(l) + "\n")
687 out.append(indent + ' '.join(l) + "\n")
683 if header and len(data) > 1:
688 if header and len(data) > 1:
684 out.insert(2, div)
689 out.insert(2, div)
685 out.append(div)
690 out.append(div)
686 return out
691 return out
@@ -1,1787 +1,1787 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 track a line of development with movable markers
58 bookmarks track a line of development with movable markers
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 copy mark files as copied for the next commit
65 copy mark files as copied for the next commit
66 diff diff repository (or selected files)
66 diff diff repository (or selected files)
67 export dump the header and diffs for one or more changesets
67 export dump the header and diffs for one or more changesets
68 forget forget the specified files on the next commit
68 forget forget the specified files on the next commit
69 graft copy changes from other branches onto the current branch
69 graft copy changes from other branches onto the current branch
70 grep search for a pattern in specified files and revisions
70 grep search for a pattern in specified files and revisions
71 heads show current repository heads or show branch heads
71 heads show current repository heads or show branch heads
72 help show help for a given topic or a help overview
72 help show help for a given topic or a help overview
73 identify identify the working copy or specified revision
73 identify identify the working copy or specified revision
74 import import an ordered set of patches
74 import import an ordered set of patches
75 incoming show new changesets found in source
75 incoming show new changesets found in source
76 init create a new repository in the given directory
76 init create a new repository in the given directory
77 locate locate files matching specific patterns
77 locate locate files matching specific patterns
78 log show revision history of entire repository or files
78 log show revision history of entire repository or files
79 manifest output the current or given revision of the project manifest
79 manifest output the current or given revision of the project manifest
80 merge merge working directory with another revision
80 merge merge working directory with another revision
81 outgoing show changesets not found in the destination
81 outgoing show changesets not found in the destination
82 parents show the parents of the working directory or revision
82 parents show the parents of the working directory or revision
83 paths show aliases for remote repositories
83 paths show aliases for remote repositories
84 phase set or show the current phase name
84 phase set or show the current phase name
85 pull pull changes from the specified source
85 pull pull changes from the specified source
86 push push changes to the specified destination
86 push push changes to the specified destination
87 recover roll back an interrupted transaction
87 recover roll back an interrupted transaction
88 remove remove the specified files on the next commit
88 remove remove the specified files on the next commit
89 rename rename files; equivalent of copy + remove
89 rename rename files; equivalent of copy + remove
90 resolve redo merges or set/view the merge status of files
90 resolve redo merges or set/view the merge status of files
91 revert restore files to their checkout state
91 revert restore files to their checkout state
92 rollback roll back the last transaction (dangerous)
92 rollback roll back the last transaction (dangerous)
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 showconfig show combined config settings from all hgrc files
95 showconfig show combined config settings from all hgrc files
96 status show changed files in the working directory
96 status show changed files in the working directory
97 summary summarize working directory state
97 summary summarize working directory state
98 tag add one or more tags for the current or given revision
98 tag add one or more tags for the current or given revision
99 tags list repository tags
99 tags list repository tags
100 tip show the tip revision
100 tip show the tip revision
101 unbundle apply one or more changegroup files
101 unbundle apply one or more changegroup files
102 update update working directory (or switch revisions)
102 update update working directory (or switch revisions)
103 verify verify the integrity of the repository
103 verify verify the integrity of the repository
104 version output version and copyright information
104 version output version and copyright information
105
105
106 additional help topics:
106 additional help topics:
107
107
108 config Configuration Files
108 config Configuration Files
109 dates Date Formats
109 dates Date Formats
110 diffs Diff Formats
110 diffs Diff Formats
111 environment Environment Variables
111 environment Environment Variables
112 extensions Using Additional Features
112 extensions Using Additional Features
113 filesets Specifying File Sets
113 filesets Specifying File Sets
114 glossary Glossary
114 glossary Glossary
115 hgignore Syntax for Mercurial Ignore Files
115 hgignore Syntax for Mercurial Ignore Files
116 hgweb Configuring hgweb
116 hgweb Configuring hgweb
117 merge-tools Merge Tools
117 merge-tools Merge Tools
118 multirevs Specifying Multiple Revisions
118 multirevs Specifying Multiple Revisions
119 patterns File Name Patterns
119 patterns File Name Patterns
120 phases Working with Phases
120 phases Working with Phases
121 revisions Specifying Single Revisions
121 revisions Specifying Single Revisions
122 revsets Specifying Revision Sets
122 revsets Specifying Revision Sets
123 subrepos Subrepositories
123 subrepos Subrepositories
124 templating Template Usage
124 templating Template Usage
125 urls URL Paths
125 urls URL Paths
126
126
127 use "hg -v help" to show builtin aliases and global options
127 use "hg -v help" to show builtin aliases and global options
128
128
129 $ hg -q help
129 $ hg -q help
130 add add the specified files on the next commit
130 add add the specified files on the next commit
131 addremove add all new files, delete all missing files
131 addremove add all new files, delete all missing files
132 annotate show changeset information by line for each file
132 annotate show changeset information by line for each file
133 archive create an unversioned archive of a repository revision
133 archive create an unversioned archive of a repository revision
134 backout reverse effect of earlier changeset
134 backout reverse effect of earlier changeset
135 bisect subdivision search of changesets
135 bisect subdivision search of changesets
136 bookmarks track a line of development with movable markers
136 bookmarks track a line of development with movable markers
137 branch set or show the current branch name
137 branch set or show the current branch name
138 branches list repository named branches
138 branches list repository named branches
139 bundle create a changegroup file
139 bundle create a changegroup file
140 cat output the current or given revision of files
140 cat output the current or given revision of files
141 clone make a copy of an existing repository
141 clone make a copy of an existing repository
142 commit commit the specified files or all outstanding changes
142 commit commit the specified files or all outstanding changes
143 copy mark files as copied for the next commit
143 copy mark files as copied for the next commit
144 diff diff repository (or selected files)
144 diff diff repository (or selected files)
145 export dump the header and diffs for one or more changesets
145 export dump the header and diffs for one or more changesets
146 forget forget the specified files on the next commit
146 forget forget the specified files on the next commit
147 graft copy changes from other branches onto the current branch
147 graft copy changes from other branches onto the current branch
148 grep search for a pattern in specified files and revisions
148 grep search for a pattern in specified files and revisions
149 heads show current repository heads or show branch heads
149 heads show current repository heads or show branch heads
150 help show help for a given topic or a help overview
150 help show help for a given topic or a help overview
151 identify identify the working copy or specified revision
151 identify identify the working copy or specified revision
152 import import an ordered set of patches
152 import import an ordered set of patches
153 incoming show new changesets found in source
153 incoming show new changesets found in source
154 init create a new repository in the given directory
154 init create a new repository in the given directory
155 locate locate files matching specific patterns
155 locate locate files matching specific patterns
156 log show revision history of entire repository or files
156 log show revision history of entire repository or files
157 manifest output the current or given revision of the project manifest
157 manifest output the current or given revision of the project manifest
158 merge merge working directory with another revision
158 merge merge working directory with another revision
159 outgoing show changesets not found in the destination
159 outgoing show changesets not found in the destination
160 parents show the parents of the working directory or revision
160 parents show the parents of the working directory or revision
161 paths show aliases for remote repositories
161 paths show aliases for remote repositories
162 phase set or show the current phase name
162 phase set or show the current phase name
163 pull pull changes from the specified source
163 pull pull changes from the specified source
164 push push changes to the specified destination
164 push push changes to the specified destination
165 recover roll back an interrupted transaction
165 recover roll back an interrupted transaction
166 remove remove the specified files on the next commit
166 remove remove the specified files on the next commit
167 rename rename files; equivalent of copy + remove
167 rename rename files; equivalent of copy + remove
168 resolve redo merges or set/view the merge status of files
168 resolve redo merges or set/view the merge status of files
169 revert restore files to their checkout state
169 revert restore files to their checkout state
170 rollback roll back the last transaction (dangerous)
170 rollback roll back the last transaction (dangerous)
171 root print the root (top) of the current working directory
171 root print the root (top) of the current working directory
172 serve start stand-alone webserver
172 serve start stand-alone webserver
173 showconfig show combined config settings from all hgrc files
173 showconfig show combined config settings from all hgrc files
174 status show changed files in the working directory
174 status show changed files in the working directory
175 summary summarize working directory state
175 summary summarize working directory state
176 tag add one or more tags for the current or given revision
176 tag add one or more tags for the current or given revision
177 tags list repository tags
177 tags list repository tags
178 tip show the tip revision
178 tip show the tip revision
179 unbundle apply one or more changegroup files
179 unbundle apply one or more changegroup files
180 update update working directory (or switch revisions)
180 update update working directory (or switch revisions)
181 verify verify the integrity of the repository
181 verify verify the integrity of the repository
182 version output version and copyright information
182 version output version and copyright information
183
183
184 additional help topics:
184 additional help topics:
185
185
186 config Configuration Files
186 config Configuration Files
187 dates Date Formats
187 dates Date Formats
188 diffs Diff Formats
188 diffs Diff Formats
189 environment Environment Variables
189 environment Environment Variables
190 extensions Using Additional Features
190 extensions Using Additional Features
191 filesets Specifying File Sets
191 filesets Specifying File Sets
192 glossary Glossary
192 glossary Glossary
193 hgignore Syntax for Mercurial Ignore Files
193 hgignore Syntax for Mercurial Ignore Files
194 hgweb Configuring hgweb
194 hgweb Configuring hgweb
195 merge-tools Merge Tools
195 merge-tools Merge Tools
196 multirevs Specifying Multiple Revisions
196 multirevs Specifying Multiple Revisions
197 patterns File Name Patterns
197 patterns File Name Patterns
198 phases Working with Phases
198 phases Working with Phases
199 revisions Specifying Single Revisions
199 revisions Specifying Single Revisions
200 revsets Specifying Revision Sets
200 revsets Specifying Revision Sets
201 subrepos Subrepositories
201 subrepos Subrepositories
202 templating Template Usage
202 templating Template Usage
203 urls URL Paths
203 urls URL Paths
204
204
205 Test short command list with verbose option
205 Test short command list with verbose option
206
206
207 $ hg -v help shortlist
207 $ hg -v help shortlist
208 Mercurial Distributed SCM
208 Mercurial Distributed SCM
209
209
210 basic commands:
210 basic commands:
211
211
212 add add the specified files on the next commit
212 add add the specified files on the next commit
213 annotate, blame
213 annotate, blame
214 show changeset information by line for each file
214 show changeset information by line for each file
215 clone make a copy of an existing repository
215 clone make a copy of an existing repository
216 commit, ci commit the specified files or all outstanding changes
216 commit, ci commit the specified files or all outstanding changes
217 diff diff repository (or selected files)
217 diff diff repository (or selected files)
218 export dump the header and diffs for one or more changesets
218 export dump the header and diffs for one or more changesets
219 forget forget the specified files on the next commit
219 forget forget the specified files on the next commit
220 init create a new repository in the given directory
220 init create a new repository in the given directory
221 log, history show revision history of entire repository or files
221 log, history show revision history of entire repository or files
222 merge merge working directory with another revision
222 merge merge working directory with another revision
223 pull pull changes from the specified source
223 pull pull changes from the specified source
224 push push changes to the specified destination
224 push push changes to the specified destination
225 remove, rm remove the specified files on the next commit
225 remove, rm remove the specified files on the next commit
226 serve start stand-alone webserver
226 serve start stand-alone webserver
227 status, st show changed files in the working directory
227 status, st show changed files in the working directory
228 summary, sum summarize working directory state
228 summary, sum summarize working directory state
229 update, up, checkout, co
229 update, up, checkout, co
230 update working directory (or switch revisions)
230 update working directory (or switch revisions)
231
231
232 global options:
232 global options:
233
233
234 -R --repository REPO repository root directory or name of overlay bundle
234 -R --repository REPO repository root directory or name of overlay bundle
235 file
235 file
236 --cwd DIR change working directory
236 --cwd DIR change working directory
237 -y --noninteractive do not prompt, automatically pick the first choice for
237 -y --noninteractive do not prompt, automatically pick the first choice for
238 all prompts
238 all prompts
239 -q --quiet suppress output
239 -q --quiet suppress output
240 -v --verbose enable additional output
240 -v --verbose enable additional output
241 --config CONFIG [+] set/override config option (use 'section.name=value')
241 --config CONFIG [+] set/override config option (use 'section.name=value')
242 --debug enable debugging output
242 --debug enable debugging output
243 --debugger start debugger
243 --debugger start debugger
244 --encoding ENCODE set the charset encoding (default: ascii)
244 --encoding ENCODE set the charset encoding (default: ascii)
245 --encodingmode MODE set the charset encoding mode (default: strict)
245 --encodingmode MODE set the charset encoding mode (default: strict)
246 --traceback always print a traceback on exception
246 --traceback always print a traceback on exception
247 --time time how long the command takes
247 --time time how long the command takes
248 --profile print command execution profile
248 --profile print command execution profile
249 --version output version information and exit
249 --version output version information and exit
250 -h --help display help and exit
250 -h --help display help and exit
251 --hidden consider hidden changesets
251 --hidden consider hidden changesets
252
252
253 [+] marked option can be specified multiple times
253 [+] marked option can be specified multiple times
254
254
255 use "hg help" for the full list of commands
255 use "hg help" for the full list of commands
256
256
257 $ hg add -h
257 $ hg add -h
258 hg add [OPTION]... [FILE]...
258 hg add [OPTION]... [FILE]...
259
259
260 add the specified files on the next commit
260 add the specified files on the next commit
261
261
262 Schedule files to be version controlled and added to the repository.
262 Schedule files to be version controlled and added to the repository.
263
263
264 The files will be added to the repository at the next commit. To undo an
264 The files will be added to the repository at the next commit. To undo an
265 add before that, see "hg forget".
265 add before that, see "hg forget".
266
266
267 If no names are given, add all files to the repository.
267 If no names are given, add all files to the repository.
268
268
269 Returns 0 if all files are successfully added.
269 Returns 0 if all files are successfully added.
270
270
271 options:
271 options:
272
272
273 -I --include PATTERN [+] include names matching the given patterns
273 -I --include PATTERN [+] include names matching the given patterns
274 -X --exclude PATTERN [+] exclude names matching the given patterns
274 -X --exclude PATTERN [+] exclude names matching the given patterns
275 -S --subrepos recurse into subrepositories
275 -S --subrepos recurse into subrepositories
276 -n --dry-run do not perform actions, just print output
276 -n --dry-run do not perform actions, just print output
277
277
278 [+] marked option can be specified multiple times
278 [+] marked option can be specified multiple times
279
279
280 use "hg -v help add" to show more complete help and the global options
280 use "hg -v help add" to show more complete help and the global options
281
281
282 Verbose help for add
282 Verbose help for add
283
283
284 $ hg add -hv
284 $ hg add -hv
285 hg add [OPTION]... [FILE]...
285 hg add [OPTION]... [FILE]...
286
286
287 add the specified files on the next commit
287 add the specified files on the next commit
288
288
289 Schedule files to be version controlled and added to the repository.
289 Schedule files to be version controlled and added to the repository.
290
290
291 The files will be added to the repository at the next commit. To undo an
291 The files will be added to the repository at the next commit. To undo an
292 add before that, see "hg forget".
292 add before that, see "hg forget".
293
293
294 If no names are given, add all files to the repository.
294 If no names are given, add all files to the repository.
295
295
296 An example showing how new (unknown) files are added automatically by "hg
296 An example showing how new (unknown) files are added automatically by "hg
297 add":
297 add":
298
298
299 $ ls
299 $ ls
300 foo.c
300 foo.c
301 $ hg status
301 $ hg status
302 ? foo.c
302 ? foo.c
303 $ hg add
303 $ hg add
304 adding foo.c
304 adding foo.c
305 $ hg status
305 $ hg status
306 A foo.c
306 A foo.c
307
307
308 Returns 0 if all files are successfully added.
308 Returns 0 if all files are successfully added.
309
309
310 options:
310 options:
311
311
312 -I --include PATTERN [+] include names matching the given patterns
312 -I --include PATTERN [+] include names matching the given patterns
313 -X --exclude PATTERN [+] exclude names matching the given patterns
313 -X --exclude PATTERN [+] exclude names matching the given patterns
314 -S --subrepos recurse into subrepositories
314 -S --subrepos recurse into subrepositories
315 -n --dry-run do not perform actions, just print output
315 -n --dry-run do not perform actions, just print output
316
316
317 [+] marked option can be specified multiple times
317 [+] marked option can be specified multiple times
318
318
319 global options:
319 global options:
320
320
321 -R --repository REPO repository root directory or name of overlay bundle
321 -R --repository REPO repository root directory or name of overlay bundle
322 file
322 file
323 --cwd DIR change working directory
323 --cwd DIR change working directory
324 -y --noninteractive do not prompt, automatically pick the first choice for
324 -y --noninteractive do not prompt, automatically pick the first choice for
325 all prompts
325 all prompts
326 -q --quiet suppress output
326 -q --quiet suppress output
327 -v --verbose enable additional output
327 -v --verbose enable additional output
328 --config CONFIG [+] set/override config option (use 'section.name=value')
328 --config CONFIG [+] set/override config option (use 'section.name=value')
329 --debug enable debugging output
329 --debug enable debugging output
330 --debugger start debugger
330 --debugger start debugger
331 --encoding ENCODE set the charset encoding (default: ascii)
331 --encoding ENCODE set the charset encoding (default: ascii)
332 --encodingmode MODE set the charset encoding mode (default: strict)
332 --encodingmode MODE set the charset encoding mode (default: strict)
333 --traceback always print a traceback on exception
333 --traceback always print a traceback on exception
334 --time time how long the command takes
334 --time time how long the command takes
335 --profile print command execution profile
335 --profile print command execution profile
336 --version output version information and exit
336 --version output version information and exit
337 -h --help display help and exit
337 -h --help display help and exit
338 --hidden consider hidden changesets
338 --hidden consider hidden changesets
339
339
340 [+] marked option can be specified multiple times
340 [+] marked option can be specified multiple times
341
341
342 Test help option with version option
342 Test help option with version option
343
343
344 $ hg add -h --version
344 $ hg add -h --version
345 Mercurial Distributed SCM (version *) (glob)
345 Mercurial Distributed SCM (version *) (glob)
346 (see http://mercurial.selenic.com for more information)
346 (see http://mercurial.selenic.com for more information)
347
347
348 Copyright (C) 2005-2012 Matt Mackall and others
348 Copyright (C) 2005-2012 Matt Mackall and others
349 This is free software; see the source for copying conditions. There is NO
349 This is free software; see the source for copying conditions. There is NO
350 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
350 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
351
351
352 $ hg add --skjdfks
352 $ hg add --skjdfks
353 hg add: option --skjdfks not recognized
353 hg add: option --skjdfks not recognized
354 hg add [OPTION]... [FILE]...
354 hg add [OPTION]... [FILE]...
355
355
356 add the specified files on the next commit
356 add the specified files on the next commit
357
357
358 options:
358 options:
359
359
360 -I --include PATTERN [+] include names matching the given patterns
360 -I --include PATTERN [+] include names matching the given patterns
361 -X --exclude PATTERN [+] exclude names matching the given patterns
361 -X --exclude PATTERN [+] exclude names matching the given patterns
362 -S --subrepos recurse into subrepositories
362 -S --subrepos recurse into subrepositories
363 -n --dry-run do not perform actions, just print output
363 -n --dry-run do not perform actions, just print output
364
364
365 [+] marked option can be specified multiple times
365 [+] marked option can be specified multiple times
366
366
367 use "hg help add" to show the full help text
367 use "hg help add" to show the full help text
368 [255]
368 [255]
369
369
370 Test ambiguous command help
370 Test ambiguous command help
371
371
372 $ hg help ad
372 $ hg help ad
373 list of commands:
373 list of commands:
374
374
375 add add the specified files on the next commit
375 add add the specified files on the next commit
376 addremove add all new files, delete all missing files
376 addremove add all new files, delete all missing files
377
377
378 use "hg -v help ad" to show builtin aliases and global options
378 use "hg -v help ad" to show builtin aliases and global options
379
379
380 Test command without options
380 Test command without options
381
381
382 $ hg help verify
382 $ hg help verify
383 hg verify
383 hg verify
384
384
385 verify the integrity of the repository
385 verify the integrity of the repository
386
386
387 Verify the integrity of the current repository.
387 Verify the integrity of the current repository.
388
388
389 This will perform an extensive check of the repository's integrity,
389 This will perform an extensive check of the repository's integrity,
390 validating the hashes and checksums of each entry in the changelog,
390 validating the hashes and checksums of each entry in the changelog,
391 manifest, and tracked files, as well as the integrity of their crosslinks
391 manifest, and tracked files, as well as the integrity of their crosslinks
392 and indices.
392 and indices.
393
393
394 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more
394 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more
395 information about recovery from corruption of the repository.
395 information about recovery from corruption of the repository.
396
396
397 Returns 0 on success, 1 if errors are encountered.
397 Returns 0 on success, 1 if errors are encountered.
398
398
399 use "hg -v help verify" to show the global options
399 use "hg -v help verify" to show the global options
400
400
401 $ hg help diff
401 $ hg help diff
402 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
402 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
403
403
404 diff repository (or selected files)
404 diff repository (or selected files)
405
405
406 Show differences between revisions for the specified files.
406 Show differences between revisions for the specified files.
407
407
408 Differences between files are shown using the unified diff format.
408 Differences between files are shown using the unified diff format.
409
409
410 Note:
410 Note:
411 diff may generate unexpected results for merges, as it will default to
411 diff may generate unexpected results for merges, as it will default to
412 comparing against the working directory's first parent changeset if no
412 comparing against the working directory's first parent changeset if no
413 revisions are specified.
413 revisions are specified.
414
414
415 When two revision arguments are given, then changes are shown between
415 When two revision arguments are given, then changes are shown between
416 those revisions. If only one revision is specified then that revision is
416 those revisions. If only one revision is specified then that revision is
417 compared to the working directory, and, when no revisions are specified,
417 compared to the working directory, and, when no revisions are specified,
418 the working directory files are compared to its parent.
418 the working directory files are compared to its parent.
419
419
420 Alternatively you can specify -c/--change with a revision to see the
420 Alternatively you can specify -c/--change with a revision to see the
421 changes in that changeset relative to its first parent.
421 changes in that changeset relative to its first parent.
422
422
423 Without the -a/--text option, diff will avoid generating diffs of files it
423 Without the -a/--text option, diff will avoid generating diffs of files it
424 detects as binary. With -a, diff will generate a diff anyway, probably
424 detects as binary. With -a, diff will generate a diff anyway, probably
425 with undesirable results.
425 with undesirable results.
426
426
427 Use the -g/--git option to generate diffs in the git extended diff format.
427 Use the -g/--git option to generate diffs in the git extended diff format.
428 For more information, read "hg help diffs".
428 For more information, read "hg help diffs".
429
429
430 Returns 0 on success.
430 Returns 0 on success.
431
431
432 options:
432 options:
433
433
434 -r --rev REV [+] revision
434 -r --rev REV [+] revision
435 -c --change REV change made by revision
435 -c --change REV change made by revision
436 -a --text treat all files as text
436 -a --text treat all files as text
437 -g --git use git extended diff format
437 -g --git use git extended diff format
438 --nodates omit dates from diff headers
438 --nodates omit dates from diff headers
439 -p --show-function show which function each change is in
439 -p --show-function show which function each change is in
440 --reverse produce a diff that undoes the changes
440 --reverse produce a diff that undoes the changes
441 -w --ignore-all-space ignore white space when comparing lines
441 -w --ignore-all-space ignore white space when comparing lines
442 -b --ignore-space-change ignore changes in the amount of white space
442 -b --ignore-space-change ignore changes in the amount of white space
443 -B --ignore-blank-lines ignore changes whose lines are all blank
443 -B --ignore-blank-lines ignore changes whose lines are all blank
444 -U --unified NUM number of lines of context to show
444 -U --unified NUM number of lines of context to show
445 --stat output diffstat-style summary of changes
445 --stat output diffstat-style summary of changes
446 -I --include PATTERN [+] include names matching the given patterns
446 -I --include PATTERN [+] include names matching the given patterns
447 -X --exclude PATTERN [+] exclude names matching the given patterns
447 -X --exclude PATTERN [+] exclude names matching the given patterns
448 -S --subrepos recurse into subrepositories
448 -S --subrepos recurse into subrepositories
449
449
450 [+] marked option can be specified multiple times
450 [+] marked option can be specified multiple times
451
451
452 use "hg -v help diff" to show more complete help and the global options
452 use "hg -v help diff" to show more complete help and the global options
453
453
454 $ hg help status
454 $ hg help status
455 hg status [OPTION]... [FILE]...
455 hg status [OPTION]... [FILE]...
456
456
457 aliases: st
457 aliases: st
458
458
459 show changed files in the working directory
459 show changed files in the working directory
460
460
461 Show status of files in the repository. If names are given, only files
461 Show status of files in the repository. If names are given, only files
462 that match are shown. Files that are clean or ignored or the source of a
462 that match are shown. Files that are clean or ignored or the source of a
463 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
463 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
464 -C/--copies or -A/--all are given. Unless options described with "show
464 -C/--copies or -A/--all are given. Unless options described with "show
465 only ..." are given, the options -mardu are used.
465 only ..." are given, the options -mardu are used.
466
466
467 Option -q/--quiet hides untracked (unknown and ignored) files unless
467 Option -q/--quiet hides untracked (unknown and ignored) files unless
468 explicitly requested with -u/--unknown or -i/--ignored.
468 explicitly requested with -u/--unknown or -i/--ignored.
469
469
470 Note:
470 Note:
471 status may appear to disagree with diff if permissions have changed or
471 status may appear to disagree with diff if permissions have changed or
472 a merge has occurred. The standard diff format does not report
472 a merge has occurred. The standard diff format does not report
473 permission changes and diff only reports changes relative to one merge
473 permission changes and diff only reports changes relative to one merge
474 parent.
474 parent.
475
475
476 If one revision is given, it is used as the base revision. If two
476 If one revision is given, it is used as the base revision. If two
477 revisions are given, the differences between them are shown. The --change
477 revisions are given, the differences between them are shown. The --change
478 option can also be used as a shortcut to list the changed files of a
478 option can also be used as a shortcut to list the changed files of a
479 revision from its first parent.
479 revision from its first parent.
480
480
481 The codes used to show the status of files are:
481 The codes used to show the status of files are:
482
482
483 M = modified
483 M = modified
484 A = added
484 A = added
485 R = removed
485 R = removed
486 C = clean
486 C = clean
487 ! = missing (deleted by non-hg command, but still tracked)
487 ! = missing (deleted by non-hg command, but still tracked)
488 ? = not tracked
488 ? = not tracked
489 I = ignored
489 I = ignored
490 = origin of the previous file listed as A (added)
490 = origin of the previous file listed as A (added)
491
491
492 Returns 0 on success.
492 Returns 0 on success.
493
493
494 options:
494 options:
495
495
496 -A --all show status of all files
496 -A --all show status of all files
497 -m --modified show only modified files
497 -m --modified show only modified files
498 -a --added show only added files
498 -a --added show only added files
499 -r --removed show only removed files
499 -r --removed show only removed files
500 -d --deleted show only deleted (but tracked) files
500 -d --deleted show only deleted (but tracked) files
501 -c --clean show only files without changes
501 -c --clean show only files without changes
502 -u --unknown show only unknown (not tracked) files
502 -u --unknown show only unknown (not tracked) files
503 -i --ignored show only ignored files
503 -i --ignored show only ignored files
504 -n --no-status hide status prefix
504 -n --no-status hide status prefix
505 -C --copies show source of copied files
505 -C --copies show source of copied files
506 -0 --print0 end filenames with NUL, for use with xargs
506 -0 --print0 end filenames with NUL, for use with xargs
507 --rev REV [+] show difference from revision
507 --rev REV [+] show difference from revision
508 --change REV list the changed files of a revision
508 --change REV list the changed files of a revision
509 -I --include PATTERN [+] include names matching the given patterns
509 -I --include PATTERN [+] include names matching the given patterns
510 -X --exclude PATTERN [+] exclude names matching the given patterns
510 -X --exclude PATTERN [+] exclude names matching the given patterns
511 -S --subrepos recurse into subrepositories
511 -S --subrepos recurse into subrepositories
512
512
513 [+] marked option can be specified multiple times
513 [+] marked option can be specified multiple times
514
514
515 use "hg -v help status" to show more complete help and the global options
515 use "hg -v help status" to show more complete help and the global options
516
516
517 $ hg -q help status
517 $ hg -q help status
518 hg status [OPTION]... [FILE]...
518 hg status [OPTION]... [FILE]...
519
519
520 show changed files in the working directory
520 show changed files in the working directory
521
521
522 $ hg help foo
522 $ hg help foo
523 hg: unknown command 'foo'
523 hg: unknown command 'foo'
524 Mercurial Distributed SCM
524 Mercurial Distributed SCM
525
525
526 basic commands:
526 basic commands:
527
527
528 add add the specified files on the next commit
528 add add the specified files on the next commit
529 annotate show changeset information by line for each file
529 annotate show changeset information by line for each file
530 clone make a copy of an existing repository
530 clone make a copy of an existing repository
531 commit commit the specified files or all outstanding changes
531 commit commit the specified files or all outstanding changes
532 diff diff repository (or selected files)
532 diff diff repository (or selected files)
533 export dump the header and diffs for one or more changesets
533 export dump the header and diffs for one or more changesets
534 forget forget the specified files on the next commit
534 forget forget the specified files on the next commit
535 init create a new repository in the given directory
535 init create a new repository in the given directory
536 log show revision history of entire repository or files
536 log show revision history of entire repository or files
537 merge merge working directory with another revision
537 merge merge working directory with another revision
538 pull pull changes from the specified source
538 pull pull changes from the specified source
539 push push changes to the specified destination
539 push push changes to the specified destination
540 remove remove the specified files on the next commit
540 remove remove the specified files on the next commit
541 serve start stand-alone webserver
541 serve start stand-alone webserver
542 status show changed files in the working directory
542 status show changed files in the working directory
543 summary summarize working directory state
543 summary summarize working directory state
544 update update working directory (or switch revisions)
544 update update working directory (or switch revisions)
545
545
546 use "hg help" for the full list of commands or "hg -v" for details
546 use "hg help" for the full list of commands or "hg -v" for details
547 [255]
547 [255]
548
548
549 $ hg skjdfks
549 $ hg skjdfks
550 hg: unknown command 'skjdfks'
550 hg: unknown command 'skjdfks'
551 Mercurial Distributed SCM
551 Mercurial Distributed SCM
552
552
553 basic commands:
553 basic commands:
554
554
555 add add the specified files on the next commit
555 add add the specified files on the next commit
556 annotate show changeset information by line for each file
556 annotate show changeset information by line for each file
557 clone make a copy of an existing repository
557 clone make a copy of an existing repository
558 commit commit the specified files or all outstanding changes
558 commit commit the specified files or all outstanding changes
559 diff diff repository (or selected files)
559 diff diff repository (or selected files)
560 export dump the header and diffs for one or more changesets
560 export dump the header and diffs for one or more changesets
561 forget forget the specified files on the next commit
561 forget forget the specified files on the next commit
562 init create a new repository in the given directory
562 init create a new repository in the given directory
563 log show revision history of entire repository or files
563 log show revision history of entire repository or files
564 merge merge working directory with another revision
564 merge merge working directory with another revision
565 pull pull changes from the specified source
565 pull pull changes from the specified source
566 push push changes to the specified destination
566 push push changes to the specified destination
567 remove remove the specified files on the next commit
567 remove remove the specified files on the next commit
568 serve start stand-alone webserver
568 serve start stand-alone webserver
569 status show changed files in the working directory
569 status show changed files in the working directory
570 summary summarize working directory state
570 summary summarize working directory state
571 update update working directory (or switch revisions)
571 update update working directory (or switch revisions)
572
572
573 use "hg help" for the full list of commands or "hg -v" for details
573 use "hg help" for the full list of commands or "hg -v" for details
574 [255]
574 [255]
575
575
576 $ cat > helpext.py <<EOF
576 $ cat > helpext.py <<EOF
577 > import os
577 > import os
578 > from mercurial import commands
578 > from mercurial import commands
579 >
579 >
580 > def nohelp(ui, *args, **kwargs):
580 > def nohelp(ui, *args, **kwargs):
581 > pass
581 > pass
582 >
582 >
583 > cmdtable = {
583 > cmdtable = {
584 > "nohelp": (nohelp, [], "hg nohelp"),
584 > "nohelp": (nohelp, [], "hg nohelp"),
585 > }
585 > }
586 >
586 >
587 > commands.norepo += ' nohelp'
587 > commands.norepo += ' nohelp'
588 > EOF
588 > EOF
589 $ echo '[extensions]' >> $HGRCPATH
589 $ echo '[extensions]' >> $HGRCPATH
590 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
590 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
591
591
592 Test command with no help text
592 Test command with no help text
593
593
594 $ hg help nohelp
594 $ hg help nohelp
595 hg nohelp
595 hg nohelp
596
596
597 (no help text available)
597 (no help text available)
598
598
599 use "hg -v help nohelp" to show the global options
599 use "hg -v help nohelp" to show the global options
600
600
601 $ hg help -k nohelp
601 $ hg help -k nohelp
602 Commands:
602 Commands:
603
603
604 nohelp hg nohelp
604 nohelp hg nohelp
605
605
606 Extension Commands:
606 Extension Commands:
607
607
608 nohelp (no help text available)
608 nohelp (no help text available)
609
609
610 Test that default list of commands omits extension commands
610 Test that default list of commands omits extension commands
611
611
612 $ hg help
612 $ hg help
613 Mercurial Distributed SCM
613 Mercurial Distributed SCM
614
614
615 list of commands:
615 list of commands:
616
616
617 add add the specified files on the next commit
617 add add the specified files on the next commit
618 addremove add all new files, delete all missing files
618 addremove add all new files, delete all missing files
619 annotate show changeset information by line for each file
619 annotate show changeset information by line for each file
620 archive create an unversioned archive of a repository revision
620 archive create an unversioned archive of a repository revision
621 backout reverse effect of earlier changeset
621 backout reverse effect of earlier changeset
622 bisect subdivision search of changesets
622 bisect subdivision search of changesets
623 bookmarks track a line of development with movable markers
623 bookmarks track a line of development with movable markers
624 branch set or show the current branch name
624 branch set or show the current branch name
625 branches list repository named branches
625 branches list repository named branches
626 bundle create a changegroup file
626 bundle create a changegroup file
627 cat output the current or given revision of files
627 cat output the current or given revision of files
628 clone make a copy of an existing repository
628 clone make a copy of an existing repository
629 commit commit the specified files or all outstanding changes
629 commit commit the specified files or all outstanding changes
630 copy mark files as copied for the next commit
630 copy mark files as copied for the next commit
631 diff diff repository (or selected files)
631 diff diff repository (or selected files)
632 export dump the header and diffs for one or more changesets
632 export dump the header and diffs for one or more changesets
633 forget forget the specified files on the next commit
633 forget forget the specified files on the next commit
634 graft copy changes from other branches onto the current branch
634 graft copy changes from other branches onto the current branch
635 grep search for a pattern in specified files and revisions
635 grep search for a pattern in specified files and revisions
636 heads show current repository heads or show branch heads
636 heads show current repository heads or show branch heads
637 help show help for a given topic or a help overview
637 help show help for a given topic or a help overview
638 identify identify the working copy or specified revision
638 identify identify the working copy or specified revision
639 import import an ordered set of patches
639 import import an ordered set of patches
640 incoming show new changesets found in source
640 incoming show new changesets found in source
641 init create a new repository in the given directory
641 init create a new repository in the given directory
642 locate locate files matching specific patterns
642 locate locate files matching specific patterns
643 log show revision history of entire repository or files
643 log show revision history of entire repository or files
644 manifest output the current or given revision of the project manifest
644 manifest output the current or given revision of the project manifest
645 merge merge working directory with another revision
645 merge merge working directory with another revision
646 outgoing show changesets not found in the destination
646 outgoing show changesets not found in the destination
647 parents show the parents of the working directory or revision
647 parents show the parents of the working directory or revision
648 paths show aliases for remote repositories
648 paths show aliases for remote repositories
649 phase set or show the current phase name
649 phase set or show the current phase name
650 pull pull changes from the specified source
650 pull pull changes from the specified source
651 push push changes to the specified destination
651 push push changes to the specified destination
652 recover roll back an interrupted transaction
652 recover roll back an interrupted transaction
653 remove remove the specified files on the next commit
653 remove remove the specified files on the next commit
654 rename rename files; equivalent of copy + remove
654 rename rename files; equivalent of copy + remove
655 resolve redo merges or set/view the merge status of files
655 resolve redo merges or set/view the merge status of files
656 revert restore files to their checkout state
656 revert restore files to their checkout state
657 rollback roll back the last transaction (dangerous)
657 rollback roll back the last transaction (dangerous)
658 root print the root (top) of the current working directory
658 root print the root (top) of the current working directory
659 serve start stand-alone webserver
659 serve start stand-alone webserver
660 showconfig show combined config settings from all hgrc files
660 showconfig show combined config settings from all hgrc files
661 status show changed files in the working directory
661 status show changed files in the working directory
662 summary summarize working directory state
662 summary summarize working directory state
663 tag add one or more tags for the current or given revision
663 tag add one or more tags for the current or given revision
664 tags list repository tags
664 tags list repository tags
665 tip show the tip revision
665 tip show the tip revision
666 unbundle apply one or more changegroup files
666 unbundle apply one or more changegroup files
667 update update working directory (or switch revisions)
667 update update working directory (or switch revisions)
668 verify verify the integrity of the repository
668 verify verify the integrity of the repository
669 version output version and copyright information
669 version output version and copyright information
670
670
671 enabled extensions:
671 enabled extensions:
672
672
673 helpext (no help text available)
673 helpext (no help text available)
674
674
675 additional help topics:
675 additional help topics:
676
676
677 config Configuration Files
677 config Configuration Files
678 dates Date Formats
678 dates Date Formats
679 diffs Diff Formats
679 diffs Diff Formats
680 environment Environment Variables
680 environment Environment Variables
681 extensions Using Additional Features
681 extensions Using Additional Features
682 filesets Specifying File Sets
682 filesets Specifying File Sets
683 glossary Glossary
683 glossary Glossary
684 hgignore Syntax for Mercurial Ignore Files
684 hgignore Syntax for Mercurial Ignore Files
685 hgweb Configuring hgweb
685 hgweb Configuring hgweb
686 merge-tools Merge Tools
686 merge-tools Merge Tools
687 multirevs Specifying Multiple Revisions
687 multirevs Specifying Multiple Revisions
688 patterns File Name Patterns
688 patterns File Name Patterns
689 phases Working with Phases
689 phases Working with Phases
690 revisions Specifying Single Revisions
690 revisions Specifying Single Revisions
691 revsets Specifying Revision Sets
691 revsets Specifying Revision Sets
692 subrepos Subrepositories
692 subrepos Subrepositories
693 templating Template Usage
693 templating Template Usage
694 urls URL Paths
694 urls URL Paths
695
695
696 use "hg -v help" to show builtin aliases and global options
696 use "hg -v help" to show builtin aliases and global options
697
697
698
698
699
699
700 Test list of commands with command with no help text
700 Test list of commands with command with no help text
701
701
702 $ hg help helpext
702 $ hg help helpext
703 helpext extension - no help text available
703 helpext extension - no help text available
704
704
705 list of commands:
705 list of commands:
706
706
707 nohelp (no help text available)
707 nohelp (no help text available)
708
708
709 use "hg -v help helpext" to show builtin aliases and global options
709 use "hg -v help helpext" to show builtin aliases and global options
710
710
711 Test a help topic
711 Test a help topic
712
712
713 $ hg help revs
713 $ hg help revs
714 Specifying Single Revisions
714 Specifying Single Revisions
715 """""""""""""""""""""""""""
715 """""""""""""""""""""""""""
716
716
717 Mercurial supports several ways to specify individual revisions.
717 Mercurial supports several ways to specify individual revisions.
718
718
719 A plain integer is treated as a revision number. Negative integers are
719 A plain integer is treated as a revision number. Negative integers are
720 treated as sequential offsets from the tip, with -1 denoting the tip, -2
720 treated as sequential offsets from the tip, with -1 denoting the tip, -2
721 denoting the revision prior to the tip, and so forth.
721 denoting the revision prior to the tip, and so forth.
722
722
723 A 40-digit hexadecimal string is treated as a unique revision identifier.
723 A 40-digit hexadecimal string is treated as a unique revision identifier.
724
724
725 A hexadecimal string less than 40 characters long is treated as a unique
725 A hexadecimal string less than 40 characters long is treated as a unique
726 revision identifier and is referred to as a short-form identifier. A
726 revision identifier and is referred to as a short-form identifier. A
727 short-form identifier is only valid if it is the prefix of exactly one
727 short-form identifier is only valid if it is the prefix of exactly one
728 full-length identifier.
728 full-length identifier.
729
729
730 Any other string is treated as a bookmark, tag, or branch name. A bookmark
730 Any other string is treated as a bookmark, tag, or branch name. A bookmark
731 is a movable pointer to a revision. A tag is a permanent name associated
731 is a movable pointer to a revision. A tag is a permanent name associated
732 with a revision. A branch name denotes the tipmost revision of that
732 with a revision. A branch name denotes the tipmost revision of that
733 branch. Bookmark, tag, and branch names must not contain the ":"
733 branch. Bookmark, tag, and branch names must not contain the ":"
734 character.
734 character.
735
735
736 The reserved name "tip" always identifies the most recent revision.
736 The reserved name "tip" always identifies the most recent revision.
737
737
738 The reserved name "null" indicates the null revision. This is the revision
738 The reserved name "null" indicates the null revision. This is the revision
739 of an empty repository, and the parent of revision 0.
739 of an empty repository, and the parent of revision 0.
740
740
741 The reserved name "." indicates the working directory parent. If no
741 The reserved name "." indicates the working directory parent. If no
742 working directory is checked out, it is equivalent to null. If an
742 working directory is checked out, it is equivalent to null. If an
743 uncommitted merge is in progress, "." is the revision of the first parent.
743 uncommitted merge is in progress, "." is the revision of the first parent.
744
744
745 Test templating help
745 Test templating help
746
746
747 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
747 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
748 desc String. The text of the changeset description.
748 desc String. The text of the changeset description.
749 diffstat String. Statistics of changes with the following format:
749 diffstat String. Statistics of changes with the following format:
750 firstline Any text. Returns the first line of text.
750 firstline Any text. Returns the first line of text.
751 nonempty Any text. Returns '(none)' if the string is empty.
751 nonempty Any text. Returns '(none)' if the string is empty.
752
752
753 Test help hooks
753 Test help hooks
754
754
755 $ cat > helphook1.py <<EOF
755 $ cat > helphook1.py <<EOF
756 > from mercurial import help
756 > from mercurial import help
757 >
757 >
758 > def rewrite(topic, doc):
758 > def rewrite(topic, doc):
759 > return doc + '\nhelphook1\n'
759 > return doc + '\nhelphook1\n'
760 >
760 >
761 > def extsetup(ui):
761 > def extsetup(ui):
762 > help.addtopichook('revsets', rewrite)
762 > help.addtopichook('revsets', rewrite)
763 > EOF
763 > EOF
764 $ cat > helphook2.py <<EOF
764 $ cat > helphook2.py <<EOF
765 > from mercurial import help
765 > from mercurial import help
766 >
766 >
767 > def rewrite(topic, doc):
767 > def rewrite(topic, doc):
768 > return doc + '\nhelphook2\n'
768 > return doc + '\nhelphook2\n'
769 >
769 >
770 > def extsetup(ui):
770 > def extsetup(ui):
771 > help.addtopichook('revsets', rewrite)
771 > help.addtopichook('revsets', rewrite)
772 > EOF
772 > EOF
773 $ echo '[extensions]' >> $HGRCPATH
773 $ echo '[extensions]' >> $HGRCPATH
774 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
774 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
775 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
775 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
776 $ hg help revsets | grep helphook
776 $ hg help revsets | grep helphook
777 helphook1
777 helphook1
778 helphook2
778 helphook2
779
779
780 Test keyword search help
780 Test keyword search help
781
781
782 $ hg help -k clone
782 $ hg help -k clone
783 Topics:
783 Topics:
784
784
785 config Configuration Files
785 config Configuration Files
786 extensions Using Additional Features
786 extensions Using Additional Features
787 glossary Glossary
787 glossary Glossary
788 phases Working with Phases
788 phases Working with Phases
789 subrepos Subrepositories
789 subrepos Subrepositories
790 urls URL Paths
790 urls URL Paths
791
791
792 Commands:
792 Commands:
793
793
794 bookmarks track a line of development with movable markers
794 bookmarks track a line of development with movable markers
795 clone make a copy of an existing repository
795 clone make a copy of an existing repository
796 paths show aliases for remote repositories
796 paths show aliases for remote repositories
797 update update working directory (or switch revisions)
797 update update working directory (or switch revisions)
798
798
799 Extensions:
799 Extensions:
800
800
801 relink recreates hardlinks between repository clones
801 relink recreates hardlinks between repository clones
802
802
803 Extension Commands:
803 Extension Commands:
804
804
805 qclone clone main and patch repository at same time
805 qclone clone main and patch repository at same time
806
806
807 Test omit indicating for help
807 Test omit indicating for help
808
808
809 $ cat > addverboseitems.py <<EOF
809 $ cat > addverboseitems.py <<EOF
810 > '''extension to test omit indicating.
810 > '''extension to test omit indicating.
811 >
811 >
812 > This paragraph is never omitted (for extension)
812 > This paragraph is never omitted (for extension)
813 >
813 >
814 > .. container:: verbose
814 > .. container:: verbose
815 >
815 >
816 > This paragraph is omitted,
816 > This paragraph is omitted,
817 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
817 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
818 >
818 >
819 > This paragraph is never omitted, too (for extension)
819 > This paragraph is never omitted, too (for extension)
820 > '''
820 > '''
821 >
821 >
822 > from mercurial import help, commands
822 > from mercurial import help, commands
823 > testtopic = """This paragraph is never omitted (for topic).
823 > testtopic = """This paragraph is never omitted (for topic).
824 >
824 >
825 > .. container:: verbose
825 > .. container:: verbose
826 >
826 >
827 > This paragraph is omitted,
827 > This paragraph is omitted,
828 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
828 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
829 >
829 >
830 > This paragraph is never omitted, too (for topic)
830 > This paragraph is never omitted, too (for topic)
831 > """
831 > """
832 > def extsetup(ui):
832 > def extsetup(ui):
833 > help.helptable.append((["topic-containing-verbose"],
833 > help.helptable.append((["topic-containing-verbose"],
834 > "This is the topic to test omit indicating.",
834 > "This is the topic to test omit indicating.",
835 > lambda : testtopic))
835 > lambda : testtopic))
836 > EOF
836 > EOF
837 $ echo '[extensions]' >> $HGRCPATH
837 $ echo '[extensions]' >> $HGRCPATH
838 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
838 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
839 $ hg help addverboseitems
839 $ hg help addverboseitems
840 addverboseitems extension - extension to test omit indicating.
840 addverboseitems extension - extension to test omit indicating.
841
841
842 This paragraph is never omitted (for extension)
842 This paragraph is never omitted (for extension)
843
843
844 This paragraph is never omitted, too (for extension)
844 This paragraph is never omitted, too (for extension)
845
845
846 use "hg help -v addverboseitems" to show more complete help
846 use "hg help -v addverboseitems" to show more complete help
847
847
848 no commands defined
848 no commands defined
849 $ hg help -v addverboseitems
849 $ hg help -v addverboseitems
850 addverboseitems extension - extension to test omit indicating.
850 addverboseitems extension - extension to test omit indicating.
851
851
852 This paragraph is never omitted (for extension)
852 This paragraph is never omitted (for extension)
853
853
854 This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
854 This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
855
855
856 This paragraph is never omitted, too (for extension)
856 This paragraph is never omitted, too (for extension)
857
857
858 no commands defined
858 no commands defined
859 $ hg help topic-containing-verbose
859 $ hg help topic-containing-verbose
860 This is the topic to test omit indicating.
860 This is the topic to test omit indicating.
861 """"""""""""""""""""""""""""""""""""""""""
861 """"""""""""""""""""""""""""""""""""""""""
862
862
863 This paragraph is never omitted (for topic).
863 This paragraph is never omitted (for topic).
864
864
865 This paragraph is never omitted, too (for topic)
865 This paragraph is never omitted, too (for topic)
866
866
867 use "hg help -v topic-containing-verbose" to show more complete help
867 use "hg help -v topic-containing-verbose" to show more complete help
868 $ hg help -v topic-containing-verbose
868 $ hg help -v topic-containing-verbose
869 This is the topic to test omit indicating.
869 This is the topic to test omit indicating.
870 """"""""""""""""""""""""""""""""""""""""""
870 """"""""""""""""""""""""""""""""""""""""""
871
871
872 This paragraph is never omitted (for topic).
872 This paragraph is never omitted (for topic).
873
873
874 This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
874 This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
875
875
876 This paragraph is never omitted, too (for topic)
876 This paragraph is never omitted, too (for topic)
877
877
878 Test usage of section marks in help documents
878 Test usage of section marks in help documents
879
879
880 $ cd "$TESTDIR"/../doc
880 $ cd "$TESTDIR"/../doc
881 $ python check-seclevel.py
881 $ python check-seclevel.py
882 $ cd $TESTTMP
882 $ cd $TESTTMP
883
883
884 #if serve
884 #if serve
885
885
886 Test the help pages in hgweb.
886 Test the help pages in hgweb.
887
887
888 Dish up an empty repo; serve it cold.
888 Dish up an empty repo; serve it cold.
889
889
890 $ hg init "$TESTTMP/test"
890 $ hg init "$TESTTMP/test"
891 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
891 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
892 $ cat hg.pid >> $DAEMON_PIDS
892 $ cat hg.pid >> $DAEMON_PIDS
893
893
894 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
894 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
895 200 Script output follows
895 200 Script output follows
896
896
897 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
897 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
898 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
898 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
899 <head>
899 <head>
900 <link rel="icon" href="/static/hgicon.png" type="image/png" />
900 <link rel="icon" href="/static/hgicon.png" type="image/png" />
901 <meta name="robots" content="index, nofollow" />
901 <meta name="robots" content="index, nofollow" />
902 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
902 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
903 <script type="text/javascript" src="/static/mercurial.js"></script>
903 <script type="text/javascript" src="/static/mercurial.js"></script>
904
904
905 <title>Help: Index</title>
905 <title>Help: Index</title>
906 </head>
906 </head>
907 <body>
907 <body>
908
908
909 <div class="container">
909 <div class="container">
910 <div class="menu">
910 <div class="menu">
911 <div class="logo">
911 <div class="logo">
912 <a href="http://mercurial.selenic.com/">
912 <a href="http://mercurial.selenic.com/">
913 <img src="/static/hglogo.png" alt="mercurial" /></a>
913 <img src="/static/hglogo.png" alt="mercurial" /></a>
914 </div>
914 </div>
915 <ul>
915 <ul>
916 <li><a href="/shortlog">log</a></li>
916 <li><a href="/shortlog">log</a></li>
917 <li><a href="/graph">graph</a></li>
917 <li><a href="/graph">graph</a></li>
918 <li><a href="/tags">tags</a></li>
918 <li><a href="/tags">tags</a></li>
919 <li><a href="/bookmarks">bookmarks</a></li>
919 <li><a href="/bookmarks">bookmarks</a></li>
920 <li><a href="/branches">branches</a></li>
920 <li><a href="/branches">branches</a></li>
921 </ul>
921 </ul>
922 <ul>
922 <ul>
923 <li class="active">help</li>
923 <li class="active">help</li>
924 </ul>
924 </ul>
925 </div>
925 </div>
926
926
927 <div class="main">
927 <div class="main">
928 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
928 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
929 <form class="search" action="/log">
929 <form class="search" action="/log">
930
930
931 <p><input name="rev" id="search1" type="text" size="30" /></p>
931 <p><input name="rev" id="search1" type="text" size="30" /></p>
932 <div id="hint">find changesets by author, revision,
932 <div id="hint">find changesets by author, revision,
933 files, or words in the commit message</div>
933 files, or words in the commit message</div>
934 </form>
934 </form>
935 <table class="bigtable">
935 <table class="bigtable">
936 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
936 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
937
937
938 <tr><td>
938 <tr><td>
939 <a href="/help/config">
939 <a href="/help/config">
940 config
940 config
941 </a>
941 </a>
942 </td><td>
942 </td><td>
943 Configuration Files
943 Configuration Files
944 </td></tr>
944 </td></tr>
945 <tr><td>
945 <tr><td>
946 <a href="/help/dates">
946 <a href="/help/dates">
947 dates
947 dates
948 </a>
948 </a>
949 </td><td>
949 </td><td>
950 Date Formats
950 Date Formats
951 </td></tr>
951 </td></tr>
952 <tr><td>
952 <tr><td>
953 <a href="/help/diffs">
953 <a href="/help/diffs">
954 diffs
954 diffs
955 </a>
955 </a>
956 </td><td>
956 </td><td>
957 Diff Formats
957 Diff Formats
958 </td></tr>
958 </td></tr>
959 <tr><td>
959 <tr><td>
960 <a href="/help/environment">
960 <a href="/help/environment">
961 environment
961 environment
962 </a>
962 </a>
963 </td><td>
963 </td><td>
964 Environment Variables
964 Environment Variables
965 </td></tr>
965 </td></tr>
966 <tr><td>
966 <tr><td>
967 <a href="/help/extensions">
967 <a href="/help/extensions">
968 extensions
968 extensions
969 </a>
969 </a>
970 </td><td>
970 </td><td>
971 Using Additional Features
971 Using Additional Features
972 </td></tr>
972 </td></tr>
973 <tr><td>
973 <tr><td>
974 <a href="/help/filesets">
974 <a href="/help/filesets">
975 filesets
975 filesets
976 </a>
976 </a>
977 </td><td>
977 </td><td>
978 Specifying File Sets
978 Specifying File Sets
979 </td></tr>
979 </td></tr>
980 <tr><td>
980 <tr><td>
981 <a href="/help/glossary">
981 <a href="/help/glossary">
982 glossary
982 glossary
983 </a>
983 </a>
984 </td><td>
984 </td><td>
985 Glossary
985 Glossary
986 </td></tr>
986 </td></tr>
987 <tr><td>
987 <tr><td>
988 <a href="/help/hgignore">
988 <a href="/help/hgignore">
989 hgignore
989 hgignore
990 </a>
990 </a>
991 </td><td>
991 </td><td>
992 Syntax for Mercurial Ignore Files
992 Syntax for Mercurial Ignore Files
993 </td></tr>
993 </td></tr>
994 <tr><td>
994 <tr><td>
995 <a href="/help/hgweb">
995 <a href="/help/hgweb">
996 hgweb
996 hgweb
997 </a>
997 </a>
998 </td><td>
998 </td><td>
999 Configuring hgweb
999 Configuring hgweb
1000 </td></tr>
1000 </td></tr>
1001 <tr><td>
1001 <tr><td>
1002 <a href="/help/merge-tools">
1002 <a href="/help/merge-tools">
1003 merge-tools
1003 merge-tools
1004 </a>
1004 </a>
1005 </td><td>
1005 </td><td>
1006 Merge Tools
1006 Merge Tools
1007 </td></tr>
1007 </td></tr>
1008 <tr><td>
1008 <tr><td>
1009 <a href="/help/multirevs">
1009 <a href="/help/multirevs">
1010 multirevs
1010 multirevs
1011 </a>
1011 </a>
1012 </td><td>
1012 </td><td>
1013 Specifying Multiple Revisions
1013 Specifying Multiple Revisions
1014 </td></tr>
1014 </td></tr>
1015 <tr><td>
1015 <tr><td>
1016 <a href="/help/patterns">
1016 <a href="/help/patterns">
1017 patterns
1017 patterns
1018 </a>
1018 </a>
1019 </td><td>
1019 </td><td>
1020 File Name Patterns
1020 File Name Patterns
1021 </td></tr>
1021 </td></tr>
1022 <tr><td>
1022 <tr><td>
1023 <a href="/help/phases">
1023 <a href="/help/phases">
1024 phases
1024 phases
1025 </a>
1025 </a>
1026 </td><td>
1026 </td><td>
1027 Working with Phases
1027 Working with Phases
1028 </td></tr>
1028 </td></tr>
1029 <tr><td>
1029 <tr><td>
1030 <a href="/help/revisions">
1030 <a href="/help/revisions">
1031 revisions
1031 revisions
1032 </a>
1032 </a>
1033 </td><td>
1033 </td><td>
1034 Specifying Single Revisions
1034 Specifying Single Revisions
1035 </td></tr>
1035 </td></tr>
1036 <tr><td>
1036 <tr><td>
1037 <a href="/help/revsets">
1037 <a href="/help/revsets">
1038 revsets
1038 revsets
1039 </a>
1039 </a>
1040 </td><td>
1040 </td><td>
1041 Specifying Revision Sets
1041 Specifying Revision Sets
1042 </td></tr>
1042 </td></tr>
1043 <tr><td>
1043 <tr><td>
1044 <a href="/help/subrepos">
1044 <a href="/help/subrepos">
1045 subrepos
1045 subrepos
1046 </a>
1046 </a>
1047 </td><td>
1047 </td><td>
1048 Subrepositories
1048 Subrepositories
1049 </td></tr>
1049 </td></tr>
1050 <tr><td>
1050 <tr><td>
1051 <a href="/help/templating">
1051 <a href="/help/templating">
1052 templating
1052 templating
1053 </a>
1053 </a>
1054 </td><td>
1054 </td><td>
1055 Template Usage
1055 Template Usage
1056 </td></tr>
1056 </td></tr>
1057 <tr><td>
1057 <tr><td>
1058 <a href="/help/urls">
1058 <a href="/help/urls">
1059 urls
1059 urls
1060 </a>
1060 </a>
1061 </td><td>
1061 </td><td>
1062 URL Paths
1062 URL Paths
1063 </td></tr>
1063 </td></tr>
1064 <tr><td>
1064 <tr><td>
1065 <a href="/help/topic-containing-verbose">
1065 <a href="/help/topic-containing-verbose">
1066 topic-containing-verbose
1066 topic-containing-verbose
1067 </a>
1067 </a>
1068 </td><td>
1068 </td><td>
1069 This is the topic to test omit indicating.
1069 This is the topic to test omit indicating.
1070 </td></tr>
1070 </td></tr>
1071
1071
1072 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1072 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1073
1073
1074 <tr><td>
1074 <tr><td>
1075 <a href="/help/add">
1075 <a href="/help/add">
1076 add
1076 add
1077 </a>
1077 </a>
1078 </td><td>
1078 </td><td>
1079 add the specified files on the next commit
1079 add the specified files on the next commit
1080 </td></tr>
1080 </td></tr>
1081 <tr><td>
1081 <tr><td>
1082 <a href="/help/annotate">
1082 <a href="/help/annotate">
1083 annotate
1083 annotate
1084 </a>
1084 </a>
1085 </td><td>
1085 </td><td>
1086 show changeset information by line for each file
1086 show changeset information by line for each file
1087 </td></tr>
1087 </td></tr>
1088 <tr><td>
1088 <tr><td>
1089 <a href="/help/clone">
1089 <a href="/help/clone">
1090 clone
1090 clone
1091 </a>
1091 </a>
1092 </td><td>
1092 </td><td>
1093 make a copy of an existing repository
1093 make a copy of an existing repository
1094 </td></tr>
1094 </td></tr>
1095 <tr><td>
1095 <tr><td>
1096 <a href="/help/commit">
1096 <a href="/help/commit">
1097 commit
1097 commit
1098 </a>
1098 </a>
1099 </td><td>
1099 </td><td>
1100 commit the specified files or all outstanding changes
1100 commit the specified files or all outstanding changes
1101 </td></tr>
1101 </td></tr>
1102 <tr><td>
1102 <tr><td>
1103 <a href="/help/diff">
1103 <a href="/help/diff">
1104 diff
1104 diff
1105 </a>
1105 </a>
1106 </td><td>
1106 </td><td>
1107 diff repository (or selected files)
1107 diff repository (or selected files)
1108 </td></tr>
1108 </td></tr>
1109 <tr><td>
1109 <tr><td>
1110 <a href="/help/export">
1110 <a href="/help/export">
1111 export
1111 export
1112 </a>
1112 </a>
1113 </td><td>
1113 </td><td>
1114 dump the header and diffs for one or more changesets
1114 dump the header and diffs for one or more changesets
1115 </td></tr>
1115 </td></tr>
1116 <tr><td>
1116 <tr><td>
1117 <a href="/help/forget">
1117 <a href="/help/forget">
1118 forget
1118 forget
1119 </a>
1119 </a>
1120 </td><td>
1120 </td><td>
1121 forget the specified files on the next commit
1121 forget the specified files on the next commit
1122 </td></tr>
1122 </td></tr>
1123 <tr><td>
1123 <tr><td>
1124 <a href="/help/init">
1124 <a href="/help/init">
1125 init
1125 init
1126 </a>
1126 </a>
1127 </td><td>
1127 </td><td>
1128 create a new repository in the given directory
1128 create a new repository in the given directory
1129 </td></tr>
1129 </td></tr>
1130 <tr><td>
1130 <tr><td>
1131 <a href="/help/log">
1131 <a href="/help/log">
1132 log
1132 log
1133 </a>
1133 </a>
1134 </td><td>
1134 </td><td>
1135 show revision history of entire repository or files
1135 show revision history of entire repository or files
1136 </td></tr>
1136 </td></tr>
1137 <tr><td>
1137 <tr><td>
1138 <a href="/help/merge">
1138 <a href="/help/merge">
1139 merge
1139 merge
1140 </a>
1140 </a>
1141 </td><td>
1141 </td><td>
1142 merge working directory with another revision
1142 merge working directory with another revision
1143 </td></tr>
1143 </td></tr>
1144 <tr><td>
1144 <tr><td>
1145 <a href="/help/pull">
1145 <a href="/help/pull">
1146 pull
1146 pull
1147 </a>
1147 </a>
1148 </td><td>
1148 </td><td>
1149 pull changes from the specified source
1149 pull changes from the specified source
1150 </td></tr>
1150 </td></tr>
1151 <tr><td>
1151 <tr><td>
1152 <a href="/help/push">
1152 <a href="/help/push">
1153 push
1153 push
1154 </a>
1154 </a>
1155 </td><td>
1155 </td><td>
1156 push changes to the specified destination
1156 push changes to the specified destination
1157 </td></tr>
1157 </td></tr>
1158 <tr><td>
1158 <tr><td>
1159 <a href="/help/remove">
1159 <a href="/help/remove">
1160 remove
1160 remove
1161 </a>
1161 </a>
1162 </td><td>
1162 </td><td>
1163 remove the specified files on the next commit
1163 remove the specified files on the next commit
1164 </td></tr>
1164 </td></tr>
1165 <tr><td>
1165 <tr><td>
1166 <a href="/help/serve">
1166 <a href="/help/serve">
1167 serve
1167 serve
1168 </a>
1168 </a>
1169 </td><td>
1169 </td><td>
1170 start stand-alone webserver
1170 start stand-alone webserver
1171 </td></tr>
1171 </td></tr>
1172 <tr><td>
1172 <tr><td>
1173 <a href="/help/status">
1173 <a href="/help/status">
1174 status
1174 status
1175 </a>
1175 </a>
1176 </td><td>
1176 </td><td>
1177 show changed files in the working directory
1177 show changed files in the working directory
1178 </td></tr>
1178 </td></tr>
1179 <tr><td>
1179 <tr><td>
1180 <a href="/help/summary">
1180 <a href="/help/summary">
1181 summary
1181 summary
1182 </a>
1182 </a>
1183 </td><td>
1183 </td><td>
1184 summarize working directory state
1184 summarize working directory state
1185 </td></tr>
1185 </td></tr>
1186 <tr><td>
1186 <tr><td>
1187 <a href="/help/update">
1187 <a href="/help/update">
1188 update
1188 update
1189 </a>
1189 </a>
1190 </td><td>
1190 </td><td>
1191 update working directory (or switch revisions)
1191 update working directory (or switch revisions)
1192 </td></tr>
1192 </td></tr>
1193
1193
1194 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1194 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1195
1195
1196 <tr><td>
1196 <tr><td>
1197 <a href="/help/addremove">
1197 <a href="/help/addremove">
1198 addremove
1198 addremove
1199 </a>
1199 </a>
1200 </td><td>
1200 </td><td>
1201 add all new files, delete all missing files
1201 add all new files, delete all missing files
1202 </td></tr>
1202 </td></tr>
1203 <tr><td>
1203 <tr><td>
1204 <a href="/help/archive">
1204 <a href="/help/archive">
1205 archive
1205 archive
1206 </a>
1206 </a>
1207 </td><td>
1207 </td><td>
1208 create an unversioned archive of a repository revision
1208 create an unversioned archive of a repository revision
1209 </td></tr>
1209 </td></tr>
1210 <tr><td>
1210 <tr><td>
1211 <a href="/help/backout">
1211 <a href="/help/backout">
1212 backout
1212 backout
1213 </a>
1213 </a>
1214 </td><td>
1214 </td><td>
1215 reverse effect of earlier changeset
1215 reverse effect of earlier changeset
1216 </td></tr>
1216 </td></tr>
1217 <tr><td>
1217 <tr><td>
1218 <a href="/help/bisect">
1218 <a href="/help/bisect">
1219 bisect
1219 bisect
1220 </a>
1220 </a>
1221 </td><td>
1221 </td><td>
1222 subdivision search of changesets
1222 subdivision search of changesets
1223 </td></tr>
1223 </td></tr>
1224 <tr><td>
1224 <tr><td>
1225 <a href="/help/bookmarks">
1225 <a href="/help/bookmarks">
1226 bookmarks
1226 bookmarks
1227 </a>
1227 </a>
1228 </td><td>
1228 </td><td>
1229 track a line of development with movable markers
1229 track a line of development with movable markers
1230 </td></tr>
1230 </td></tr>
1231 <tr><td>
1231 <tr><td>
1232 <a href="/help/branch">
1232 <a href="/help/branch">
1233 branch
1233 branch
1234 </a>
1234 </a>
1235 </td><td>
1235 </td><td>
1236 set or show the current branch name
1236 set or show the current branch name
1237 </td></tr>
1237 </td></tr>
1238 <tr><td>
1238 <tr><td>
1239 <a href="/help/branches">
1239 <a href="/help/branches">
1240 branches
1240 branches
1241 </a>
1241 </a>
1242 </td><td>
1242 </td><td>
1243 list repository named branches
1243 list repository named branches
1244 </td></tr>
1244 </td></tr>
1245 <tr><td>
1245 <tr><td>
1246 <a href="/help/bundle">
1246 <a href="/help/bundle">
1247 bundle
1247 bundle
1248 </a>
1248 </a>
1249 </td><td>
1249 </td><td>
1250 create a changegroup file
1250 create a changegroup file
1251 </td></tr>
1251 </td></tr>
1252 <tr><td>
1252 <tr><td>
1253 <a href="/help/cat">
1253 <a href="/help/cat">
1254 cat
1254 cat
1255 </a>
1255 </a>
1256 </td><td>
1256 </td><td>
1257 output the current or given revision of files
1257 output the current or given revision of files
1258 </td></tr>
1258 </td></tr>
1259 <tr><td>
1259 <tr><td>
1260 <a href="/help/copy">
1260 <a href="/help/copy">
1261 copy
1261 copy
1262 </a>
1262 </a>
1263 </td><td>
1263 </td><td>
1264 mark files as copied for the next commit
1264 mark files as copied for the next commit
1265 </td></tr>
1265 </td></tr>
1266 <tr><td>
1266 <tr><td>
1267 <a href="/help/graft">
1267 <a href="/help/graft">
1268 graft
1268 graft
1269 </a>
1269 </a>
1270 </td><td>
1270 </td><td>
1271 copy changes from other branches onto the current branch
1271 copy changes from other branches onto the current branch
1272 </td></tr>
1272 </td></tr>
1273 <tr><td>
1273 <tr><td>
1274 <a href="/help/grep">
1274 <a href="/help/grep">
1275 grep
1275 grep
1276 </a>
1276 </a>
1277 </td><td>
1277 </td><td>
1278 search for a pattern in specified files and revisions
1278 search for a pattern in specified files and revisions
1279 </td></tr>
1279 </td></tr>
1280 <tr><td>
1280 <tr><td>
1281 <a href="/help/heads">
1281 <a href="/help/heads">
1282 heads
1282 heads
1283 </a>
1283 </a>
1284 </td><td>
1284 </td><td>
1285 show current repository heads or show branch heads
1285 show current repository heads or show branch heads
1286 </td></tr>
1286 </td></tr>
1287 <tr><td>
1287 <tr><td>
1288 <a href="/help/help">
1288 <a href="/help/help">
1289 help
1289 help
1290 </a>
1290 </a>
1291 </td><td>
1291 </td><td>
1292 show help for a given topic or a help overview
1292 show help for a given topic or a help overview
1293 </td></tr>
1293 </td></tr>
1294 <tr><td>
1294 <tr><td>
1295 <a href="/help/identify">
1295 <a href="/help/identify">
1296 identify
1296 identify
1297 </a>
1297 </a>
1298 </td><td>
1298 </td><td>
1299 identify the working copy or specified revision
1299 identify the working copy or specified revision
1300 </td></tr>
1300 </td></tr>
1301 <tr><td>
1301 <tr><td>
1302 <a href="/help/import">
1302 <a href="/help/import">
1303 import
1303 import
1304 </a>
1304 </a>
1305 </td><td>
1305 </td><td>
1306 import an ordered set of patches
1306 import an ordered set of patches
1307 </td></tr>
1307 </td></tr>
1308 <tr><td>
1308 <tr><td>
1309 <a href="/help/incoming">
1309 <a href="/help/incoming">
1310 incoming
1310 incoming
1311 </a>
1311 </a>
1312 </td><td>
1312 </td><td>
1313 show new changesets found in source
1313 show new changesets found in source
1314 </td></tr>
1314 </td></tr>
1315 <tr><td>
1315 <tr><td>
1316 <a href="/help/locate">
1316 <a href="/help/locate">
1317 locate
1317 locate
1318 </a>
1318 </a>
1319 </td><td>
1319 </td><td>
1320 locate files matching specific patterns
1320 locate files matching specific patterns
1321 </td></tr>
1321 </td></tr>
1322 <tr><td>
1322 <tr><td>
1323 <a href="/help/manifest">
1323 <a href="/help/manifest">
1324 manifest
1324 manifest
1325 </a>
1325 </a>
1326 </td><td>
1326 </td><td>
1327 output the current or given revision of the project manifest
1327 output the current or given revision of the project manifest
1328 </td></tr>
1328 </td></tr>
1329 <tr><td>
1329 <tr><td>
1330 <a href="/help/nohelp">
1330 <a href="/help/nohelp">
1331 nohelp
1331 nohelp
1332 </a>
1332 </a>
1333 </td><td>
1333 </td><td>
1334 (no help text available)
1334 (no help text available)
1335 </td></tr>
1335 </td></tr>
1336 <tr><td>
1336 <tr><td>
1337 <a href="/help/outgoing">
1337 <a href="/help/outgoing">
1338 outgoing
1338 outgoing
1339 </a>
1339 </a>
1340 </td><td>
1340 </td><td>
1341 show changesets not found in the destination
1341 show changesets not found in the destination
1342 </td></tr>
1342 </td></tr>
1343 <tr><td>
1343 <tr><td>
1344 <a href="/help/parents">
1344 <a href="/help/parents">
1345 parents
1345 parents
1346 </a>
1346 </a>
1347 </td><td>
1347 </td><td>
1348 show the parents of the working directory or revision
1348 show the parents of the working directory or revision
1349 </td></tr>
1349 </td></tr>
1350 <tr><td>
1350 <tr><td>
1351 <a href="/help/paths">
1351 <a href="/help/paths">
1352 paths
1352 paths
1353 </a>
1353 </a>
1354 </td><td>
1354 </td><td>
1355 show aliases for remote repositories
1355 show aliases for remote repositories
1356 </td></tr>
1356 </td></tr>
1357 <tr><td>
1357 <tr><td>
1358 <a href="/help/phase">
1358 <a href="/help/phase">
1359 phase
1359 phase
1360 </a>
1360 </a>
1361 </td><td>
1361 </td><td>
1362 set or show the current phase name
1362 set or show the current phase name
1363 </td></tr>
1363 </td></tr>
1364 <tr><td>
1364 <tr><td>
1365 <a href="/help/recover">
1365 <a href="/help/recover">
1366 recover
1366 recover
1367 </a>
1367 </a>
1368 </td><td>
1368 </td><td>
1369 roll back an interrupted transaction
1369 roll back an interrupted transaction
1370 </td></tr>
1370 </td></tr>
1371 <tr><td>
1371 <tr><td>
1372 <a href="/help/rename">
1372 <a href="/help/rename">
1373 rename
1373 rename
1374 </a>
1374 </a>
1375 </td><td>
1375 </td><td>
1376 rename files; equivalent of copy + remove
1376 rename files; equivalent of copy + remove
1377 </td></tr>
1377 </td></tr>
1378 <tr><td>
1378 <tr><td>
1379 <a href="/help/resolve">
1379 <a href="/help/resolve">
1380 resolve
1380 resolve
1381 </a>
1381 </a>
1382 </td><td>
1382 </td><td>
1383 redo merges or set/view the merge status of files
1383 redo merges or set/view the merge status of files
1384 </td></tr>
1384 </td></tr>
1385 <tr><td>
1385 <tr><td>
1386 <a href="/help/revert">
1386 <a href="/help/revert">
1387 revert
1387 revert
1388 </a>
1388 </a>
1389 </td><td>
1389 </td><td>
1390 restore files to their checkout state
1390 restore files to their checkout state
1391 </td></tr>
1391 </td></tr>
1392 <tr><td>
1392 <tr><td>
1393 <a href="/help/rollback">
1393 <a href="/help/rollback">
1394 rollback
1394 rollback
1395 </a>
1395 </a>
1396 </td><td>
1396 </td><td>
1397 roll back the last transaction (dangerous)
1397 roll back the last transaction (dangerous)
1398 </td></tr>
1398 </td></tr>
1399 <tr><td>
1399 <tr><td>
1400 <a href="/help/root">
1400 <a href="/help/root">
1401 root
1401 root
1402 </a>
1402 </a>
1403 </td><td>
1403 </td><td>
1404 print the root (top) of the current working directory
1404 print the root (top) of the current working directory
1405 </td></tr>
1405 </td></tr>
1406 <tr><td>
1406 <tr><td>
1407 <a href="/help/showconfig">
1407 <a href="/help/showconfig">
1408 showconfig
1408 showconfig
1409 </a>
1409 </a>
1410 </td><td>
1410 </td><td>
1411 show combined config settings from all hgrc files
1411 show combined config settings from all hgrc files
1412 </td></tr>
1412 </td></tr>
1413 <tr><td>
1413 <tr><td>
1414 <a href="/help/tag">
1414 <a href="/help/tag">
1415 tag
1415 tag
1416 </a>
1416 </a>
1417 </td><td>
1417 </td><td>
1418 add one or more tags for the current or given revision
1418 add one or more tags for the current or given revision
1419 </td></tr>
1419 </td></tr>
1420 <tr><td>
1420 <tr><td>
1421 <a href="/help/tags">
1421 <a href="/help/tags">
1422 tags
1422 tags
1423 </a>
1423 </a>
1424 </td><td>
1424 </td><td>
1425 list repository tags
1425 list repository tags
1426 </td></tr>
1426 </td></tr>
1427 <tr><td>
1427 <tr><td>
1428 <a href="/help/tip">
1428 <a href="/help/tip">
1429 tip
1429 tip
1430 </a>
1430 </a>
1431 </td><td>
1431 </td><td>
1432 show the tip revision
1432 show the tip revision
1433 </td></tr>
1433 </td></tr>
1434 <tr><td>
1434 <tr><td>
1435 <a href="/help/unbundle">
1435 <a href="/help/unbundle">
1436 unbundle
1436 unbundle
1437 </a>
1437 </a>
1438 </td><td>
1438 </td><td>
1439 apply one or more changegroup files
1439 apply one or more changegroup files
1440 </td></tr>
1440 </td></tr>
1441 <tr><td>
1441 <tr><td>
1442 <a href="/help/verify">
1442 <a href="/help/verify">
1443 verify
1443 verify
1444 </a>
1444 </a>
1445 </td><td>
1445 </td><td>
1446 verify the integrity of the repository
1446 verify the integrity of the repository
1447 </td></tr>
1447 </td></tr>
1448 <tr><td>
1448 <tr><td>
1449 <a href="/help/version">
1449 <a href="/help/version">
1450 version
1450 version
1451 </a>
1451 </a>
1452 </td><td>
1452 </td><td>
1453 output version and copyright information
1453 output version and copyright information
1454 </td></tr>
1454 </td></tr>
1455 </table>
1455 </table>
1456 </div>
1456 </div>
1457 </div>
1457 </div>
1458
1458
1459 <script type="text/javascript">process_dates()</script>
1459 <script type="text/javascript">process_dates()</script>
1460
1460
1461
1461
1462 </body>
1462 </body>
1463 </html>
1463 </html>
1464
1464
1465
1465
1466 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
1466 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
1467 200 Script output follows
1467 200 Script output follows
1468
1468
1469 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1469 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1470 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1470 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1471 <head>
1471 <head>
1472 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1472 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1473 <meta name="robots" content="index, nofollow" />
1473 <meta name="robots" content="index, nofollow" />
1474 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1474 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1475 <script type="text/javascript" src="/static/mercurial.js"></script>
1475 <script type="text/javascript" src="/static/mercurial.js"></script>
1476
1476
1477 <title>Help: add</title>
1477 <title>Help: add</title>
1478 </head>
1478 </head>
1479 <body>
1479 <body>
1480
1480
1481 <div class="container">
1481 <div class="container">
1482 <div class="menu">
1482 <div class="menu">
1483 <div class="logo">
1483 <div class="logo">
1484 <a href="http://mercurial.selenic.com/">
1484 <a href="http://mercurial.selenic.com/">
1485 <img src="/static/hglogo.png" alt="mercurial" /></a>
1485 <img src="/static/hglogo.png" alt="mercurial" /></a>
1486 </div>
1486 </div>
1487 <ul>
1487 <ul>
1488 <li><a href="/shortlog">log</a></li>
1488 <li><a href="/shortlog">log</a></li>
1489 <li><a href="/graph">graph</a></li>
1489 <li><a href="/graph">graph</a></li>
1490 <li><a href="/tags">tags</a></li>
1490 <li><a href="/tags">tags</a></li>
1491 <li><a href="/bookmarks">bookmarks</a></li>
1491 <li><a href="/bookmarks">bookmarks</a></li>
1492 <li><a href="/branches">branches</a></li>
1492 <li><a href="/branches">branches</a></li>
1493 </ul>
1493 </ul>
1494 <ul>
1494 <ul>
1495 <li class="active"><a href="/help">help</a></li>
1495 <li class="active"><a href="/help">help</a></li>
1496 </ul>
1496 </ul>
1497 </div>
1497 </div>
1498
1498
1499 <div class="main">
1499 <div class="main">
1500 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1500 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1501 <h3>Help: add</h3>
1501 <h3>Help: add</h3>
1502
1502
1503 <form class="search" action="/log">
1503 <form class="search" action="/log">
1504
1504
1505 <p><input name="rev" id="search1" type="text" size="30" /></p>
1505 <p><input name="rev" id="search1" type="text" size="30" /></p>
1506 <div id="hint">find changesets by author, revision,
1506 <div id="hint">find changesets by author, revision,
1507 files, or words in the commit message</div>
1507 files, or words in the commit message</div>
1508 </form>
1508 </form>
1509 <div id="doc">
1509 <div id="doc">
1510 <p>
1510 <p>
1511 hg add [OPTION]... [FILE]...
1511 hg add [OPTION]... [FILE]...
1512 </p>
1512 </p>
1513 <p>
1513 <p>
1514 add the specified files on the next commit
1514 add the specified files on the next commit
1515 </p>
1515 </p>
1516 <p>
1516 <p>
1517 Schedule files to be version controlled and added to the
1517 Schedule files to be version controlled and added to the
1518 repository.
1518 repository.
1519 </p>
1519 </p>
1520 <p>
1520 <p>
1521 The files will be added to the repository at the next commit. To
1521 The files will be added to the repository at the next commit. To
1522 undo an add before that, see "hg forget".
1522 undo an add before that, see &quot;hg forget&quot;.
1523 </p>
1523 </p>
1524 <p>
1524 <p>
1525 If no names are given, add all files to the repository.
1525 If no names are given, add all files to the repository.
1526 </p>
1526 </p>
1527 <p>
1527 <p>
1528 Returns 0 if all files are successfully added.
1528 Returns 0 if all files are successfully added.
1529 </p>
1529 </p>
1530 <p>
1530 <p>
1531 options:
1531 options:
1532 </p>
1532 </p>
1533 <table>
1533 <table>
1534 <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
1534 <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
1535 <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
1535 <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
1536 <tr><td>-S</td><td>--subrepos</td><td>recurse into subrepositories</td></tr>
1536 <tr><td>-S</td><td>--subrepos</td><td>recurse into subrepositories</td></tr>
1537 <tr><td>-n</td><td>--dry-run</td><td>do not perform actions, just print output</td></tr>
1537 <tr><td>-n</td><td>--dry-run</td><td>do not perform actions, just print output</td></tr>
1538 </table>
1538 </table>
1539 <p>
1539 <p>
1540 [+] marked option can be specified multiple times
1540 [+] marked option can be specified multiple times
1541 </p>
1541 </p>
1542 <p>
1542 <p>
1543 global options:
1543 global options:
1544 </p>
1544 </p>
1545 <table>
1545 <table>
1546 <tr><td>-R</td><td>--repository REPO</td><td>repository root directory or name of overlay bundle file</td></tr>
1546 <tr><td>-R</td><td>--repository REPO</td><td>repository root directory or name of overlay bundle file</td></tr>
1547 <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
1547 <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
1548 <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1548 <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1549 <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
1549 <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
1550 <tr><td>-v</td><td>--verbose</td><td>enable additional output</td></tr>
1550 <tr><td>-v</td><td>--verbose</td><td>enable additional output</td></tr>
1551 <tr><td></td><td>--config CONFIG [+]</td><td>set/override config option (use 'section.name=value')</td></tr>
1551 <tr><td></td><td>--config CONFIG [+]</td><td>set/override config option (use 'section.name=value')</td></tr>
1552 <tr><td></td><td>--debug</td><td>enable debugging output</td></tr>
1552 <tr><td></td><td>--debug</td><td>enable debugging output</td></tr>
1553 <tr><td></td><td>--debugger</td><td>start debugger</td></tr>
1553 <tr><td></td><td>--debugger</td><td>start debugger</td></tr>
1554 <tr><td></td><td>--encoding ENCODE</td><td>set the charset encoding (default: ascii)</td></tr>
1554 <tr><td></td><td>--encoding ENCODE</td><td>set the charset encoding (default: ascii)</td></tr>
1555 <tr><td></td><td>--encodingmode MODE</td><td>set the charset encoding mode (default: strict)</td></tr>
1555 <tr><td></td><td>--encodingmode MODE</td><td>set the charset encoding mode (default: strict)</td></tr>
1556 <tr><td></td><td>--traceback</td><td>always print a traceback on exception</td></tr>
1556 <tr><td></td><td>--traceback</td><td>always print a traceback on exception</td></tr>
1557 <tr><td></td><td>--time</td><td>time how long the command takes</td></tr>
1557 <tr><td></td><td>--time</td><td>time how long the command takes</td></tr>
1558 <tr><td></td><td>--profile</td><td>print command execution profile</td></tr>
1558 <tr><td></td><td>--profile</td><td>print command execution profile</td></tr>
1559 <tr><td></td><td>--version</td><td>output version information and exit</td></tr>
1559 <tr><td></td><td>--version</td><td>output version information and exit</td></tr>
1560 <tr><td>-h</td><td>--help</td><td>display help and exit</td></tr>
1560 <tr><td>-h</td><td>--help</td><td>display help and exit</td></tr>
1561 <tr><td></td><td>--hidden</td><td>consider hidden changesets</td></tr>
1561 <tr><td></td><td>--hidden</td><td>consider hidden changesets</td></tr>
1562 </table>
1562 </table>
1563 <p>
1563 <p>
1564 [+] marked option can be specified multiple times
1564 [+] marked option can be specified multiple times
1565 </p>
1565 </p>
1566
1566
1567 </div>
1567 </div>
1568 </div>
1568 </div>
1569 </div>
1569 </div>
1570
1570
1571 <script type="text/javascript">process_dates()</script>
1571 <script type="text/javascript">process_dates()</script>
1572
1572
1573
1573
1574 </body>
1574 </body>
1575 </html>
1575 </html>
1576
1576
1577
1577
1578 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
1578 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
1579 200 Script output follows
1579 200 Script output follows
1580
1580
1581 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1581 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1582 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1582 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1583 <head>
1583 <head>
1584 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1584 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1585 <meta name="robots" content="index, nofollow" />
1585 <meta name="robots" content="index, nofollow" />
1586 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1586 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1587 <script type="text/javascript" src="/static/mercurial.js"></script>
1587 <script type="text/javascript" src="/static/mercurial.js"></script>
1588
1588
1589 <title>Help: remove</title>
1589 <title>Help: remove</title>
1590 </head>
1590 </head>
1591 <body>
1591 <body>
1592
1592
1593 <div class="container">
1593 <div class="container">
1594 <div class="menu">
1594 <div class="menu">
1595 <div class="logo">
1595 <div class="logo">
1596 <a href="http://mercurial.selenic.com/">
1596 <a href="http://mercurial.selenic.com/">
1597 <img src="/static/hglogo.png" alt="mercurial" /></a>
1597 <img src="/static/hglogo.png" alt="mercurial" /></a>
1598 </div>
1598 </div>
1599 <ul>
1599 <ul>
1600 <li><a href="/shortlog">log</a></li>
1600 <li><a href="/shortlog">log</a></li>
1601 <li><a href="/graph">graph</a></li>
1601 <li><a href="/graph">graph</a></li>
1602 <li><a href="/tags">tags</a></li>
1602 <li><a href="/tags">tags</a></li>
1603 <li><a href="/bookmarks">bookmarks</a></li>
1603 <li><a href="/bookmarks">bookmarks</a></li>
1604 <li><a href="/branches">branches</a></li>
1604 <li><a href="/branches">branches</a></li>
1605 </ul>
1605 </ul>
1606 <ul>
1606 <ul>
1607 <li class="active"><a href="/help">help</a></li>
1607 <li class="active"><a href="/help">help</a></li>
1608 </ul>
1608 </ul>
1609 </div>
1609 </div>
1610
1610
1611 <div class="main">
1611 <div class="main">
1612 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1612 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1613 <h3>Help: remove</h3>
1613 <h3>Help: remove</h3>
1614
1614
1615 <form class="search" action="/log">
1615 <form class="search" action="/log">
1616
1616
1617 <p><input name="rev" id="search1" type="text" size="30" /></p>
1617 <p><input name="rev" id="search1" type="text" size="30" /></p>
1618 <div id="hint">find changesets by author, revision,
1618 <div id="hint">find changesets by author, revision,
1619 files, or words in the commit message</div>
1619 files, or words in the commit message</div>
1620 </form>
1620 </form>
1621 <div id="doc">
1621 <div id="doc">
1622 <p>
1622 <p>
1623 hg remove [OPTION]... FILE...
1623 hg remove [OPTION]... FILE...
1624 </p>
1624 </p>
1625 <p>
1625 <p>
1626 aliases: rm
1626 aliases: rm
1627 </p>
1627 </p>
1628 <p>
1628 <p>
1629 remove the specified files on the next commit
1629 remove the specified files on the next commit
1630 </p>
1630 </p>
1631 <p>
1631 <p>
1632 Schedule the indicated files for removal from the current branch.
1632 Schedule the indicated files for removal from the current branch.
1633 </p>
1633 </p>
1634 <p>
1634 <p>
1635 This command schedules the files to be removed at the next commit.
1635 This command schedules the files to be removed at the next commit.
1636 To undo a remove before that, see "hg revert". To undo added
1636 To undo a remove before that, see &quot;hg revert&quot;. To undo added
1637 files, see "hg forget".
1637 files, see &quot;hg forget&quot;.
1638 </p>
1638 </p>
1639 <p>
1639 <p>
1640 Returns 0 on success, 1 if any warnings encountered.
1640 Returns 0 on success, 1 if any warnings encountered.
1641 </p>
1641 </p>
1642 <p>
1642 <p>
1643 options:
1643 options:
1644 </p>
1644 </p>
1645 <table>
1645 <table>
1646 <tr><td>-A</td><td>--after</td><td>record delete for missing files</td></tr>
1646 <tr><td>-A</td><td>--after</td><td>record delete for missing files</td></tr>
1647 <tr><td>-f</td><td>--force</td><td>remove (and delete) file even if added or modified</td></tr>
1647 <tr><td>-f</td><td>--force</td><td>remove (and delete) file even if added or modified</td></tr>
1648 <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
1648 <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
1649 <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
1649 <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
1650 </table>
1650 </table>
1651 <p>
1651 <p>
1652 [+] marked option can be specified multiple times
1652 [+] marked option can be specified multiple times
1653 </p>
1653 </p>
1654 <p>
1654 <p>
1655 global options:
1655 global options:
1656 </p>
1656 </p>
1657 <table>
1657 <table>
1658 <tr><td>-R</td><td>--repository REPO</td><td>repository root directory or name of overlay bundle file</td></tr>
1658 <tr><td>-R</td><td>--repository REPO</td><td>repository root directory or name of overlay bundle file</td></tr>
1659 <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
1659 <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
1660 <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1660 <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1661 <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
1661 <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
1662 <tr><td>-v</td><td>--verbose</td><td>enable additional output</td></tr>
1662 <tr><td>-v</td><td>--verbose</td><td>enable additional output</td></tr>
1663 <tr><td></td><td>--config CONFIG [+]</td><td>set/override config option (use 'section.name=value')</td></tr>
1663 <tr><td></td><td>--config CONFIG [+]</td><td>set/override config option (use 'section.name=value')</td></tr>
1664 <tr><td></td><td>--debug</td><td>enable debugging output</td></tr>
1664 <tr><td></td><td>--debug</td><td>enable debugging output</td></tr>
1665 <tr><td></td><td>--debugger</td><td>start debugger</td></tr>
1665 <tr><td></td><td>--debugger</td><td>start debugger</td></tr>
1666 <tr><td></td><td>--encoding ENCODE</td><td>set the charset encoding (default: ascii)</td></tr>
1666 <tr><td></td><td>--encoding ENCODE</td><td>set the charset encoding (default: ascii)</td></tr>
1667 <tr><td></td><td>--encodingmode MODE</td><td>set the charset encoding mode (default: strict)</td></tr>
1667 <tr><td></td><td>--encodingmode MODE</td><td>set the charset encoding mode (default: strict)</td></tr>
1668 <tr><td></td><td>--traceback</td><td>always print a traceback on exception</td></tr>
1668 <tr><td></td><td>--traceback</td><td>always print a traceback on exception</td></tr>
1669 <tr><td></td><td>--time</td><td>time how long the command takes</td></tr>
1669 <tr><td></td><td>--time</td><td>time how long the command takes</td></tr>
1670 <tr><td></td><td>--profile</td><td>print command execution profile</td></tr>
1670 <tr><td></td><td>--profile</td><td>print command execution profile</td></tr>
1671 <tr><td></td><td>--version</td><td>output version information and exit</td></tr>
1671 <tr><td></td><td>--version</td><td>output version information and exit</td></tr>
1672 <tr><td>-h</td><td>--help</td><td>display help and exit</td></tr>
1672 <tr><td>-h</td><td>--help</td><td>display help and exit</td></tr>
1673 <tr><td></td><td>--hidden</td><td>consider hidden changesets</td></tr>
1673 <tr><td></td><td>--hidden</td><td>consider hidden changesets</td></tr>
1674 </table>
1674 </table>
1675 <p>
1675 <p>
1676 [+] marked option can be specified multiple times
1676 [+] marked option can be specified multiple times
1677 </p>
1677 </p>
1678
1678
1679 </div>
1679 </div>
1680 </div>
1680 </div>
1681 </div>
1681 </div>
1682
1682
1683 <script type="text/javascript">process_dates()</script>
1683 <script type="text/javascript">process_dates()</script>
1684
1684
1685
1685
1686 </body>
1686 </body>
1687 </html>
1687 </html>
1688
1688
1689
1689
1690 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
1690 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
1691 200 Script output follows
1691 200 Script output follows
1692
1692
1693 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1693 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1694 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1694 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1695 <head>
1695 <head>
1696 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1696 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1697 <meta name="robots" content="index, nofollow" />
1697 <meta name="robots" content="index, nofollow" />
1698 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1698 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1699 <script type="text/javascript" src="/static/mercurial.js"></script>
1699 <script type="text/javascript" src="/static/mercurial.js"></script>
1700
1700
1701 <title>Help: revisions</title>
1701 <title>Help: revisions</title>
1702 </head>
1702 </head>
1703 <body>
1703 <body>
1704
1704
1705 <div class="container">
1705 <div class="container">
1706 <div class="menu">
1706 <div class="menu">
1707 <div class="logo">
1707 <div class="logo">
1708 <a href="http://mercurial.selenic.com/">
1708 <a href="http://mercurial.selenic.com/">
1709 <img src="/static/hglogo.png" alt="mercurial" /></a>
1709 <img src="/static/hglogo.png" alt="mercurial" /></a>
1710 </div>
1710 </div>
1711 <ul>
1711 <ul>
1712 <li><a href="/shortlog">log</a></li>
1712 <li><a href="/shortlog">log</a></li>
1713 <li><a href="/graph">graph</a></li>
1713 <li><a href="/graph">graph</a></li>
1714 <li><a href="/tags">tags</a></li>
1714 <li><a href="/tags">tags</a></li>
1715 <li><a href="/bookmarks">bookmarks</a></li>
1715 <li><a href="/bookmarks">bookmarks</a></li>
1716 <li><a href="/branches">branches</a></li>
1716 <li><a href="/branches">branches</a></li>
1717 </ul>
1717 </ul>
1718 <ul>
1718 <ul>
1719 <li class="active"><a href="/help">help</a></li>
1719 <li class="active"><a href="/help">help</a></li>
1720 </ul>
1720 </ul>
1721 </div>
1721 </div>
1722
1722
1723 <div class="main">
1723 <div class="main">
1724 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1724 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1725 <h3>Help: revisions</h3>
1725 <h3>Help: revisions</h3>
1726
1726
1727 <form class="search" action="/log">
1727 <form class="search" action="/log">
1728
1728
1729 <p><input name="rev" id="search1" type="text" size="30" /></p>
1729 <p><input name="rev" id="search1" type="text" size="30" /></p>
1730 <div id="hint">find changesets by author, revision,
1730 <div id="hint">find changesets by author, revision,
1731 files, or words in the commit message</div>
1731 files, or words in the commit message</div>
1732 </form>
1732 </form>
1733 <div id="doc">
1733 <div id="doc">
1734 <h1>Specifying Single Revisions</h1>
1734 <h1>Specifying Single Revisions</h1>
1735 <p>
1735 <p>
1736 Mercurial supports several ways to specify individual revisions.
1736 Mercurial supports several ways to specify individual revisions.
1737 </p>
1737 </p>
1738 <p>
1738 <p>
1739 A plain integer is treated as a revision number. Negative integers are
1739 A plain integer is treated as a revision number. Negative integers are
1740 treated as sequential offsets from the tip, with -1 denoting the tip,
1740 treated as sequential offsets from the tip, with -1 denoting the tip,
1741 -2 denoting the revision prior to the tip, and so forth.
1741 -2 denoting the revision prior to the tip, and so forth.
1742 </p>
1742 </p>
1743 <p>
1743 <p>
1744 A 40-digit hexadecimal string is treated as a unique revision
1744 A 40-digit hexadecimal string is treated as a unique revision
1745 identifier.
1745 identifier.
1746 </p>
1746 </p>
1747 <p>
1747 <p>
1748 A hexadecimal string less than 40 characters long is treated as a
1748 A hexadecimal string less than 40 characters long is treated as a
1749 unique revision identifier and is referred to as a short-form
1749 unique revision identifier and is referred to as a short-form
1750 identifier. A short-form identifier is only valid if it is the prefix
1750 identifier. A short-form identifier is only valid if it is the prefix
1751 of exactly one full-length identifier.
1751 of exactly one full-length identifier.
1752 </p>
1752 </p>
1753 <p>
1753 <p>
1754 Any other string is treated as a bookmark, tag, or branch name. A
1754 Any other string is treated as a bookmark, tag, or branch name. A
1755 bookmark is a movable pointer to a revision. A tag is a permanent name
1755 bookmark is a movable pointer to a revision. A tag is a permanent name
1756 associated with a revision. A branch name denotes the tipmost revision
1756 associated with a revision. A branch name denotes the tipmost revision
1757 of that branch. Bookmark, tag, and branch names must not contain the ":"
1757 of that branch. Bookmark, tag, and branch names must not contain the &quot;:&quot;
1758 character.
1758 character.
1759 </p>
1759 </p>
1760 <p>
1760 <p>
1761 The reserved name "tip" always identifies the most recent revision.
1761 The reserved name &quot;tip&quot; always identifies the most recent revision.
1762 </p>
1762 </p>
1763 <p>
1763 <p>
1764 The reserved name "null" indicates the null revision. This is the
1764 The reserved name &quot;null&quot; indicates the null revision. This is the
1765 revision of an empty repository, and the parent of revision 0.
1765 revision of an empty repository, and the parent of revision 0.
1766 </p>
1766 </p>
1767 <p>
1767 <p>
1768 The reserved name "." indicates the working directory parent. If no
1768 The reserved name &quot;.&quot; indicates the working directory parent. If no
1769 working directory is checked out, it is equivalent to null. If an
1769 working directory is checked out, it is equivalent to null. If an
1770 uncommitted merge is in progress, "." is the revision of the first
1770 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
1771 parent.
1771 parent.
1772 </p>
1772 </p>
1773
1773
1774 </div>
1774 </div>
1775 </div>
1775 </div>
1776 </div>
1776 </div>
1777
1777
1778 <script type="text/javascript">process_dates()</script>
1778 <script type="text/javascript">process_dates()</script>
1779
1779
1780
1780
1781 </body>
1781 </body>
1782 </html>
1782 </html>
1783
1783
1784
1784
1785 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1785 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1786
1786
1787 #endif
1787 #endif
@@ -1,766 +1,766 b''
1 == paragraphs ==
1 == paragraphs ==
2 60 column format:
2 60 column format:
3 ----------------------------------------------------------------------
3 ----------------------------------------------------------------------
4 This is some text in the first paragraph.
4 This is some text in the first paragraph.
5
5
6 A small indented paragraph. It is followed by some lines
6 A small indented paragraph. It is followed by some lines
7 containing random whitespace.
7 containing random whitespace.
8
8
9 The third and final paragraph.
9 The third and final paragraph.
10 ----------------------------------------------------------------------
10 ----------------------------------------------------------------------
11
11
12 30 column format:
12 30 column format:
13 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
14 This is some text in the first
14 This is some text in the first
15 paragraph.
15 paragraph.
16
16
17 A small indented paragraph.
17 A small indented paragraph.
18 It is followed by some lines
18 It is followed by some lines
19 containing random
19 containing random
20 whitespace.
20 whitespace.
21
21
22 The third and final paragraph.
22 The third and final paragraph.
23 ----------------------------------------------------------------------
23 ----------------------------------------------------------------------
24
24
25 html format:
25 html format:
26 ----------------------------------------------------------------------
26 ----------------------------------------------------------------------
27 <p>
27 <p>
28 This is some text in the first paragraph.
28 This is some text in the first paragraph.
29 </p>
29 </p>
30 <p>
30 <p>
31 A small indented paragraph.
31 A small indented paragraph.
32 It is followed by some lines
32 It is followed by some lines
33 containing random whitespace.
33 containing random whitespace.
34 </p>
34 </p>
35 <p>
35 <p>
36 The third and final paragraph.
36 The third and final paragraph.
37 </p>
37 </p>
38 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
39
39
40 == definitions ==
40 == definitions ==
41 60 column format:
41 60 column format:
42 ----------------------------------------------------------------------
42 ----------------------------------------------------------------------
43 A Term
43 A Term
44 Definition. The indented lines make up the definition.
44 Definition. The indented lines make up the definition.
45
45
46 Another Term
46 Another Term
47 Another definition. The final line in the definition
47 Another definition. The final line in the definition
48 determines the indentation, so this will be indented
48 determines the indentation, so this will be indented
49 with four spaces.
49 with four spaces.
50
50
51 A Nested/Indented Term
51 A Nested/Indented Term
52 Definition.
52 Definition.
53 ----------------------------------------------------------------------
53 ----------------------------------------------------------------------
54
54
55 30 column format:
55 30 column format:
56 ----------------------------------------------------------------------
56 ----------------------------------------------------------------------
57 A Term
57 A Term
58 Definition. The indented
58 Definition. The indented
59 lines make up the
59 lines make up the
60 definition.
60 definition.
61
61
62 Another Term
62 Another Term
63 Another definition. The
63 Another definition. The
64 final line in the
64 final line in the
65 definition determines the
65 definition determines the
66 indentation, so this will
66 indentation, so this will
67 be indented with four
67 be indented with four
68 spaces.
68 spaces.
69
69
70 A Nested/Indented Term
70 A Nested/Indented Term
71 Definition.
71 Definition.
72 ----------------------------------------------------------------------
72 ----------------------------------------------------------------------
73
73
74 html format:
74 html format:
75 ----------------------------------------------------------------------
75 ----------------------------------------------------------------------
76 <dl>
76 <dl>
77 <dt>A Term
77 <dt>A Term
78 <dd>Definition. The indented lines make up the definition.
78 <dd>Definition. The indented lines make up the definition.
79 <dt>Another Term
79 <dt>Another Term
80 <dd>Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces.
80 <dd>Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces.
81 <dt>A Nested/Indented Term
81 <dt>A Nested/Indented Term
82 <dd>Definition.
82 <dd>Definition.
83 </dl>
83 </dl>
84 ----------------------------------------------------------------------
84 ----------------------------------------------------------------------
85
85
86 == literals ==
86 == literals ==
87 60 column format:
87 60 column format:
88 ----------------------------------------------------------------------
88 ----------------------------------------------------------------------
89 The fully minimized form is the most convenient form:
89 The fully minimized form is the most convenient form:
90
90
91 Hello
91 Hello
92 literal
92 literal
93 world
93 world
94
94
95 In the partially minimized form a paragraph simply ends with
95 In the partially minimized form a paragraph simply ends with
96 space-double-colon.
96 space-double-colon.
97
97
98 ////////////////////////////////////////
98 ////////////////////////////////////////
99 long un-wrapped line in a literal block
99 long un-wrapped line in a literal block
100 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
100 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
101
101
102 This literal block is started with '::',
102 This literal block is started with '::',
103 the so-called expanded form. The paragraph
103 the so-called expanded form. The paragraph
104 with '::' disappears in the final output.
104 with '::' disappears in the final output.
105 ----------------------------------------------------------------------
105 ----------------------------------------------------------------------
106
106
107 30 column format:
107 30 column format:
108 ----------------------------------------------------------------------
108 ----------------------------------------------------------------------
109 The fully minimized form is
109 The fully minimized form is
110 the most convenient form:
110 the most convenient form:
111
111
112 Hello
112 Hello
113 literal
113 literal
114 world
114 world
115
115
116 In the partially minimized
116 In the partially minimized
117 form a paragraph simply ends
117 form a paragraph simply ends
118 with space-double-colon.
118 with space-double-colon.
119
119
120 ////////////////////////////////////////
120 ////////////////////////////////////////
121 long un-wrapped line in a literal block
121 long un-wrapped line in a literal block
122 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
122 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
123
123
124 This literal block is started with '::',
124 This literal block is started with '::',
125 the so-called expanded form. The paragraph
125 the so-called expanded form. The paragraph
126 with '::' disappears in the final output.
126 with '::' disappears in the final output.
127 ----------------------------------------------------------------------
127 ----------------------------------------------------------------------
128
128
129 html format:
129 html format:
130 ----------------------------------------------------------------------
130 ----------------------------------------------------------------------
131 <p>
131 <p>
132 The fully minimized form is the most
132 The fully minimized form is the most
133 convenient form:
133 convenient form:
134 </p>
134 </p>
135 <pre>
135 <pre>
136 Hello
136 Hello
137 literal
137 literal
138 world
138 world
139 </pre>
139 </pre>
140 <p>
140 <p>
141 In the partially minimized form a paragraph
141 In the partially minimized form a paragraph
142 simply ends with space-double-colon.
142 simply ends with space-double-colon.
143 </p>
143 </p>
144 <pre>
144 <pre>
145 ////////////////////////////////////////
145 ////////////////////////////////////////
146 long un-wrapped line in a literal block
146 long un-wrapped line in a literal block
147 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
147 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
148 </pre>
148 </pre>
149 <pre>
149 <pre>
150 This literal block is started with '::',
150 This literal block is started with '::',
151 the so-called expanded form. The paragraph
151 the so-called expanded form. The paragraph
152 with '::' disappears in the final output.
152 with '::' disappears in the final output.
153 </pre>
153 </pre>
154 ----------------------------------------------------------------------
154 ----------------------------------------------------------------------
155
155
156 == lists ==
156 == lists ==
157 60 column format:
157 60 column format:
158 ----------------------------------------------------------------------
158 ----------------------------------------------------------------------
159 - This is the first list item.
159 - This is the first list item.
160
160
161 Second paragraph in the first list item.
161 Second paragraph in the first list item.
162
162
163 - List items need not be separated by a blank line.
163 - List items need not be separated by a blank line.
164 - And will be rendered without one in any case.
164 - And will be rendered without one in any case.
165
165
166 We can have indented lists:
166 We can have indented lists:
167
167
168 - This is an indented list item
168 - This is an indented list item
169 - Another indented list item:
169 - Another indented list item:
170
170
171 - A literal block in the middle
171 - A literal block in the middle
172 of an indented list.
172 of an indented list.
173
173
174 (The above is not a list item since we are in the literal block.)
174 (The above is not a list item since we are in the literal block.)
175
175
176 Literal block with no indentation (apart from
176 Literal block with no indentation (apart from
177 the two spaces added to all literal blocks).
177 the two spaces added to all literal blocks).
178
178
179 1. This is an enumerated list (first item).
179 1. This is an enumerated list (first item).
180 2. Continuing with the second item.
180 2. Continuing with the second item.
181 (1) foo
181 (1) foo
182 (2) bar
182 (2) bar
183 1) Another
183 1) Another
184 2) List
184 2) List
185
185
186 Line blocks are also a form of list:
186 Line blocks are also a form of list:
187
187
188 This is the first line. The line continues here.
188 This is the first line. The line continues here.
189 This is the second line.
189 This is the second line.
190 ----------------------------------------------------------------------
190 ----------------------------------------------------------------------
191
191
192 30 column format:
192 30 column format:
193 ----------------------------------------------------------------------
193 ----------------------------------------------------------------------
194 - This is the first list item.
194 - This is the first list item.
195
195
196 Second paragraph in the
196 Second paragraph in the
197 first list item.
197 first list item.
198
198
199 - List items need not be
199 - List items need not be
200 separated by a blank line.
200 separated by a blank line.
201 - And will be rendered without
201 - And will be rendered without
202 one in any case.
202 one in any case.
203
203
204 We can have indented lists:
204 We can have indented lists:
205
205
206 - This is an indented list
206 - This is an indented list
207 item
207 item
208 - Another indented list
208 - Another indented list
209 item:
209 item:
210
210
211 - A literal block in the middle
211 - A literal block in the middle
212 of an indented list.
212 of an indented list.
213
213
214 (The above is not a list item since we are in the literal block.)
214 (The above is not a list item since we are in the literal block.)
215
215
216 Literal block with no indentation (apart from
216 Literal block with no indentation (apart from
217 the two spaces added to all literal blocks).
217 the two spaces added to all literal blocks).
218
218
219 1. This is an enumerated list
219 1. This is an enumerated list
220 (first item).
220 (first item).
221 2. Continuing with the second
221 2. Continuing with the second
222 item.
222 item.
223 (1) foo
223 (1) foo
224 (2) bar
224 (2) bar
225 1) Another
225 1) Another
226 2) List
226 2) List
227
227
228 Line blocks are also a form of
228 Line blocks are also a form of
229 list:
229 list:
230
230
231 This is the first line. The
231 This is the first line. The
232 line continues here.
232 line continues here.
233 This is the second line.
233 This is the second line.
234 ----------------------------------------------------------------------
234 ----------------------------------------------------------------------
235
235
236 html format:
236 html format:
237 ----------------------------------------------------------------------
237 ----------------------------------------------------------------------
238 <ul>
238 <ul>
239 <li> This is the first list item.
239 <li> This is the first list item.
240 <p>
240 <p>
241 Second paragraph in the first list item.
241 Second paragraph in the first list item.
242 </p>
242 </p>
243 <li> List items need not be separated by a blank line.
243 <li> List items need not be separated by a blank line.
244 <li> And will be rendered without one in any case.
244 <li> And will be rendered without one in any case.
245 </ul>
245 </ul>
246 <p>
246 <p>
247 We can have indented lists:
247 We can have indented lists:
248 </p>
248 </p>
249 <ul>
249 <ul>
250 <li> This is an indented list item
250 <li> This is an indented list item
251 <li> Another indented list item:
251 <li> Another indented list item:
252 <pre>
252 <pre>
253 - A literal block in the middle
253 - A literal block in the middle
254 of an indented list.
254 of an indented list.
255 </pre>
255 </pre>
256 <pre>
256 <pre>
257 (The above is not a list item since we are in the literal block.)
257 (The above is not a list item since we are in the literal block.)
258 </pre>
258 </pre>
259 </ul>
259 </ul>
260 <pre>
260 <pre>
261 Literal block with no indentation (apart from
261 Literal block with no indentation (apart from
262 the two spaces added to all literal blocks).
262 the two spaces added to all literal blocks).
263 </pre>
263 </pre>
264 <ol>
264 <ol>
265 <li> This is an enumerated list (first item).
265 <li> This is an enumerated list (first item).
266 <li> Continuing with the second item.
266 <li> Continuing with the second item.
267 <li> foo
267 <li> foo
268 <li> bar
268 <li> bar
269 <li> Another
269 <li> Another
270 <li> List
270 <li> List
271 </ol>
271 </ol>
272 <p>
272 <p>
273 Line blocks are also a form of list:
273 Line blocks are also a form of list:
274 </p>
274 </p>
275 <ol>
275 <ol>
276 <li> This is the first line. The line continues here.
276 <li> This is the first line. The line continues here.
277 <li> This is the second line.
277 <li> This is the second line.
278 </ol>
278 </ol>
279 ----------------------------------------------------------------------
279 ----------------------------------------------------------------------
280
280
281 == options ==
281 == options ==
282 60 column format:
282 60 column format:
283 ----------------------------------------------------------------------
283 ----------------------------------------------------------------------
284 There is support for simple option lists, but only with long
284 There is support for simple option lists, but only with long
285 options:
285 options:
286
286
287 -X --exclude filter an option with a short and long option
287 -X --exclude filter an option with a short and long option
288 with an argument
288 with an argument
289 -I --include an option with both a short option and
289 -I --include an option with both a short option and
290 a long option
290 a long option
291 --all Output all.
291 --all Output all.
292 --both Output both (this description is quite
292 --both Output both (this description is quite
293 long).
293 long).
294 --long Output all day long.
294 --long Output all day long.
295 --par This option has two paragraphs in its
295 --par This option has two paragraphs in its
296 description. This is the first.
296 description. This is the first.
297
297
298 This is the second. Blank lines may
298 This is the second. Blank lines may
299 be omitted between options (as above)
299 be omitted between options (as above)
300 or left in (as here).
300 or left in (as here).
301
301
302 The next paragraph looks like an option list, but lacks the
302 The next paragraph looks like an option list, but lacks the
303 two-space marker after the option. It is treated as a normal
303 two-space marker after the option. It is treated as a normal
304 paragraph:
304 paragraph:
305
305
306 --foo bar baz
306 --foo bar baz
307 ----------------------------------------------------------------------
307 ----------------------------------------------------------------------
308
308
309 30 column format:
309 30 column format:
310 ----------------------------------------------------------------------
310 ----------------------------------------------------------------------
311 There is support for simple
311 There is support for simple
312 option lists, but only with
312 option lists, but only with
313 long options:
313 long options:
314
314
315 -X --exclude filter an
315 -X --exclude filter an
316 option
316 option
317 with a
317 with a
318 short
318 short
319 and
319 and
320 long
320 long
321 option
321 option
322 with an
322 with an
323 argumen
323 argumen
324 t
324 t
325 -I --include an
325 -I --include an
326 option
326 option
327 with
327 with
328 both a
328 both a
329 short
329 short
330 option
330 option
331 and a
331 and a
332 long
332 long
333 option
333 option
334 --all Output
334 --all Output
335 all.
335 all.
336 --both Output
336 --both Output
337 both
337 both
338 (this d
338 (this d
339 escript
339 escript
340 ion is
340 ion is
341 quite
341 quite
342 long).
342 long).
343 --long Output
343 --long Output
344 all day
344 all day
345 long.
345 long.
346 --par This
346 --par This
347 option
347 option
348 has two
348 has two
349 paragra
349 paragra
350 phs in
350 phs in
351 its des
351 its des
352 criptio
352 criptio
353 n. This
353 n. This
354 is the
354 is the
355 first.
355 first.
356
356
357 This is
357 This is
358 the
358 the
359 second.
359 second.
360 Blank
360 Blank
361 lines
361 lines
362 may be
362 may be
363 omitted
363 omitted
364 between
364 between
365 options
365 options
366 (as
366 (as
367 above)
367 above)
368 or left
368 or left
369 in (as
369 in (as
370 here).
370 here).
371
371
372 The next paragraph looks like
372 The next paragraph looks like
373 an option list, but lacks the
373 an option list, but lacks the
374 two-space marker after the
374 two-space marker after the
375 option. It is treated as a
375 option. It is treated as a
376 normal paragraph:
376 normal paragraph:
377
377
378 --foo bar baz
378 --foo bar baz
379 ----------------------------------------------------------------------
379 ----------------------------------------------------------------------
380
380
381 html format:
381 html format:
382 ----------------------------------------------------------------------
382 ----------------------------------------------------------------------
383 <p>
383 <p>
384 There is support for simple option lists,
384 There is support for simple option lists,
385 but only with long options:
385 but only with long options:
386 </p>
386 </p>
387 <dl>
387 <dl>
388 <dt>-X --exclude filter
388 <dt>-X --exclude filter
389 <dd>an option with a short and long option with an argument
389 <dd>an option with a short and long option with an argument
390 <dt>-I --include
390 <dt>-I --include
391 <dd>an option with both a short option and a long option
391 <dd>an option with both a short option and a long option
392 <dt> --all
392 <dt> --all
393 <dd>Output all.
393 <dd>Output all.
394 <dt> --both
394 <dt> --both
395 <dd>Output both (this description is quite long).
395 <dd>Output both (this description is quite long).
396 <dt> --long
396 <dt> --long
397 <dd>Output all day long.
397 <dd>Output all day long.
398 <dt> --par
398 <dt> --par
399 <dd>This option has two paragraphs in its description. This is the first.
399 <dd>This option has two paragraphs in its description. This is the first.
400 <p>
400 <p>
401 This is the second. Blank lines may be omitted between
401 This is the second. Blank lines may be omitted between
402 options (as above) or left in (as here).
402 options (as above) or left in (as here).
403 </p>
403 </p>
404 </dl>
404 </dl>
405 <p>
405 <p>
406 The next paragraph looks like an option list, but lacks the two-space
406 The next paragraph looks like an option list, but lacks the two-space
407 marker after the option. It is treated as a normal paragraph:
407 marker after the option. It is treated as a normal paragraph:
408 </p>
408 </p>
409 <p>
409 <p>
410 --foo bar baz
410 --foo bar baz
411 </p>
411 </p>
412 ----------------------------------------------------------------------
412 ----------------------------------------------------------------------
413
413
414 == fields ==
414 == fields ==
415 60 column format:
415 60 column format:
416 ----------------------------------------------------------------------
416 ----------------------------------------------------------------------
417 a First item.
417 a First item.
418 ab Second item. Indentation and wrapping is
418 ab Second item. Indentation and wrapping is
419 handled automatically.
419 handled automatically.
420
420
421 Next list:
421 Next list:
422
422
423 small The larger key below triggers full indentation
423 small The larger key below triggers full indentation
424 here.
424 here.
425 much too large
425 much too large
426 This key is big enough to get its own line.
426 This key is big enough to get its own line.
427 ----------------------------------------------------------------------
427 ----------------------------------------------------------------------
428
428
429 30 column format:
429 30 column format:
430 ----------------------------------------------------------------------
430 ----------------------------------------------------------------------
431 a First item.
431 a First item.
432 ab Second item.
432 ab Second item.
433 Indentation and
433 Indentation and
434 wrapping is
434 wrapping is
435 handled
435 handled
436 automatically.
436 automatically.
437
437
438 Next list:
438 Next list:
439
439
440 small The larger key
440 small The larger key
441 below triggers
441 below triggers
442 full indentation
442 full indentation
443 here.
443 here.
444 much too large
444 much too large
445 This key is big
445 This key is big
446 enough to get
446 enough to get
447 its own line.
447 its own line.
448 ----------------------------------------------------------------------
448 ----------------------------------------------------------------------
449
449
450 html format:
450 html format:
451 ----------------------------------------------------------------------
451 ----------------------------------------------------------------------
452 <dl>
452 <dl>
453 <dt>a
453 <dt>a
454 <dd>First item.
454 <dd>First item.
455 <dt>ab
455 <dt>ab
456 <dd>Second item. Indentation and wrapping is handled automatically.
456 <dd>Second item. Indentation and wrapping is handled automatically.
457 </dl>
457 </dl>
458 <p>
458 <p>
459 Next list:
459 Next list:
460 </p>
460 </p>
461 <dl>
461 <dl>
462 <dt>small
462 <dt>small
463 <dd>The larger key below triggers full indentation here.
463 <dd>The larger key below triggers full indentation here.
464 <dt>much too large
464 <dt>much too large
465 <dd>This key is big enough to get its own line.
465 <dd>This key is big enough to get its own line.
466 </dl>
466 </dl>
467 ----------------------------------------------------------------------
467 ----------------------------------------------------------------------
468
468
469 == containers (normal) ==
469 == containers (normal) ==
470 60 column format:
470 60 column format:
471 ----------------------------------------------------------------------
471 ----------------------------------------------------------------------
472 Normal output.
472 Normal output.
473 ----------------------------------------------------------------------
473 ----------------------------------------------------------------------
474
474
475 30 column format:
475 30 column format:
476 ----------------------------------------------------------------------
476 ----------------------------------------------------------------------
477 Normal output.
477 Normal output.
478 ----------------------------------------------------------------------
478 ----------------------------------------------------------------------
479
479
480 html format:
480 html format:
481 ----------------------------------------------------------------------
481 ----------------------------------------------------------------------
482 <p>
482 <p>
483 Normal output.
483 Normal output.
484 </p>
484 </p>
485 ----------------------------------------------------------------------
485 ----------------------------------------------------------------------
486
486
487 == containers (verbose) ==
487 == containers (verbose) ==
488 60 column format:
488 60 column format:
489 ----------------------------------------------------------------------
489 ----------------------------------------------------------------------
490 Normal output.
490 Normal output.
491
491
492 Verbose output.
492 Verbose output.
493 ----------------------------------------------------------------------
493 ----------------------------------------------------------------------
494 ['debug', 'debug']
494 ['debug', 'debug']
495 ----------------------------------------------------------------------
495 ----------------------------------------------------------------------
496
496
497 30 column format:
497 30 column format:
498 ----------------------------------------------------------------------
498 ----------------------------------------------------------------------
499 Normal output.
499 Normal output.
500
500
501 Verbose output.
501 Verbose output.
502 ----------------------------------------------------------------------
502 ----------------------------------------------------------------------
503 ['debug', 'debug']
503 ['debug', 'debug']
504 ----------------------------------------------------------------------
504 ----------------------------------------------------------------------
505
505
506 html format:
506 html format:
507 ----------------------------------------------------------------------
507 ----------------------------------------------------------------------
508 <p>
508 <p>
509 Normal output.
509 Normal output.
510 </p>
510 </p>
511 <p>
511 <p>
512 Verbose output.
512 Verbose output.
513 </p>
513 </p>
514 ----------------------------------------------------------------------
514 ----------------------------------------------------------------------
515 ['debug', 'debug']
515 ['debug', 'debug']
516 ----------------------------------------------------------------------
516 ----------------------------------------------------------------------
517
517
518 == containers (debug) ==
518 == containers (debug) ==
519 60 column format:
519 60 column format:
520 ----------------------------------------------------------------------
520 ----------------------------------------------------------------------
521 Normal output.
521 Normal output.
522
522
523 Initial debug output.
523 Initial debug output.
524 ----------------------------------------------------------------------
524 ----------------------------------------------------------------------
525 ['verbose']
525 ['verbose']
526 ----------------------------------------------------------------------
526 ----------------------------------------------------------------------
527
527
528 30 column format:
528 30 column format:
529 ----------------------------------------------------------------------
529 ----------------------------------------------------------------------
530 Normal output.
530 Normal output.
531
531
532 Initial debug output.
532 Initial debug output.
533 ----------------------------------------------------------------------
533 ----------------------------------------------------------------------
534 ['verbose']
534 ['verbose']
535 ----------------------------------------------------------------------
535 ----------------------------------------------------------------------
536
536
537 html format:
537 html format:
538 ----------------------------------------------------------------------
538 ----------------------------------------------------------------------
539 <p>
539 <p>
540 Normal output.
540 Normal output.
541 </p>
541 </p>
542 <p>
542 <p>
543 Initial debug output.
543 Initial debug output.
544 </p>
544 </p>
545 ----------------------------------------------------------------------
545 ----------------------------------------------------------------------
546 ['verbose']
546 ['verbose']
547 ----------------------------------------------------------------------
547 ----------------------------------------------------------------------
548
548
549 == containers (verbose debug) ==
549 == containers (verbose debug) ==
550 60 column format:
550 60 column format:
551 ----------------------------------------------------------------------
551 ----------------------------------------------------------------------
552 Normal output.
552 Normal output.
553
553
554 Initial debug output.
554 Initial debug output.
555
555
556 Verbose output.
556 Verbose output.
557
557
558 Debug output.
558 Debug output.
559 ----------------------------------------------------------------------
559 ----------------------------------------------------------------------
560 []
560 []
561 ----------------------------------------------------------------------
561 ----------------------------------------------------------------------
562
562
563 30 column format:
563 30 column format:
564 ----------------------------------------------------------------------
564 ----------------------------------------------------------------------
565 Normal output.
565 Normal output.
566
566
567 Initial debug output.
567 Initial debug output.
568
568
569 Verbose output.
569 Verbose output.
570
570
571 Debug output.
571 Debug output.
572 ----------------------------------------------------------------------
572 ----------------------------------------------------------------------
573 []
573 []
574 ----------------------------------------------------------------------
574 ----------------------------------------------------------------------
575
575
576 html format:
576 html format:
577 ----------------------------------------------------------------------
577 ----------------------------------------------------------------------
578 <p>
578 <p>
579 Normal output.
579 Normal output.
580 </p>
580 </p>
581 <p>
581 <p>
582 Initial debug output.
582 Initial debug output.
583 </p>
583 </p>
584 <p>
584 <p>
585 Verbose output.
585 Verbose output.
586 </p>
586 </p>
587 <p>
587 <p>
588 Debug output.
588 Debug output.
589 </p>
589 </p>
590 ----------------------------------------------------------------------
590 ----------------------------------------------------------------------
591 []
591 []
592 ----------------------------------------------------------------------
592 ----------------------------------------------------------------------
593
593
594 == roles ==
594 == roles ==
595 60 column format:
595 60 column format:
596 ----------------------------------------------------------------------
596 ----------------------------------------------------------------------
597 Please see "hg add".
597 Please see "hg add".
598 ----------------------------------------------------------------------
598 ----------------------------------------------------------------------
599
599
600 30 column format:
600 30 column format:
601 ----------------------------------------------------------------------
601 ----------------------------------------------------------------------
602 Please see "hg add".
602 Please see "hg add".
603 ----------------------------------------------------------------------
603 ----------------------------------------------------------------------
604
604
605 html format:
605 html format:
606 ----------------------------------------------------------------------
606 ----------------------------------------------------------------------
607 <p>
607 <p>
608 Please see "hg add".
608 Please see &quot;hg add&quot;.
609 </p>
609 </p>
610 ----------------------------------------------------------------------
610 ----------------------------------------------------------------------
611
611
612 == sections ==
612 == sections ==
613 60 column format:
613 60 column format:
614 ----------------------------------------------------------------------
614 ----------------------------------------------------------------------
615 Title
615 Title
616 =====
616 =====
617
617
618 Section
618 Section
619 -------
619 -------
620
620
621 Subsection
621 Subsection
622 ''''''''''
622 ''''''''''
623
623
624 Markup: "foo" and "hg help"
624 Markup: "foo" and "hg help"
625 ---------------------------
625 ---------------------------
626 ----------------------------------------------------------------------
626 ----------------------------------------------------------------------
627
627
628 30 column format:
628 30 column format:
629 ----------------------------------------------------------------------
629 ----------------------------------------------------------------------
630 Title
630 Title
631 =====
631 =====
632
632
633 Section
633 Section
634 -------
634 -------
635
635
636 Subsection
636 Subsection
637 ''''''''''
637 ''''''''''
638
638
639 Markup: "foo" and "hg help"
639 Markup: "foo" and "hg help"
640 ---------------------------
640 ---------------------------
641 ----------------------------------------------------------------------
641 ----------------------------------------------------------------------
642
642
643 html format:
643 html format:
644 ----------------------------------------------------------------------
644 ----------------------------------------------------------------------
645 <h1>Title</h1>
645 <h1>Title</h1>
646 <h2>Section</h2>
646 <h2>Section</h2>
647 <h3>Subsection</h3>
647 <h3>Subsection</h3>
648 <h2>Markup: "foo" and "hg help"</h2>
648 <h2>Markup: &quot;foo&quot; and &quot;hg help&quot;</h2>
649 ----------------------------------------------------------------------
649 ----------------------------------------------------------------------
650
650
651 == admonitions ==
651 == admonitions ==
652 60 column format:
652 60 column format:
653 ----------------------------------------------------------------------
653 ----------------------------------------------------------------------
654 Note:
654 Note:
655 This is a note
655 This is a note
656
656
657 - Bullet 1
657 - Bullet 1
658 - Bullet 2
658 - Bullet 2
659
659
660 Warning!
660 Warning!
661 This is a warning Second input line of warning
661 This is a warning Second input line of warning
662
662
663 !Danger!
663 !Danger!
664 This is danger
664 This is danger
665 ----------------------------------------------------------------------
665 ----------------------------------------------------------------------
666
666
667 30 column format:
667 30 column format:
668 ----------------------------------------------------------------------
668 ----------------------------------------------------------------------
669 Note:
669 Note:
670 This is a note
670 This is a note
671
671
672 - Bullet 1
672 - Bullet 1
673 - Bullet 2
673 - Bullet 2
674
674
675 Warning!
675 Warning!
676 This is a warning Second
676 This is a warning Second
677 input line of warning
677 input line of warning
678
678
679 !Danger!
679 !Danger!
680 This is danger
680 This is danger
681 ----------------------------------------------------------------------
681 ----------------------------------------------------------------------
682
682
683 html format:
683 html format:
684 ----------------------------------------------------------------------
684 ----------------------------------------------------------------------
685 <p>
685 <p>
686 <b>Note:</b> This is a note
686 <b>Note:</b> This is a note
687 </p>
687 </p>
688 <ul>
688 <ul>
689 <li> Bullet 1
689 <li> Bullet 1
690 <li> Bullet 2
690 <li> Bullet 2
691 </ul>
691 </ul>
692 <p>
692 <p>
693 <b>Warning!</b> This is a warning Second input line of warning
693 <b>Warning!</b> This is a warning Second input line of warning
694 </p>
694 </p>
695 <p>
695 <p>
696 <b>!Danger!</b> This is danger
696 <b>!Danger!</b> This is danger
697 </p>
697 </p>
698 ----------------------------------------------------------------------
698 ----------------------------------------------------------------------
699
699
700 == comments ==
700 == comments ==
701 60 column format:
701 60 column format:
702 ----------------------------------------------------------------------
702 ----------------------------------------------------------------------
703 Some text.
703 Some text.
704
704
705 Some indented text.
705 Some indented text.
706
706
707 Empty comment above
707 Empty comment above
708 ----------------------------------------------------------------------
708 ----------------------------------------------------------------------
709
709
710 30 column format:
710 30 column format:
711 ----------------------------------------------------------------------
711 ----------------------------------------------------------------------
712 Some text.
712 Some text.
713
713
714 Some indented text.
714 Some indented text.
715
715
716 Empty comment above
716 Empty comment above
717 ----------------------------------------------------------------------
717 ----------------------------------------------------------------------
718
718
719 html format:
719 html format:
720 ----------------------------------------------------------------------
720 ----------------------------------------------------------------------
721 <p>
721 <p>
722 Some text.
722 Some text.
723 </p>
723 </p>
724 <p>
724 <p>
725 Some indented text.
725 Some indented text.
726 </p>
726 </p>
727 <p>
727 <p>
728 Empty comment above
728 Empty comment above
729 </p>
729 </p>
730 ----------------------------------------------------------------------
730 ----------------------------------------------------------------------
731
731
732 === === ========================================
732 === === ========================================
733 a b c
733 a b c
734 === === ========================================
734 === === ========================================
735 1 2 3
735 1 2 3
736 foo bar baz this list is very very very long man
736 foo bar baz this list is very very very long man
737 === === ========================================
737 === === ========================================
738
738
739 == table ==
739 == table ==
740 60 column format:
740 60 column format:
741 ----------------------------------------------------------------------
741 ----------------------------------------------------------------------
742 a b c
742 a b c
743 ------------------------------------------------
743 ------------------------------------------------
744 1 2 3
744 1 2 3
745 foo bar baz this list is very very very long man
745 foo bar baz this list is very very very long man
746 ----------------------------------------------------------------------
746 ----------------------------------------------------------------------
747
747
748 30 column format:
748 30 column format:
749 ----------------------------------------------------------------------
749 ----------------------------------------------------------------------
750 a b c
750 a b c
751 ------------------------------
751 ------------------------------
752 1 2 3
752 1 2 3
753 foo bar baz this list is
753 foo bar baz this list is
754 very very very long
754 very very very long
755 man
755 man
756 ----------------------------------------------------------------------
756 ----------------------------------------------------------------------
757
757
758 html format:
758 html format:
759 ----------------------------------------------------------------------
759 ----------------------------------------------------------------------
760 <table>
760 <table>
761 <tr><td>a</td><td>b</td><td>c</td></tr>
761 <tr><td>a</td><td>b</td><td>c</td></tr>
762 <tr><td>1</td><td>2</td><td>3</td></tr>
762 <tr><td>1</td><td>2</td><td>3</td></tr>
763 <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
763 <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
764 </table>
764 </table>
765 ----------------------------------------------------------------------
765 ----------------------------------------------------------------------
766
766
General Comments 0
You need to be logged in to leave comments. Login now