Show More
@@ -1,690 +1,690 b'' | |||||
1 | # templatefuncs.py - common template functions |
|
1 | # templatefuncs.py - common template functions | |
2 | # |
|
2 | # | |
3 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> | |
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 | from __future__ import absolute_import |
|
8 | from __future__ import absolute_import | |
9 |
|
9 | |||
10 | import re |
|
10 | import re | |
11 |
|
11 | |||
12 | from .i18n import _ |
|
12 | from .i18n import _ | |
13 | from .node import ( |
|
13 | from .node import ( | |
14 | bin, |
|
14 | bin, | |
15 | ) |
|
15 | ) | |
16 | from . import ( |
|
16 | from . import ( | |
17 | color, |
|
17 | color, | |
18 | encoding, |
|
18 | encoding, | |
19 | error, |
|
19 | error, | |
20 | minirst, |
|
20 | minirst, | |
21 | obsutil, |
|
21 | obsutil, | |
22 | pycompat, |
|
22 | pycompat, | |
23 | registrar, |
|
23 | registrar, | |
24 | revset as revsetmod, |
|
24 | revset as revsetmod, | |
25 | revsetlang, |
|
25 | revsetlang, | |
26 | scmutil, |
|
26 | scmutil, | |
27 | templatefilters, |
|
27 | templatefilters, | |
28 | templatekw, |
|
28 | templatekw, | |
29 | templateutil, |
|
29 | templateutil, | |
30 | util, |
|
30 | util, | |
31 | ) |
|
31 | ) | |
32 | from .utils import ( |
|
32 | from .utils import ( | |
33 | dateutil, |
|
33 | dateutil, | |
34 | stringutil, |
|
34 | stringutil, | |
35 | ) |
|
35 | ) | |
36 |
|
36 | |||
37 | evalrawexp = templateutil.evalrawexp |
|
37 | evalrawexp = templateutil.evalrawexp | |
38 | evalfuncarg = templateutil.evalfuncarg |
|
38 | evalfuncarg = templateutil.evalfuncarg | |
39 | evalboolean = templateutil.evalboolean |
|
39 | evalboolean = templateutil.evalboolean | |
40 | evaldate = templateutil.evaldate |
|
40 | evaldate = templateutil.evaldate | |
41 | evalinteger = templateutil.evalinteger |
|
41 | evalinteger = templateutil.evalinteger | |
42 | evalstring = templateutil.evalstring |
|
42 | evalstring = templateutil.evalstring | |
43 | evalstringliteral = templateutil.evalstringliteral |
|
43 | evalstringliteral = templateutil.evalstringliteral | |
44 |
|
44 | |||
45 | # dict of template built-in functions |
|
45 | # dict of template built-in functions | |
46 | funcs = {} |
|
46 | funcs = {} | |
47 | templatefunc = registrar.templatefunc(funcs) |
|
47 | templatefunc = registrar.templatefunc(funcs) | |
48 |
|
48 | |||
49 | @templatefunc('date(date[, fmt])') |
|
49 | @templatefunc('date(date[, fmt])') | |
50 | def date(context, mapping, args): |
|
50 | def date(context, mapping, args): | |
51 | """Format a date. See :hg:`help dates` for formatting |
|
51 | """Format a date. See :hg:`help dates` for formatting | |
52 | strings. The default is a Unix date format, including the timezone: |
|
52 | strings. The default is a Unix date format, including the timezone: | |
53 | "Mon Sep 04 15:13:13 2006 0700".""" |
|
53 | "Mon Sep 04 15:13:13 2006 0700".""" | |
54 | if not (1 <= len(args) <= 2): |
|
54 | if not (1 <= len(args) <= 2): | |
55 | # i18n: "date" is a keyword |
|
55 | # i18n: "date" is a keyword | |
56 | raise error.ParseError(_("date expects one or two arguments")) |
|
56 | raise error.ParseError(_("date expects one or two arguments")) | |
57 |
|
57 | |||
58 | date = evaldate(context, mapping, args[0], |
|
58 | date = evaldate(context, mapping, args[0], | |
59 | # i18n: "date" is a keyword |
|
59 | # i18n: "date" is a keyword | |
60 | _("date expects a date information")) |
|
60 | _("date expects a date information")) | |
61 | fmt = None |
|
61 | fmt = None | |
62 | if len(args) == 2: |
|
62 | if len(args) == 2: | |
63 | fmt = evalstring(context, mapping, args[1]) |
|
63 | fmt = evalstring(context, mapping, args[1]) | |
64 | if fmt is None: |
|
64 | if fmt is None: | |
65 | return dateutil.datestr(date) |
|
65 | return dateutil.datestr(date) | |
66 | else: |
|
66 | else: | |
67 | return dateutil.datestr(date, fmt) |
|
67 | return dateutil.datestr(date, fmt) | |
68 |
|
68 | |||
69 | @templatefunc('dict([[key=]value...])', argspec='*args **kwargs') |
|
69 | @templatefunc('dict([[key=]value...])', argspec='*args **kwargs') | |
70 | def dict_(context, mapping, args): |
|
70 | def dict_(context, mapping, args): | |
71 | """Construct a dict from key-value pairs. A key may be omitted if |
|
71 | """Construct a dict from key-value pairs. A key may be omitted if | |
72 | a value expression can provide an unambiguous name.""" |
|
72 | a value expression can provide an unambiguous name.""" | |
73 | data = util.sortdict() |
|
73 | data = util.sortdict() | |
74 |
|
74 | |||
75 | for v in args['args']: |
|
75 | for v in args['args']: | |
76 | k = templateutil.findsymbolicname(v) |
|
76 | k = templateutil.findsymbolicname(v) | |
77 | if not k: |
|
77 | if not k: | |
78 | raise error.ParseError(_('dict key cannot be inferred')) |
|
78 | raise error.ParseError(_('dict key cannot be inferred')) | |
79 | if k in data or k in args['kwargs']: |
|
79 | if k in data or k in args['kwargs']: | |
80 | raise error.ParseError(_("duplicated dict key '%s' inferred") % k) |
|
80 | raise error.ParseError(_("duplicated dict key '%s' inferred") % k) | |
81 | data[k] = evalfuncarg(context, mapping, v) |
|
81 | data[k] = evalfuncarg(context, mapping, v) | |
82 |
|
82 | |||
83 | data.update((k, evalfuncarg(context, mapping, v)) |
|
83 | data.update((k, evalfuncarg(context, mapping, v)) | |
84 | for k, v in args['kwargs'].iteritems()) |
|
84 | for k, v in args['kwargs'].iteritems()) | |
85 | return templateutil.hybriddict(data) |
|
85 | return templateutil.hybriddict(data) | |
86 |
|
86 | |||
87 | @templatefunc('diff([includepattern [, excludepattern]])') |
|
87 | @templatefunc('diff([includepattern [, excludepattern]])') | |
88 | def diff(context, mapping, args): |
|
88 | def diff(context, mapping, args): | |
89 | """Show a diff, optionally |
|
89 | """Show a diff, optionally | |
90 | specifying files to include or exclude.""" |
|
90 | specifying files to include or exclude.""" | |
91 | if len(args) > 2: |
|
91 | if len(args) > 2: | |
92 | # i18n: "diff" is a keyword |
|
92 | # i18n: "diff" is a keyword | |
93 | raise error.ParseError(_("diff expects zero, one, or two arguments")) |
|
93 | raise error.ParseError(_("diff expects zero, one, or two arguments")) | |
94 |
|
94 | |||
95 | def getpatterns(i): |
|
95 | def getpatterns(i): | |
96 | if i < len(args): |
|
96 | if i < len(args): | |
97 | s = evalstring(context, mapping, args[i]).strip() |
|
97 | s = evalstring(context, mapping, args[i]).strip() | |
98 | if s: |
|
98 | if s: | |
99 | return [s] |
|
99 | return [s] | |
100 | return [] |
|
100 | return [] | |
101 |
|
101 | |||
102 | ctx = context.resource(mapping, 'ctx') |
|
102 | ctx = context.resource(mapping, 'ctx') | |
103 | chunks = ctx.diff(match=ctx.match([], getpatterns(0), getpatterns(1))) |
|
103 | chunks = ctx.diff(match=ctx.match([], getpatterns(0), getpatterns(1))) | |
104 |
|
104 | |||
105 | return ''.join(chunks) |
|
105 | return ''.join(chunks) | |
106 |
|
106 | |||
107 | @templatefunc('extdata(source)', argspec='source') |
|
107 | @templatefunc('extdata(source)', argspec='source') | |
108 | def extdata(context, mapping, args): |
|
108 | def extdata(context, mapping, args): | |
109 | """Show a text read from the specified extdata source. (EXPERIMENTAL)""" |
|
109 | """Show a text read from the specified extdata source. (EXPERIMENTAL)""" | |
110 | if 'source' not in args: |
|
110 | if 'source' not in args: | |
111 | # i18n: "extdata" is a keyword |
|
111 | # i18n: "extdata" is a keyword | |
112 | raise error.ParseError(_('extdata expects one argument')) |
|
112 | raise error.ParseError(_('extdata expects one argument')) | |
113 |
|
113 | |||
114 | source = evalstring(context, mapping, args['source']) |
|
114 | source = evalstring(context, mapping, args['source']) | |
115 | cache = context.resource(mapping, 'cache').setdefault('extdata', {}) |
|
115 | cache = context.resource(mapping, 'cache').setdefault('extdata', {}) | |
116 | ctx = context.resource(mapping, 'ctx') |
|
116 | ctx = context.resource(mapping, 'ctx') | |
117 | if source in cache: |
|
117 | if source in cache: | |
118 | data = cache[source] |
|
118 | data = cache[source] | |
119 | else: |
|
119 | else: | |
120 | data = cache[source] = scmutil.extdatasource(ctx.repo(), source) |
|
120 | data = cache[source] = scmutil.extdatasource(ctx.repo(), source) | |
121 | return data.get(ctx.rev(), '') |
|
121 | return data.get(ctx.rev(), '') | |
122 |
|
122 | |||
123 | @templatefunc('files(pattern)') |
|
123 | @templatefunc('files(pattern)') | |
124 | def files(context, mapping, args): |
|
124 | def files(context, mapping, args): | |
125 | """All files of the current changeset matching the pattern. See |
|
125 | """All files of the current changeset matching the pattern. See | |
126 | :hg:`help patterns`.""" |
|
126 | :hg:`help patterns`.""" | |
127 | if not len(args) == 1: |
|
127 | if not len(args) == 1: | |
128 | # i18n: "files" is a keyword |
|
128 | # i18n: "files" is a keyword | |
129 | raise error.ParseError(_("files expects one argument")) |
|
129 | raise error.ParseError(_("files expects one argument")) | |
130 |
|
130 | |||
131 | raw = evalstring(context, mapping, args[0]) |
|
131 | raw = evalstring(context, mapping, args[0]) | |
132 | ctx = context.resource(mapping, 'ctx') |
|
132 | ctx = context.resource(mapping, 'ctx') | |
133 | m = ctx.match([raw]) |
|
133 | m = ctx.match([raw]) | |
134 | files = list(ctx.matches(m)) |
|
134 | files = list(ctx.matches(m)) | |
135 | return templateutil.compatlist(context, mapping, "file", files) |
|
135 | return templateutil.compatlist(context, mapping, "file", files) | |
136 |
|
136 | |||
137 | @templatefunc('fill(text[, width[, initialident[, hangindent]]])') |
|
137 | @templatefunc('fill(text[, width[, initialident[, hangindent]]])') | |
138 | def fill(context, mapping, args): |
|
138 | def fill(context, mapping, args): | |
139 | """Fill many |
|
139 | """Fill many | |
140 | paragraphs with optional indentation. See the "fill" filter.""" |
|
140 | paragraphs with optional indentation. See the "fill" filter.""" | |
141 | if not (1 <= len(args) <= 4): |
|
141 | if not (1 <= len(args) <= 4): | |
142 | # i18n: "fill" is a keyword |
|
142 | # i18n: "fill" is a keyword | |
143 | raise error.ParseError(_("fill expects one to four arguments")) |
|
143 | raise error.ParseError(_("fill expects one to four arguments")) | |
144 |
|
144 | |||
145 | text = evalstring(context, mapping, args[0]) |
|
145 | text = evalstring(context, mapping, args[0]) | |
146 | width = 76 |
|
146 | width = 76 | |
147 | initindent = '' |
|
147 | initindent = '' | |
148 | hangindent = '' |
|
148 | hangindent = '' | |
149 | if 2 <= len(args) <= 4: |
|
149 | if 2 <= len(args) <= 4: | |
150 | width = evalinteger(context, mapping, args[1], |
|
150 | width = evalinteger(context, mapping, args[1], | |
151 | # i18n: "fill" is a keyword |
|
151 | # i18n: "fill" is a keyword | |
152 | _("fill expects an integer width")) |
|
152 | _("fill expects an integer width")) | |
153 | try: |
|
153 | try: | |
154 | initindent = evalstring(context, mapping, args[2]) |
|
154 | initindent = evalstring(context, mapping, args[2]) | |
155 | hangindent = evalstring(context, mapping, args[3]) |
|
155 | hangindent = evalstring(context, mapping, args[3]) | |
156 | except IndexError: |
|
156 | except IndexError: | |
157 | pass |
|
157 | pass | |
158 |
|
158 | |||
159 | return templatefilters.fill(text, width, initindent, hangindent) |
|
159 | return templatefilters.fill(text, width, initindent, hangindent) | |
160 |
|
160 | |||
161 | @templatefunc('formatnode(node)') |
|
161 | @templatefunc('formatnode(node)') | |
162 | def formatnode(context, mapping, args): |
|
162 | def formatnode(context, mapping, args): | |
163 | """Obtain the preferred form of a changeset hash. (DEPRECATED)""" |
|
163 | """Obtain the preferred form of a changeset hash. (DEPRECATED)""" | |
164 | if len(args) != 1: |
|
164 | if len(args) != 1: | |
165 | # i18n: "formatnode" is a keyword |
|
165 | # i18n: "formatnode" is a keyword | |
166 | raise error.ParseError(_("formatnode expects one argument")) |
|
166 | raise error.ParseError(_("formatnode expects one argument")) | |
167 |
|
167 | |||
168 | ui = context.resource(mapping, 'ui') |
|
168 | ui = context.resource(mapping, 'ui') | |
169 | node = evalstring(context, mapping, args[0]) |
|
169 | node = evalstring(context, mapping, args[0]) | |
170 | if ui.debugflag: |
|
170 | if ui.debugflag: | |
171 | return node |
|
171 | return node | |
172 | return templatefilters.short(node) |
|
172 | return templatefilters.short(node) | |
173 |
|
173 | |||
174 | @templatefunc('mailmap(author)') |
|
174 | @templatefunc('mailmap(author)') | |
175 | def mailmap(context, mapping, args): |
|
175 | def mailmap(context, mapping, args): | |
176 | """Return the author, updated according to the value |
|
176 | """Return the author, updated according to the value | |
177 | set in the .mailmap file""" |
|
177 | set in the .mailmap file""" | |
178 | if len(args) != 1: |
|
178 | if len(args) != 1: | |
179 | raise error.ParseError(_("mailmap expects one argument")) |
|
179 | raise error.ParseError(_("mailmap expects one argument")) | |
180 |
|
180 | |||
181 | author = evalstring(context, mapping, args[0]) |
|
181 | author = evalstring(context, mapping, args[0]) | |
182 |
|
182 | |||
183 | cache = context.resource(mapping, 'cache') |
|
183 | cache = context.resource(mapping, 'cache') | |
184 | repo = context.resource(mapping, 'repo') |
|
184 | repo = context.resource(mapping, 'repo') | |
185 |
|
185 | |||
186 | if 'mailmap' not in cache: |
|
186 | if 'mailmap' not in cache: | |
187 | data = repo.wvfs.tryread('.mailmap') |
|
187 | data = repo.wvfs.tryread('.mailmap') | |
188 | cache['mailmap'] = stringutil.parsemailmap(data) |
|
188 | cache['mailmap'] = stringutil.parsemailmap(data) | |
189 |
|
189 | |||
190 | return stringutil.mapname(cache['mailmap'], author) |
|
190 | return stringutil.mapname(cache['mailmap'], author) | |
191 |
|
191 | |||
192 | @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])', |
|
192 | @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])', | |
193 | argspec='text width fillchar left') |
|
193 | argspec='text width fillchar left') | |
194 | def pad(context, mapping, args): |
|
194 | def pad(context, mapping, args): | |
195 | """Pad text with a |
|
195 | """Pad text with a | |
196 | fill character.""" |
|
196 | fill character.""" | |
197 | if 'text' not in args or 'width' not in args: |
|
197 | if 'text' not in args or 'width' not in args: | |
198 | # i18n: "pad" is a keyword |
|
198 | # i18n: "pad" is a keyword | |
199 | raise error.ParseError(_("pad() expects two to four arguments")) |
|
199 | raise error.ParseError(_("pad() expects two to four arguments")) | |
200 |
|
200 | |||
201 | width = evalinteger(context, mapping, args['width'], |
|
201 | width = evalinteger(context, mapping, args['width'], | |
202 | # i18n: "pad" is a keyword |
|
202 | # i18n: "pad" is a keyword | |
203 | _("pad() expects an integer width")) |
|
203 | _("pad() expects an integer width")) | |
204 |
|
204 | |||
205 | text = evalstring(context, mapping, args['text']) |
|
205 | text = evalstring(context, mapping, args['text']) | |
206 |
|
206 | |||
207 | left = False |
|
207 | left = False | |
208 | fillchar = ' ' |
|
208 | fillchar = ' ' | |
209 | if 'fillchar' in args: |
|
209 | if 'fillchar' in args: | |
210 | fillchar = evalstring(context, mapping, args['fillchar']) |
|
210 | fillchar = evalstring(context, mapping, args['fillchar']) | |
211 | if len(color.stripeffects(fillchar)) != 1: |
|
211 | if len(color.stripeffects(fillchar)) != 1: | |
212 | # i18n: "pad" is a keyword |
|
212 | # i18n: "pad" is a keyword | |
213 | raise error.ParseError(_("pad() expects a single fill character")) |
|
213 | raise error.ParseError(_("pad() expects a single fill character")) | |
214 | if 'left' in args: |
|
214 | if 'left' in args: | |
215 | left = evalboolean(context, mapping, args['left']) |
|
215 | left = evalboolean(context, mapping, args['left']) | |
216 |
|
216 | |||
217 | fillwidth = width - encoding.colwidth(color.stripeffects(text)) |
|
217 | fillwidth = width - encoding.colwidth(color.stripeffects(text)) | |
218 | if fillwidth <= 0: |
|
218 | if fillwidth <= 0: | |
219 | return text |
|
219 | return text | |
220 | if left: |
|
220 | if left: | |
221 | return fillchar * fillwidth + text |
|
221 | return fillchar * fillwidth + text | |
222 | else: |
|
222 | else: | |
223 | return text + fillchar * fillwidth |
|
223 | return text + fillchar * fillwidth | |
224 |
|
224 | |||
225 | @templatefunc('indent(text, indentchars[, firstline])') |
|
225 | @templatefunc('indent(text, indentchars[, firstline])') | |
226 | def indent(context, mapping, args): |
|
226 | def indent(context, mapping, args): | |
227 | """Indents all non-empty lines |
|
227 | """Indents all non-empty lines | |
228 | with the characters given in the indentchars string. An optional |
|
228 | with the characters given in the indentchars string. An optional | |
229 | third parameter will override the indent for the first line only |
|
229 | third parameter will override the indent for the first line only | |
230 | if present.""" |
|
230 | if present.""" | |
231 | if not (2 <= len(args) <= 3): |
|
231 | if not (2 <= len(args) <= 3): | |
232 | # i18n: "indent" is a keyword |
|
232 | # i18n: "indent" is a keyword | |
233 | raise error.ParseError(_("indent() expects two or three arguments")) |
|
233 | raise error.ParseError(_("indent() expects two or three arguments")) | |
234 |
|
234 | |||
235 | text = evalstring(context, mapping, args[0]) |
|
235 | text = evalstring(context, mapping, args[0]) | |
236 | indent = evalstring(context, mapping, args[1]) |
|
236 | indent = evalstring(context, mapping, args[1]) | |
237 |
|
237 | |||
238 | if len(args) == 3: |
|
238 | if len(args) == 3: | |
239 | firstline = evalstring(context, mapping, args[2]) |
|
239 | firstline = evalstring(context, mapping, args[2]) | |
240 | else: |
|
240 | else: | |
241 | firstline = indent |
|
241 | firstline = indent | |
242 |
|
242 | |||
243 | # the indent function doesn't indent the first line, so we do it here |
|
243 | # the indent function doesn't indent the first line, so we do it here | |
244 | return templatefilters.indent(firstline + text, indent) |
|
244 | return templatefilters.indent(firstline + text, indent) | |
245 |
|
245 | |||
246 | @templatefunc('get(dict, key)') |
|
246 | @templatefunc('get(dict, key)') | |
247 | def get(context, mapping, args): |
|
247 | def get(context, mapping, args): | |
248 | """Get an attribute/key from an object. Some keywords |
|
248 | """Get an attribute/key from an object. Some keywords | |
249 | are complex types. This function allows you to obtain the value of an |
|
249 | are complex types. This function allows you to obtain the value of an | |
250 | attribute on these types.""" |
|
250 | attribute on these types.""" | |
251 | if len(args) != 2: |
|
251 | if len(args) != 2: | |
252 | # i18n: "get" is a keyword |
|
252 | # i18n: "get" is a keyword | |
253 | raise error.ParseError(_("get() expects two arguments")) |
|
253 | raise error.ParseError(_("get() expects two arguments")) | |
254 |
|
254 | |||
255 | dictarg = evalfuncarg(context, mapping, args[0]) |
|
255 | dictarg = evalfuncarg(context, mapping, args[0]) | |
256 | if not util.safehasattr(dictarg, 'get'): |
|
256 | if not util.safehasattr(dictarg, 'get'): | |
257 | # i18n: "get" is a keyword |
|
257 | # i18n: "get" is a keyword | |
258 | raise error.ParseError(_("get() expects a dict as first argument")) |
|
258 | raise error.ParseError(_("get() expects a dict as first argument")) | |
259 |
|
259 | |||
260 | key = evalfuncarg(context, mapping, args[1]) |
|
260 | key = evalfuncarg(context, mapping, args[1]) | |
261 | return templateutil.getdictitem(dictarg, key) |
|
261 | return templateutil.getdictitem(dictarg, key) | |
262 |
|
262 | |||
263 | @templatefunc('if(expr, then[, else])') |
|
263 | @templatefunc('if(expr, then[, else])') | |
264 | def if_(context, mapping, args): |
|
264 | def if_(context, mapping, args): | |
265 | """Conditionally execute based on the result of |
|
265 | """Conditionally execute based on the result of | |
266 | an expression.""" |
|
266 | an expression.""" | |
267 | if not (2 <= len(args) <= 3): |
|
267 | if not (2 <= len(args) <= 3): | |
268 | # i18n: "if" is a keyword |
|
268 | # i18n: "if" is a keyword | |
269 | raise error.ParseError(_("if expects two or three arguments")) |
|
269 | raise error.ParseError(_("if expects two or three arguments")) | |
270 |
|
270 | |||
271 | test = evalboolean(context, mapping, args[0]) |
|
271 | test = evalboolean(context, mapping, args[0]) | |
272 | if test: |
|
272 | if test: | |
273 | return evalrawexp(context, mapping, args[1]) |
|
273 | return evalrawexp(context, mapping, args[1]) | |
274 | elif len(args) == 3: |
|
274 | elif len(args) == 3: | |
275 | return evalrawexp(context, mapping, args[2]) |
|
275 | return evalrawexp(context, mapping, args[2]) | |
276 |
|
276 | |||
277 | @templatefunc('ifcontains(needle, haystack, then[, else])') |
|
277 | @templatefunc('ifcontains(needle, haystack, then[, else])') | |
278 | def ifcontains(context, mapping, args): |
|
278 | def ifcontains(context, mapping, args): | |
279 | """Conditionally execute based |
|
279 | """Conditionally execute based | |
280 | on whether the item "needle" is in "haystack".""" |
|
280 | on whether the item "needle" is in "haystack".""" | |
281 | if not (3 <= len(args) <= 4): |
|
281 | if not (3 <= len(args) <= 4): | |
282 | # i18n: "ifcontains" is a keyword |
|
282 | # i18n: "ifcontains" is a keyword | |
283 | raise error.ParseError(_("ifcontains expects three or four arguments")) |
|
283 | raise error.ParseError(_("ifcontains expects three or four arguments")) | |
284 |
|
284 | |||
285 | haystack = evalfuncarg(context, mapping, args[1]) |
|
285 | haystack = evalfuncarg(context, mapping, args[1]) | |
286 | keytype = getattr(haystack, 'keytype', None) |
|
286 | keytype = getattr(haystack, 'keytype', None) | |
287 | try: |
|
287 | try: | |
288 | needle = evalrawexp(context, mapping, args[0]) |
|
288 | needle = evalrawexp(context, mapping, args[0]) | |
289 | needle = templateutil.unwrapastype(context, mapping, needle, |
|
289 | needle = templateutil.unwrapastype(context, mapping, needle, | |
290 | keytype or bytes) |
|
290 | keytype or bytes) | |
291 | found = (needle in haystack) |
|
291 | found = (needle in haystack) | |
292 | except error.ParseError: |
|
292 | except error.ParseError: | |
293 | found = False |
|
293 | found = False | |
294 |
|
294 | |||
295 | if found: |
|
295 | if found: | |
296 | return evalrawexp(context, mapping, args[2]) |
|
296 | return evalrawexp(context, mapping, args[2]) | |
297 | elif len(args) == 4: |
|
297 | elif len(args) == 4: | |
298 | return evalrawexp(context, mapping, args[3]) |
|
298 | return evalrawexp(context, mapping, args[3]) | |
299 |
|
299 | |||
300 | @templatefunc('ifeq(expr1, expr2, then[, else])') |
|
300 | @templatefunc('ifeq(expr1, expr2, then[, else])') | |
301 | def ifeq(context, mapping, args): |
|
301 | def ifeq(context, mapping, args): | |
302 | """Conditionally execute based on |
|
302 | """Conditionally execute based on | |
303 | whether 2 items are equivalent.""" |
|
303 | whether 2 items are equivalent.""" | |
304 | if not (3 <= len(args) <= 4): |
|
304 | if not (3 <= len(args) <= 4): | |
305 | # i18n: "ifeq" is a keyword |
|
305 | # i18n: "ifeq" is a keyword | |
306 | raise error.ParseError(_("ifeq expects three or four arguments")) |
|
306 | raise error.ParseError(_("ifeq expects three or four arguments")) | |
307 |
|
307 | |||
308 | test = evalstring(context, mapping, args[0]) |
|
308 | test = evalstring(context, mapping, args[0]) | |
309 | match = evalstring(context, mapping, args[1]) |
|
309 | match = evalstring(context, mapping, args[1]) | |
310 | if test == match: |
|
310 | if test == match: | |
311 | return evalrawexp(context, mapping, args[2]) |
|
311 | return evalrawexp(context, mapping, args[2]) | |
312 | elif len(args) == 4: |
|
312 | elif len(args) == 4: | |
313 | return evalrawexp(context, mapping, args[3]) |
|
313 | return evalrawexp(context, mapping, args[3]) | |
314 |
|
314 | |||
315 | @templatefunc('join(list, sep)') |
|
315 | @templatefunc('join(list, sep)') | |
316 | def join(context, mapping, args): |
|
316 | def join(context, mapping, args): | |
317 | """Join items in a list with a delimiter.""" |
|
317 | """Join items in a list with a delimiter.""" | |
318 | if not (1 <= len(args) <= 2): |
|
318 | if not (1 <= len(args) <= 2): | |
319 | # i18n: "join" is a keyword |
|
319 | # i18n: "join" is a keyword | |
320 | raise error.ParseError(_("join expects one or two arguments")) |
|
320 | raise error.ParseError(_("join expects one or two arguments")) | |
321 |
|
321 | |||
322 | joinset = evalrawexp(context, mapping, args[0]) |
|
322 | joinset = evalrawexp(context, mapping, args[0]) | |
323 | joiner = " " |
|
323 | joiner = " " | |
324 | if len(args) > 1: |
|
324 | if len(args) > 1: | |
325 | joiner = evalstring(context, mapping, args[1]) |
|
325 | joiner = evalstring(context, mapping, args[1]) | |
326 | if isinstance(joinset, templateutil.wrapped): |
|
326 | if isinstance(joinset, templateutil.wrapped): | |
327 | return joinset.join(context, mapping, joiner) |
|
327 | return joinset.join(context, mapping, joiner) | |
328 | # TODO: perhaps a generator should be stringify()-ed here, but we can't |
|
328 | # TODO: perhaps a generator should be stringify()-ed here, but we can't | |
329 | # because hgweb abuses it as a keyword that returns a list of dicts. |
|
329 | # because hgweb abuses it as a keyword that returns a list of dicts. | |
330 | joinset = templateutil.unwrapvalue(context, mapping, joinset) |
|
330 | joinset = templateutil.unwrapvalue(context, mapping, joinset) | |
331 | return templateutil.joinitems(pycompat.maybebytestr(joinset), joiner) |
|
331 | return templateutil.joinitems(pycompat.maybebytestr(joinset), joiner) | |
332 |
|
332 | |||
333 | @templatefunc('label(label, expr)') |
|
333 | @templatefunc('label(label, expr)') | |
334 | def label(context, mapping, args): |
|
334 | def label(context, mapping, args): | |
335 | """Apply a label to generated content. Content with |
|
335 | """Apply a label to generated content. Content with | |
336 | a label applied can result in additional post-processing, such as |
|
336 | a label applied can result in additional post-processing, such as | |
337 | automatic colorization.""" |
|
337 | automatic colorization.""" | |
338 | if len(args) != 2: |
|
338 | if len(args) != 2: | |
339 | # i18n: "label" is a keyword |
|
339 | # i18n: "label" is a keyword | |
340 | raise error.ParseError(_("label expects two arguments")) |
|
340 | raise error.ParseError(_("label expects two arguments")) | |
341 |
|
341 | |||
342 | ui = context.resource(mapping, 'ui') |
|
342 | ui = context.resource(mapping, 'ui') | |
343 | thing = evalstring(context, mapping, args[1]) |
|
343 | thing = evalstring(context, mapping, args[1]) | |
344 | # preserve unknown symbol as literal so effects like 'red', 'bold', |
|
344 | # preserve unknown symbol as literal so effects like 'red', 'bold', | |
345 | # etc. don't need to be quoted |
|
345 | # etc. don't need to be quoted | |
346 | label = evalstringliteral(context, mapping, args[0]) |
|
346 | label = evalstringliteral(context, mapping, args[0]) | |
347 |
|
347 | |||
348 | return ui.label(thing, label) |
|
348 | return ui.label(thing, label) | |
349 |
|
349 | |||
350 | @templatefunc('latesttag([pattern])') |
|
350 | @templatefunc('latesttag([pattern])') | |
351 | def latesttag(context, mapping, args): |
|
351 | def latesttag(context, mapping, args): | |
352 | """The global tags matching the given pattern on the |
|
352 | """The global tags matching the given pattern on the | |
353 | most recent globally tagged ancestor of this changeset. |
|
353 | most recent globally tagged ancestor of this changeset. | |
354 | If no such tags exist, the "{tag}" template resolves to |
|
354 | If no such tags exist, the "{tag}" template resolves to | |
355 | the string "null".""" |
|
355 | the string "null".""" | |
356 | if len(args) > 1: |
|
356 | if len(args) > 1: | |
357 | # i18n: "latesttag" is a keyword |
|
357 | # i18n: "latesttag" is a keyword | |
358 | raise error.ParseError(_("latesttag expects at most one argument")) |
|
358 | raise error.ParseError(_("latesttag expects at most one argument")) | |
359 |
|
359 | |||
360 | pattern = None |
|
360 | pattern = None | |
361 | if len(args) == 1: |
|
361 | if len(args) == 1: | |
362 | pattern = evalstring(context, mapping, args[0]) |
|
362 | pattern = evalstring(context, mapping, args[0]) | |
363 | return templatekw.showlatesttags(context, mapping, pattern) |
|
363 | return templatekw.showlatesttags(context, mapping, pattern) | |
364 |
|
364 | |||
365 | @templatefunc('localdate(date[, tz])') |
|
365 | @templatefunc('localdate(date[, tz])') | |
366 | def localdate(context, mapping, args): |
|
366 | def localdate(context, mapping, args): | |
367 | """Converts a date to the specified timezone. |
|
367 | """Converts a date to the specified timezone. | |
368 | The default is local date.""" |
|
368 | The default is local date.""" | |
369 | if not (1 <= len(args) <= 2): |
|
369 | if not (1 <= len(args) <= 2): | |
370 | # i18n: "localdate" is a keyword |
|
370 | # i18n: "localdate" is a keyword | |
371 | raise error.ParseError(_("localdate expects one or two arguments")) |
|
371 | raise error.ParseError(_("localdate expects one or two arguments")) | |
372 |
|
372 | |||
373 | date = evaldate(context, mapping, args[0], |
|
373 | date = evaldate(context, mapping, args[0], | |
374 | # i18n: "localdate" is a keyword |
|
374 | # i18n: "localdate" is a keyword | |
375 | _("localdate expects a date information")) |
|
375 | _("localdate expects a date information")) | |
376 | if len(args) >= 2: |
|
376 | if len(args) >= 2: | |
377 | tzoffset = None |
|
377 | tzoffset = None | |
378 | tz = evalfuncarg(context, mapping, args[1]) |
|
378 | tz = evalfuncarg(context, mapping, args[1]) | |
379 | if isinstance(tz, bytes): |
|
379 | if isinstance(tz, bytes): | |
380 | tzoffset, remainder = dateutil.parsetimezone(tz) |
|
380 | tzoffset, remainder = dateutil.parsetimezone(tz) | |
381 | if remainder: |
|
381 | if remainder: | |
382 | tzoffset = None |
|
382 | tzoffset = None | |
383 | if tzoffset is None: |
|
383 | if tzoffset is None: | |
384 | try: |
|
384 | try: | |
385 | tzoffset = int(tz) |
|
385 | tzoffset = int(tz) | |
386 | except (TypeError, ValueError): |
|
386 | except (TypeError, ValueError): | |
387 | # i18n: "localdate" is a keyword |
|
387 | # i18n: "localdate" is a keyword | |
388 | raise error.ParseError(_("localdate expects a timezone")) |
|
388 | raise error.ParseError(_("localdate expects a timezone")) | |
389 | else: |
|
389 | else: | |
390 | tzoffset = dateutil.makedate()[1] |
|
390 | tzoffset = dateutil.makedate()[1] | |
391 | return (date[0], tzoffset) |
|
391 | return (date[0], tzoffset) | |
392 |
|
392 | |||
393 | @templatefunc('max(iterable)') |
|
393 | @templatefunc('max(iterable)') | |
394 | def max_(context, mapping, args, **kwargs): |
|
394 | def max_(context, mapping, args, **kwargs): | |
395 | """Return the max of an iterable""" |
|
395 | """Return the max of an iterable""" | |
396 | if len(args) != 1: |
|
396 | if len(args) != 1: | |
397 | # i18n: "max" is a keyword |
|
397 | # i18n: "max" is a keyword | |
398 | raise error.ParseError(_("max expects one argument")) |
|
398 | raise error.ParseError(_("max expects one argument")) | |
399 |
|
399 | |||
400 | iterable = evalfuncarg(context, mapping, args[0]) |
|
400 | iterable = evalfuncarg(context, mapping, args[0]) | |
401 | try: |
|
401 | try: | |
402 | x = max(pycompat.maybebytestr(iterable)) |
|
402 | x = max(pycompat.maybebytestr(iterable)) | |
403 | except (TypeError, ValueError): |
|
403 | except (TypeError, ValueError): | |
404 | # i18n: "max" is a keyword |
|
404 | # i18n: "max" is a keyword | |
405 | raise error.ParseError(_("max first argument should be an iterable")) |
|
405 | raise error.ParseError(_("max first argument should be an iterable")) | |
406 | return templateutil.wraphybridvalue(iterable, x, x) |
|
406 | return templateutil.wraphybridvalue(iterable, x, x) | |
407 |
|
407 | |||
408 | @templatefunc('min(iterable)') |
|
408 | @templatefunc('min(iterable)') | |
409 | def min_(context, mapping, args, **kwargs): |
|
409 | def min_(context, mapping, args, **kwargs): | |
410 | """Return the min of an iterable""" |
|
410 | """Return the min of an iterable""" | |
411 | if len(args) != 1: |
|
411 | if len(args) != 1: | |
412 | # i18n: "min" is a keyword |
|
412 | # i18n: "min" is a keyword | |
413 | raise error.ParseError(_("min expects one argument")) |
|
413 | raise error.ParseError(_("min expects one argument")) | |
414 |
|
414 | |||
415 | iterable = evalfuncarg(context, mapping, args[0]) |
|
415 | iterable = evalfuncarg(context, mapping, args[0]) | |
416 | try: |
|
416 | try: | |
417 | x = min(pycompat.maybebytestr(iterable)) |
|
417 | x = min(pycompat.maybebytestr(iterable)) | |
418 | except (TypeError, ValueError): |
|
418 | except (TypeError, ValueError): | |
419 | # i18n: "min" is a keyword |
|
419 | # i18n: "min" is a keyword | |
420 | raise error.ParseError(_("min first argument should be an iterable")) |
|
420 | raise error.ParseError(_("min first argument should be an iterable")) | |
421 | return templateutil.wraphybridvalue(iterable, x, x) |
|
421 | return templateutil.wraphybridvalue(iterable, x, x) | |
422 |
|
422 | |||
423 | @templatefunc('mod(a, b)') |
|
423 | @templatefunc('mod(a, b)') | |
424 | def mod(context, mapping, args): |
|
424 | def mod(context, mapping, args): | |
425 | """Calculate a mod b such that a / b + a mod b == a""" |
|
425 | """Calculate a mod b such that a / b + a mod b == a""" | |
426 | if not len(args) == 2: |
|
426 | if not len(args) == 2: | |
427 | # i18n: "mod" is a keyword |
|
427 | # i18n: "mod" is a keyword | |
428 | raise error.ParseError(_("mod expects two arguments")) |
|
428 | raise error.ParseError(_("mod expects two arguments")) | |
429 |
|
429 | |||
430 | func = lambda a, b: a % b |
|
430 | func = lambda a, b: a % b | |
431 | return templateutil.runarithmetic(context, mapping, |
|
431 | return templateutil.runarithmetic(context, mapping, | |
432 | (func, args[0], args[1])) |
|
432 | (func, args[0], args[1])) | |
433 |
|
433 | |||
434 | @templatefunc('obsfateoperations(markers)') |
|
434 | @templatefunc('obsfateoperations(markers)') | |
435 | def obsfateoperations(context, mapping, args): |
|
435 | def obsfateoperations(context, mapping, args): | |
436 | """Compute obsfate related information based on markers (EXPERIMENTAL)""" |
|
436 | """Compute obsfate related information based on markers (EXPERIMENTAL)""" | |
437 | if len(args) != 1: |
|
437 | if len(args) != 1: | |
438 | # i18n: "obsfateoperations" is a keyword |
|
438 | # i18n: "obsfateoperations" is a keyword | |
439 | raise error.ParseError(_("obsfateoperations expects one argument")) |
|
439 | raise error.ParseError(_("obsfateoperations expects one argument")) | |
440 |
|
440 | |||
441 | markers = evalfuncarg(context, mapping, args[0]) |
|
441 | markers = evalfuncarg(context, mapping, args[0]) | |
442 |
|
442 | |||
443 | try: |
|
443 | try: | |
444 | data = obsutil.markersoperations(markers) |
|
444 | data = obsutil.markersoperations(markers) | |
445 | return templateutil.hybridlist(data, name='operation') |
|
445 | return templateutil.hybridlist(data, name='operation') | |
446 | except (TypeError, KeyError): |
|
446 | except (TypeError, KeyError): | |
447 | # i18n: "obsfateoperations" is a keyword |
|
447 | # i18n: "obsfateoperations" is a keyword | |
448 | errmsg = _("obsfateoperations first argument should be an iterable") |
|
448 | errmsg = _("obsfateoperations first argument should be an iterable") | |
449 | raise error.ParseError(errmsg) |
|
449 | raise error.ParseError(errmsg) | |
450 |
|
450 | |||
451 | @templatefunc('obsfatedate(markers)') |
|
451 | @templatefunc('obsfatedate(markers)') | |
452 | def obsfatedate(context, mapping, args): |
|
452 | def obsfatedate(context, mapping, args): | |
453 | """Compute obsfate related information based on markers (EXPERIMENTAL)""" |
|
453 | """Compute obsfate related information based on markers (EXPERIMENTAL)""" | |
454 | if len(args) != 1: |
|
454 | if len(args) != 1: | |
455 | # i18n: "obsfatedate" is a keyword |
|
455 | # i18n: "obsfatedate" is a keyword | |
456 | raise error.ParseError(_("obsfatedate expects one argument")) |
|
456 | raise error.ParseError(_("obsfatedate expects one argument")) | |
457 |
|
457 | |||
458 | markers = evalfuncarg(context, mapping, args[0]) |
|
458 | markers = evalfuncarg(context, mapping, args[0]) | |
459 |
|
459 | |||
460 | try: |
|
460 | try: | |
461 | data = obsutil.markersdates(markers) |
|
461 | data = obsutil.markersdates(markers) | |
462 | return templateutil.hybridlist(data, name='date', fmt='%d %d') |
|
462 | return templateutil.hybridlist(data, name='date', fmt='%d %d') | |
463 | except (TypeError, KeyError): |
|
463 | except (TypeError, KeyError): | |
464 | # i18n: "obsfatedate" is a keyword |
|
464 | # i18n: "obsfatedate" is a keyword | |
465 | errmsg = _("obsfatedate first argument should be an iterable") |
|
465 | errmsg = _("obsfatedate first argument should be an iterable") | |
466 | raise error.ParseError(errmsg) |
|
466 | raise error.ParseError(errmsg) | |
467 |
|
467 | |||
468 | @templatefunc('obsfateusers(markers)') |
|
468 | @templatefunc('obsfateusers(markers)') | |
469 | def obsfateusers(context, mapping, args): |
|
469 | def obsfateusers(context, mapping, args): | |
470 | """Compute obsfate related information based on markers (EXPERIMENTAL)""" |
|
470 | """Compute obsfate related information based on markers (EXPERIMENTAL)""" | |
471 | if len(args) != 1: |
|
471 | if len(args) != 1: | |
472 | # i18n: "obsfateusers" is a keyword |
|
472 | # i18n: "obsfateusers" is a keyword | |
473 | raise error.ParseError(_("obsfateusers expects one argument")) |
|
473 | raise error.ParseError(_("obsfateusers expects one argument")) | |
474 |
|
474 | |||
475 | markers = evalfuncarg(context, mapping, args[0]) |
|
475 | markers = evalfuncarg(context, mapping, args[0]) | |
476 |
|
476 | |||
477 | try: |
|
477 | try: | |
478 | data = obsutil.markersusers(markers) |
|
478 | data = obsutil.markersusers(markers) | |
479 | return templateutil.hybridlist(data, name='user') |
|
479 | return templateutil.hybridlist(data, name='user') | |
480 | except (TypeError, KeyError, ValueError): |
|
480 | except (TypeError, KeyError, ValueError): | |
481 | # i18n: "obsfateusers" is a keyword |
|
481 | # i18n: "obsfateusers" is a keyword | |
482 | msg = _("obsfateusers first argument should be an iterable of " |
|
482 | msg = _("obsfateusers first argument should be an iterable of " | |
483 | "obsmakers") |
|
483 | "obsmakers") | |
484 | raise error.ParseError(msg) |
|
484 | raise error.ParseError(msg) | |
485 |
|
485 | |||
486 | @templatefunc('obsfateverb(successors, markers)') |
|
486 | @templatefunc('obsfateverb(successors, markers)') | |
487 | def obsfateverb(context, mapping, args): |
|
487 | def obsfateverb(context, mapping, args): | |
488 | """Compute obsfate related information based on successors (EXPERIMENTAL)""" |
|
488 | """Compute obsfate related information based on successors (EXPERIMENTAL)""" | |
489 | if len(args) != 2: |
|
489 | if len(args) != 2: | |
490 | # i18n: "obsfateverb" is a keyword |
|
490 | # i18n: "obsfateverb" is a keyword | |
491 | raise error.ParseError(_("obsfateverb expects two arguments")) |
|
491 | raise error.ParseError(_("obsfateverb expects two arguments")) | |
492 |
|
492 | |||
493 | successors = evalfuncarg(context, mapping, args[0]) |
|
493 | successors = evalfuncarg(context, mapping, args[0]) | |
494 | markers = evalfuncarg(context, mapping, args[1]) |
|
494 | markers = evalfuncarg(context, mapping, args[1]) | |
495 |
|
495 | |||
496 | try: |
|
496 | try: | |
497 | return obsutil.obsfateverb(successors, markers) |
|
497 | return obsutil.obsfateverb(successors, markers) | |
498 | except TypeError: |
|
498 | except TypeError: | |
499 | # i18n: "obsfateverb" is a keyword |
|
499 | # i18n: "obsfateverb" is a keyword | |
500 | errmsg = _("obsfateverb first argument should be countable") |
|
500 | errmsg = _("obsfateverb first argument should be countable") | |
501 | raise error.ParseError(errmsg) |
|
501 | raise error.ParseError(errmsg) | |
502 |
|
502 | |||
503 | @templatefunc('relpath(path)') |
|
503 | @templatefunc('relpath(path)') | |
504 | def relpath(context, mapping, args): |
|
504 | def relpath(context, mapping, args): | |
505 | """Convert a repository-absolute path into a filesystem path relative to |
|
505 | """Convert a repository-absolute path into a filesystem path relative to | |
506 | the current working directory.""" |
|
506 | the current working directory.""" | |
507 | if len(args) != 1: |
|
507 | if len(args) != 1: | |
508 | # i18n: "relpath" is a keyword |
|
508 | # i18n: "relpath" is a keyword | |
509 | raise error.ParseError(_("relpath expects one argument")) |
|
509 | raise error.ParseError(_("relpath expects one argument")) | |
510 |
|
510 | |||
511 | repo = context.resource(mapping, 'ctx').repo() |
|
511 | repo = context.resource(mapping, 'ctx').repo() | |
512 | path = evalstring(context, mapping, args[0]) |
|
512 | path = evalstring(context, mapping, args[0]) | |
513 | return repo.pathto(path) |
|
513 | return repo.pathto(path) | |
514 |
|
514 | |||
515 | @templatefunc('revset(query[, formatargs...])') |
|
515 | @templatefunc('revset(query[, formatargs...])') | |
516 | def revset(context, mapping, args): |
|
516 | def revset(context, mapping, args): | |
517 | """Execute a revision set query. See |
|
517 | """Execute a revision set query. See | |
518 | :hg:`help revset`.""" |
|
518 | :hg:`help revset`.""" | |
519 | if not len(args) > 0: |
|
519 | if not len(args) > 0: | |
520 | # i18n: "revset" is a keyword |
|
520 | # i18n: "revset" is a keyword | |
521 | raise error.ParseError(_("revset expects one or more arguments")) |
|
521 | raise error.ParseError(_("revset expects one or more arguments")) | |
522 |
|
522 | |||
523 | raw = evalstring(context, mapping, args[0]) |
|
523 | raw = evalstring(context, mapping, args[0]) | |
524 | ctx = context.resource(mapping, 'ctx') |
|
524 | ctx = context.resource(mapping, 'ctx') | |
525 | repo = ctx.repo() |
|
525 | repo = ctx.repo() | |
526 |
|
526 | |||
527 | def query(expr): |
|
527 | def query(expr): | |
528 | m = revsetmod.match(repo.ui, expr, lookup=revsetmod.lookupfn(repo)) |
|
528 | m = revsetmod.match(repo.ui, expr, lookup=revsetmod.lookupfn(repo)) | |
529 | return m(repo) |
|
529 | return m(repo) | |
530 |
|
530 | |||
531 | if len(args) > 1: |
|
531 | if len(args) > 1: | |
532 | formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]] |
|
532 | formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]] | |
533 | revs = query(revsetlang.formatspec(raw, *formatargs)) |
|
533 | revs = query(revsetlang.formatspec(raw, *formatargs)) | |
534 | revs = list(revs) |
|
534 | revs = list(revs) | |
535 | else: |
|
535 | else: | |
536 | cache = context.resource(mapping, 'cache') |
|
536 | cache = context.resource(mapping, 'cache') | |
537 | revsetcache = cache.setdefault("revsetcache", {}) |
|
537 | revsetcache = cache.setdefault("revsetcache", {}) | |
538 | if raw in revsetcache: |
|
538 | if raw in revsetcache: | |
539 | revs = revsetcache[raw] |
|
539 | revs = revsetcache[raw] | |
540 | else: |
|
540 | else: | |
541 | revs = query(raw) |
|
541 | revs = query(raw) | |
542 | revs = list(revs) |
|
542 | revs = list(revs) | |
543 | revsetcache[raw] = revs |
|
543 | revsetcache[raw] = revs | |
544 | return templatekw.showrevslist(context, mapping, "revision", revs) |
|
544 | return templatekw.showrevslist(context, mapping, "revision", revs) | |
545 |
|
545 | |||
546 | @templatefunc('rstdoc(text, style)') |
|
546 | @templatefunc('rstdoc(text, style)') | |
547 | def rstdoc(context, mapping, args): |
|
547 | def rstdoc(context, mapping, args): | |
548 | """Format reStructuredText.""" |
|
548 | """Format reStructuredText.""" | |
549 | if len(args) != 2: |
|
549 | if len(args) != 2: | |
550 | # i18n: "rstdoc" is a keyword |
|
550 | # i18n: "rstdoc" is a keyword | |
551 | raise error.ParseError(_("rstdoc expects two arguments")) |
|
551 | raise error.ParseError(_("rstdoc expects two arguments")) | |
552 |
|
552 | |||
553 | text = evalstring(context, mapping, args[0]) |
|
553 | text = evalstring(context, mapping, args[0]) | |
554 | style = evalstring(context, mapping, args[1]) |
|
554 | style = evalstring(context, mapping, args[1]) | |
555 |
|
555 | |||
556 | return minirst.format(text, style=style, keep=['verbose']) |
|
556 | return minirst.format(text, style=style, keep=['verbose'])[0] | |
557 |
|
557 | |||
558 | @templatefunc('separate(sep, args...)', argspec='sep *args') |
|
558 | @templatefunc('separate(sep, args...)', argspec='sep *args') | |
559 | def separate(context, mapping, args): |
|
559 | def separate(context, mapping, args): | |
560 | """Add a separator between non-empty arguments.""" |
|
560 | """Add a separator between non-empty arguments.""" | |
561 | if 'sep' not in args: |
|
561 | if 'sep' not in args: | |
562 | # i18n: "separate" is a keyword |
|
562 | # i18n: "separate" is a keyword | |
563 | raise error.ParseError(_("separate expects at least one argument")) |
|
563 | raise error.ParseError(_("separate expects at least one argument")) | |
564 |
|
564 | |||
565 | sep = evalstring(context, mapping, args['sep']) |
|
565 | sep = evalstring(context, mapping, args['sep']) | |
566 | first = True |
|
566 | first = True | |
567 | for arg in args['args']: |
|
567 | for arg in args['args']: | |
568 | argstr = evalstring(context, mapping, arg) |
|
568 | argstr = evalstring(context, mapping, arg) | |
569 | if not argstr: |
|
569 | if not argstr: | |
570 | continue |
|
570 | continue | |
571 | if first: |
|
571 | if first: | |
572 | first = False |
|
572 | first = False | |
573 | else: |
|
573 | else: | |
574 | yield sep |
|
574 | yield sep | |
575 | yield argstr |
|
575 | yield argstr | |
576 |
|
576 | |||
577 | @templatefunc('shortest(node, minlength=4)') |
|
577 | @templatefunc('shortest(node, minlength=4)') | |
578 | def shortest(context, mapping, args): |
|
578 | def shortest(context, mapping, args): | |
579 | """Obtain the shortest representation of |
|
579 | """Obtain the shortest representation of | |
580 | a node.""" |
|
580 | a node.""" | |
581 | if not (1 <= len(args) <= 2): |
|
581 | if not (1 <= len(args) <= 2): | |
582 | # i18n: "shortest" is a keyword |
|
582 | # i18n: "shortest" is a keyword | |
583 | raise error.ParseError(_("shortest() expects one or two arguments")) |
|
583 | raise error.ParseError(_("shortest() expects one or two arguments")) | |
584 |
|
584 | |||
585 | hexnode = evalstring(context, mapping, args[0]) |
|
585 | hexnode = evalstring(context, mapping, args[0]) | |
586 |
|
586 | |||
587 | minlength = 4 |
|
587 | minlength = 4 | |
588 | if len(args) > 1: |
|
588 | if len(args) > 1: | |
589 | minlength = evalinteger(context, mapping, args[1], |
|
589 | minlength = evalinteger(context, mapping, args[1], | |
590 | # i18n: "shortest" is a keyword |
|
590 | # i18n: "shortest" is a keyword | |
591 | _("shortest() expects an integer minlength")) |
|
591 | _("shortest() expects an integer minlength")) | |
592 |
|
592 | |||
593 | repo = context.resource(mapping, 'ctx')._repo |
|
593 | repo = context.resource(mapping, 'ctx')._repo | |
594 | if len(hexnode) > 40: |
|
594 | if len(hexnode) > 40: | |
595 | return hexnode |
|
595 | return hexnode | |
596 | elif len(hexnode) == 40: |
|
596 | elif len(hexnode) == 40: | |
597 | try: |
|
597 | try: | |
598 | node = bin(hexnode) |
|
598 | node = bin(hexnode) | |
599 | except TypeError: |
|
599 | except TypeError: | |
600 | return hexnode |
|
600 | return hexnode | |
601 | else: |
|
601 | else: | |
602 | try: |
|
602 | try: | |
603 | node = scmutil.resolvehexnodeidprefix(repo, hexnode) |
|
603 | node = scmutil.resolvehexnodeidprefix(repo, hexnode) | |
604 | except (error.LookupError, error.WdirUnsupported): |
|
604 | except (error.LookupError, error.WdirUnsupported): | |
605 | return hexnode |
|
605 | return hexnode | |
606 | if not node: |
|
606 | if not node: | |
607 | return hexnode |
|
607 | return hexnode | |
608 | return scmutil.shortesthexnodeidprefix(repo, node, minlength) |
|
608 | return scmutil.shortesthexnodeidprefix(repo, node, minlength) | |
609 |
|
609 | |||
610 | @templatefunc('strip(text[, chars])') |
|
610 | @templatefunc('strip(text[, chars])') | |
611 | def strip(context, mapping, args): |
|
611 | def strip(context, mapping, args): | |
612 | """Strip characters from a string. By default, |
|
612 | """Strip characters from a string. By default, | |
613 | strips all leading and trailing whitespace.""" |
|
613 | strips all leading and trailing whitespace.""" | |
614 | if not (1 <= len(args) <= 2): |
|
614 | if not (1 <= len(args) <= 2): | |
615 | # i18n: "strip" is a keyword |
|
615 | # i18n: "strip" is a keyword | |
616 | raise error.ParseError(_("strip expects one or two arguments")) |
|
616 | raise error.ParseError(_("strip expects one or two arguments")) | |
617 |
|
617 | |||
618 | text = evalstring(context, mapping, args[0]) |
|
618 | text = evalstring(context, mapping, args[0]) | |
619 | if len(args) == 2: |
|
619 | if len(args) == 2: | |
620 | chars = evalstring(context, mapping, args[1]) |
|
620 | chars = evalstring(context, mapping, args[1]) | |
621 | return text.strip(chars) |
|
621 | return text.strip(chars) | |
622 | return text.strip() |
|
622 | return text.strip() | |
623 |
|
623 | |||
624 | @templatefunc('sub(pattern, replacement, expression)') |
|
624 | @templatefunc('sub(pattern, replacement, expression)') | |
625 | def sub(context, mapping, args): |
|
625 | def sub(context, mapping, args): | |
626 | """Perform text substitution |
|
626 | """Perform text substitution | |
627 | using regular expressions.""" |
|
627 | using regular expressions.""" | |
628 | if len(args) != 3: |
|
628 | if len(args) != 3: | |
629 | # i18n: "sub" is a keyword |
|
629 | # i18n: "sub" is a keyword | |
630 | raise error.ParseError(_("sub expects three arguments")) |
|
630 | raise error.ParseError(_("sub expects three arguments")) | |
631 |
|
631 | |||
632 | pat = evalstring(context, mapping, args[0]) |
|
632 | pat = evalstring(context, mapping, args[0]) | |
633 | rpl = evalstring(context, mapping, args[1]) |
|
633 | rpl = evalstring(context, mapping, args[1]) | |
634 | src = evalstring(context, mapping, args[2]) |
|
634 | src = evalstring(context, mapping, args[2]) | |
635 | try: |
|
635 | try: | |
636 | patre = re.compile(pat) |
|
636 | patre = re.compile(pat) | |
637 | except re.error: |
|
637 | except re.error: | |
638 | # i18n: "sub" is a keyword |
|
638 | # i18n: "sub" is a keyword | |
639 | raise error.ParseError(_("sub got an invalid pattern: %s") % pat) |
|
639 | raise error.ParseError(_("sub got an invalid pattern: %s") % pat) | |
640 | try: |
|
640 | try: | |
641 | yield patre.sub(rpl, src) |
|
641 | yield patre.sub(rpl, src) | |
642 | except re.error: |
|
642 | except re.error: | |
643 | # i18n: "sub" is a keyword |
|
643 | # i18n: "sub" is a keyword | |
644 | raise error.ParseError(_("sub got an invalid replacement: %s") % rpl) |
|
644 | raise error.ParseError(_("sub got an invalid replacement: %s") % rpl) | |
645 |
|
645 | |||
646 | @templatefunc('startswith(pattern, text)') |
|
646 | @templatefunc('startswith(pattern, text)') | |
647 | def startswith(context, mapping, args): |
|
647 | def startswith(context, mapping, args): | |
648 | """Returns the value from the "text" argument |
|
648 | """Returns the value from the "text" argument | |
649 | if it begins with the content from the "pattern" argument.""" |
|
649 | if it begins with the content from the "pattern" argument.""" | |
650 | if len(args) != 2: |
|
650 | if len(args) != 2: | |
651 | # i18n: "startswith" is a keyword |
|
651 | # i18n: "startswith" is a keyword | |
652 | raise error.ParseError(_("startswith expects two arguments")) |
|
652 | raise error.ParseError(_("startswith expects two arguments")) | |
653 |
|
653 | |||
654 | patn = evalstring(context, mapping, args[0]) |
|
654 | patn = evalstring(context, mapping, args[0]) | |
655 | text = evalstring(context, mapping, args[1]) |
|
655 | text = evalstring(context, mapping, args[1]) | |
656 | if text.startswith(patn): |
|
656 | if text.startswith(patn): | |
657 | return text |
|
657 | return text | |
658 | return '' |
|
658 | return '' | |
659 |
|
659 | |||
660 | @templatefunc('word(number, text[, separator])') |
|
660 | @templatefunc('word(number, text[, separator])') | |
661 | def word(context, mapping, args): |
|
661 | def word(context, mapping, args): | |
662 | """Return the nth word from a string.""" |
|
662 | """Return the nth word from a string.""" | |
663 | if not (2 <= len(args) <= 3): |
|
663 | if not (2 <= len(args) <= 3): | |
664 | # i18n: "word" is a keyword |
|
664 | # i18n: "word" is a keyword | |
665 | raise error.ParseError(_("word expects two or three arguments, got %d") |
|
665 | raise error.ParseError(_("word expects two or three arguments, got %d") | |
666 | % len(args)) |
|
666 | % len(args)) | |
667 |
|
667 | |||
668 | num = evalinteger(context, mapping, args[0], |
|
668 | num = evalinteger(context, mapping, args[0], | |
669 | # i18n: "word" is a keyword |
|
669 | # i18n: "word" is a keyword | |
670 | _("word expects an integer index")) |
|
670 | _("word expects an integer index")) | |
671 | text = evalstring(context, mapping, args[1]) |
|
671 | text = evalstring(context, mapping, args[1]) | |
672 | if len(args) == 3: |
|
672 | if len(args) == 3: | |
673 | splitter = evalstring(context, mapping, args[2]) |
|
673 | splitter = evalstring(context, mapping, args[2]) | |
674 | else: |
|
674 | else: | |
675 | splitter = None |
|
675 | splitter = None | |
676 |
|
676 | |||
677 | tokens = text.split(splitter) |
|
677 | tokens = text.split(splitter) | |
678 | if num >= len(tokens) or num < -len(tokens): |
|
678 | if num >= len(tokens) or num < -len(tokens): | |
679 | return '' |
|
679 | return '' | |
680 | else: |
|
680 | else: | |
681 | return tokens[num] |
|
681 | return tokens[num] | |
682 |
|
682 | |||
683 | def loadfunction(ui, extname, registrarobj): |
|
683 | def loadfunction(ui, extname, registrarobj): | |
684 | """Load template function from specified registrarobj |
|
684 | """Load template function from specified registrarobj | |
685 | """ |
|
685 | """ | |
686 | for name, func in registrarobj._table.iteritems(): |
|
686 | for name, func in registrarobj._table.iteritems(): | |
687 | funcs[name] = func |
|
687 | funcs[name] = func | |
688 |
|
688 | |||
689 | # tell hggettext to extract docstrings from these functions: |
|
689 | # tell hggettext to extract docstrings from these functions: | |
690 | i18nfunctions = funcs.values() |
|
690 | i18nfunctions = funcs.values() |
@@ -1,3610 +1,3610 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 another revision into working directory |
|
17 | merge merge another revision into working directory | |
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 another revision into working directory |
|
38 | merge merge another revision into working directory | |
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 | Extra extensions will be printed in help output in a non-reliable order since |
|
47 | Extra extensions will be printed in help output in a non-reliable order since | |
48 | the extension is unknown. |
|
48 | the extension is unknown. | |
49 | #if no-extraextensions |
|
49 | #if no-extraextensions | |
50 |
|
50 | |||
51 | $ hg help |
|
51 | $ hg help | |
52 | Mercurial Distributed SCM |
|
52 | Mercurial Distributed SCM | |
53 |
|
53 | |||
54 | list of commands: |
|
54 | list of commands: | |
55 |
|
55 | |||
56 | add add the specified files on the next commit |
|
56 | add add the specified files on the next commit | |
57 | addremove add all new files, delete all missing files |
|
57 | addremove add all new files, delete all missing files | |
58 | annotate show changeset information by line for each file |
|
58 | annotate show changeset information by line for each file | |
59 | archive create an unversioned archive of a repository revision |
|
59 | archive create an unversioned archive of a repository revision | |
60 | backout reverse effect of earlier changeset |
|
60 | backout reverse effect of earlier changeset | |
61 | bisect subdivision search of changesets |
|
61 | bisect subdivision search of changesets | |
62 | bookmarks create a new bookmark or list existing bookmarks |
|
62 | bookmarks create a new bookmark or list existing bookmarks | |
63 | branch set or show the current branch name |
|
63 | branch set or show the current branch name | |
64 | branches list repository named branches |
|
64 | branches list repository named branches | |
65 | bundle create a bundle file |
|
65 | bundle create a bundle file | |
66 | cat output the current or given revision of files |
|
66 | cat output the current or given revision of files | |
67 | clone make a copy of an existing repository |
|
67 | clone make a copy of an existing repository | |
68 | commit commit the specified files or all outstanding changes |
|
68 | commit commit the specified files or all outstanding changes | |
69 | config show combined config settings from all hgrc files |
|
69 | config show combined config settings from all hgrc files | |
70 | copy mark files as copied for the next commit |
|
70 | copy mark files as copied for the next commit | |
71 | diff diff repository (or selected files) |
|
71 | diff diff repository (or selected files) | |
72 | export dump the header and diffs for one or more changesets |
|
72 | export dump the header and diffs for one or more changesets | |
73 | files list tracked files |
|
73 | files list tracked files | |
74 | forget forget the specified files on the next commit |
|
74 | forget forget the specified files on the next commit | |
75 | graft copy changes from other branches onto the current branch |
|
75 | graft copy changes from other branches onto the current branch | |
76 | grep search revision history for a pattern in specified files |
|
76 | grep search revision history for a pattern in specified files | |
77 | heads show branch heads |
|
77 | heads show branch heads | |
78 | help show help for a given topic or a help overview |
|
78 | help show help for a given topic or a help overview | |
79 | identify identify the working directory or specified revision |
|
79 | identify identify the working directory or specified revision | |
80 | import import an ordered set of patches |
|
80 | import import an ordered set of patches | |
81 | incoming show new changesets found in source |
|
81 | incoming show new changesets found in source | |
82 | init create a new repository in the given directory |
|
82 | init create a new repository in the given directory | |
83 | log show revision history of entire repository or files |
|
83 | log show revision history of entire repository or files | |
84 | manifest output the current or given revision of the project manifest |
|
84 | manifest output the current or given revision of the project manifest | |
85 | merge merge another revision into working directory |
|
85 | merge merge another revision into working directory | |
86 | outgoing show changesets not found in the destination |
|
86 | outgoing show changesets not found in the destination | |
87 | paths show aliases for remote repositories |
|
87 | paths show aliases for remote repositories | |
88 | phase set or show the current phase name |
|
88 | phase set or show the current phase name | |
89 | pull pull changes from the specified source |
|
89 | pull pull changes from the specified source | |
90 | push push changes to the specified destination |
|
90 | push push changes to the specified destination | |
91 | recover roll back an interrupted transaction |
|
91 | recover roll back an interrupted transaction | |
92 | remove remove the specified files on the next commit |
|
92 | remove remove the specified files on the next commit | |
93 | rename rename files; equivalent of copy + remove |
|
93 | rename rename files; equivalent of copy + remove | |
94 | resolve redo merges or set/view the merge status of files |
|
94 | resolve redo merges or set/view the merge status of files | |
95 | revert restore files to their checkout state |
|
95 | revert restore files to their checkout state | |
96 | root print the root (top) of the current working directory |
|
96 | root print the root (top) of the current working directory | |
97 | serve start stand-alone webserver |
|
97 | serve start stand-alone webserver | |
98 | status show changed files in the working directory |
|
98 | status show changed files in the working directory | |
99 | summary summarize working directory state |
|
99 | summary summarize working directory state | |
100 | tag add one or more tags for the current or given revision |
|
100 | tag add one or more tags for the current or given revision | |
101 | tags list repository tags |
|
101 | tags list repository tags | |
102 | unbundle apply one or more bundle files |
|
102 | unbundle apply one or more bundle files | |
103 | update update working directory (or switch revisions) |
|
103 | update update working directory (or switch revisions) | |
104 | verify verify the integrity of the repository |
|
104 | verify verify the integrity of the repository | |
105 | version output version and copyright information |
|
105 | version output version and copyright information | |
106 |
|
106 | |||
107 | additional help topics: |
|
107 | additional help topics: | |
108 |
|
108 | |||
109 | bundlespec Bundle File Formats |
|
109 | bundlespec Bundle File Formats | |
110 | color Colorizing Outputs |
|
110 | color Colorizing Outputs | |
111 | config Configuration Files |
|
111 | config Configuration Files | |
112 | dates Date Formats |
|
112 | dates Date Formats | |
113 | diffs Diff Formats |
|
113 | diffs Diff Formats | |
114 | environment Environment Variables |
|
114 | environment Environment Variables | |
115 | extensions Using Additional Features |
|
115 | extensions Using Additional Features | |
116 | filesets Specifying File Sets |
|
116 | filesets Specifying File Sets | |
117 | flags Command-line flags |
|
117 | flags Command-line flags | |
118 | glossary Glossary |
|
118 | glossary Glossary | |
119 | hgignore Syntax for Mercurial Ignore Files |
|
119 | hgignore Syntax for Mercurial Ignore Files | |
120 | hgweb Configuring hgweb |
|
120 | hgweb Configuring hgweb | |
121 | internals Technical implementation topics |
|
121 | internals Technical implementation topics | |
122 | merge-tools Merge Tools |
|
122 | merge-tools Merge Tools | |
123 | pager Pager Support |
|
123 | pager Pager Support | |
124 | patterns File Name Patterns |
|
124 | patterns File Name Patterns | |
125 | phases Working with Phases |
|
125 | phases Working with Phases | |
126 | revisions Specifying Revisions |
|
126 | revisions Specifying Revisions | |
127 | scripting Using Mercurial from scripts and automation |
|
127 | scripting Using Mercurial from scripts and automation | |
128 | subrepos Subrepositories |
|
128 | subrepos Subrepositories | |
129 | templating Template Usage |
|
129 | templating Template Usage | |
130 | urls URL Paths |
|
130 | urls URL Paths | |
131 |
|
131 | |||
132 | (use 'hg help -v' to show built-in aliases and global options) |
|
132 | (use 'hg help -v' to show built-in aliases and global options) | |
133 |
|
133 | |||
134 | $ hg -q help |
|
134 | $ hg -q help | |
135 | add add the specified files on the next commit |
|
135 | add add the specified files on the next commit | |
136 | addremove add all new files, delete all missing files |
|
136 | addremove add all new files, delete all missing files | |
137 | annotate show changeset information by line for each file |
|
137 | annotate show changeset information by line for each file | |
138 | archive create an unversioned archive of a repository revision |
|
138 | archive create an unversioned archive of a repository revision | |
139 | backout reverse effect of earlier changeset |
|
139 | backout reverse effect of earlier changeset | |
140 | bisect subdivision search of changesets |
|
140 | bisect subdivision search of changesets | |
141 | bookmarks create a new bookmark or list existing bookmarks |
|
141 | bookmarks create a new bookmark or list existing bookmarks | |
142 | branch set or show the current branch name |
|
142 | branch set or show the current branch name | |
143 | branches list repository named branches |
|
143 | branches list repository named branches | |
144 | bundle create a bundle file |
|
144 | bundle create a bundle file | |
145 | cat output the current or given revision of files |
|
145 | cat output the current or given revision of files | |
146 | clone make a copy of an existing repository |
|
146 | clone make a copy of an existing repository | |
147 | commit commit the specified files or all outstanding changes |
|
147 | commit commit the specified files or all outstanding changes | |
148 | config show combined config settings from all hgrc files |
|
148 | config show combined config settings from all hgrc files | |
149 | copy mark files as copied for the next commit |
|
149 | copy mark files as copied for the next commit | |
150 | diff diff repository (or selected files) |
|
150 | diff diff repository (or selected files) | |
151 | export dump the header and diffs for one or more changesets |
|
151 | export dump the header and diffs for one or more changesets | |
152 | files list tracked files |
|
152 | files list tracked files | |
153 | forget forget the specified files on the next commit |
|
153 | forget forget the specified files on the next commit | |
154 | graft copy changes from other branches onto the current branch |
|
154 | graft copy changes from other branches onto the current branch | |
155 | grep search revision history for a pattern in specified files |
|
155 | grep search revision history for a pattern in specified files | |
156 | heads show branch heads |
|
156 | heads show branch heads | |
157 | help show help for a given topic or a help overview |
|
157 | help show help for a given topic or a help overview | |
158 | identify identify the working directory or specified revision |
|
158 | identify identify the working directory or specified revision | |
159 | import import an ordered set of patches |
|
159 | import import an ordered set of patches | |
160 | incoming show new changesets found in source |
|
160 | incoming show new changesets found in source | |
161 | init create a new repository in the given directory |
|
161 | init create a new repository in the given directory | |
162 | log show revision history of entire repository or files |
|
162 | log show revision history of entire repository or files | |
163 | manifest output the current or given revision of the project manifest |
|
163 | manifest output the current or given revision of the project manifest | |
164 | merge merge another revision into working directory |
|
164 | merge merge another revision into working directory | |
165 | outgoing show changesets not found in the destination |
|
165 | outgoing show changesets not found in the destination | |
166 | paths show aliases for remote repositories |
|
166 | paths show aliases for remote repositories | |
167 | phase set or show the current phase name |
|
167 | phase set or show the current phase name | |
168 | pull pull changes from the specified source |
|
168 | pull pull changes from the specified source | |
169 | push push changes to the specified destination |
|
169 | push push changes to the specified destination | |
170 | recover roll back an interrupted transaction |
|
170 | recover roll back an interrupted transaction | |
171 | remove remove the specified files on the next commit |
|
171 | remove remove the specified files on the next commit | |
172 | rename rename files; equivalent of copy + remove |
|
172 | rename rename files; equivalent of copy + remove | |
173 | resolve redo merges or set/view the merge status of files |
|
173 | resolve redo merges or set/view the merge status of files | |
174 | revert restore files to their checkout state |
|
174 | revert restore files to their checkout state | |
175 | root print the root (top) of the current working directory |
|
175 | root print the root (top) of the current working directory | |
176 | serve start stand-alone webserver |
|
176 | serve start stand-alone webserver | |
177 | status show changed files in the working directory |
|
177 | status show changed files in the working directory | |
178 | summary summarize working directory state |
|
178 | summary summarize working directory state | |
179 | tag add one or more tags for the current or given revision |
|
179 | tag add one or more tags for the current or given revision | |
180 | tags list repository tags |
|
180 | tags list repository tags | |
181 | unbundle apply one or more bundle files |
|
181 | unbundle apply one or more bundle files | |
182 | update update working directory (or switch revisions) |
|
182 | update update working directory (or switch revisions) | |
183 | verify verify the integrity of the repository |
|
183 | verify verify the integrity of the repository | |
184 | version output version and copyright information |
|
184 | version output version and copyright information | |
185 |
|
185 | |||
186 | additional help topics: |
|
186 | additional help topics: | |
187 |
|
187 | |||
188 | bundlespec Bundle File Formats |
|
188 | bundlespec Bundle File Formats | |
189 | color Colorizing Outputs |
|
189 | color Colorizing Outputs | |
190 | config Configuration Files |
|
190 | config Configuration Files | |
191 | dates Date Formats |
|
191 | dates Date Formats | |
192 | diffs Diff Formats |
|
192 | diffs Diff Formats | |
193 | environment Environment Variables |
|
193 | environment Environment Variables | |
194 | extensions Using Additional Features |
|
194 | extensions Using Additional Features | |
195 | filesets Specifying File Sets |
|
195 | filesets Specifying File Sets | |
196 | flags Command-line flags |
|
196 | flags Command-line flags | |
197 | glossary Glossary |
|
197 | glossary Glossary | |
198 | hgignore Syntax for Mercurial Ignore Files |
|
198 | hgignore Syntax for Mercurial Ignore Files | |
199 | hgweb Configuring hgweb |
|
199 | hgweb Configuring hgweb | |
200 | internals Technical implementation topics |
|
200 | internals Technical implementation topics | |
201 | merge-tools Merge Tools |
|
201 | merge-tools Merge Tools | |
202 | pager Pager Support |
|
202 | pager Pager Support | |
203 | patterns File Name Patterns |
|
203 | patterns File Name Patterns | |
204 | phases Working with Phases |
|
204 | phases Working with Phases | |
205 | revisions Specifying Revisions |
|
205 | revisions Specifying Revisions | |
206 | scripting Using Mercurial from scripts and automation |
|
206 | scripting Using Mercurial from scripts and automation | |
207 | subrepos Subrepositories |
|
207 | subrepos Subrepositories | |
208 | templating Template Usage |
|
208 | templating Template Usage | |
209 | urls URL Paths |
|
209 | urls URL Paths | |
210 |
|
210 | |||
211 | Test extension help: |
|
211 | Test extension help: | |
212 | $ hg help extensions --config extensions.rebase= --config extensions.children= |
|
212 | $ hg help extensions --config extensions.rebase= --config extensions.children= | |
213 | Using Additional Features |
|
213 | Using Additional Features | |
214 | """"""""""""""""""""""""" |
|
214 | """"""""""""""""""""""""" | |
215 |
|
215 | |||
216 | Mercurial has the ability to add new features through the use of |
|
216 | Mercurial has the ability to add new features through the use of | |
217 | extensions. Extensions may add new commands, add options to existing |
|
217 | extensions. Extensions may add new commands, add options to existing | |
218 | commands, change the default behavior of commands, or implement hooks. |
|
218 | commands, change the default behavior of commands, or implement hooks. | |
219 |
|
219 | |||
220 | To enable the "foo" extension, either shipped with Mercurial or in the |
|
220 | To enable the "foo" extension, either shipped with Mercurial or in the | |
221 | Python search path, create an entry for it in your configuration file, |
|
221 | Python search path, create an entry for it in your configuration file, | |
222 | like this: |
|
222 | like this: | |
223 |
|
223 | |||
224 | [extensions] |
|
224 | [extensions] | |
225 | foo = |
|
225 | foo = | |
226 |
|
226 | |||
227 | You may also specify the full path to an extension: |
|
227 | You may also specify the full path to an extension: | |
228 |
|
228 | |||
229 | [extensions] |
|
229 | [extensions] | |
230 | myfeature = ~/.hgext/myfeature.py |
|
230 | myfeature = ~/.hgext/myfeature.py | |
231 |
|
231 | |||
232 | See 'hg help config' for more information on configuration files. |
|
232 | See 'hg help config' for more information on configuration files. | |
233 |
|
233 | |||
234 | Extensions are not loaded by default for a variety of reasons: they can |
|
234 | Extensions are not loaded by default for a variety of reasons: they can | |
235 | increase startup overhead; they may be meant for advanced usage only; they |
|
235 | increase startup overhead; they may be meant for advanced usage only; they | |
236 | may provide potentially dangerous abilities (such as letting you destroy |
|
236 | may provide potentially dangerous abilities (such as letting you destroy | |
237 | or modify history); they might not be ready for prime time; or they may |
|
237 | or modify history); they might not be ready for prime time; or they may | |
238 | alter some usual behaviors of stock Mercurial. It is thus up to the user |
|
238 | alter some usual behaviors of stock Mercurial. It is thus up to the user | |
239 | to activate extensions as needed. |
|
239 | to activate extensions as needed. | |
240 |
|
240 | |||
241 | To explicitly disable an extension enabled in a configuration file of |
|
241 | To explicitly disable an extension enabled in a configuration file of | |
242 | broader scope, prepend its path with !: |
|
242 | broader scope, prepend its path with !: | |
243 |
|
243 | |||
244 | [extensions] |
|
244 | [extensions] | |
245 | # disabling extension bar residing in /path/to/extension/bar.py |
|
245 | # disabling extension bar residing in /path/to/extension/bar.py | |
246 | bar = !/path/to/extension/bar.py |
|
246 | bar = !/path/to/extension/bar.py | |
247 | # ditto, but no path was supplied for extension baz |
|
247 | # ditto, but no path was supplied for extension baz | |
248 | baz = ! |
|
248 | baz = ! | |
249 |
|
249 | |||
250 | enabled extensions: |
|
250 | enabled extensions: | |
251 |
|
251 | |||
252 | children command to display child changesets (DEPRECATED) |
|
252 | children command to display child changesets (DEPRECATED) | |
253 | rebase command to move sets of revisions to a different ancestor |
|
253 | rebase command to move sets of revisions to a different ancestor | |
254 |
|
254 | |||
255 | disabled extensions: |
|
255 | disabled extensions: | |
256 |
|
256 | |||
257 | acl hooks for controlling repository access |
|
257 | acl hooks for controlling repository access | |
258 | blackbox log repository events to a blackbox for debugging |
|
258 | blackbox log repository events to a blackbox for debugging | |
259 | bugzilla hooks for integrating with the Bugzilla bug tracker |
|
259 | bugzilla hooks for integrating with the Bugzilla bug tracker | |
260 | censor erase file content at a given revision |
|
260 | censor erase file content at a given revision | |
261 | churn command to display statistics about repository history |
|
261 | churn command to display statistics about repository history | |
262 | clonebundles advertise pre-generated bundles to seed clones |
|
262 | clonebundles advertise pre-generated bundles to seed clones | |
263 | convert import revisions from foreign VCS repositories into |
|
263 | convert import revisions from foreign VCS repositories into | |
264 | Mercurial |
|
264 | Mercurial | |
265 | eol automatically manage newlines in repository files |
|
265 | eol automatically manage newlines in repository files | |
266 | extdiff command to allow external programs to compare revisions |
|
266 | extdiff command to allow external programs to compare revisions | |
267 | factotum http authentication with factotum |
|
267 | factotum http authentication with factotum | |
268 | githelp try mapping git commands to Mercurial commands |
|
268 | githelp try mapping git commands to Mercurial commands | |
269 | gpg commands to sign and verify changesets |
|
269 | gpg commands to sign and verify changesets | |
270 | hgk browse the repository in a graphical way |
|
270 | hgk browse the repository in a graphical way | |
271 | highlight syntax highlighting for hgweb (requires Pygments) |
|
271 | highlight syntax highlighting for hgweb (requires Pygments) | |
272 | histedit interactive history editing |
|
272 | histedit interactive history editing | |
273 | keyword expand keywords in tracked files |
|
273 | keyword expand keywords in tracked files | |
274 | largefiles track large binary files |
|
274 | largefiles track large binary files | |
275 | mq manage a stack of patches |
|
275 | mq manage a stack of patches | |
276 | notify hooks for sending email push notifications |
|
276 | notify hooks for sending email push notifications | |
277 | patchbomb command to send changesets as (a series of) patch emails |
|
277 | patchbomb command to send changesets as (a series of) patch emails | |
278 | purge command to delete untracked files from the working |
|
278 | purge command to delete untracked files from the working | |
279 | directory |
|
279 | directory | |
280 | relink recreates hardlinks between repository clones |
|
280 | relink recreates hardlinks between repository clones | |
281 | schemes extend schemes with shortcuts to repository swarms |
|
281 | schemes extend schemes with shortcuts to repository swarms | |
282 | share share a common history between several working directories |
|
282 | share share a common history between several working directories | |
283 | shelve save and restore changes to the working directory |
|
283 | shelve save and restore changes to the working directory | |
284 | strip strip changesets and their descendants from history |
|
284 | strip strip changesets and their descendants from history | |
285 | transplant command to transplant changesets from another branch |
|
285 | transplant command to transplant changesets from another branch | |
286 | win32mbcs allow the use of MBCS paths with problematic encodings |
|
286 | win32mbcs allow the use of MBCS paths with problematic encodings | |
287 | zeroconf discover and advertise repositories on the local network |
|
287 | zeroconf discover and advertise repositories on the local network | |
288 |
|
288 | |||
289 | #endif |
|
289 | #endif | |
290 |
|
290 | |||
291 | Verify that deprecated extensions are included if --verbose: |
|
291 | Verify that deprecated extensions are included if --verbose: | |
292 |
|
292 | |||
293 | $ hg -v help extensions | grep children |
|
293 | $ hg -v help extensions | grep children | |
294 | children command to display child changesets (DEPRECATED) |
|
294 | children command to display child changesets (DEPRECATED) | |
295 |
|
295 | |||
296 | Verify that extension keywords appear in help templates |
|
296 | Verify that extension keywords appear in help templates | |
297 |
|
297 | |||
298 | $ hg help --config extensions.transplant= templating|grep transplant > /dev/null |
|
298 | $ hg help --config extensions.transplant= templating|grep transplant > /dev/null | |
299 |
|
299 | |||
300 | Test short command list with verbose option |
|
300 | Test short command list with verbose option | |
301 |
|
301 | |||
302 | $ hg -v help shortlist |
|
302 | $ hg -v help shortlist | |
303 | Mercurial Distributed SCM |
|
303 | Mercurial Distributed SCM | |
304 |
|
304 | |||
305 | basic commands: |
|
305 | basic commands: | |
306 |
|
306 | |||
307 | add add the specified files on the next commit |
|
307 | add add the specified files on the next commit | |
308 | annotate, blame |
|
308 | annotate, blame | |
309 | show changeset information by line for each file |
|
309 | show changeset information by line for each file | |
310 | clone make a copy of an existing repository |
|
310 | clone make a copy of an existing repository | |
311 | commit, ci commit the specified files or all outstanding changes |
|
311 | commit, ci commit the specified files or all outstanding changes | |
312 | diff diff repository (or selected files) |
|
312 | diff diff repository (or selected files) | |
313 | export dump the header and diffs for one or more changesets |
|
313 | export dump the header and diffs for one or more changesets | |
314 | forget forget the specified files on the next commit |
|
314 | forget forget the specified files on the next commit | |
315 | init create a new repository in the given directory |
|
315 | init create a new repository in the given directory | |
316 | log, history show revision history of entire repository or files |
|
316 | log, history show revision history of entire repository or files | |
317 | merge merge another revision into working directory |
|
317 | merge merge another revision into working directory | |
318 | pull pull changes from the specified source |
|
318 | pull pull changes from the specified source | |
319 | push push changes to the specified destination |
|
319 | push push changes to the specified destination | |
320 | remove, rm remove the specified files on the next commit |
|
320 | remove, rm remove the specified files on the next commit | |
321 | serve start stand-alone webserver |
|
321 | serve start stand-alone webserver | |
322 | status, st show changed files in the working directory |
|
322 | status, st show changed files in the working directory | |
323 | summary, sum summarize working directory state |
|
323 | summary, sum summarize working directory state | |
324 | update, up, checkout, co |
|
324 | update, up, checkout, co | |
325 | update working directory (or switch revisions) |
|
325 | update working directory (or switch revisions) | |
326 |
|
326 | |||
327 | global options ([+] can be repeated): |
|
327 | global options ([+] can be repeated): | |
328 |
|
328 | |||
329 | -R --repository REPO repository root directory or name of overlay bundle |
|
329 | -R --repository REPO repository root directory or name of overlay bundle | |
330 | file |
|
330 | file | |
331 | --cwd DIR change working directory |
|
331 | --cwd DIR change working directory | |
332 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
332 | -y --noninteractive do not prompt, automatically pick the first choice for | |
333 | all prompts |
|
333 | all prompts | |
334 | -q --quiet suppress output |
|
334 | -q --quiet suppress output | |
335 | -v --verbose enable additional output |
|
335 | -v --verbose enable additional output | |
336 | --color TYPE when to colorize (boolean, always, auto, never, or |
|
336 | --color TYPE when to colorize (boolean, always, auto, never, or | |
337 | debug) |
|
337 | debug) | |
338 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
338 | --config CONFIG [+] set/override config option (use 'section.name=value') | |
339 | --debug enable debugging output |
|
339 | --debug enable debugging output | |
340 | --debugger start debugger |
|
340 | --debugger start debugger | |
341 | --encoding ENCODE set the charset encoding (default: ascii) |
|
341 | --encoding ENCODE set the charset encoding (default: ascii) | |
342 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
342 | --encodingmode MODE set the charset encoding mode (default: strict) | |
343 | --traceback always print a traceback on exception |
|
343 | --traceback always print a traceback on exception | |
344 | --time time how long the command takes |
|
344 | --time time how long the command takes | |
345 | --profile print command execution profile |
|
345 | --profile print command execution profile | |
346 | --version output version information and exit |
|
346 | --version output version information and exit | |
347 | -h --help display help and exit |
|
347 | -h --help display help and exit | |
348 | --hidden consider hidden changesets |
|
348 | --hidden consider hidden changesets | |
349 | --pager TYPE when to paginate (boolean, always, auto, or never) |
|
349 | --pager TYPE when to paginate (boolean, always, auto, or never) | |
350 | (default: auto) |
|
350 | (default: auto) | |
351 |
|
351 | |||
352 | (use 'hg help' for the full list of commands) |
|
352 | (use 'hg help' for the full list of commands) | |
353 |
|
353 | |||
354 | $ hg add -h |
|
354 | $ hg add -h | |
355 | hg add [OPTION]... [FILE]... |
|
355 | hg add [OPTION]... [FILE]... | |
356 |
|
356 | |||
357 | add the specified files on the next commit |
|
357 | add the specified files on the next commit | |
358 |
|
358 | |||
359 | Schedule files to be version controlled and added to the repository. |
|
359 | Schedule files to be version controlled and added to the repository. | |
360 |
|
360 | |||
361 | The files will be added to the repository at the next commit. To undo an |
|
361 | The files will be added to the repository at the next commit. To undo an | |
362 | add before that, see 'hg forget'. |
|
362 | add before that, see 'hg forget'. | |
363 |
|
363 | |||
364 | If no names are given, add all files to the repository (except files |
|
364 | If no names are given, add all files to the repository (except files | |
365 | matching ".hgignore"). |
|
365 | matching ".hgignore"). | |
366 |
|
366 | |||
367 | Returns 0 if all files are successfully added. |
|
367 | Returns 0 if all files are successfully added. | |
368 |
|
368 | |||
369 | options ([+] can be repeated): |
|
369 | options ([+] can be repeated): | |
370 |
|
370 | |||
371 | -I --include PATTERN [+] include names matching the given patterns |
|
371 | -I --include PATTERN [+] include names matching the given patterns | |
372 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
372 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
373 | -S --subrepos recurse into subrepositories |
|
373 | -S --subrepos recurse into subrepositories | |
374 | -n --dry-run do not perform actions, just print output |
|
374 | -n --dry-run do not perform actions, just print output | |
375 |
|
375 | |||
376 | (some details hidden, use --verbose to show complete help) |
|
376 | (some details hidden, use --verbose to show complete help) | |
377 |
|
377 | |||
378 | Verbose help for add |
|
378 | Verbose help for add | |
379 |
|
379 | |||
380 | $ hg add -hv |
|
380 | $ hg add -hv | |
381 | hg add [OPTION]... [FILE]... |
|
381 | hg add [OPTION]... [FILE]... | |
382 |
|
382 | |||
383 | add the specified files on the next commit |
|
383 | add the specified files on the next commit | |
384 |
|
384 | |||
385 | Schedule files to be version controlled and added to the repository. |
|
385 | Schedule files to be version controlled and added to the repository. | |
386 |
|
386 | |||
387 | The files will be added to the repository at the next commit. To undo an |
|
387 | The files will be added to the repository at the next commit. To undo an | |
388 | add before that, see 'hg forget'. |
|
388 | add before that, see 'hg forget'. | |
389 |
|
389 | |||
390 | If no names are given, add all files to the repository (except files |
|
390 | If no names are given, add all files to the repository (except files | |
391 | matching ".hgignore"). |
|
391 | matching ".hgignore"). | |
392 |
|
392 | |||
393 | Examples: |
|
393 | Examples: | |
394 |
|
394 | |||
395 | - New (unknown) files are added automatically by 'hg add': |
|
395 | - New (unknown) files are added automatically by 'hg add': | |
396 |
|
396 | |||
397 | $ ls |
|
397 | $ ls | |
398 | foo.c |
|
398 | foo.c | |
399 | $ hg status |
|
399 | $ hg status | |
400 | ? foo.c |
|
400 | ? foo.c | |
401 | $ hg add |
|
401 | $ hg add | |
402 | adding foo.c |
|
402 | adding foo.c | |
403 | $ hg status |
|
403 | $ hg status | |
404 | A foo.c |
|
404 | A foo.c | |
405 |
|
405 | |||
406 | - Specific files to be added can be specified: |
|
406 | - Specific files to be added can be specified: | |
407 |
|
407 | |||
408 | $ ls |
|
408 | $ ls | |
409 | bar.c foo.c |
|
409 | bar.c foo.c | |
410 | $ hg status |
|
410 | $ hg status | |
411 | ? bar.c |
|
411 | ? bar.c | |
412 | ? foo.c |
|
412 | ? foo.c | |
413 | $ hg add bar.c |
|
413 | $ hg add bar.c | |
414 | $ hg status |
|
414 | $ hg status | |
415 | A bar.c |
|
415 | A bar.c | |
416 | ? foo.c |
|
416 | ? foo.c | |
417 |
|
417 | |||
418 | Returns 0 if all files are successfully added. |
|
418 | Returns 0 if all files are successfully added. | |
419 |
|
419 | |||
420 | options ([+] can be repeated): |
|
420 | options ([+] can be repeated): | |
421 |
|
421 | |||
422 | -I --include PATTERN [+] include names matching the given patterns |
|
422 | -I --include PATTERN [+] include names matching the given patterns | |
423 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
423 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
424 | -S --subrepos recurse into subrepositories |
|
424 | -S --subrepos recurse into subrepositories | |
425 | -n --dry-run do not perform actions, just print output |
|
425 | -n --dry-run do not perform actions, just print output | |
426 |
|
426 | |||
427 | global options ([+] can be repeated): |
|
427 | global options ([+] can be repeated): | |
428 |
|
428 | |||
429 | -R --repository REPO repository root directory or name of overlay bundle |
|
429 | -R --repository REPO repository root directory or name of overlay bundle | |
430 | file |
|
430 | file | |
431 | --cwd DIR change working directory |
|
431 | --cwd DIR change working directory | |
432 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
432 | -y --noninteractive do not prompt, automatically pick the first choice for | |
433 | all prompts |
|
433 | all prompts | |
434 | -q --quiet suppress output |
|
434 | -q --quiet suppress output | |
435 | -v --verbose enable additional output |
|
435 | -v --verbose enable additional output | |
436 | --color TYPE when to colorize (boolean, always, auto, never, or |
|
436 | --color TYPE when to colorize (boolean, always, auto, never, or | |
437 | debug) |
|
437 | debug) | |
438 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
438 | --config CONFIG [+] set/override config option (use 'section.name=value') | |
439 | --debug enable debugging output |
|
439 | --debug enable debugging output | |
440 | --debugger start debugger |
|
440 | --debugger start debugger | |
441 | --encoding ENCODE set the charset encoding (default: ascii) |
|
441 | --encoding ENCODE set the charset encoding (default: ascii) | |
442 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
442 | --encodingmode MODE set the charset encoding mode (default: strict) | |
443 | --traceback always print a traceback on exception |
|
443 | --traceback always print a traceback on exception | |
444 | --time time how long the command takes |
|
444 | --time time how long the command takes | |
445 | --profile print command execution profile |
|
445 | --profile print command execution profile | |
446 | --version output version information and exit |
|
446 | --version output version information and exit | |
447 | -h --help display help and exit |
|
447 | -h --help display help and exit | |
448 | --hidden consider hidden changesets |
|
448 | --hidden consider hidden changesets | |
449 | --pager TYPE when to paginate (boolean, always, auto, or never) |
|
449 | --pager TYPE when to paginate (boolean, always, auto, or never) | |
450 | (default: auto) |
|
450 | (default: auto) | |
451 |
|
451 | |||
452 | Test the textwidth config option |
|
452 | Test the textwidth config option | |
453 |
|
453 | |||
454 | $ hg root -h --config ui.textwidth=50 |
|
454 | $ hg root -h --config ui.textwidth=50 | |
455 | hg root |
|
455 | hg root | |
456 |
|
456 | |||
457 | print the root (top) of the current working |
|
457 | print the root (top) of the current working | |
458 | directory |
|
458 | directory | |
459 |
|
459 | |||
460 | Print the root directory of the current |
|
460 | Print the root directory of the current | |
461 | repository. |
|
461 | repository. | |
462 |
|
462 | |||
463 | Returns 0 on success. |
|
463 | Returns 0 on success. | |
464 |
|
464 | |||
465 | (some details hidden, use --verbose to show |
|
465 | (some details hidden, use --verbose to show | |
466 | complete help) |
|
466 | complete help) | |
467 |
|
467 | |||
468 | Test help option with version option |
|
468 | Test help option with version option | |
469 |
|
469 | |||
470 | $ hg add -h --version |
|
470 | $ hg add -h --version | |
471 | Mercurial Distributed SCM (version *) (glob) |
|
471 | Mercurial Distributed SCM (version *) (glob) | |
472 | (see https://mercurial-scm.org for more information) |
|
472 | (see https://mercurial-scm.org for more information) | |
473 |
|
473 | |||
474 | Copyright (C) 2005-* Matt Mackall and others (glob) |
|
474 | Copyright (C) 2005-* Matt Mackall and others (glob) | |
475 | This is free software; see the source for copying conditions. There is NO |
|
475 | This is free software; see the source for copying conditions. There is NO | |
476 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
476 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
477 |
|
477 | |||
478 | $ hg add --skjdfks |
|
478 | $ hg add --skjdfks | |
479 | hg add: option --skjdfks not recognized |
|
479 | hg add: option --skjdfks not recognized | |
480 | hg add [OPTION]... [FILE]... |
|
480 | hg add [OPTION]... [FILE]... | |
481 |
|
481 | |||
482 | add the specified files on the next commit |
|
482 | add the specified files on the next commit | |
483 |
|
483 | |||
484 | options ([+] can be repeated): |
|
484 | options ([+] can be repeated): | |
485 |
|
485 | |||
486 | -I --include PATTERN [+] include names matching the given patterns |
|
486 | -I --include PATTERN [+] include names matching the given patterns | |
487 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
487 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
488 | -S --subrepos recurse into subrepositories |
|
488 | -S --subrepos recurse into subrepositories | |
489 | -n --dry-run do not perform actions, just print output |
|
489 | -n --dry-run do not perform actions, just print output | |
490 |
|
490 | |||
491 | (use 'hg add -h' to show more help) |
|
491 | (use 'hg add -h' to show more help) | |
492 | [255] |
|
492 | [255] | |
493 |
|
493 | |||
494 | Test ambiguous command help |
|
494 | Test ambiguous command help | |
495 |
|
495 | |||
496 | $ hg help ad |
|
496 | $ hg help ad | |
497 | list of commands: |
|
497 | list of commands: | |
498 |
|
498 | |||
499 | add add the specified files on the next commit |
|
499 | add add the specified files on the next commit | |
500 | addremove add all new files, delete all missing files |
|
500 | addremove add all new files, delete all missing files | |
501 |
|
501 | |||
502 | (use 'hg help -v ad' to show built-in aliases and global options) |
|
502 | (use 'hg help -v ad' to show built-in aliases and global options) | |
503 |
|
503 | |||
504 | Test command without options |
|
504 | Test command without options | |
505 |
|
505 | |||
506 | $ hg help verify |
|
506 | $ hg help verify | |
507 | hg verify |
|
507 | hg verify | |
508 |
|
508 | |||
509 | verify the integrity of the repository |
|
509 | verify the integrity of the repository | |
510 |
|
510 | |||
511 | Verify the integrity of the current repository. |
|
511 | Verify the integrity of the current repository. | |
512 |
|
512 | |||
513 | This will perform an extensive check of the repository's integrity, |
|
513 | This will perform an extensive check of the repository's integrity, | |
514 | validating the hashes and checksums of each entry in the changelog, |
|
514 | validating the hashes and checksums of each entry in the changelog, | |
515 | manifest, and tracked files, as well as the integrity of their crosslinks |
|
515 | manifest, and tracked files, as well as the integrity of their crosslinks | |
516 | and indices. |
|
516 | and indices. | |
517 |
|
517 | |||
518 | Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more |
|
518 | Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more | |
519 | information about recovery from corruption of the repository. |
|
519 | information about recovery from corruption of the repository. | |
520 |
|
520 | |||
521 | Returns 0 on success, 1 if errors are encountered. |
|
521 | Returns 0 on success, 1 if errors are encountered. | |
522 |
|
522 | |||
523 | (some details hidden, use --verbose to show complete help) |
|
523 | (some details hidden, use --verbose to show complete help) | |
524 |
|
524 | |||
525 | $ hg help diff |
|
525 | $ hg help diff | |
526 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... |
|
526 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... | |
527 |
|
527 | |||
528 | diff repository (or selected files) |
|
528 | diff repository (or selected files) | |
529 |
|
529 | |||
530 | Show differences between revisions for the specified files. |
|
530 | Show differences between revisions for the specified files. | |
531 |
|
531 | |||
532 | Differences between files are shown using the unified diff format. |
|
532 | Differences between files are shown using the unified diff format. | |
533 |
|
533 | |||
534 | Note: |
|
534 | Note: | |
535 | 'hg diff' may generate unexpected results for merges, as it will |
|
535 | 'hg diff' may generate unexpected results for merges, as it will | |
536 | default to comparing against the working directory's first parent |
|
536 | default to comparing against the working directory's first parent | |
537 | changeset if no revisions are specified. |
|
537 | changeset if no revisions are specified. | |
538 |
|
538 | |||
539 | When two revision arguments are given, then changes are shown between |
|
539 | When two revision arguments are given, then changes are shown between | |
540 | those revisions. If only one revision is specified then that revision is |
|
540 | those revisions. If only one revision is specified then that revision is | |
541 | compared to the working directory, and, when no revisions are specified, |
|
541 | compared to the working directory, and, when no revisions are specified, | |
542 | the working directory files are compared to its first parent. |
|
542 | the working directory files are compared to its first parent. | |
543 |
|
543 | |||
544 | Alternatively you can specify -c/--change with a revision to see the |
|
544 | Alternatively you can specify -c/--change with a revision to see the | |
545 | changes in that changeset relative to its first parent. |
|
545 | changes in that changeset relative to its first parent. | |
546 |
|
546 | |||
547 | Without the -a/--text option, diff will avoid generating diffs of files it |
|
547 | Without the -a/--text option, diff will avoid generating diffs of files it | |
548 | detects as binary. With -a, diff will generate a diff anyway, probably |
|
548 | detects as binary. With -a, diff will generate a diff anyway, probably | |
549 | with undesirable results. |
|
549 | with undesirable results. | |
550 |
|
550 | |||
551 | Use the -g/--git option to generate diffs in the git extended diff format. |
|
551 | Use the -g/--git option to generate diffs in the git extended diff format. | |
552 | For more information, read 'hg help diffs'. |
|
552 | For more information, read 'hg help diffs'. | |
553 |
|
553 | |||
554 | Returns 0 on success. |
|
554 | Returns 0 on success. | |
555 |
|
555 | |||
556 | options ([+] can be repeated): |
|
556 | options ([+] can be repeated): | |
557 |
|
557 | |||
558 | -r --rev REV [+] revision |
|
558 | -r --rev REV [+] revision | |
559 | -c --change REV change made by revision |
|
559 | -c --change REV change made by revision | |
560 | -a --text treat all files as text |
|
560 | -a --text treat all files as text | |
561 | -g --git use git extended diff format |
|
561 | -g --git use git extended diff format | |
562 | --binary generate binary diffs in git mode (default) |
|
562 | --binary generate binary diffs in git mode (default) | |
563 | --nodates omit dates from diff headers |
|
563 | --nodates omit dates from diff headers | |
564 | --noprefix omit a/ and b/ prefixes from filenames |
|
564 | --noprefix omit a/ and b/ prefixes from filenames | |
565 | -p --show-function show which function each change is in |
|
565 | -p --show-function show which function each change is in | |
566 | --reverse produce a diff that undoes the changes |
|
566 | --reverse produce a diff that undoes the changes | |
567 | -w --ignore-all-space ignore white space when comparing lines |
|
567 | -w --ignore-all-space ignore white space when comparing lines | |
568 | -b --ignore-space-change ignore changes in the amount of white space |
|
568 | -b --ignore-space-change ignore changes in the amount of white space | |
569 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
569 | -B --ignore-blank-lines ignore changes whose lines are all blank | |
570 | -Z --ignore-space-at-eol ignore changes in whitespace at EOL |
|
570 | -Z --ignore-space-at-eol ignore changes in whitespace at EOL | |
571 | -U --unified NUM number of lines of context to show |
|
571 | -U --unified NUM number of lines of context to show | |
572 | --stat output diffstat-style summary of changes |
|
572 | --stat output diffstat-style summary of changes | |
573 | --root DIR produce diffs relative to subdirectory |
|
573 | --root DIR produce diffs relative to subdirectory | |
574 | -I --include PATTERN [+] include names matching the given patterns |
|
574 | -I --include PATTERN [+] include names matching the given patterns | |
575 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
575 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
576 | -S --subrepos recurse into subrepositories |
|
576 | -S --subrepos recurse into subrepositories | |
577 |
|
577 | |||
578 | (some details hidden, use --verbose to show complete help) |
|
578 | (some details hidden, use --verbose to show complete help) | |
579 |
|
579 | |||
580 | $ hg help status |
|
580 | $ hg help status | |
581 | hg status [OPTION]... [FILE]... |
|
581 | hg status [OPTION]... [FILE]... | |
582 |
|
582 | |||
583 | aliases: st |
|
583 | aliases: st | |
584 |
|
584 | |||
585 | show changed files in the working directory |
|
585 | show changed files in the working directory | |
586 |
|
586 | |||
587 | Show status of files in the repository. If names are given, only files |
|
587 | Show status of files in the repository. If names are given, only files | |
588 | that match are shown. Files that are clean or ignored or the source of a |
|
588 | that match are shown. Files that are clean or ignored or the source of a | |
589 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, |
|
589 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, | |
590 | -C/--copies or -A/--all are given. Unless options described with "show |
|
590 | -C/--copies or -A/--all are given. Unless options described with "show | |
591 | only ..." are given, the options -mardu are used. |
|
591 | only ..." are given, the options -mardu are used. | |
592 |
|
592 | |||
593 | Option -q/--quiet hides untracked (unknown and ignored) files unless |
|
593 | Option -q/--quiet hides untracked (unknown and ignored) files unless | |
594 | explicitly requested with -u/--unknown or -i/--ignored. |
|
594 | explicitly requested with -u/--unknown or -i/--ignored. | |
595 |
|
595 | |||
596 | Note: |
|
596 | Note: | |
597 | 'hg status' may appear to disagree with diff if permissions have |
|
597 | 'hg status' may appear to disagree with diff if permissions have | |
598 | changed or a merge has occurred. The standard diff format does not |
|
598 | changed or a merge has occurred. The standard diff format does not | |
599 | report permission changes and diff only reports changes relative to one |
|
599 | report permission changes and diff only reports changes relative to one | |
600 | merge parent. |
|
600 | merge parent. | |
601 |
|
601 | |||
602 | If one revision is given, it is used as the base revision. If two |
|
602 | If one revision is given, it is used as the base revision. If two | |
603 | revisions are given, the differences between them are shown. The --change |
|
603 | revisions are given, the differences between them are shown. The --change | |
604 | option can also be used as a shortcut to list the changed files of a |
|
604 | option can also be used as a shortcut to list the changed files of a | |
605 | revision from its first parent. |
|
605 | revision from its first parent. | |
606 |
|
606 | |||
607 | The codes used to show the status of files are: |
|
607 | The codes used to show the status of files are: | |
608 |
|
608 | |||
609 | M = modified |
|
609 | M = modified | |
610 | A = added |
|
610 | A = added | |
611 | R = removed |
|
611 | R = removed | |
612 | C = clean |
|
612 | C = clean | |
613 | ! = missing (deleted by non-hg command, but still tracked) |
|
613 | ! = missing (deleted by non-hg command, but still tracked) | |
614 | ? = not tracked |
|
614 | ? = not tracked | |
615 | I = ignored |
|
615 | I = ignored | |
616 | = origin of the previous file (with --copies) |
|
616 | = origin of the previous file (with --copies) | |
617 |
|
617 | |||
618 | Returns 0 on success. |
|
618 | Returns 0 on success. | |
619 |
|
619 | |||
620 | options ([+] can be repeated): |
|
620 | options ([+] can be repeated): | |
621 |
|
621 | |||
622 | -A --all show status of all files |
|
622 | -A --all show status of all files | |
623 | -m --modified show only modified files |
|
623 | -m --modified show only modified files | |
624 | -a --added show only added files |
|
624 | -a --added show only added files | |
625 | -r --removed show only removed files |
|
625 | -r --removed show only removed files | |
626 | -d --deleted show only deleted (but tracked) files |
|
626 | -d --deleted show only deleted (but tracked) files | |
627 | -c --clean show only files without changes |
|
627 | -c --clean show only files without changes | |
628 | -u --unknown show only unknown (not tracked) files |
|
628 | -u --unknown show only unknown (not tracked) files | |
629 | -i --ignored show only ignored files |
|
629 | -i --ignored show only ignored files | |
630 | -n --no-status hide status prefix |
|
630 | -n --no-status hide status prefix | |
631 | -C --copies show source of copied files |
|
631 | -C --copies show source of copied files | |
632 | -0 --print0 end filenames with NUL, for use with xargs |
|
632 | -0 --print0 end filenames with NUL, for use with xargs | |
633 | --rev REV [+] show difference from revision |
|
633 | --rev REV [+] show difference from revision | |
634 | --change REV list the changed files of a revision |
|
634 | --change REV list the changed files of a revision | |
635 | -I --include PATTERN [+] include names matching the given patterns |
|
635 | -I --include PATTERN [+] include names matching the given patterns | |
636 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
636 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
637 | -S --subrepos recurse into subrepositories |
|
637 | -S --subrepos recurse into subrepositories | |
638 |
|
638 | |||
639 | (some details hidden, use --verbose to show complete help) |
|
639 | (some details hidden, use --verbose to show complete help) | |
640 |
|
640 | |||
641 | $ hg -q help status |
|
641 | $ hg -q help status | |
642 | hg status [OPTION]... [FILE]... |
|
642 | hg status [OPTION]... [FILE]... | |
643 |
|
643 | |||
644 | show changed files in the working directory |
|
644 | show changed files in the working directory | |
645 |
|
645 | |||
646 | $ hg help foo |
|
646 | $ hg help foo | |
647 | abort: no such help topic: foo |
|
647 | abort: no such help topic: foo | |
648 | (try 'hg help --keyword foo') |
|
648 | (try 'hg help --keyword foo') | |
649 | [255] |
|
649 | [255] | |
650 |
|
650 | |||
651 | $ hg skjdfks |
|
651 | $ hg skjdfks | |
652 | hg: unknown command 'skjdfks' |
|
652 | hg: unknown command 'skjdfks' | |
653 | Mercurial Distributed SCM |
|
653 | Mercurial Distributed SCM | |
654 |
|
654 | |||
655 | basic commands: |
|
655 | basic commands: | |
656 |
|
656 | |||
657 | add add the specified files on the next commit |
|
657 | add add the specified files on the next commit | |
658 | annotate show changeset information by line for each file |
|
658 | annotate show changeset information by line for each file | |
659 | clone make a copy of an existing repository |
|
659 | clone make a copy of an existing repository | |
660 | commit commit the specified files or all outstanding changes |
|
660 | commit commit the specified files or all outstanding changes | |
661 | diff diff repository (or selected files) |
|
661 | diff diff repository (or selected files) | |
662 | export dump the header and diffs for one or more changesets |
|
662 | export dump the header and diffs for one or more changesets | |
663 | forget forget the specified files on the next commit |
|
663 | forget forget the specified files on the next commit | |
664 | init create a new repository in the given directory |
|
664 | init create a new repository in the given directory | |
665 | log show revision history of entire repository or files |
|
665 | log show revision history of entire repository or files | |
666 | merge merge another revision into working directory |
|
666 | merge merge another revision into working directory | |
667 | pull pull changes from the specified source |
|
667 | pull pull changes from the specified source | |
668 | push push changes to the specified destination |
|
668 | push push changes to the specified destination | |
669 | remove remove the specified files on the next commit |
|
669 | remove remove the specified files on the next commit | |
670 | serve start stand-alone webserver |
|
670 | serve start stand-alone webserver | |
671 | status show changed files in the working directory |
|
671 | status show changed files in the working directory | |
672 | summary summarize working directory state |
|
672 | summary summarize working directory state | |
673 | update update working directory (or switch revisions) |
|
673 | update update working directory (or switch revisions) | |
674 |
|
674 | |||
675 | (use 'hg help' for the full list of commands or 'hg -v' for details) |
|
675 | (use 'hg help' for the full list of commands or 'hg -v' for details) | |
676 | [255] |
|
676 | [255] | |
677 |
|
677 | |||
678 | Typoed command gives suggestion |
|
678 | Typoed command gives suggestion | |
679 | $ hg puls |
|
679 | $ hg puls | |
680 | hg: unknown command 'puls' |
|
680 | hg: unknown command 'puls' | |
681 | (did you mean one of pull, push?) |
|
681 | (did you mean one of pull, push?) | |
682 | [255] |
|
682 | [255] | |
683 |
|
683 | |||
684 | Not enabled extension gets suggested |
|
684 | Not enabled extension gets suggested | |
685 |
|
685 | |||
686 | $ hg rebase |
|
686 | $ hg rebase | |
687 | hg: unknown command 'rebase' |
|
687 | hg: unknown command 'rebase' | |
688 | 'rebase' is provided by the following extension: |
|
688 | 'rebase' is provided by the following extension: | |
689 |
|
689 | |||
690 | rebase command to move sets of revisions to a different ancestor |
|
690 | rebase command to move sets of revisions to a different ancestor | |
691 |
|
691 | |||
692 | (use 'hg help extensions' for information on enabling extensions) |
|
692 | (use 'hg help extensions' for information on enabling extensions) | |
693 | [255] |
|
693 | [255] | |
694 |
|
694 | |||
695 | Disabled extension gets suggested |
|
695 | Disabled extension gets suggested | |
696 | $ hg --config extensions.rebase=! rebase |
|
696 | $ hg --config extensions.rebase=! rebase | |
697 | hg: unknown command 'rebase' |
|
697 | hg: unknown command 'rebase' | |
698 | 'rebase' is provided by the following extension: |
|
698 | 'rebase' is provided by the following extension: | |
699 |
|
699 | |||
700 | rebase command to move sets of revisions to a different ancestor |
|
700 | rebase command to move sets of revisions to a different ancestor | |
701 |
|
701 | |||
702 | (use 'hg help extensions' for information on enabling extensions) |
|
702 | (use 'hg help extensions' for information on enabling extensions) | |
703 | [255] |
|
703 | [255] | |
704 |
|
704 | |||
705 | Make sure that we don't run afoul of the help system thinking that |
|
705 | Make sure that we don't run afoul of the help system thinking that | |
706 | this is a section and erroring out weirdly. |
|
706 | this is a section and erroring out weirdly. | |
707 |
|
707 | |||
708 | $ hg .log |
|
708 | $ hg .log | |
709 | hg: unknown command '.log' |
|
709 | hg: unknown command '.log' | |
710 | (did you mean log?) |
|
710 | (did you mean log?) | |
711 | [255] |
|
711 | [255] | |
712 |
|
712 | |||
713 | $ hg log. |
|
713 | $ hg log. | |
714 | hg: unknown command 'log.' |
|
714 | hg: unknown command 'log.' | |
715 | (did you mean log?) |
|
715 | (did you mean log?) | |
716 | [255] |
|
716 | [255] | |
717 | $ hg pu.lh |
|
717 | $ hg pu.lh | |
718 | hg: unknown command 'pu.lh' |
|
718 | hg: unknown command 'pu.lh' | |
719 | (did you mean one of pull, push?) |
|
719 | (did you mean one of pull, push?) | |
720 | [255] |
|
720 | [255] | |
721 |
|
721 | |||
722 | $ cat > helpext.py <<EOF |
|
722 | $ cat > helpext.py <<EOF | |
723 | > import os |
|
723 | > import os | |
724 | > from mercurial import commands, fancyopts, registrar |
|
724 | > from mercurial import commands, fancyopts, registrar | |
725 | > |
|
725 | > | |
726 | > def func(arg): |
|
726 | > def func(arg): | |
727 | > return '%sfoo' % arg |
|
727 | > return '%sfoo' % arg | |
728 | > class customopt(fancyopts.customopt): |
|
728 | > class customopt(fancyopts.customopt): | |
729 | > def newstate(self, oldstate, newparam, abort): |
|
729 | > def newstate(self, oldstate, newparam, abort): | |
730 | > return '%sbar' % oldstate |
|
730 | > return '%sbar' % oldstate | |
731 | > cmdtable = {} |
|
731 | > cmdtable = {} | |
732 | > command = registrar.command(cmdtable) |
|
732 | > command = registrar.command(cmdtable) | |
733 | > |
|
733 | > | |
734 | > @command(b'nohelp', |
|
734 | > @command(b'nohelp', | |
735 | > [(b'', b'longdesc', 3, b'x'*67), |
|
735 | > [(b'', b'longdesc', 3, b'x'*67), | |
736 | > (b'n', b'', None, b'normal desc'), |
|
736 | > (b'n', b'', None, b'normal desc'), | |
737 | > (b'', b'newline', b'', b'line1\nline2'), |
|
737 | > (b'', b'newline', b'', b'line1\nline2'), | |
738 | > (b'', b'callableopt', func, b'adds foo'), |
|
738 | > (b'', b'callableopt', func, b'adds foo'), | |
739 | > (b'', b'customopt', customopt(''), b'adds bar'), |
|
739 | > (b'', b'customopt', customopt(''), b'adds bar'), | |
740 | > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')], |
|
740 | > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')], | |
741 | > b'hg nohelp', |
|
741 | > b'hg nohelp', | |
742 | > norepo=True) |
|
742 | > norepo=True) | |
743 | > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) |
|
743 | > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) | |
744 | > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) |
|
744 | > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) | |
745 | > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) |
|
745 | > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) | |
746 | > def nohelp(ui, *args, **kwargs): |
|
746 | > def nohelp(ui, *args, **kwargs): | |
747 | > pass |
|
747 | > pass | |
748 | > |
|
748 | > | |
749 | > def uisetup(ui): |
|
749 | > def uisetup(ui): | |
750 | > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') |
|
750 | > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') | |
751 | > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') |
|
751 | > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') | |
752 | > |
|
752 | > | |
753 | > EOF |
|
753 | > EOF | |
754 | $ echo '[extensions]' >> $HGRCPATH |
|
754 | $ echo '[extensions]' >> $HGRCPATH | |
755 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
|
755 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH | |
756 |
|
756 | |||
757 | Test for aliases |
|
757 | Test for aliases | |
758 |
|
758 | |||
759 | $ hg help hgalias |
|
759 | $ hg help hgalias | |
760 | hg hgalias [--remote] |
|
760 | hg hgalias [--remote] | |
761 |
|
761 | |||
762 | alias for: hg summary |
|
762 | alias for: hg summary | |
763 |
|
763 | |||
764 | summarize working directory state |
|
764 | summarize working directory state | |
765 |
|
765 | |||
766 | This generates a brief summary of the working directory state, including |
|
766 | This generates a brief summary of the working directory state, including | |
767 | parents, branch, commit status, phase and available updates. |
|
767 | parents, branch, commit status, phase and available updates. | |
768 |
|
768 | |||
769 | With the --remote option, this will check the default paths for incoming |
|
769 | With the --remote option, this will check the default paths for incoming | |
770 | and outgoing changes. This can be time-consuming. |
|
770 | and outgoing changes. This can be time-consuming. | |
771 |
|
771 | |||
772 | Returns 0 on success. |
|
772 | Returns 0 on success. | |
773 |
|
773 | |||
774 | defined by: helpext |
|
774 | defined by: helpext | |
775 |
|
775 | |||
776 | options: |
|
776 | options: | |
777 |
|
777 | |||
778 | --remote check for push and pull |
|
778 | --remote check for push and pull | |
779 |
|
779 | |||
780 | (some details hidden, use --verbose to show complete help) |
|
780 | (some details hidden, use --verbose to show complete help) | |
781 |
|
781 | |||
782 | $ hg help shellalias |
|
782 | $ hg help shellalias | |
783 | hg shellalias |
|
783 | hg shellalias | |
784 |
|
784 | |||
785 | shell alias for: echo hi |
|
785 | shell alias for: echo hi | |
786 |
|
786 | |||
787 | (no help text available) |
|
787 | (no help text available) | |
788 |
|
788 | |||
789 | defined by: helpext |
|
789 | defined by: helpext | |
790 |
|
790 | |||
791 | (some details hidden, use --verbose to show complete help) |
|
791 | (some details hidden, use --verbose to show complete help) | |
792 |
|
792 | |||
793 | Test command with no help text |
|
793 | Test command with no help text | |
794 |
|
794 | |||
795 | $ hg help nohelp |
|
795 | $ hg help nohelp | |
796 | hg nohelp |
|
796 | hg nohelp | |
797 |
|
797 | |||
798 | (no help text available) |
|
798 | (no help text available) | |
799 |
|
799 | |||
800 | options: |
|
800 | options: | |
801 |
|
801 | |||
802 | --longdesc VALUE |
|
802 | --longdesc VALUE | |
803 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
803 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
804 | xxxxxxxxxxxxxxxxxxxxxxx (default: 3) |
|
804 | xxxxxxxxxxxxxxxxxxxxxxx (default: 3) | |
805 | -n -- normal desc |
|
805 | -n -- normal desc | |
806 | --newline VALUE line1 line2 |
|
806 | --newline VALUE line1 line2 | |
807 | --callableopt VALUE adds foo |
|
807 | --callableopt VALUE adds foo | |
808 | --customopt VALUE adds bar |
|
808 | --customopt VALUE adds bar | |
809 | --customopt-withdefault VALUE adds bar (default: foo) |
|
809 | --customopt-withdefault VALUE adds bar (default: foo) | |
810 |
|
810 | |||
811 | (some details hidden, use --verbose to show complete help) |
|
811 | (some details hidden, use --verbose to show complete help) | |
812 |
|
812 | |||
813 | $ hg help -k nohelp |
|
813 | $ hg help -k nohelp | |
814 | Commands: |
|
814 | Commands: | |
815 |
|
815 | |||
816 | nohelp hg nohelp |
|
816 | nohelp hg nohelp | |
817 |
|
817 | |||
818 | Extension Commands: |
|
818 | Extension Commands: | |
819 |
|
819 | |||
820 | nohelp (no help text available) |
|
820 | nohelp (no help text available) | |
821 |
|
821 | |||
822 | Test that default list of commands omits extension commands |
|
822 | Test that default list of commands omits extension commands | |
823 |
|
823 | |||
824 | #if no-extraextensions |
|
824 | #if no-extraextensions | |
825 |
|
825 | |||
826 | $ hg help |
|
826 | $ hg help | |
827 | Mercurial Distributed SCM |
|
827 | Mercurial Distributed SCM | |
828 |
|
828 | |||
829 | list of commands: |
|
829 | list of commands: | |
830 |
|
830 | |||
831 | add add the specified files on the next commit |
|
831 | add add the specified files on the next commit | |
832 | addremove add all new files, delete all missing files |
|
832 | addremove add all new files, delete all missing files | |
833 | annotate show changeset information by line for each file |
|
833 | annotate show changeset information by line for each file | |
834 | archive create an unversioned archive of a repository revision |
|
834 | archive create an unversioned archive of a repository revision | |
835 | backout reverse effect of earlier changeset |
|
835 | backout reverse effect of earlier changeset | |
836 | bisect subdivision search of changesets |
|
836 | bisect subdivision search of changesets | |
837 | bookmarks create a new bookmark or list existing bookmarks |
|
837 | bookmarks create a new bookmark or list existing bookmarks | |
838 | branch set or show the current branch name |
|
838 | branch set or show the current branch name | |
839 | branches list repository named branches |
|
839 | branches list repository named branches | |
840 | bundle create a bundle file |
|
840 | bundle create a bundle file | |
841 | cat output the current or given revision of files |
|
841 | cat output the current or given revision of files | |
842 | clone make a copy of an existing repository |
|
842 | clone make a copy of an existing repository | |
843 | commit commit the specified files or all outstanding changes |
|
843 | commit commit the specified files or all outstanding changes | |
844 | config show combined config settings from all hgrc files |
|
844 | config show combined config settings from all hgrc files | |
845 | copy mark files as copied for the next commit |
|
845 | copy mark files as copied for the next commit | |
846 | diff diff repository (or selected files) |
|
846 | diff diff repository (or selected files) | |
847 | export dump the header and diffs for one or more changesets |
|
847 | export dump the header and diffs for one or more changesets | |
848 | files list tracked files |
|
848 | files list tracked files | |
849 | forget forget the specified files on the next commit |
|
849 | forget forget the specified files on the next commit | |
850 | graft copy changes from other branches onto the current branch |
|
850 | graft copy changes from other branches onto the current branch | |
851 | grep search revision history for a pattern in specified files |
|
851 | grep search revision history for a pattern in specified files | |
852 | heads show branch heads |
|
852 | heads show branch heads | |
853 | help show help for a given topic or a help overview |
|
853 | help show help for a given topic or a help overview | |
854 | identify identify the working directory or specified revision |
|
854 | identify identify the working directory or specified revision | |
855 | import import an ordered set of patches |
|
855 | import import an ordered set of patches | |
856 | incoming show new changesets found in source |
|
856 | incoming show new changesets found in source | |
857 | init create a new repository in the given directory |
|
857 | init create a new repository in the given directory | |
858 | log show revision history of entire repository or files |
|
858 | log show revision history of entire repository or files | |
859 | manifest output the current or given revision of the project manifest |
|
859 | manifest output the current or given revision of the project manifest | |
860 | merge merge another revision into working directory |
|
860 | merge merge another revision into working directory | |
861 | outgoing show changesets not found in the destination |
|
861 | outgoing show changesets not found in the destination | |
862 | paths show aliases for remote repositories |
|
862 | paths show aliases for remote repositories | |
863 | phase set or show the current phase name |
|
863 | phase set or show the current phase name | |
864 | pull pull changes from the specified source |
|
864 | pull pull changes from the specified source | |
865 | push push changes to the specified destination |
|
865 | push push changes to the specified destination | |
866 | recover roll back an interrupted transaction |
|
866 | recover roll back an interrupted transaction | |
867 | remove remove the specified files on the next commit |
|
867 | remove remove the specified files on the next commit | |
868 | rename rename files; equivalent of copy + remove |
|
868 | rename rename files; equivalent of copy + remove | |
869 | resolve redo merges or set/view the merge status of files |
|
869 | resolve redo merges or set/view the merge status of files | |
870 | revert restore files to their checkout state |
|
870 | revert restore files to their checkout state | |
871 | root print the root (top) of the current working directory |
|
871 | root print the root (top) of the current working directory | |
872 | serve start stand-alone webserver |
|
872 | serve start stand-alone webserver | |
873 | status show changed files in the working directory |
|
873 | status show changed files in the working directory | |
874 | summary summarize working directory state |
|
874 | summary summarize working directory state | |
875 | tag add one or more tags for the current or given revision |
|
875 | tag add one or more tags for the current or given revision | |
876 | tags list repository tags |
|
876 | tags list repository tags | |
877 | unbundle apply one or more bundle files |
|
877 | unbundle apply one or more bundle files | |
878 | update update working directory (or switch revisions) |
|
878 | update update working directory (or switch revisions) | |
879 | verify verify the integrity of the repository |
|
879 | verify verify the integrity of the repository | |
880 | version output version and copyright information |
|
880 | version output version and copyright information | |
881 |
|
881 | |||
882 | enabled extensions: |
|
882 | enabled extensions: | |
883 |
|
883 | |||
884 | helpext (no help text available) |
|
884 | helpext (no help text available) | |
885 |
|
885 | |||
886 | additional help topics: |
|
886 | additional help topics: | |
887 |
|
887 | |||
888 | bundlespec Bundle File Formats |
|
888 | bundlespec Bundle File Formats | |
889 | color Colorizing Outputs |
|
889 | color Colorizing Outputs | |
890 | config Configuration Files |
|
890 | config Configuration Files | |
891 | dates Date Formats |
|
891 | dates Date Formats | |
892 | diffs Diff Formats |
|
892 | diffs Diff Formats | |
893 | environment Environment Variables |
|
893 | environment Environment Variables | |
894 | extensions Using Additional Features |
|
894 | extensions Using Additional Features | |
895 | filesets Specifying File Sets |
|
895 | filesets Specifying File Sets | |
896 | flags Command-line flags |
|
896 | flags Command-line flags | |
897 | glossary Glossary |
|
897 | glossary Glossary | |
898 | hgignore Syntax for Mercurial Ignore Files |
|
898 | hgignore Syntax for Mercurial Ignore Files | |
899 | hgweb Configuring hgweb |
|
899 | hgweb Configuring hgweb | |
900 | internals Technical implementation topics |
|
900 | internals Technical implementation topics | |
901 | merge-tools Merge Tools |
|
901 | merge-tools Merge Tools | |
902 | pager Pager Support |
|
902 | pager Pager Support | |
903 | patterns File Name Patterns |
|
903 | patterns File Name Patterns | |
904 | phases Working with Phases |
|
904 | phases Working with Phases | |
905 | revisions Specifying Revisions |
|
905 | revisions Specifying Revisions | |
906 | scripting Using Mercurial from scripts and automation |
|
906 | scripting Using Mercurial from scripts and automation | |
907 | subrepos Subrepositories |
|
907 | subrepos Subrepositories | |
908 | templating Template Usage |
|
908 | templating Template Usage | |
909 | urls URL Paths |
|
909 | urls URL Paths | |
910 |
|
910 | |||
911 | (use 'hg help -v' to show built-in aliases and global options) |
|
911 | (use 'hg help -v' to show built-in aliases and global options) | |
912 |
|
912 | |||
913 | #endif |
|
913 | #endif | |
914 |
|
914 | |||
915 | Test list of internal help commands |
|
915 | Test list of internal help commands | |
916 |
|
916 | |||
917 | $ hg help debug |
|
917 | $ hg help debug | |
918 | debug commands (internal and unsupported): |
|
918 | debug commands (internal and unsupported): | |
919 |
|
919 | |||
920 | debugancestor |
|
920 | debugancestor | |
921 | find the ancestor revision of two revisions in a given index |
|
921 | find the ancestor revision of two revisions in a given index | |
922 | debugapplystreamclonebundle |
|
922 | debugapplystreamclonebundle | |
923 | apply a stream clone bundle file |
|
923 | apply a stream clone bundle file | |
924 | debugbuilddag |
|
924 | debugbuilddag | |
925 | builds a repo with a given DAG from scratch in the current |
|
925 | builds a repo with a given DAG from scratch in the current | |
926 | empty repo |
|
926 | empty repo | |
927 | debugbundle lists the contents of a bundle |
|
927 | debugbundle lists the contents of a bundle | |
928 | debugcapabilities |
|
928 | debugcapabilities | |
929 | lists the capabilities of a remote peer |
|
929 | lists the capabilities of a remote peer | |
930 | debugcheckstate |
|
930 | debugcheckstate | |
931 | validate the correctness of the current dirstate |
|
931 | validate the correctness of the current dirstate | |
932 | debugcolor show available color, effects or style |
|
932 | debugcolor show available color, effects or style | |
933 | debugcommands |
|
933 | debugcommands | |
934 | list all available commands and options |
|
934 | list all available commands and options | |
935 | debugcomplete |
|
935 | debugcomplete | |
936 | returns the completion list associated with the given command |
|
936 | returns the completion list associated with the given command | |
937 | debugcreatestreamclonebundle |
|
937 | debugcreatestreamclonebundle | |
938 | create a stream clone bundle file |
|
938 | create a stream clone bundle file | |
939 | debugdag format the changelog or an index DAG as a concise textual |
|
939 | debugdag format the changelog or an index DAG as a concise textual | |
940 | description |
|
940 | description | |
941 | debugdata dump the contents of a data file revision |
|
941 | debugdata dump the contents of a data file revision | |
942 | debugdate parse and display a date |
|
942 | debugdate parse and display a date | |
943 | debugdeltachain |
|
943 | debugdeltachain | |
944 | dump information about delta chains in a revlog |
|
944 | dump information about delta chains in a revlog | |
945 | debugdirstate |
|
945 | debugdirstate | |
946 | show the contents of the current dirstate |
|
946 | show the contents of the current dirstate | |
947 | debugdiscovery |
|
947 | debugdiscovery | |
948 | runs the changeset discovery protocol in isolation |
|
948 | runs the changeset discovery protocol in isolation | |
949 | debugdownload |
|
949 | debugdownload | |
950 | download a resource using Mercurial logic and config |
|
950 | download a resource using Mercurial logic and config | |
951 | debugextensions |
|
951 | debugextensions | |
952 | show information about active extensions |
|
952 | show information about active extensions | |
953 | debugfileset parse and apply a fileset specification |
|
953 | debugfileset parse and apply a fileset specification | |
954 | debugformat display format information about the current repository |
|
954 | debugformat display format information about the current repository | |
955 | debugfsinfo show information detected about current filesystem |
|
955 | debugfsinfo show information detected about current filesystem | |
956 | debuggetbundle |
|
956 | debuggetbundle | |
957 | retrieves a bundle from a repo |
|
957 | retrieves a bundle from a repo | |
958 | debugignore display the combined ignore pattern and information about |
|
958 | debugignore display the combined ignore pattern and information about | |
959 | ignored files |
|
959 | ignored files | |
960 | debugindex dump the contents of an index file |
|
960 | debugindex dump the contents of an index file | |
961 | debugindexdot |
|
961 | debugindexdot | |
962 | dump an index DAG as a graphviz dot file |
|
962 | dump an index DAG as a graphviz dot file | |
963 | debuginstall test Mercurial installation |
|
963 | debuginstall test Mercurial installation | |
964 | debugknown test whether node ids are known to a repo |
|
964 | debugknown test whether node ids are known to a repo | |
965 | debuglocks show or modify state of locks |
|
965 | debuglocks show or modify state of locks | |
966 | debugmergestate |
|
966 | debugmergestate | |
967 | print merge state |
|
967 | print merge state | |
968 | debugnamecomplete |
|
968 | debugnamecomplete | |
969 | complete "names" - tags, open branch names, bookmark names |
|
969 | complete "names" - tags, open branch names, bookmark names | |
970 | debugobsolete |
|
970 | debugobsolete | |
971 | create arbitrary obsolete marker |
|
971 | create arbitrary obsolete marker | |
972 | debugoptADV (no help text available) |
|
972 | debugoptADV (no help text available) | |
973 | debugoptDEP (no help text available) |
|
973 | debugoptDEP (no help text available) | |
974 | debugoptEXP (no help text available) |
|
974 | debugoptEXP (no help text available) | |
975 | debugpathcomplete |
|
975 | debugpathcomplete | |
976 | complete part or all of a tracked path |
|
976 | complete part or all of a tracked path | |
977 | debugpeer establish a connection to a peer repository |
|
977 | debugpeer establish a connection to a peer repository | |
978 | debugpickmergetool |
|
978 | debugpickmergetool | |
979 | examine which merge tool is chosen for specified file |
|
979 | examine which merge tool is chosen for specified file | |
980 | debugpushkey access the pushkey key/value protocol |
|
980 | debugpushkey access the pushkey key/value protocol | |
981 | debugpvec (no help text available) |
|
981 | debugpvec (no help text available) | |
982 | debugrebuilddirstate |
|
982 | debugrebuilddirstate | |
983 | rebuild the dirstate as it would look like for the given |
|
983 | rebuild the dirstate as it would look like for the given | |
984 | revision |
|
984 | revision | |
985 | debugrebuildfncache |
|
985 | debugrebuildfncache | |
986 | rebuild the fncache file |
|
986 | rebuild the fncache file | |
987 | debugrename dump rename information |
|
987 | debugrename dump rename information | |
988 | debugrevlog show data and statistics about a revlog |
|
988 | debugrevlog show data and statistics about a revlog | |
989 | debugrevspec parse and apply a revision specification |
|
989 | debugrevspec parse and apply a revision specification | |
990 | debugserve run a server with advanced settings |
|
990 | debugserve run a server with advanced settings | |
991 | debugsetparents |
|
991 | debugsetparents | |
992 | manually set the parents of the current working directory |
|
992 | manually set the parents of the current working directory | |
993 | debugssl test a secure connection to a server |
|
993 | debugssl test a secure connection to a server | |
994 | debugsub (no help text available) |
|
994 | debugsub (no help text available) | |
995 | debugsuccessorssets |
|
995 | debugsuccessorssets | |
996 | show set of successors for revision |
|
996 | show set of successors for revision | |
997 | debugtemplate |
|
997 | debugtemplate | |
998 | parse and apply a template |
|
998 | parse and apply a template | |
999 | debuguigetpass |
|
999 | debuguigetpass | |
1000 | show prompt to type password |
|
1000 | show prompt to type password | |
1001 | debuguiprompt |
|
1001 | debuguiprompt | |
1002 | show plain prompt |
|
1002 | show plain prompt | |
1003 | debugupdatecaches |
|
1003 | debugupdatecaches | |
1004 | warm all known caches in the repository |
|
1004 | warm all known caches in the repository | |
1005 | debugupgraderepo |
|
1005 | debugupgraderepo | |
1006 | upgrade a repository to use different features |
|
1006 | upgrade a repository to use different features | |
1007 | debugwalk show how files match on given patterns |
|
1007 | debugwalk show how files match on given patterns | |
1008 | debugwhyunstable |
|
1008 | debugwhyunstable | |
1009 | explain instabilities of a changeset |
|
1009 | explain instabilities of a changeset | |
1010 | debugwireargs |
|
1010 | debugwireargs | |
1011 | (no help text available) |
|
1011 | (no help text available) | |
1012 | debugwireproto |
|
1012 | debugwireproto | |
1013 | send wire protocol commands to a server |
|
1013 | send wire protocol commands to a server | |
1014 |
|
1014 | |||
1015 | (use 'hg help -v debug' to show built-in aliases and global options) |
|
1015 | (use 'hg help -v debug' to show built-in aliases and global options) | |
1016 |
|
1016 | |||
1017 | internals topic renders index of available sub-topics |
|
1017 | internals topic renders index of available sub-topics | |
1018 |
|
1018 | |||
1019 | $ hg help internals |
|
1019 | $ hg help internals | |
1020 | Technical implementation topics |
|
1020 | Technical implementation topics | |
1021 | """"""""""""""""""""""""""""""" |
|
1021 | """"""""""""""""""""""""""""""" | |
1022 |
|
1022 | |||
1023 | To access a subtopic, use "hg help internals.{subtopic-name}" |
|
1023 | To access a subtopic, use "hg help internals.{subtopic-name}" | |
1024 |
|
1024 | |||
1025 | bundle2 Bundle2 |
|
1025 | bundle2 Bundle2 | |
1026 | bundles Bundles |
|
1026 | bundles Bundles | |
1027 | censor Censor |
|
1027 | censor Censor | |
1028 | changegroups Changegroups |
|
1028 | changegroups Changegroups | |
1029 | config Config Registrar |
|
1029 | config Config Registrar | |
1030 | requirements Repository Requirements |
|
1030 | requirements Repository Requirements | |
1031 | revlogs Revision Logs |
|
1031 | revlogs Revision Logs | |
1032 | wireprotocol Wire Protocol |
|
1032 | wireprotocol Wire Protocol | |
1033 |
|
1033 | |||
1034 | sub-topics can be accessed |
|
1034 | sub-topics can be accessed | |
1035 |
|
1035 | |||
1036 | $ hg help internals.changegroups |
|
1036 | $ hg help internals.changegroups | |
1037 | Changegroups |
|
1037 | Changegroups | |
1038 | """""""""""" |
|
1038 | """""""""""" | |
1039 |
|
1039 | |||
1040 | Changegroups are representations of repository revlog data, specifically |
|
1040 | Changegroups are representations of repository revlog data, specifically | |
1041 | the changelog data, root/flat manifest data, treemanifest data, and |
|
1041 | the changelog data, root/flat manifest data, treemanifest data, and | |
1042 | filelogs. |
|
1042 | filelogs. | |
1043 |
|
1043 | |||
1044 | There are 3 versions of changegroups: "1", "2", and "3". From a high- |
|
1044 | There are 3 versions of changegroups: "1", "2", and "3". From a high- | |
1045 | level, versions "1" and "2" are almost exactly the same, with the only |
|
1045 | level, versions "1" and "2" are almost exactly the same, with the only | |
1046 | difference being an additional item in the *delta header*. Version "3" |
|
1046 | difference being an additional item in the *delta header*. Version "3" | |
1047 | adds support for revlog flags in the *delta header* and optionally |
|
1047 | adds support for revlog flags in the *delta header* and optionally | |
1048 | exchanging treemanifests (enabled by setting an option on the |
|
1048 | exchanging treemanifests (enabled by setting an option on the | |
1049 | "changegroup" part in the bundle2). |
|
1049 | "changegroup" part in the bundle2). | |
1050 |
|
1050 | |||
1051 | Changegroups when not exchanging treemanifests consist of 3 logical |
|
1051 | Changegroups when not exchanging treemanifests consist of 3 logical | |
1052 | segments: |
|
1052 | segments: | |
1053 |
|
1053 | |||
1054 | +---------------------------------+ |
|
1054 | +---------------------------------+ | |
1055 | | | | | |
|
1055 | | | | | | |
1056 | | changeset | manifest | filelogs | |
|
1056 | | changeset | manifest | filelogs | | |
1057 | | | | | |
|
1057 | | | | | | |
1058 | | | | | |
|
1058 | | | | | | |
1059 | +---------------------------------+ |
|
1059 | +---------------------------------+ | |
1060 |
|
1060 | |||
1061 | When exchanging treemanifests, there are 4 logical segments: |
|
1061 | When exchanging treemanifests, there are 4 logical segments: | |
1062 |
|
1062 | |||
1063 | +-------------------------------------------------+ |
|
1063 | +-------------------------------------------------+ | |
1064 | | | | | | |
|
1064 | | | | | | | |
1065 | | changeset | root | treemanifests | filelogs | |
|
1065 | | changeset | root | treemanifests | filelogs | | |
1066 | | | manifest | | | |
|
1066 | | | manifest | | | | |
1067 | | | | | | |
|
1067 | | | | | | | |
1068 | +-------------------------------------------------+ |
|
1068 | +-------------------------------------------------+ | |
1069 |
|
1069 | |||
1070 | The principle building block of each segment is a *chunk*. A *chunk* is a |
|
1070 | The principle building block of each segment is a *chunk*. A *chunk* is a | |
1071 | framed piece of data: |
|
1071 | framed piece of data: | |
1072 |
|
1072 | |||
1073 | +---------------------------------------+ |
|
1073 | +---------------------------------------+ | |
1074 | | | | |
|
1074 | | | | | |
1075 | | length | data | |
|
1075 | | length | data | | |
1076 | | (4 bytes) | (<length - 4> bytes) | |
|
1076 | | (4 bytes) | (<length - 4> bytes) | | |
1077 | | | | |
|
1077 | | | | | |
1078 | +---------------------------------------+ |
|
1078 | +---------------------------------------+ | |
1079 |
|
1079 | |||
1080 | All integers are big-endian signed integers. Each chunk starts with a |
|
1080 | All integers are big-endian signed integers. Each chunk starts with a | |
1081 | 32-bit integer indicating the length of the entire chunk (including the |
|
1081 | 32-bit integer indicating the length of the entire chunk (including the | |
1082 | length field itself). |
|
1082 | length field itself). | |
1083 |
|
1083 | |||
1084 | There is a special case chunk that has a value of 0 for the length |
|
1084 | There is a special case chunk that has a value of 0 for the length | |
1085 | ("0x00000000"). We call this an *empty chunk*. |
|
1085 | ("0x00000000"). We call this an *empty chunk*. | |
1086 |
|
1086 | |||
1087 | Delta Groups |
|
1087 | Delta Groups | |
1088 | ============ |
|
1088 | ============ | |
1089 |
|
1089 | |||
1090 | A *delta group* expresses the content of a revlog as a series of deltas, |
|
1090 | A *delta group* expresses the content of a revlog as a series of deltas, | |
1091 | or patches against previous revisions. |
|
1091 | or patches against previous revisions. | |
1092 |
|
1092 | |||
1093 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* |
|
1093 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* | |
1094 | to signal the end of the delta group: |
|
1094 | to signal the end of the delta group: | |
1095 |
|
1095 | |||
1096 | +------------------------------------------------------------------------+ |
|
1096 | +------------------------------------------------------------------------+ | |
1097 | | | | | | | |
|
1097 | | | | | | | | |
1098 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | |
|
1098 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | | |
1099 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | |
|
1099 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | | |
1100 | | | | | | | |
|
1100 | | | | | | | | |
1101 | +------------------------------------------------------------------------+ |
|
1101 | +------------------------------------------------------------------------+ | |
1102 |
|
1102 | |||
1103 | Each *chunk*'s data consists of the following: |
|
1103 | Each *chunk*'s data consists of the following: | |
1104 |
|
1104 | |||
1105 | +---------------------------------------+ |
|
1105 | +---------------------------------------+ | |
1106 | | | | |
|
1106 | | | | | |
1107 | | delta header | delta data | |
|
1107 | | delta header | delta data | | |
1108 | | (various by version) | (various) | |
|
1108 | | (various by version) | (various) | | |
1109 | | | | |
|
1109 | | | | | |
1110 | +---------------------------------------+ |
|
1110 | +---------------------------------------+ | |
1111 |
|
1111 | |||
1112 | The *delta data* is a series of *delta*s that describe a diff from an |
|
1112 | The *delta data* is a series of *delta*s that describe a diff from an | |
1113 | existing entry (either that the recipient already has, or previously |
|
1113 | existing entry (either that the recipient already has, or previously | |
1114 | specified in the bundle/changegroup). |
|
1114 | specified in the bundle/changegroup). | |
1115 |
|
1115 | |||
1116 | The *delta header* is different between versions "1", "2", and "3" of the |
|
1116 | The *delta header* is different between versions "1", "2", and "3" of the | |
1117 | changegroup format. |
|
1117 | changegroup format. | |
1118 |
|
1118 | |||
1119 | Version 1 (headerlen=80): |
|
1119 | Version 1 (headerlen=80): | |
1120 |
|
1120 | |||
1121 | +------------------------------------------------------+ |
|
1121 | +------------------------------------------------------+ | |
1122 | | | | | | |
|
1122 | | | | | | | |
1123 | | node | p1 node | p2 node | link node | |
|
1123 | | node | p1 node | p2 node | link node | | |
1124 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
1124 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | | |
1125 | | | | | | |
|
1125 | | | | | | | |
1126 | +------------------------------------------------------+ |
|
1126 | +------------------------------------------------------+ | |
1127 |
|
1127 | |||
1128 | Version 2 (headerlen=100): |
|
1128 | Version 2 (headerlen=100): | |
1129 |
|
1129 | |||
1130 | +------------------------------------------------------------------+ |
|
1130 | +------------------------------------------------------------------+ | |
1131 | | | | | | | |
|
1131 | | | | | | | | |
1132 | | node | p1 node | p2 node | base node | link node | |
|
1132 | | node | p1 node | p2 node | base node | link node | | |
1133 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
1133 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | | |
1134 | | | | | | | |
|
1134 | | | | | | | | |
1135 | +------------------------------------------------------------------+ |
|
1135 | +------------------------------------------------------------------+ | |
1136 |
|
1136 | |||
1137 | Version 3 (headerlen=102): |
|
1137 | Version 3 (headerlen=102): | |
1138 |
|
1138 | |||
1139 | +------------------------------------------------------------------------------+ |
|
1139 | +------------------------------------------------------------------------------+ | |
1140 | | | | | | | | |
|
1140 | | | | | | | | | |
1141 | | node | p1 node | p2 node | base node | link node | flags | |
|
1141 | | node | p1 node | p2 node | base node | link node | flags | | |
1142 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
|
1142 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | | |
1143 | | | | | | | | |
|
1143 | | | | | | | | | |
1144 | +------------------------------------------------------------------------------+ |
|
1144 | +------------------------------------------------------------------------------+ | |
1145 |
|
1145 | |||
1146 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which |
|
1146 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which | |
1147 | contain a series of *delta*s, densely packed (no separators). These deltas |
|
1147 | contain a series of *delta*s, densely packed (no separators). These deltas | |
1148 | describe a diff from an existing entry (either that the recipient already |
|
1148 | describe a diff from an existing entry (either that the recipient already | |
1149 | has, or previously specified in the bundle/changegroup). The format is |
|
1149 | has, or previously specified in the bundle/changegroup). The format is | |
1150 | described more fully in "hg help internals.bdiff", but briefly: |
|
1150 | described more fully in "hg help internals.bdiff", but briefly: | |
1151 |
|
1151 | |||
1152 | +---------------------------------------------------------------+ |
|
1152 | +---------------------------------------------------------------+ | |
1153 | | | | | | |
|
1153 | | | | | | | |
1154 | | start offset | end offset | new length | content | |
|
1154 | | start offset | end offset | new length | content | | |
1155 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | |
|
1155 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | | |
1156 | | | | | | |
|
1156 | | | | | | | |
1157 | +---------------------------------------------------------------+ |
|
1157 | +---------------------------------------------------------------+ | |
1158 |
|
1158 | |||
1159 | Please note that the length field in the delta data does *not* include |
|
1159 | Please note that the length field in the delta data does *not* include | |
1160 | itself. |
|
1160 | itself. | |
1161 |
|
1161 | |||
1162 | In version 1, the delta is always applied against the previous node from |
|
1162 | In version 1, the delta is always applied against the previous node from | |
1163 | the changegroup or the first parent if this is the first entry in the |
|
1163 | the changegroup or the first parent if this is the first entry in the | |
1164 | changegroup. |
|
1164 | changegroup. | |
1165 |
|
1165 | |||
1166 | In version 2 and up, the delta base node is encoded in the entry in the |
|
1166 | In version 2 and up, the delta base node is encoded in the entry in the | |
1167 | changegroup. This allows the delta to be expressed against any parent, |
|
1167 | changegroup. This allows the delta to be expressed against any parent, | |
1168 | which can result in smaller deltas and more efficient encoding of data. |
|
1168 | which can result in smaller deltas and more efficient encoding of data. | |
1169 |
|
1169 | |||
1170 | Changeset Segment |
|
1170 | Changeset Segment | |
1171 | ================= |
|
1171 | ================= | |
1172 |
|
1172 | |||
1173 | The *changeset segment* consists of a single *delta group* holding |
|
1173 | The *changeset segment* consists of a single *delta group* holding | |
1174 | changelog data. The *empty chunk* at the end of the *delta group* denotes |
|
1174 | changelog data. The *empty chunk* at the end of the *delta group* denotes | |
1175 | the boundary to the *manifest segment*. |
|
1175 | the boundary to the *manifest segment*. | |
1176 |
|
1176 | |||
1177 | Manifest Segment |
|
1177 | Manifest Segment | |
1178 | ================ |
|
1178 | ================ | |
1179 |
|
1179 | |||
1180 | The *manifest segment* consists of a single *delta group* holding manifest |
|
1180 | The *manifest segment* consists of a single *delta group* holding manifest | |
1181 | data. If treemanifests are in use, it contains only the manifest for the |
|
1181 | data. If treemanifests are in use, it contains only the manifest for the | |
1182 | root directory of the repository. Otherwise, it contains the entire |
|
1182 | root directory of the repository. Otherwise, it contains the entire | |
1183 | manifest data. The *empty chunk* at the end of the *delta group* denotes |
|
1183 | manifest data. The *empty chunk* at the end of the *delta group* denotes | |
1184 | the boundary to the next segment (either the *treemanifests segment* or |
|
1184 | the boundary to the next segment (either the *treemanifests segment* or | |
1185 | the *filelogs segment*, depending on version and the request options). |
|
1185 | the *filelogs segment*, depending on version and the request options). | |
1186 |
|
1186 | |||
1187 | Treemanifests Segment |
|
1187 | Treemanifests Segment | |
1188 | --------------------- |
|
1188 | --------------------- | |
1189 |
|
1189 | |||
1190 | The *treemanifests segment* only exists in changegroup version "3", and |
|
1190 | The *treemanifests segment* only exists in changegroup version "3", and | |
1191 | only if the 'treemanifest' param is part of the bundle2 changegroup part |
|
1191 | only if the 'treemanifest' param is part of the bundle2 changegroup part | |
1192 | (it is not possible to use changegroup version 3 outside of bundle2). |
|
1192 | (it is not possible to use changegroup version 3 outside of bundle2). | |
1193 | Aside from the filenames in the *treemanifests segment* containing a |
|
1193 | Aside from the filenames in the *treemanifests segment* containing a | |
1194 | trailing "/" character, it behaves identically to the *filelogs segment* |
|
1194 | trailing "/" character, it behaves identically to the *filelogs segment* | |
1195 | (see below). The final sub-segment is followed by an *empty chunk* |
|
1195 | (see below). The final sub-segment is followed by an *empty chunk* | |
1196 | (logically, a sub-segment with filename size 0). This denotes the boundary |
|
1196 | (logically, a sub-segment with filename size 0). This denotes the boundary | |
1197 | to the *filelogs segment*. |
|
1197 | to the *filelogs segment*. | |
1198 |
|
1198 | |||
1199 | Filelogs Segment |
|
1199 | Filelogs Segment | |
1200 | ================ |
|
1200 | ================ | |
1201 |
|
1201 | |||
1202 | The *filelogs segment* consists of multiple sub-segments, each |
|
1202 | The *filelogs segment* consists of multiple sub-segments, each | |
1203 | corresponding to an individual file whose data is being described: |
|
1203 | corresponding to an individual file whose data is being described: | |
1204 |
|
1204 | |||
1205 | +--------------------------------------------------+ |
|
1205 | +--------------------------------------------------+ | |
1206 | | | | | | | |
|
1206 | | | | | | | | |
1207 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | |
|
1207 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | | |
1208 | | | | | | (4 bytes) | |
|
1208 | | | | | | (4 bytes) | | |
1209 | | | | | | | |
|
1209 | | | | | | | | |
1210 | +--------------------------------------------------+ |
|
1210 | +--------------------------------------------------+ | |
1211 |
|
1211 | |||
1212 | The final filelog sub-segment is followed by an *empty chunk* (logically, |
|
1212 | The final filelog sub-segment is followed by an *empty chunk* (logically, | |
1213 | a sub-segment with filename size 0). This denotes the end of the segment |
|
1213 | a sub-segment with filename size 0). This denotes the end of the segment | |
1214 | and of the overall changegroup. |
|
1214 | and of the overall changegroup. | |
1215 |
|
1215 | |||
1216 | Each filelog sub-segment consists of the following: |
|
1216 | Each filelog sub-segment consists of the following: | |
1217 |
|
1217 | |||
1218 | +------------------------------------------------------+ |
|
1218 | +------------------------------------------------------+ | |
1219 | | | | | |
|
1219 | | | | | | |
1220 | | filename length | filename | delta group | |
|
1220 | | filename length | filename | delta group | | |
1221 | | (4 bytes) | (<length - 4> bytes) | (various) | |
|
1221 | | (4 bytes) | (<length - 4> bytes) | (various) | | |
1222 | | | | | |
|
1222 | | | | | | |
1223 | +------------------------------------------------------+ |
|
1223 | +------------------------------------------------------+ | |
1224 |
|
1224 | |||
1225 | That is, a *chunk* consisting of the filename (not terminated or padded) |
|
1225 | That is, a *chunk* consisting of the filename (not terminated or padded) | |
1226 | followed by N chunks constituting the *delta group* for this file. The |
|
1226 | followed by N chunks constituting the *delta group* for this file. The | |
1227 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
1227 | *empty chunk* at the end of each *delta group* denotes the boundary to the | |
1228 | next filelog sub-segment. |
|
1228 | next filelog sub-segment. | |
1229 |
|
1229 | |||
1230 | Test list of commands with command with no help text |
|
1230 | Test list of commands with command with no help text | |
1231 |
|
1231 | |||
1232 | $ hg help helpext |
|
1232 | $ hg help helpext | |
1233 | helpext extension - no help text available |
|
1233 | helpext extension - no help text available | |
1234 |
|
1234 | |||
1235 | list of commands: |
|
1235 | list of commands: | |
1236 |
|
1236 | |||
1237 | nohelp (no help text available) |
|
1237 | nohelp (no help text available) | |
1238 |
|
1238 | |||
1239 | (use 'hg help -v helpext' to show built-in aliases and global options) |
|
1239 | (use 'hg help -v helpext' to show built-in aliases and global options) | |
1240 |
|
1240 | |||
1241 |
|
1241 | |||
1242 | test advanced, deprecated and experimental options are hidden in command help |
|
1242 | test advanced, deprecated and experimental options are hidden in command help | |
1243 | $ hg help debugoptADV |
|
1243 | $ hg help debugoptADV | |
1244 | hg debugoptADV |
|
1244 | hg debugoptADV | |
1245 |
|
1245 | |||
1246 | (no help text available) |
|
1246 | (no help text available) | |
1247 |
|
1247 | |||
1248 | options: |
|
1248 | options: | |
1249 |
|
1249 | |||
1250 | (some details hidden, use --verbose to show complete help) |
|
1250 | (some details hidden, use --verbose to show complete help) | |
1251 | $ hg help debugoptDEP |
|
1251 | $ hg help debugoptDEP | |
1252 | hg debugoptDEP |
|
1252 | hg debugoptDEP | |
1253 |
|
1253 | |||
1254 | (no help text available) |
|
1254 | (no help text available) | |
1255 |
|
1255 | |||
1256 | options: |
|
1256 | options: | |
1257 |
|
1257 | |||
1258 | (some details hidden, use --verbose to show complete help) |
|
1258 | (some details hidden, use --verbose to show complete help) | |
1259 |
|
1259 | |||
1260 | $ hg help debugoptEXP |
|
1260 | $ hg help debugoptEXP | |
1261 | hg debugoptEXP |
|
1261 | hg debugoptEXP | |
1262 |
|
1262 | |||
1263 | (no help text available) |
|
1263 | (no help text available) | |
1264 |
|
1264 | |||
1265 | options: |
|
1265 | options: | |
1266 |
|
1266 | |||
1267 | (some details hidden, use --verbose to show complete help) |
|
1267 | (some details hidden, use --verbose to show complete help) | |
1268 |
|
1268 | |||
1269 | test advanced, deprecated and experimental options are shown with -v |
|
1269 | test advanced, deprecated and experimental options are shown with -v | |
1270 | $ hg help -v debugoptADV | grep aopt |
|
1270 | $ hg help -v debugoptADV | grep aopt | |
1271 | --aopt option is (ADVANCED) |
|
1271 | --aopt option is (ADVANCED) | |
1272 | $ hg help -v debugoptDEP | grep dopt |
|
1272 | $ hg help -v debugoptDEP | grep dopt | |
1273 | --dopt option is (DEPRECATED) |
|
1273 | --dopt option is (DEPRECATED) | |
1274 | $ hg help -v debugoptEXP | grep eopt |
|
1274 | $ hg help -v debugoptEXP | grep eopt | |
1275 | --eopt option is (EXPERIMENTAL) |
|
1275 | --eopt option is (EXPERIMENTAL) | |
1276 |
|
1276 | |||
1277 | #if gettext |
|
1277 | #if gettext | |
1278 | test deprecated option is hidden with translation with untranslated description |
|
1278 | test deprecated option is hidden with translation with untranslated description | |
1279 | (use many globy for not failing on changed transaction) |
|
1279 | (use many globy for not failing on changed transaction) | |
1280 | $ LANGUAGE=sv hg help debugoptDEP |
|
1280 | $ LANGUAGE=sv hg help debugoptDEP | |
1281 | hg debugoptDEP |
|
1281 | hg debugoptDEP | |
1282 |
|
1282 | |||
1283 | (*) (glob) |
|
1283 | (*) (glob) | |
1284 |
|
1284 | |||
1285 | options: |
|
1285 | options: | |
1286 |
|
1286 | |||
1287 | (some details hidden, use --verbose to show complete help) |
|
1287 | (some details hidden, use --verbose to show complete help) | |
1288 | #endif |
|
1288 | #endif | |
1289 |
|
1289 | |||
1290 | Test commands that collide with topics (issue4240) |
|
1290 | Test commands that collide with topics (issue4240) | |
1291 |
|
1291 | |||
1292 | $ hg config -hq |
|
1292 | $ hg config -hq | |
1293 | hg config [-u] [NAME]... |
|
1293 | hg config [-u] [NAME]... | |
1294 |
|
1294 | |||
1295 | show combined config settings from all hgrc files |
|
1295 | show combined config settings from all hgrc files | |
1296 | $ hg showconfig -hq |
|
1296 | $ hg showconfig -hq | |
1297 | hg config [-u] [NAME]... |
|
1297 | hg config [-u] [NAME]... | |
1298 |
|
1298 | |||
1299 | show combined config settings from all hgrc files |
|
1299 | show combined config settings from all hgrc files | |
1300 |
|
1300 | |||
1301 | Test a help topic |
|
1301 | Test a help topic | |
1302 |
|
1302 | |||
1303 | $ hg help dates |
|
1303 | $ hg help dates | |
1304 | Date Formats |
|
1304 | Date Formats | |
1305 | """""""""""" |
|
1305 | """""""""""" | |
1306 |
|
1306 | |||
1307 | Some commands allow the user to specify a date, e.g.: |
|
1307 | Some commands allow the user to specify a date, e.g.: | |
1308 |
|
1308 | |||
1309 | - backout, commit, import, tag: Specify the commit date. |
|
1309 | - backout, commit, import, tag: Specify the commit date. | |
1310 | - log, revert, update: Select revision(s) by date. |
|
1310 | - log, revert, update: Select revision(s) by date. | |
1311 |
|
1311 | |||
1312 | Many date formats are valid. Here are some examples: |
|
1312 | Many date formats are valid. Here are some examples: | |
1313 |
|
1313 | |||
1314 | - "Wed Dec 6 13:18:29 2006" (local timezone assumed) |
|
1314 | - "Wed Dec 6 13:18:29 2006" (local timezone assumed) | |
1315 | - "Dec 6 13:18 -0600" (year assumed, time offset provided) |
|
1315 | - "Dec 6 13:18 -0600" (year assumed, time offset provided) | |
1316 | - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) |
|
1316 | - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) | |
1317 | - "Dec 6" (midnight) |
|
1317 | - "Dec 6" (midnight) | |
1318 | - "13:18" (today assumed) |
|
1318 | - "13:18" (today assumed) | |
1319 | - "3:39" (3:39AM assumed) |
|
1319 | - "3:39" (3:39AM assumed) | |
1320 | - "3:39pm" (15:39) |
|
1320 | - "3:39pm" (15:39) | |
1321 | - "2006-12-06 13:18:29" (ISO 8601 format) |
|
1321 | - "2006-12-06 13:18:29" (ISO 8601 format) | |
1322 | - "2006-12-6 13:18" |
|
1322 | - "2006-12-6 13:18" | |
1323 | - "2006-12-6" |
|
1323 | - "2006-12-6" | |
1324 | - "12-6" |
|
1324 | - "12-6" | |
1325 | - "12/6" |
|
1325 | - "12/6" | |
1326 | - "12/6/6" (Dec 6 2006) |
|
1326 | - "12/6/6" (Dec 6 2006) | |
1327 | - "today" (midnight) |
|
1327 | - "today" (midnight) | |
1328 | - "yesterday" (midnight) |
|
1328 | - "yesterday" (midnight) | |
1329 | - "now" - right now |
|
1329 | - "now" - right now | |
1330 |
|
1330 | |||
1331 | Lastly, there is Mercurial's internal format: |
|
1331 | Lastly, there is Mercurial's internal format: | |
1332 |
|
1332 | |||
1333 | - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) |
|
1333 | - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) | |
1334 |
|
1334 | |||
1335 | This is the internal representation format for dates. The first number is |
|
1335 | This is the internal representation format for dates. The first number is | |
1336 | the number of seconds since the epoch (1970-01-01 00:00 UTC). The second |
|
1336 | the number of seconds since the epoch (1970-01-01 00:00 UTC). The second | |
1337 | is the offset of the local timezone, in seconds west of UTC (negative if |
|
1337 | is the offset of the local timezone, in seconds west of UTC (negative if | |
1338 | the timezone is east of UTC). |
|
1338 | the timezone is east of UTC). | |
1339 |
|
1339 | |||
1340 | The log command also accepts date ranges: |
|
1340 | The log command also accepts date ranges: | |
1341 |
|
1341 | |||
1342 | - "<DATE" - at or before a given date/time |
|
1342 | - "<DATE" - at or before a given date/time | |
1343 | - ">DATE" - on or after a given date/time |
|
1343 | - ">DATE" - on or after a given date/time | |
1344 | - "DATE to DATE" - a date range, inclusive |
|
1344 | - "DATE to DATE" - a date range, inclusive | |
1345 | - "-DAYS" - within a given number of days of today |
|
1345 | - "-DAYS" - within a given number of days of today | |
1346 |
|
1346 | |||
1347 | Test repeated config section name |
|
1347 | Test repeated config section name | |
1348 |
|
1348 | |||
1349 | $ hg help config.host |
|
1349 | $ hg help config.host | |
1350 | "http_proxy.host" |
|
1350 | "http_proxy.host" | |
1351 | Host name and (optional) port of the proxy server, for example |
|
1351 | Host name and (optional) port of the proxy server, for example | |
1352 | "myproxy:8000". |
|
1352 | "myproxy:8000". | |
1353 |
|
1353 | |||
1354 | "smtp.host" |
|
1354 | "smtp.host" | |
1355 | Host name of mail server, e.g. "mail.example.com". |
|
1355 | Host name of mail server, e.g. "mail.example.com". | |
1356 |
|
1356 | |||
1357 | Unrelated trailing paragraphs shouldn't be included |
|
1357 | Unrelated trailing paragraphs shouldn't be included | |
1358 |
|
1358 | |||
1359 | $ hg help config.extramsg | grep '^$' |
|
1359 | $ hg help config.extramsg | grep '^$' | |
1360 |
|
1360 | |||
1361 |
|
1361 | |||
1362 | Test capitalized section name |
|
1362 | Test capitalized section name | |
1363 |
|
1363 | |||
1364 | $ hg help scripting.HGPLAIN > /dev/null |
|
1364 | $ hg help scripting.HGPLAIN > /dev/null | |
1365 |
|
1365 | |||
1366 | Help subsection: |
|
1366 | Help subsection: | |
1367 |
|
1367 | |||
1368 | $ hg help config.charsets |grep "Email example:" > /dev/null |
|
1368 | $ hg help config.charsets |grep "Email example:" > /dev/null | |
1369 | [1] |
|
1369 | [1] | |
1370 |
|
1370 | |||
1371 | Show nested definitions |
|
1371 | Show nested definitions | |
1372 | ("profiling.type"[break]"ls"[break]"stat"[break]) |
|
1372 | ("profiling.type"[break]"ls"[break]"stat"[break]) | |
1373 |
|
1373 | |||
1374 | $ hg help config.type | egrep '^$'|wc -l |
|
1374 | $ hg help config.type | egrep '^$'|wc -l | |
1375 | \s*3 (re) |
|
1375 | \s*3 (re) | |
1376 |
|
1376 | |||
1377 | Separate sections from subsections |
|
1377 | Separate sections from subsections | |
1378 |
|
1378 | |||
1379 | $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq |
|
1379 | $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq | |
1380 | "format" |
|
1380 | "format" | |
1381 | -------- |
|
1381 | -------- | |
1382 |
|
1382 | |||
1383 | "usegeneraldelta" |
|
1383 | "usegeneraldelta" | |
1384 |
|
1384 | |||
1385 | "dotencode" |
|
1385 | "dotencode" | |
1386 |
|
1386 | |||
1387 | "usefncache" |
|
1387 | "usefncache" | |
1388 |
|
1388 | |||
1389 | "usestore" |
|
1389 | "usestore" | |
1390 |
|
1390 | |||
1391 | "profiling" |
|
1391 | "profiling" | |
1392 | ----------- |
|
1392 | ----------- | |
1393 |
|
1393 | |||
1394 | "format" |
|
1394 | "format" | |
1395 |
|
1395 | |||
1396 | "progress" |
|
1396 | "progress" | |
1397 | ---------- |
|
1397 | ---------- | |
1398 |
|
1398 | |||
1399 | "format" |
|
1399 | "format" | |
1400 |
|
1400 | |||
1401 |
|
1401 | |||
1402 | Last item in help config.*: |
|
1402 | Last item in help config.*: | |
1403 |
|
1403 | |||
1404 | $ hg help config.`hg help config|grep '^ "'| \ |
|
1404 | $ hg help config.`hg help config|grep '^ "'| \ | |
1405 | > tail -1|sed 's![ "]*!!g'`| \ |
|
1405 | > tail -1|sed 's![ "]*!!g'`| \ | |
1406 | > grep 'hg help -c config' > /dev/null |
|
1406 | > grep 'hg help -c config' > /dev/null | |
1407 | [1] |
|
1407 | [1] | |
1408 |
|
1408 | |||
1409 | note to use help -c for general hg help config: |
|
1409 | note to use help -c for general hg help config: | |
1410 |
|
1410 | |||
1411 | $ hg help config |grep 'hg help -c config' > /dev/null |
|
1411 | $ hg help config |grep 'hg help -c config' > /dev/null | |
1412 |
|
1412 | |||
1413 | Test templating help |
|
1413 | Test templating help | |
1414 |
|
1414 | |||
1415 | $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) ' |
|
1415 | $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) ' | |
1416 | desc String. The text of the changeset description. |
|
1416 | desc String. The text of the changeset description. | |
1417 | diffstat String. Statistics of changes with the following format: |
|
1417 | diffstat String. Statistics of changes with the following format: | |
1418 | firstline Any text. Returns the first line of text. |
|
1418 | firstline Any text. Returns the first line of text. | |
1419 | nonempty Any text. Returns '(none)' if the string is empty. |
|
1419 | nonempty Any text. Returns '(none)' if the string is empty. | |
1420 |
|
1420 | |||
1421 | Test deprecated items |
|
1421 | Test deprecated items | |
1422 |
|
1422 | |||
1423 | $ hg help -v templating | grep currentbookmark |
|
1423 | $ hg help -v templating | grep currentbookmark | |
1424 | currentbookmark |
|
1424 | currentbookmark | |
1425 | $ hg help templating | (grep currentbookmark || true) |
|
1425 | $ hg help templating | (grep currentbookmark || true) | |
1426 |
|
1426 | |||
1427 | Test help hooks |
|
1427 | Test help hooks | |
1428 |
|
1428 | |||
1429 | $ cat > helphook1.py <<EOF |
|
1429 | $ cat > helphook1.py <<EOF | |
1430 | > from mercurial import help |
|
1430 | > from mercurial import help | |
1431 | > |
|
1431 | > | |
1432 | > def rewrite(ui, topic, doc): |
|
1432 | > def rewrite(ui, topic, doc): | |
1433 | > return doc + '\nhelphook1\n' |
|
1433 | > return doc + '\nhelphook1\n' | |
1434 | > |
|
1434 | > | |
1435 | > def extsetup(ui): |
|
1435 | > def extsetup(ui): | |
1436 | > help.addtopichook('revisions', rewrite) |
|
1436 | > help.addtopichook('revisions', rewrite) | |
1437 | > EOF |
|
1437 | > EOF | |
1438 | $ cat > helphook2.py <<EOF |
|
1438 | $ cat > helphook2.py <<EOF | |
1439 | > from mercurial import help |
|
1439 | > from mercurial import help | |
1440 | > |
|
1440 | > | |
1441 | > def rewrite(ui, topic, doc): |
|
1441 | > def rewrite(ui, topic, doc): | |
1442 | > return doc + '\nhelphook2\n' |
|
1442 | > return doc + '\nhelphook2\n' | |
1443 | > |
|
1443 | > | |
1444 | > def extsetup(ui): |
|
1444 | > def extsetup(ui): | |
1445 | > help.addtopichook('revisions', rewrite) |
|
1445 | > help.addtopichook('revisions', rewrite) | |
1446 | > EOF |
|
1446 | > EOF | |
1447 | $ echo '[extensions]' >> $HGRCPATH |
|
1447 | $ echo '[extensions]' >> $HGRCPATH | |
1448 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
|
1448 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH | |
1449 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
|
1449 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH | |
1450 | $ hg help revsets | grep helphook |
|
1450 | $ hg help revsets | grep helphook | |
1451 | helphook1 |
|
1451 | helphook1 | |
1452 | helphook2 |
|
1452 | helphook2 | |
1453 |
|
1453 | |||
1454 | help -c should only show debug --debug |
|
1454 | help -c should only show debug --debug | |
1455 |
|
1455 | |||
1456 | $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$' |
|
1456 | $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$' | |
1457 | [1] |
|
1457 | [1] | |
1458 |
|
1458 | |||
1459 | help -c should only show deprecated for -v |
|
1459 | help -c should only show deprecated for -v | |
1460 |
|
1460 | |||
1461 | $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$' |
|
1461 | $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$' | |
1462 | [1] |
|
1462 | [1] | |
1463 |
|
1463 | |||
1464 | Test -s / --system |
|
1464 | Test -s / --system | |
1465 |
|
1465 | |||
1466 | $ hg help config.files -s windows |grep 'etc/mercurial' | \ |
|
1466 | $ hg help config.files -s windows |grep 'etc/mercurial' | \ | |
1467 | > wc -l | sed -e 's/ //g' |
|
1467 | > wc -l | sed -e 's/ //g' | |
1468 | 0 |
|
1468 | 0 | |
1469 | $ hg help config.files --system unix | grep 'USER' | \ |
|
1469 | $ hg help config.files --system unix | grep 'USER' | \ | |
1470 | > wc -l | sed -e 's/ //g' |
|
1470 | > wc -l | sed -e 's/ //g' | |
1471 | 0 |
|
1471 | 0 | |
1472 |
|
1472 | |||
1473 | Test -e / -c / -k combinations |
|
1473 | Test -e / -c / -k combinations | |
1474 |
|
1474 | |||
1475 | $ hg help -c|egrep '^[A-Z].*:|^ debug' |
|
1475 | $ hg help -c|egrep '^[A-Z].*:|^ debug' | |
1476 | Commands: |
|
1476 | Commands: | |
1477 | $ hg help -e|egrep '^[A-Z].*:|^ debug' |
|
1477 | $ hg help -e|egrep '^[A-Z].*:|^ debug' | |
1478 | Extensions: |
|
1478 | Extensions: | |
1479 | $ hg help -k|egrep '^[A-Z].*:|^ debug' |
|
1479 | $ hg help -k|egrep '^[A-Z].*:|^ debug' | |
1480 | Topics: |
|
1480 | Topics: | |
1481 | Commands: |
|
1481 | Commands: | |
1482 | Extensions: |
|
1482 | Extensions: | |
1483 | Extension Commands: |
|
1483 | Extension Commands: | |
1484 | $ hg help -c schemes |
|
1484 | $ hg help -c schemes | |
1485 | abort: no such help topic: schemes |
|
1485 | abort: no such help topic: schemes | |
1486 | (try 'hg help --keyword schemes') |
|
1486 | (try 'hg help --keyword schemes') | |
1487 | [255] |
|
1487 | [255] | |
1488 | $ hg help -e schemes |head -1 |
|
1488 | $ hg help -e schemes |head -1 | |
1489 | schemes extension - extend schemes with shortcuts to repository swarms |
|
1489 | schemes extension - extend schemes with shortcuts to repository swarms | |
1490 | $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' |
|
1490 | $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' | |
1491 | Commands: |
|
1491 | Commands: | |
1492 | $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):' |
|
1492 | $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):' | |
1493 | Extensions: |
|
1493 | Extensions: | |
1494 | $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):' |
|
1494 | $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):' | |
1495 | Extensions: |
|
1495 | Extensions: | |
1496 | Commands: |
|
1496 | Commands: | |
1497 | $ hg help -c commit > /dev/null |
|
1497 | $ hg help -c commit > /dev/null | |
1498 | $ hg help -e -c commit > /dev/null |
|
1498 | $ hg help -e -c commit > /dev/null | |
1499 | $ hg help -e commit > /dev/null |
|
1499 | $ hg help -e commit > /dev/null | |
1500 | abort: no such help topic: commit |
|
1500 | abort: no such help topic: commit | |
1501 | (try 'hg help --keyword commit') |
|
1501 | (try 'hg help --keyword commit') | |
1502 | [255] |
|
1502 | [255] | |
1503 |
|
1503 | |||
1504 | Test keyword search help |
|
1504 | Test keyword search help | |
1505 |
|
1505 | |||
1506 | $ cat > prefixedname.py <<EOF |
|
1506 | $ cat > prefixedname.py <<EOF | |
1507 | > '''matched against word "clone" |
|
1507 | > '''matched against word "clone" | |
1508 | > ''' |
|
1508 | > ''' | |
1509 | > EOF |
|
1509 | > EOF | |
1510 | $ echo '[extensions]' >> $HGRCPATH |
|
1510 | $ echo '[extensions]' >> $HGRCPATH | |
1511 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH |
|
1511 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH | |
1512 | $ hg help -k clone |
|
1512 | $ hg help -k clone | |
1513 | Topics: |
|
1513 | Topics: | |
1514 |
|
1514 | |||
1515 | config Configuration Files |
|
1515 | config Configuration Files | |
1516 | extensions Using Additional Features |
|
1516 | extensions Using Additional Features | |
1517 | glossary Glossary |
|
1517 | glossary Glossary | |
1518 | phases Working with Phases |
|
1518 | phases Working with Phases | |
1519 | subrepos Subrepositories |
|
1519 | subrepos Subrepositories | |
1520 | urls URL Paths |
|
1520 | urls URL Paths | |
1521 |
|
1521 | |||
1522 | Commands: |
|
1522 | Commands: | |
1523 |
|
1523 | |||
1524 | bookmarks create a new bookmark or list existing bookmarks |
|
1524 | bookmarks create a new bookmark or list existing bookmarks | |
1525 | clone make a copy of an existing repository |
|
1525 | clone make a copy of an existing repository | |
1526 | paths show aliases for remote repositories |
|
1526 | paths show aliases for remote repositories | |
1527 | pull pull changes from the specified source |
|
1527 | pull pull changes from the specified source | |
1528 | update update working directory (or switch revisions) |
|
1528 | update update working directory (or switch revisions) | |
1529 |
|
1529 | |||
1530 | Extensions: |
|
1530 | Extensions: | |
1531 |
|
1531 | |||
1532 | clonebundles advertise pre-generated bundles to seed clones |
|
1532 | clonebundles advertise pre-generated bundles to seed clones | |
1533 | narrow create clones which fetch history data for subset of files |
|
1533 | narrow create clones which fetch history data for subset of files | |
1534 | (EXPERIMENTAL) |
|
1534 | (EXPERIMENTAL) | |
1535 | prefixedname matched against word "clone" |
|
1535 | prefixedname matched against word "clone" | |
1536 | relink recreates hardlinks between repository clones |
|
1536 | relink recreates hardlinks between repository clones | |
1537 |
|
1537 | |||
1538 | Extension Commands: |
|
1538 | Extension Commands: | |
1539 |
|
1539 | |||
1540 | qclone clone main and patch repository at same time |
|
1540 | qclone clone main and patch repository at same time | |
1541 |
|
1541 | |||
1542 | Test unfound topic |
|
1542 | Test unfound topic | |
1543 |
|
1543 | |||
1544 | $ hg help nonexistingtopicthatwillneverexisteverever |
|
1544 | $ hg help nonexistingtopicthatwillneverexisteverever | |
1545 | abort: no such help topic: nonexistingtopicthatwillneverexisteverever |
|
1545 | abort: no such help topic: nonexistingtopicthatwillneverexisteverever | |
1546 | (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever') |
|
1546 | (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever') | |
1547 | [255] |
|
1547 | [255] | |
1548 |
|
1548 | |||
1549 | Test unfound keyword |
|
1549 | Test unfound keyword | |
1550 |
|
1550 | |||
1551 | $ hg help --keyword nonexistingwordthatwillneverexisteverever |
|
1551 | $ hg help --keyword nonexistingwordthatwillneverexisteverever | |
1552 | abort: no matches |
|
1552 | abort: no matches | |
1553 | (try 'hg help' for a list of topics) |
|
1553 | (try 'hg help' for a list of topics) | |
1554 | [255] |
|
1554 | [255] | |
1555 |
|
1555 | |||
1556 | Test omit indicating for help |
|
1556 | Test omit indicating for help | |
1557 |
|
1557 | |||
1558 | $ cat > addverboseitems.py <<EOF |
|
1558 | $ cat > addverboseitems.py <<EOF | |
1559 | > '''extension to test omit indicating. |
|
1559 | > '''extension to test omit indicating. | |
1560 | > |
|
1560 | > | |
1561 | > This paragraph is never omitted (for extension) |
|
1561 | > This paragraph is never omitted (for extension) | |
1562 | > |
|
1562 | > | |
1563 | > .. container:: verbose |
|
1563 | > .. container:: verbose | |
1564 | > |
|
1564 | > | |
1565 | > This paragraph is omitted, |
|
1565 | > This paragraph is omitted, | |
1566 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension) |
|
1566 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension) | |
1567 | > |
|
1567 | > | |
1568 | > This paragraph is never omitted, too (for extension) |
|
1568 | > This paragraph is never omitted, too (for extension) | |
1569 | > ''' |
|
1569 | > ''' | |
1570 | > from __future__ import absolute_import |
|
1570 | > from __future__ import absolute_import | |
1571 | > from mercurial import commands, help |
|
1571 | > from mercurial import commands, help | |
1572 | > testtopic = """This paragraph is never omitted (for topic). |
|
1572 | > testtopic = """This paragraph is never omitted (for topic). | |
1573 | > |
|
1573 | > | |
1574 | > .. container:: verbose |
|
1574 | > .. container:: verbose | |
1575 | > |
|
1575 | > | |
1576 | > This paragraph is omitted, |
|
1576 | > This paragraph is omitted, | |
1577 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) |
|
1577 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) | |
1578 | > |
|
1578 | > | |
1579 | > This paragraph is never omitted, too (for topic) |
|
1579 | > This paragraph is never omitted, too (for topic) | |
1580 | > """ |
|
1580 | > """ | |
1581 | > def extsetup(ui): |
|
1581 | > def extsetup(ui): | |
1582 | > help.helptable.append((["topic-containing-verbose"], |
|
1582 | > help.helptable.append((["topic-containing-verbose"], | |
1583 | > "This is the topic to test omit indicating.", |
|
1583 | > "This is the topic to test omit indicating.", | |
1584 | > lambda ui: testtopic)) |
|
1584 | > lambda ui: testtopic)) | |
1585 | > EOF |
|
1585 | > EOF | |
1586 | $ echo '[extensions]' >> $HGRCPATH |
|
1586 | $ echo '[extensions]' >> $HGRCPATH | |
1587 | $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
|
1587 | $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH | |
1588 | $ hg help addverboseitems |
|
1588 | $ hg help addverboseitems | |
1589 | addverboseitems extension - extension to test omit indicating. |
|
1589 | addverboseitems extension - extension to test omit indicating. | |
1590 |
|
1590 | |||
1591 | This paragraph is never omitted (for extension) |
|
1591 | This paragraph is never omitted (for extension) | |
1592 |
|
1592 | |||
1593 | This paragraph is never omitted, too (for extension) |
|
1593 | This paragraph is never omitted, too (for extension) | |
1594 |
|
1594 | |||
1595 | (some details hidden, use --verbose to show complete help) |
|
1595 | (some details hidden, use --verbose to show complete help) | |
1596 |
|
1596 | |||
1597 | no commands defined |
|
1597 | no commands defined | |
1598 | $ hg help -v addverboseitems |
|
1598 | $ hg help -v addverboseitems | |
1599 | addverboseitems extension - extension to test omit indicating. |
|
1599 | addverboseitems extension - extension to test omit indicating. | |
1600 |
|
1600 | |||
1601 | This paragraph is never omitted (for extension) |
|
1601 | This paragraph is never omitted (for extension) | |
1602 |
|
1602 | |||
1603 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for |
|
1603 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for | |
1604 | extension) |
|
1604 | extension) | |
1605 |
|
1605 | |||
1606 | This paragraph is never omitted, too (for extension) |
|
1606 | This paragraph is never omitted, too (for extension) | |
1607 |
|
1607 | |||
1608 | no commands defined |
|
1608 | no commands defined | |
1609 | $ hg help topic-containing-verbose |
|
1609 | $ hg help topic-containing-verbose | |
1610 | This is the topic to test omit indicating. |
|
1610 | This is the topic to test omit indicating. | |
1611 | """""""""""""""""""""""""""""""""""""""""" |
|
1611 | """""""""""""""""""""""""""""""""""""""""" | |
1612 |
|
1612 | |||
1613 | This paragraph is never omitted (for topic). |
|
1613 | This paragraph is never omitted (for topic). | |
1614 |
|
1614 | |||
1615 | This paragraph is never omitted, too (for topic) |
|
1615 | This paragraph is never omitted, too (for topic) | |
1616 |
|
1616 | |||
1617 | (some details hidden, use --verbose to show complete help) |
|
1617 | (some details hidden, use --verbose to show complete help) | |
1618 | $ hg help -v topic-containing-verbose |
|
1618 | $ hg help -v topic-containing-verbose | |
1619 | This is the topic to test omit indicating. |
|
1619 | This is the topic to test omit indicating. | |
1620 | """""""""""""""""""""""""""""""""""""""""" |
|
1620 | """""""""""""""""""""""""""""""""""""""""" | |
1621 |
|
1621 | |||
1622 | This paragraph is never omitted (for topic). |
|
1622 | This paragraph is never omitted (for topic). | |
1623 |
|
1623 | |||
1624 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for |
|
1624 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for | |
1625 | topic) |
|
1625 | topic) | |
1626 |
|
1626 | |||
1627 | This paragraph is never omitted, too (for topic) |
|
1627 | This paragraph is never omitted, too (for topic) | |
1628 |
|
1628 | |||
1629 | Test section lookup |
|
1629 | Test section lookup | |
1630 |
|
1630 | |||
1631 | $ hg help revset.merge |
|
1631 | $ hg help revset.merge | |
1632 | "merge()" |
|
1632 | "merge()" | |
1633 | Changeset is a merge changeset. |
|
1633 | Changeset is a merge changeset. | |
1634 |
|
1634 | |||
1635 | $ hg help glossary.dag |
|
1635 | $ hg help glossary.dag | |
1636 | DAG |
|
1636 | DAG | |
1637 | The repository of changesets of a distributed version control system |
|
1637 | The repository of changesets of a distributed version control system | |
1638 | (DVCS) can be described as a directed acyclic graph (DAG), consisting |
|
1638 | (DVCS) can be described as a directed acyclic graph (DAG), consisting | |
1639 | of nodes and edges, where nodes correspond to changesets and edges |
|
1639 | of nodes and edges, where nodes correspond to changesets and edges | |
1640 | imply a parent -> child relation. This graph can be visualized by |
|
1640 | imply a parent -> child relation. This graph can be visualized by | |
1641 | graphical tools such as 'hg log --graph'. In Mercurial, the DAG is |
|
1641 | graphical tools such as 'hg log --graph'. In Mercurial, the DAG is | |
1642 | limited by the requirement for children to have at most two parents. |
|
1642 | limited by the requirement for children to have at most two parents. | |
1643 |
|
1643 | |||
1644 |
|
1644 | |||
1645 | $ hg help hgrc.paths |
|
1645 | $ hg help hgrc.paths | |
1646 | "paths" |
|
1646 | "paths" | |
1647 | ------- |
|
1647 | ------- | |
1648 |
|
1648 | |||
1649 | Assigns symbolic names and behavior to repositories. |
|
1649 | Assigns symbolic names and behavior to repositories. | |
1650 |
|
1650 | |||
1651 | Options are symbolic names defining the URL or directory that is the |
|
1651 | Options are symbolic names defining the URL or directory that is the | |
1652 | location of the repository. Example: |
|
1652 | location of the repository. Example: | |
1653 |
|
1653 | |||
1654 | [paths] |
|
1654 | [paths] | |
1655 | my_server = https://example.com/my_repo |
|
1655 | my_server = https://example.com/my_repo | |
1656 | local_path = /home/me/repo |
|
1656 | local_path = /home/me/repo | |
1657 |
|
1657 | |||
1658 | These symbolic names can be used from the command line. To pull from |
|
1658 | These symbolic names can be used from the command line. To pull from | |
1659 | "my_server": 'hg pull my_server'. To push to "local_path": 'hg push |
|
1659 | "my_server": 'hg pull my_server'. To push to "local_path": 'hg push | |
1660 | local_path'. |
|
1660 | local_path'. | |
1661 |
|
1661 | |||
1662 | Options containing colons (":") denote sub-options that can influence |
|
1662 | Options containing colons (":") denote sub-options that can influence | |
1663 | behavior for that specific path. Example: |
|
1663 | behavior for that specific path. Example: | |
1664 |
|
1664 | |||
1665 | [paths] |
|
1665 | [paths] | |
1666 | my_server = https://example.com/my_path |
|
1666 | my_server = https://example.com/my_path | |
1667 | my_server:pushurl = ssh://example.com/my_path |
|
1667 | my_server:pushurl = ssh://example.com/my_path | |
1668 |
|
1668 | |||
1669 | The following sub-options can be defined: |
|
1669 | The following sub-options can be defined: | |
1670 |
|
1670 | |||
1671 | "pushurl" |
|
1671 | "pushurl" | |
1672 | The URL to use for push operations. If not defined, the location |
|
1672 | The URL to use for push operations. If not defined, the location | |
1673 | defined by the path's main entry is used. |
|
1673 | defined by the path's main entry is used. | |
1674 |
|
1674 | |||
1675 | "pushrev" |
|
1675 | "pushrev" | |
1676 | A revset defining which revisions to push by default. |
|
1676 | A revset defining which revisions to push by default. | |
1677 |
|
1677 | |||
1678 | When 'hg push' is executed without a "-r" argument, the revset defined |
|
1678 | When 'hg push' is executed without a "-r" argument, the revset defined | |
1679 | by this sub-option is evaluated to determine what to push. |
|
1679 | by this sub-option is evaluated to determine what to push. | |
1680 |
|
1680 | |||
1681 | For example, a value of "." will push the working directory's revision |
|
1681 | For example, a value of "." will push the working directory's revision | |
1682 | by default. |
|
1682 | by default. | |
1683 |
|
1683 | |||
1684 | Revsets specifying bookmarks will not result in the bookmark being |
|
1684 | Revsets specifying bookmarks will not result in the bookmark being | |
1685 | pushed. |
|
1685 | pushed. | |
1686 |
|
1686 | |||
1687 | The following special named paths exist: |
|
1687 | The following special named paths exist: | |
1688 |
|
1688 | |||
1689 | "default" |
|
1689 | "default" | |
1690 | The URL or directory to use when no source or remote is specified. |
|
1690 | The URL or directory to use when no source or remote is specified. | |
1691 |
|
1691 | |||
1692 | 'hg clone' will automatically define this path to the location the |
|
1692 | 'hg clone' will automatically define this path to the location the | |
1693 | repository was cloned from. |
|
1693 | repository was cloned from. | |
1694 |
|
1694 | |||
1695 | "default-push" |
|
1695 | "default-push" | |
1696 | (deprecated) The URL or directory for the default 'hg push' location. |
|
1696 | (deprecated) The URL or directory for the default 'hg push' location. | |
1697 | "default:pushurl" should be used instead. |
|
1697 | "default:pushurl" should be used instead. | |
1698 |
|
1698 | |||
1699 | $ hg help glossary.mcguffin |
|
1699 | $ hg help glossary.mcguffin | |
1700 | abort: help section not found: glossary.mcguffin |
|
1700 | abort: help section not found: glossary.mcguffin | |
1701 | [255] |
|
1701 | [255] | |
1702 |
|
1702 | |||
1703 | $ hg help glossary.mc.guffin |
|
1703 | $ hg help glossary.mc.guffin | |
1704 | abort: help section not found: glossary.mc.guffin |
|
1704 | abort: help section not found: glossary.mc.guffin | |
1705 | [255] |
|
1705 | [255] | |
1706 |
|
1706 | |||
1707 | $ hg help template.files |
|
1707 | $ hg help template.files | |
1708 | files List of strings. All files modified, added, or removed by |
|
1708 | files List of strings. All files modified, added, or removed by | |
1709 | this changeset. |
|
1709 | this changeset. | |
1710 | files(pattern) |
|
1710 | files(pattern) | |
1711 | All files of the current changeset matching the pattern. See |
|
1711 | All files of the current changeset matching the pattern. See | |
1712 | 'hg help patterns'. |
|
1712 | 'hg help patterns'. | |
1713 |
|
1713 | |||
1714 | Test section lookup by translated message |
|
1714 | Test section lookup by translated message | |
1715 |
|
1715 | |||
1716 | str.lower() instead of encoding.lower(str) on translated message might |
|
1716 | str.lower() instead of encoding.lower(str) on translated message might | |
1717 | make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z) |
|
1717 | make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z) | |
1718 | as the second or later byte of multi-byte character. |
|
1718 | as the second or later byte of multi-byte character. | |
1719 |
|
1719 | |||
1720 | For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932) |
|
1720 | For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932) | |
1721 | contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this |
|
1721 | contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this | |
1722 | replacement makes message meaningless. |
|
1722 | replacement makes message meaningless. | |
1723 |
|
1723 | |||
1724 | This tests that section lookup by translated string isn't broken by |
|
1724 | This tests that section lookup by translated string isn't broken by | |
1725 | such str.lower(). |
|
1725 | such str.lower(). | |
1726 |
|
1726 | |||
1727 | $ $PYTHON <<EOF |
|
1727 | $ $PYTHON <<EOF | |
1728 | > def escape(s): |
|
1728 | > def escape(s): | |
1729 | > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932')) |
|
1729 | > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932')) | |
1730 | > # translation of "record" in ja_JP.cp932 |
|
1730 | > # translation of "record" in ja_JP.cp932 | |
1731 | > upper = "\x8bL\x98^" |
|
1731 | > upper = "\x8bL\x98^" | |
1732 | > # str.lower()-ed section name should be treated as different one |
|
1732 | > # str.lower()-ed section name should be treated as different one | |
1733 | > lower = "\x8bl\x98^" |
|
1733 | > lower = "\x8bl\x98^" | |
1734 | > with open('ambiguous.py', 'w') as fp: |
|
1734 | > with open('ambiguous.py', 'w') as fp: | |
1735 | > fp.write("""# ambiguous section names in ja_JP.cp932 |
|
1735 | > fp.write("""# ambiguous section names in ja_JP.cp932 | |
1736 | > u'''summary of extension |
|
1736 | > u'''summary of extension | |
1737 | > |
|
1737 | > | |
1738 | > %s |
|
1738 | > %s | |
1739 | > ---- |
|
1739 | > ---- | |
1740 | > |
|
1740 | > | |
1741 | > Upper name should show only this message |
|
1741 | > Upper name should show only this message | |
1742 | > |
|
1742 | > | |
1743 | > %s |
|
1743 | > %s | |
1744 | > ---- |
|
1744 | > ---- | |
1745 | > |
|
1745 | > | |
1746 | > Lower name should show only this message |
|
1746 | > Lower name should show only this message | |
1747 | > |
|
1747 | > | |
1748 | > subsequent section |
|
1748 | > subsequent section | |
1749 | > ------------------ |
|
1749 | > ------------------ | |
1750 | > |
|
1750 | > | |
1751 | > This should be hidden at 'hg help ambiguous' with section name. |
|
1751 | > This should be hidden at 'hg help ambiguous' with section name. | |
1752 | > ''' |
|
1752 | > ''' | |
1753 | > """ % (escape(upper), escape(lower))) |
|
1753 | > """ % (escape(upper), escape(lower))) | |
1754 | > EOF |
|
1754 | > EOF | |
1755 |
|
1755 | |||
1756 | $ cat >> $HGRCPATH <<EOF |
|
1756 | $ cat >> $HGRCPATH <<EOF | |
1757 | > [extensions] |
|
1757 | > [extensions] | |
1758 | > ambiguous = ./ambiguous.py |
|
1758 | > ambiguous = ./ambiguous.py | |
1759 | > EOF |
|
1759 | > EOF | |
1760 |
|
1760 | |||
1761 | $ $PYTHON <<EOF | sh |
|
1761 | $ $PYTHON <<EOF | sh | |
1762 | > upper = "\x8bL\x98^" |
|
1762 | > upper = "\x8bL\x98^" | |
1763 | > print("hg --encoding cp932 help -e ambiguous.%s" % upper) |
|
1763 | > print("hg --encoding cp932 help -e ambiguous.%s" % upper) | |
1764 | > EOF |
|
1764 | > EOF | |
1765 | \x8bL\x98^ (esc) |
|
1765 | \x8bL\x98^ (esc) | |
1766 | ---- |
|
1766 | ---- | |
1767 |
|
1767 | |||
1768 | Upper name should show only this message |
|
1768 | Upper name should show only this message | |
1769 |
|
1769 | |||
1770 |
|
1770 | |||
1771 | $ $PYTHON <<EOF | sh |
|
1771 | $ $PYTHON <<EOF | sh | |
1772 | > lower = "\x8bl\x98^" |
|
1772 | > lower = "\x8bl\x98^" | |
1773 | > print("hg --encoding cp932 help -e ambiguous.%s" % lower) |
|
1773 | > print("hg --encoding cp932 help -e ambiguous.%s" % lower) | |
1774 | > EOF |
|
1774 | > EOF | |
1775 | \x8bl\x98^ (esc) |
|
1775 | \x8bl\x98^ (esc) | |
1776 | ---- |
|
1776 | ---- | |
1777 |
|
1777 | |||
1778 | Lower name should show only this message |
|
1778 | Lower name should show only this message | |
1779 |
|
1779 | |||
1780 |
|
1780 | |||
1781 | $ cat >> $HGRCPATH <<EOF |
|
1781 | $ cat >> $HGRCPATH <<EOF | |
1782 | > [extensions] |
|
1782 | > [extensions] | |
1783 | > ambiguous = ! |
|
1783 | > ambiguous = ! | |
1784 | > EOF |
|
1784 | > EOF | |
1785 |
|
1785 | |||
1786 | Show help content of disabled extensions |
|
1786 | Show help content of disabled extensions | |
1787 |
|
1787 | |||
1788 | $ cat >> $HGRCPATH <<EOF |
|
1788 | $ cat >> $HGRCPATH <<EOF | |
1789 | > [extensions] |
|
1789 | > [extensions] | |
1790 | > ambiguous = !./ambiguous.py |
|
1790 | > ambiguous = !./ambiguous.py | |
1791 | > EOF |
|
1791 | > EOF | |
1792 | $ hg help -e ambiguous |
|
1792 | $ hg help -e ambiguous | |
1793 | ambiguous extension - (no help text available) |
|
1793 | ambiguous extension - (no help text available) | |
1794 |
|
1794 | |||
1795 | (use 'hg help extensions' for information on enabling extensions) |
|
1795 | (use 'hg help extensions' for information on enabling extensions) | |
1796 |
|
1796 | |||
1797 | Test dynamic list of merge tools only shows up once |
|
1797 | Test dynamic list of merge tools only shows up once | |
1798 | $ hg help merge-tools |
|
1798 | $ hg help merge-tools | |
1799 | Merge Tools |
|
1799 | Merge Tools | |
1800 | """"""""""" |
|
1800 | """"""""""" | |
1801 |
|
1801 | |||
1802 | To merge files Mercurial uses merge tools. |
|
1802 | To merge files Mercurial uses merge tools. | |
1803 |
|
1803 | |||
1804 | A merge tool combines two different versions of a file into a merged file. |
|
1804 | A merge tool combines two different versions of a file into a merged file. | |
1805 | Merge tools are given the two files and the greatest common ancestor of |
|
1805 | Merge tools are given the two files and the greatest common ancestor of | |
1806 | the two file versions, so they can determine the changes made on both |
|
1806 | the two file versions, so they can determine the changes made on both | |
1807 | branches. |
|
1807 | branches. | |
1808 |
|
1808 | |||
1809 | Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg |
|
1809 | Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg | |
1810 | backout' and in several extensions. |
|
1810 | backout' and in several extensions. | |
1811 |
|
1811 | |||
1812 | Usually, the merge tool tries to automatically reconcile the files by |
|
1812 | Usually, the merge tool tries to automatically reconcile the files by | |
1813 | combining all non-overlapping changes that occurred separately in the two |
|
1813 | combining all non-overlapping changes that occurred separately in the two | |
1814 | different evolutions of the same initial base file. Furthermore, some |
|
1814 | different evolutions of the same initial base file. Furthermore, some | |
1815 | interactive merge programs make it easier to manually resolve conflicting |
|
1815 | interactive merge programs make it easier to manually resolve conflicting | |
1816 | merges, either in a graphical way, or by inserting some conflict markers. |
|
1816 | merges, either in a graphical way, or by inserting some conflict markers. | |
1817 | Mercurial does not include any interactive merge programs but relies on |
|
1817 | Mercurial does not include any interactive merge programs but relies on | |
1818 | external tools for that. |
|
1818 | external tools for that. | |
1819 |
|
1819 | |||
1820 | Available merge tools |
|
1820 | Available merge tools | |
1821 | ===================== |
|
1821 | ===================== | |
1822 |
|
1822 | |||
1823 | External merge tools and their properties are configured in the merge- |
|
1823 | External merge tools and their properties are configured in the merge- | |
1824 | tools configuration section - see hgrc(5) - but they can often just be |
|
1824 | tools configuration section - see hgrc(5) - but they can often just be | |
1825 | named by their executable. |
|
1825 | named by their executable. | |
1826 |
|
1826 | |||
1827 | A merge tool is generally usable if its executable can be found on the |
|
1827 | A merge tool is generally usable if its executable can be found on the | |
1828 | system and if it can handle the merge. The executable is found if it is an |
|
1828 | system and if it can handle the merge. The executable is found if it is an | |
1829 | absolute or relative executable path or the name of an application in the |
|
1829 | absolute or relative executable path or the name of an application in the | |
1830 | executable search path. The tool is assumed to be able to handle the merge |
|
1830 | executable search path. The tool is assumed to be able to handle the merge | |
1831 | if it can handle symlinks if the file is a symlink, if it can handle |
|
1831 | if it can handle symlinks if the file is a symlink, if it can handle | |
1832 | binary files if the file is binary, and if a GUI is available if the tool |
|
1832 | binary files if the file is binary, and if a GUI is available if the tool | |
1833 | requires a GUI. |
|
1833 | requires a GUI. | |
1834 |
|
1834 | |||
1835 | There are some internal merge tools which can be used. The internal merge |
|
1835 | There are some internal merge tools which can be used. The internal merge | |
1836 | tools are: |
|
1836 | tools are: | |
1837 |
|
1837 | |||
1838 | ":dump" |
|
1838 | ":dump" | |
1839 | Creates three versions of the files to merge, containing the contents of |
|
1839 | Creates three versions of the files to merge, containing the contents of | |
1840 | local, other and base. These files can then be used to perform a merge |
|
1840 | local, other and base. These files can then be used to perform a merge | |
1841 | manually. If the file to be merged is named "a.txt", these files will |
|
1841 | manually. If the file to be merged is named "a.txt", these files will | |
1842 | accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and |
|
1842 | accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and | |
1843 | they will be placed in the same directory as "a.txt". |
|
1843 | they will be placed in the same directory as "a.txt". | |
1844 |
|
1844 | |||
1845 | This implies premerge. Therefore, files aren't dumped, if premerge runs |
|
1845 | This implies premerge. Therefore, files aren't dumped, if premerge runs | |
1846 | successfully. Use :forcedump to forcibly write files out. |
|
1846 | successfully. Use :forcedump to forcibly write files out. | |
1847 |
|
1847 | |||
1848 | ":fail" |
|
1848 | ":fail" | |
1849 | Rather than attempting to merge files that were modified on both |
|
1849 | Rather than attempting to merge files that were modified on both | |
1850 | branches, it marks them as unresolved. The resolve command must be used |
|
1850 | branches, it marks them as unresolved. The resolve command must be used | |
1851 | to resolve these conflicts. |
|
1851 | to resolve these conflicts. | |
1852 |
|
1852 | |||
1853 | ":forcedump" |
|
1853 | ":forcedump" | |
1854 | Creates three versions of the files as same as :dump, but omits |
|
1854 | Creates three versions of the files as same as :dump, but omits | |
1855 | premerge. |
|
1855 | premerge. | |
1856 |
|
1856 | |||
1857 | ":local" |
|
1857 | ":local" | |
1858 | Uses the local 'p1()' version of files as the merged version. |
|
1858 | Uses the local 'p1()' version of files as the merged version. | |
1859 |
|
1859 | |||
1860 | ":merge" |
|
1860 | ":merge" | |
1861 | Uses the internal non-interactive simple merge algorithm for merging |
|
1861 | Uses the internal non-interactive simple merge algorithm for merging | |
1862 | files. It will fail if there are any conflicts and leave markers in the |
|
1862 | files. It will fail if there are any conflicts and leave markers in the | |
1863 | partially merged file. Markers will have two sections, one for each side |
|
1863 | partially merged file. Markers will have two sections, one for each side | |
1864 | of merge. |
|
1864 | of merge. | |
1865 |
|
1865 | |||
1866 | ":merge-local" |
|
1866 | ":merge-local" | |
1867 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
1867 | Like :merge, but resolve all conflicts non-interactively in favor of the | |
1868 | local 'p1()' changes. |
|
1868 | local 'p1()' changes. | |
1869 |
|
1869 | |||
1870 | ":merge-other" |
|
1870 | ":merge-other" | |
1871 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
1871 | Like :merge, but resolve all conflicts non-interactively in favor of the | |
1872 | other 'p2()' changes. |
|
1872 | other 'p2()' changes. | |
1873 |
|
1873 | |||
1874 | ":merge3" |
|
1874 | ":merge3" | |
1875 | Uses the internal non-interactive simple merge algorithm for merging |
|
1875 | Uses the internal non-interactive simple merge algorithm for merging | |
1876 | files. It will fail if there are any conflicts and leave markers in the |
|
1876 | files. It will fail if there are any conflicts and leave markers in the | |
1877 | partially merged file. Marker will have three sections, one from each |
|
1877 | partially merged file. Marker will have three sections, one from each | |
1878 | side of the merge and one for the base content. |
|
1878 | side of the merge and one for the base content. | |
1879 |
|
1879 | |||
1880 | ":other" |
|
1880 | ":other" | |
1881 | Uses the other 'p2()' version of files as the merged version. |
|
1881 | Uses the other 'p2()' version of files as the merged version. | |
1882 |
|
1882 | |||
1883 | ":prompt" |
|
1883 | ":prompt" | |
1884 | Asks the user which of the local 'p1()' or the other 'p2()' version to |
|
1884 | Asks the user which of the local 'p1()' or the other 'p2()' version to | |
1885 | keep as the merged version. |
|
1885 | keep as the merged version. | |
1886 |
|
1886 | |||
1887 | ":tagmerge" |
|
1887 | ":tagmerge" | |
1888 | Uses the internal tag merge algorithm (experimental). |
|
1888 | Uses the internal tag merge algorithm (experimental). | |
1889 |
|
1889 | |||
1890 | ":union" |
|
1890 | ":union" | |
1891 | Uses the internal non-interactive simple merge algorithm for merging |
|
1891 | Uses the internal non-interactive simple merge algorithm for merging | |
1892 | files. It will use both left and right sides for conflict regions. No |
|
1892 | files. It will use both left and right sides for conflict regions. No | |
1893 | markers are inserted. |
|
1893 | markers are inserted. | |
1894 |
|
1894 | |||
1895 | Internal tools are always available and do not require a GUI but will by |
|
1895 | Internal tools are always available and do not require a GUI but will by | |
1896 | default not handle symlinks or binary files. |
|
1896 | default not handle symlinks or binary files. | |
1897 |
|
1897 | |||
1898 | Choosing a merge tool |
|
1898 | Choosing a merge tool | |
1899 | ===================== |
|
1899 | ===================== | |
1900 |
|
1900 | |||
1901 | Mercurial uses these rules when deciding which merge tool to use: |
|
1901 | Mercurial uses these rules when deciding which merge tool to use: | |
1902 |
|
1902 | |||
1903 | 1. If a tool has been specified with the --tool option to merge or |
|
1903 | 1. If a tool has been specified with the --tool option to merge or | |
1904 | resolve, it is used. If it is the name of a tool in the merge-tools |
|
1904 | resolve, it is used. If it is the name of a tool in the merge-tools | |
1905 | configuration, its configuration is used. Otherwise the specified tool |
|
1905 | configuration, its configuration is used. Otherwise the specified tool | |
1906 | must be executable by the shell. |
|
1906 | must be executable by the shell. | |
1907 | 2. If the "HGMERGE" environment variable is present, its value is used and |
|
1907 | 2. If the "HGMERGE" environment variable is present, its value is used and | |
1908 | must be executable by the shell. |
|
1908 | must be executable by the shell. | |
1909 | 3. If the filename of the file to be merged matches any of the patterns in |
|
1909 | 3. If the filename of the file to be merged matches any of the patterns in | |
1910 | the merge-patterns configuration section, the first usable merge tool |
|
1910 | the merge-patterns configuration section, the first usable merge tool | |
1911 | corresponding to a matching pattern is used. Here, binary capabilities |
|
1911 | corresponding to a matching pattern is used. Here, binary capabilities | |
1912 | of the merge tool are not considered. |
|
1912 | of the merge tool are not considered. | |
1913 | 4. If ui.merge is set it will be considered next. If the value is not the |
|
1913 | 4. If ui.merge is set it will be considered next. If the value is not the | |
1914 | name of a configured tool, the specified value is used and must be |
|
1914 | name of a configured tool, the specified value is used and must be | |
1915 | executable by the shell. Otherwise the named tool is used if it is |
|
1915 | executable by the shell. Otherwise the named tool is used if it is | |
1916 | usable. |
|
1916 | usable. | |
1917 | 5. If any usable merge tools are present in the merge-tools configuration |
|
1917 | 5. If any usable merge tools are present in the merge-tools configuration | |
1918 | section, the one with the highest priority is used. |
|
1918 | section, the one with the highest priority is used. | |
1919 | 6. If a program named "hgmerge" can be found on the system, it is used - |
|
1919 | 6. If a program named "hgmerge" can be found on the system, it is used - | |
1920 | but it will by default not be used for symlinks and binary files. |
|
1920 | but it will by default not be used for symlinks and binary files. | |
1921 | 7. If the file to be merged is not binary and is not a symlink, then |
|
1921 | 7. If the file to be merged is not binary and is not a symlink, then | |
1922 | internal ":merge" is used. |
|
1922 | internal ":merge" is used. | |
1923 | 8. Otherwise, ":prompt" is used. |
|
1923 | 8. Otherwise, ":prompt" is used. | |
1924 |
|
1924 | |||
1925 | Note: |
|
1925 | Note: | |
1926 | After selecting a merge program, Mercurial will by default attempt to |
|
1926 | After selecting a merge program, Mercurial will by default attempt to | |
1927 | merge the files using a simple merge algorithm first. Only if it |
|
1927 | merge the files using a simple merge algorithm first. Only if it | |
1928 | doesn't succeed because of conflicting changes will Mercurial actually |
|
1928 | doesn't succeed because of conflicting changes will Mercurial actually | |
1929 | execute the merge program. Whether to use the simple merge algorithm |
|
1929 | execute the merge program. Whether to use the simple merge algorithm | |
1930 | first can be controlled by the premerge setting of the merge tool. |
|
1930 | first can be controlled by the premerge setting of the merge tool. | |
1931 | Premerge is enabled by default unless the file is binary or a symlink. |
|
1931 | Premerge is enabled by default unless the file is binary or a symlink. | |
1932 |
|
1932 | |||
1933 | See the merge-tools and ui sections of hgrc(5) for details on the |
|
1933 | See the merge-tools and ui sections of hgrc(5) for details on the | |
1934 | configuration of merge tools. |
|
1934 | configuration of merge tools. | |
1935 |
|
1935 | |||
1936 | Compression engines listed in `hg help bundlespec` |
|
1936 | Compression engines listed in `hg help bundlespec` | |
1937 |
|
1937 | |||
1938 | $ hg help bundlespec | grep gzip |
|
1938 | $ hg help bundlespec | grep gzip | |
1939 | "v1" bundles can only use the "gzip", "bzip2", and "none" compression |
|
1939 | "v1" bundles can only use the "gzip", "bzip2", and "none" compression | |
1940 | An algorithm that produces smaller bundles than "gzip". |
|
1940 | An algorithm that produces smaller bundles than "gzip". | |
1941 | This engine will likely produce smaller bundles than "gzip" but will be |
|
1941 | This engine will likely produce smaller bundles than "gzip" but will be | |
1942 | "gzip" |
|
1942 | "gzip" | |
1943 | better compression than "gzip". It also frequently yields better (?) |
|
1943 | better compression than "gzip". It also frequently yields better (?) | |
1944 |
|
1944 | |||
1945 | Test usage of section marks in help documents |
|
1945 | Test usage of section marks in help documents | |
1946 |
|
1946 | |||
1947 | $ cd "$TESTDIR"/../doc |
|
1947 | $ cd "$TESTDIR"/../doc | |
1948 | $ $PYTHON check-seclevel.py |
|
1948 | $ $PYTHON check-seclevel.py | |
1949 | $ cd $TESTTMP |
|
1949 | $ cd $TESTTMP | |
1950 |
|
1950 | |||
1951 | #if serve |
|
1951 | #if serve | |
1952 |
|
1952 | |||
1953 | Test the help pages in hgweb. |
|
1953 | Test the help pages in hgweb. | |
1954 |
|
1954 | |||
1955 | Dish up an empty repo; serve it cold. |
|
1955 | Dish up an empty repo; serve it cold. | |
1956 |
|
1956 | |||
1957 | $ hg init "$TESTTMP/test" |
|
1957 | $ hg init "$TESTTMP/test" | |
1958 | $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid |
|
1958 | $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid | |
1959 | $ cat hg.pid >> $DAEMON_PIDS |
|
1959 | $ cat hg.pid >> $DAEMON_PIDS | |
1960 |
|
1960 | |||
1961 | $ get-with-headers.py $LOCALIP:$HGPORT "help" |
|
1961 | $ get-with-headers.py $LOCALIP:$HGPORT "help" | |
1962 | 200 Script output follows |
|
1962 | 200 Script output follows | |
1963 |
|
1963 | |||
1964 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
1964 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
1965 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
1965 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
1966 | <head> |
|
1966 | <head> | |
1967 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
1967 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
1968 | <meta name="robots" content="index, nofollow" /> |
|
1968 | <meta name="robots" content="index, nofollow" /> | |
1969 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
1969 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
1970 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
1970 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
1971 |
|
1971 | |||
1972 | <title>Help: Index</title> |
|
1972 | <title>Help: Index</title> | |
1973 | </head> |
|
1973 | </head> | |
1974 | <body> |
|
1974 | <body> | |
1975 |
|
1975 | |||
1976 | <div class="container"> |
|
1976 | <div class="container"> | |
1977 | <div class="menu"> |
|
1977 | <div class="menu"> | |
1978 | <div class="logo"> |
|
1978 | <div class="logo"> | |
1979 | <a href="https://mercurial-scm.org/"> |
|
1979 | <a href="https://mercurial-scm.org/"> | |
1980 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
1980 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
1981 | </div> |
|
1981 | </div> | |
1982 | <ul> |
|
1982 | <ul> | |
1983 | <li><a href="/shortlog">log</a></li> |
|
1983 | <li><a href="/shortlog">log</a></li> | |
1984 | <li><a href="/graph">graph</a></li> |
|
1984 | <li><a href="/graph">graph</a></li> | |
1985 | <li><a href="/tags">tags</a></li> |
|
1985 | <li><a href="/tags">tags</a></li> | |
1986 | <li><a href="/bookmarks">bookmarks</a></li> |
|
1986 | <li><a href="/bookmarks">bookmarks</a></li> | |
1987 | <li><a href="/branches">branches</a></li> |
|
1987 | <li><a href="/branches">branches</a></li> | |
1988 | </ul> |
|
1988 | </ul> | |
1989 | <ul> |
|
1989 | <ul> | |
1990 | <li class="active">help</li> |
|
1990 | <li class="active">help</li> | |
1991 | </ul> |
|
1991 | </ul> | |
1992 | </div> |
|
1992 | </div> | |
1993 |
|
1993 | |||
1994 | <div class="main"> |
|
1994 | <div class="main"> | |
1995 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
1995 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
1996 |
|
1996 | |||
1997 | <form class="search" action="/log"> |
|
1997 | <form class="search" action="/log"> | |
1998 |
|
1998 | |||
1999 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
1999 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
2000 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2000 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
2001 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2001 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
2002 | </form> |
|
2002 | </form> | |
2003 | <table class="bigtable"> |
|
2003 | <table class="bigtable"> | |
2004 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> |
|
2004 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> | |
2005 |
|
2005 | |||
2006 | <tr><td> |
|
2006 | <tr><td> | |
2007 | <a href="/help/bundlespec"> |
|
2007 | <a href="/help/bundlespec"> | |
2008 | bundlespec |
|
2008 | bundlespec | |
2009 | </a> |
|
2009 | </a> | |
2010 | </td><td> |
|
2010 | </td><td> | |
2011 | Bundle File Formats |
|
2011 | Bundle File Formats | |
2012 | </td></tr> |
|
2012 | </td></tr> | |
2013 | <tr><td> |
|
2013 | <tr><td> | |
2014 | <a href="/help/color"> |
|
2014 | <a href="/help/color"> | |
2015 | color |
|
2015 | color | |
2016 | </a> |
|
2016 | </a> | |
2017 | </td><td> |
|
2017 | </td><td> | |
2018 | Colorizing Outputs |
|
2018 | Colorizing Outputs | |
2019 | </td></tr> |
|
2019 | </td></tr> | |
2020 | <tr><td> |
|
2020 | <tr><td> | |
2021 | <a href="/help/config"> |
|
2021 | <a href="/help/config"> | |
2022 | config |
|
2022 | config | |
2023 | </a> |
|
2023 | </a> | |
2024 | </td><td> |
|
2024 | </td><td> | |
2025 | Configuration Files |
|
2025 | Configuration Files | |
2026 | </td></tr> |
|
2026 | </td></tr> | |
2027 | <tr><td> |
|
2027 | <tr><td> | |
2028 | <a href="/help/dates"> |
|
2028 | <a href="/help/dates"> | |
2029 | dates |
|
2029 | dates | |
2030 | </a> |
|
2030 | </a> | |
2031 | </td><td> |
|
2031 | </td><td> | |
2032 | Date Formats |
|
2032 | Date Formats | |
2033 | </td></tr> |
|
2033 | </td></tr> | |
2034 | <tr><td> |
|
2034 | <tr><td> | |
2035 | <a href="/help/diffs"> |
|
2035 | <a href="/help/diffs"> | |
2036 | diffs |
|
2036 | diffs | |
2037 | </a> |
|
2037 | </a> | |
2038 | </td><td> |
|
2038 | </td><td> | |
2039 | Diff Formats |
|
2039 | Diff Formats | |
2040 | </td></tr> |
|
2040 | </td></tr> | |
2041 | <tr><td> |
|
2041 | <tr><td> | |
2042 | <a href="/help/environment"> |
|
2042 | <a href="/help/environment"> | |
2043 | environment |
|
2043 | environment | |
2044 | </a> |
|
2044 | </a> | |
2045 | </td><td> |
|
2045 | </td><td> | |
2046 | Environment Variables |
|
2046 | Environment Variables | |
2047 | </td></tr> |
|
2047 | </td></tr> | |
2048 | <tr><td> |
|
2048 | <tr><td> | |
2049 | <a href="/help/extensions"> |
|
2049 | <a href="/help/extensions"> | |
2050 | extensions |
|
2050 | extensions | |
2051 | </a> |
|
2051 | </a> | |
2052 | </td><td> |
|
2052 | </td><td> | |
2053 | Using Additional Features |
|
2053 | Using Additional Features | |
2054 | </td></tr> |
|
2054 | </td></tr> | |
2055 | <tr><td> |
|
2055 | <tr><td> | |
2056 | <a href="/help/filesets"> |
|
2056 | <a href="/help/filesets"> | |
2057 | filesets |
|
2057 | filesets | |
2058 | </a> |
|
2058 | </a> | |
2059 | </td><td> |
|
2059 | </td><td> | |
2060 | Specifying File Sets |
|
2060 | Specifying File Sets | |
2061 | </td></tr> |
|
2061 | </td></tr> | |
2062 | <tr><td> |
|
2062 | <tr><td> | |
2063 | <a href="/help/flags"> |
|
2063 | <a href="/help/flags"> | |
2064 | flags |
|
2064 | flags | |
2065 | </a> |
|
2065 | </a> | |
2066 | </td><td> |
|
2066 | </td><td> | |
2067 | Command-line flags |
|
2067 | Command-line flags | |
2068 | </td></tr> |
|
2068 | </td></tr> | |
2069 | <tr><td> |
|
2069 | <tr><td> | |
2070 | <a href="/help/glossary"> |
|
2070 | <a href="/help/glossary"> | |
2071 | glossary |
|
2071 | glossary | |
2072 | </a> |
|
2072 | </a> | |
2073 | </td><td> |
|
2073 | </td><td> | |
2074 | Glossary |
|
2074 | Glossary | |
2075 | </td></tr> |
|
2075 | </td></tr> | |
2076 | <tr><td> |
|
2076 | <tr><td> | |
2077 | <a href="/help/hgignore"> |
|
2077 | <a href="/help/hgignore"> | |
2078 | hgignore |
|
2078 | hgignore | |
2079 | </a> |
|
2079 | </a> | |
2080 | </td><td> |
|
2080 | </td><td> | |
2081 | Syntax for Mercurial Ignore Files |
|
2081 | Syntax for Mercurial Ignore Files | |
2082 | </td></tr> |
|
2082 | </td></tr> | |
2083 | <tr><td> |
|
2083 | <tr><td> | |
2084 | <a href="/help/hgweb"> |
|
2084 | <a href="/help/hgweb"> | |
2085 | hgweb |
|
2085 | hgweb | |
2086 | </a> |
|
2086 | </a> | |
2087 | </td><td> |
|
2087 | </td><td> | |
2088 | Configuring hgweb |
|
2088 | Configuring hgweb | |
2089 | </td></tr> |
|
2089 | </td></tr> | |
2090 | <tr><td> |
|
2090 | <tr><td> | |
2091 | <a href="/help/internals"> |
|
2091 | <a href="/help/internals"> | |
2092 | internals |
|
2092 | internals | |
2093 | </a> |
|
2093 | </a> | |
2094 | </td><td> |
|
2094 | </td><td> | |
2095 | Technical implementation topics |
|
2095 | Technical implementation topics | |
2096 | </td></tr> |
|
2096 | </td></tr> | |
2097 | <tr><td> |
|
2097 | <tr><td> | |
2098 | <a href="/help/merge-tools"> |
|
2098 | <a href="/help/merge-tools"> | |
2099 | merge-tools |
|
2099 | merge-tools | |
2100 | </a> |
|
2100 | </a> | |
2101 | </td><td> |
|
2101 | </td><td> | |
2102 | Merge Tools |
|
2102 | Merge Tools | |
2103 | </td></tr> |
|
2103 | </td></tr> | |
2104 | <tr><td> |
|
2104 | <tr><td> | |
2105 | <a href="/help/pager"> |
|
2105 | <a href="/help/pager"> | |
2106 | pager |
|
2106 | pager | |
2107 | </a> |
|
2107 | </a> | |
2108 | </td><td> |
|
2108 | </td><td> | |
2109 | Pager Support |
|
2109 | Pager Support | |
2110 | </td></tr> |
|
2110 | </td></tr> | |
2111 | <tr><td> |
|
2111 | <tr><td> | |
2112 | <a href="/help/patterns"> |
|
2112 | <a href="/help/patterns"> | |
2113 | patterns |
|
2113 | patterns | |
2114 | </a> |
|
2114 | </a> | |
2115 | </td><td> |
|
2115 | </td><td> | |
2116 | File Name Patterns |
|
2116 | File Name Patterns | |
2117 | </td></tr> |
|
2117 | </td></tr> | |
2118 | <tr><td> |
|
2118 | <tr><td> | |
2119 | <a href="/help/phases"> |
|
2119 | <a href="/help/phases"> | |
2120 | phases |
|
2120 | phases | |
2121 | </a> |
|
2121 | </a> | |
2122 | </td><td> |
|
2122 | </td><td> | |
2123 | Working with Phases |
|
2123 | Working with Phases | |
2124 | </td></tr> |
|
2124 | </td></tr> | |
2125 | <tr><td> |
|
2125 | <tr><td> | |
2126 | <a href="/help/revisions"> |
|
2126 | <a href="/help/revisions"> | |
2127 | revisions |
|
2127 | revisions | |
2128 | </a> |
|
2128 | </a> | |
2129 | </td><td> |
|
2129 | </td><td> | |
2130 | Specifying Revisions |
|
2130 | Specifying Revisions | |
2131 | </td></tr> |
|
2131 | </td></tr> | |
2132 | <tr><td> |
|
2132 | <tr><td> | |
2133 | <a href="/help/scripting"> |
|
2133 | <a href="/help/scripting"> | |
2134 | scripting |
|
2134 | scripting | |
2135 | </a> |
|
2135 | </a> | |
2136 | </td><td> |
|
2136 | </td><td> | |
2137 | Using Mercurial from scripts and automation |
|
2137 | Using Mercurial from scripts and automation | |
2138 | </td></tr> |
|
2138 | </td></tr> | |
2139 | <tr><td> |
|
2139 | <tr><td> | |
2140 | <a href="/help/subrepos"> |
|
2140 | <a href="/help/subrepos"> | |
2141 | subrepos |
|
2141 | subrepos | |
2142 | </a> |
|
2142 | </a> | |
2143 | </td><td> |
|
2143 | </td><td> | |
2144 | Subrepositories |
|
2144 | Subrepositories | |
2145 | </td></tr> |
|
2145 | </td></tr> | |
2146 | <tr><td> |
|
2146 | <tr><td> | |
2147 | <a href="/help/templating"> |
|
2147 | <a href="/help/templating"> | |
2148 | templating |
|
2148 | templating | |
2149 | </a> |
|
2149 | </a> | |
2150 | </td><td> |
|
2150 | </td><td> | |
2151 | Template Usage |
|
2151 | Template Usage | |
2152 | </td></tr> |
|
2152 | </td></tr> | |
2153 | <tr><td> |
|
2153 | <tr><td> | |
2154 | <a href="/help/urls"> |
|
2154 | <a href="/help/urls"> | |
2155 | urls |
|
2155 | urls | |
2156 | </a> |
|
2156 | </a> | |
2157 | </td><td> |
|
2157 | </td><td> | |
2158 | URL Paths |
|
2158 | URL Paths | |
2159 | </td></tr> |
|
2159 | </td></tr> | |
2160 | <tr><td> |
|
2160 | <tr><td> | |
2161 | <a href="/help/topic-containing-verbose"> |
|
2161 | <a href="/help/topic-containing-verbose"> | |
2162 | topic-containing-verbose |
|
2162 | topic-containing-verbose | |
2163 | </a> |
|
2163 | </a> | |
2164 | </td><td> |
|
2164 | </td><td> | |
2165 | This is the topic to test omit indicating. |
|
2165 | This is the topic to test omit indicating. | |
2166 | </td></tr> |
|
2166 | </td></tr> | |
2167 |
|
2167 | |||
2168 |
|
2168 | |||
2169 | <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr> |
|
2169 | <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr> | |
2170 |
|
2170 | |||
2171 | <tr><td> |
|
2171 | <tr><td> | |
2172 | <a href="/help/add"> |
|
2172 | <a href="/help/add"> | |
2173 | add |
|
2173 | add | |
2174 | </a> |
|
2174 | </a> | |
2175 | </td><td> |
|
2175 | </td><td> | |
2176 | add the specified files on the next commit |
|
2176 | add the specified files on the next commit | |
2177 | </td></tr> |
|
2177 | </td></tr> | |
2178 | <tr><td> |
|
2178 | <tr><td> | |
2179 | <a href="/help/annotate"> |
|
2179 | <a href="/help/annotate"> | |
2180 | annotate |
|
2180 | annotate | |
2181 | </a> |
|
2181 | </a> | |
2182 | </td><td> |
|
2182 | </td><td> | |
2183 | show changeset information by line for each file |
|
2183 | show changeset information by line for each file | |
2184 | </td></tr> |
|
2184 | </td></tr> | |
2185 | <tr><td> |
|
2185 | <tr><td> | |
2186 | <a href="/help/clone"> |
|
2186 | <a href="/help/clone"> | |
2187 | clone |
|
2187 | clone | |
2188 | </a> |
|
2188 | </a> | |
2189 | </td><td> |
|
2189 | </td><td> | |
2190 | make a copy of an existing repository |
|
2190 | make a copy of an existing repository | |
2191 | </td></tr> |
|
2191 | </td></tr> | |
2192 | <tr><td> |
|
2192 | <tr><td> | |
2193 | <a href="/help/commit"> |
|
2193 | <a href="/help/commit"> | |
2194 | commit |
|
2194 | commit | |
2195 | </a> |
|
2195 | </a> | |
2196 | </td><td> |
|
2196 | </td><td> | |
2197 | commit the specified files or all outstanding changes |
|
2197 | commit the specified files or all outstanding changes | |
2198 | </td></tr> |
|
2198 | </td></tr> | |
2199 | <tr><td> |
|
2199 | <tr><td> | |
2200 | <a href="/help/diff"> |
|
2200 | <a href="/help/diff"> | |
2201 | diff |
|
2201 | diff | |
2202 | </a> |
|
2202 | </a> | |
2203 | </td><td> |
|
2203 | </td><td> | |
2204 | diff repository (or selected files) |
|
2204 | diff repository (or selected files) | |
2205 | </td></tr> |
|
2205 | </td></tr> | |
2206 | <tr><td> |
|
2206 | <tr><td> | |
2207 | <a href="/help/export"> |
|
2207 | <a href="/help/export"> | |
2208 | export |
|
2208 | export | |
2209 | </a> |
|
2209 | </a> | |
2210 | </td><td> |
|
2210 | </td><td> | |
2211 | dump the header and diffs for one or more changesets |
|
2211 | dump the header and diffs for one or more changesets | |
2212 | </td></tr> |
|
2212 | </td></tr> | |
2213 | <tr><td> |
|
2213 | <tr><td> | |
2214 | <a href="/help/forget"> |
|
2214 | <a href="/help/forget"> | |
2215 | forget |
|
2215 | forget | |
2216 | </a> |
|
2216 | </a> | |
2217 | </td><td> |
|
2217 | </td><td> | |
2218 | forget the specified files on the next commit |
|
2218 | forget the specified files on the next commit | |
2219 | </td></tr> |
|
2219 | </td></tr> | |
2220 | <tr><td> |
|
2220 | <tr><td> | |
2221 | <a href="/help/init"> |
|
2221 | <a href="/help/init"> | |
2222 | init |
|
2222 | init | |
2223 | </a> |
|
2223 | </a> | |
2224 | </td><td> |
|
2224 | </td><td> | |
2225 | create a new repository in the given directory |
|
2225 | create a new repository in the given directory | |
2226 | </td></tr> |
|
2226 | </td></tr> | |
2227 | <tr><td> |
|
2227 | <tr><td> | |
2228 | <a href="/help/log"> |
|
2228 | <a href="/help/log"> | |
2229 | log |
|
2229 | log | |
2230 | </a> |
|
2230 | </a> | |
2231 | </td><td> |
|
2231 | </td><td> | |
2232 | show revision history of entire repository or files |
|
2232 | show revision history of entire repository or files | |
2233 | </td></tr> |
|
2233 | </td></tr> | |
2234 | <tr><td> |
|
2234 | <tr><td> | |
2235 | <a href="/help/merge"> |
|
2235 | <a href="/help/merge"> | |
2236 | merge |
|
2236 | merge | |
2237 | </a> |
|
2237 | </a> | |
2238 | </td><td> |
|
2238 | </td><td> | |
2239 | merge another revision into working directory |
|
2239 | merge another revision into working directory | |
2240 | </td></tr> |
|
2240 | </td></tr> | |
2241 | <tr><td> |
|
2241 | <tr><td> | |
2242 | <a href="/help/pull"> |
|
2242 | <a href="/help/pull"> | |
2243 | pull |
|
2243 | pull | |
2244 | </a> |
|
2244 | </a> | |
2245 | </td><td> |
|
2245 | </td><td> | |
2246 | pull changes from the specified source |
|
2246 | pull changes from the specified source | |
2247 | </td></tr> |
|
2247 | </td></tr> | |
2248 | <tr><td> |
|
2248 | <tr><td> | |
2249 | <a href="/help/push"> |
|
2249 | <a href="/help/push"> | |
2250 | push |
|
2250 | push | |
2251 | </a> |
|
2251 | </a> | |
2252 | </td><td> |
|
2252 | </td><td> | |
2253 | push changes to the specified destination |
|
2253 | push changes to the specified destination | |
2254 | </td></tr> |
|
2254 | </td></tr> | |
2255 | <tr><td> |
|
2255 | <tr><td> | |
2256 | <a href="/help/remove"> |
|
2256 | <a href="/help/remove"> | |
2257 | remove |
|
2257 | remove | |
2258 | </a> |
|
2258 | </a> | |
2259 | </td><td> |
|
2259 | </td><td> | |
2260 | remove the specified files on the next commit |
|
2260 | remove the specified files on the next commit | |
2261 | </td></tr> |
|
2261 | </td></tr> | |
2262 | <tr><td> |
|
2262 | <tr><td> | |
2263 | <a href="/help/serve"> |
|
2263 | <a href="/help/serve"> | |
2264 | serve |
|
2264 | serve | |
2265 | </a> |
|
2265 | </a> | |
2266 | </td><td> |
|
2266 | </td><td> | |
2267 | start stand-alone webserver |
|
2267 | start stand-alone webserver | |
2268 | </td></tr> |
|
2268 | </td></tr> | |
2269 | <tr><td> |
|
2269 | <tr><td> | |
2270 | <a href="/help/status"> |
|
2270 | <a href="/help/status"> | |
2271 | status |
|
2271 | status | |
2272 | </a> |
|
2272 | </a> | |
2273 | </td><td> |
|
2273 | </td><td> | |
2274 | show changed files in the working directory |
|
2274 | show changed files in the working directory | |
2275 | </td></tr> |
|
2275 | </td></tr> | |
2276 | <tr><td> |
|
2276 | <tr><td> | |
2277 | <a href="/help/summary"> |
|
2277 | <a href="/help/summary"> | |
2278 | summary |
|
2278 | summary | |
2279 | </a> |
|
2279 | </a> | |
2280 | </td><td> |
|
2280 | </td><td> | |
2281 | summarize working directory state |
|
2281 | summarize working directory state | |
2282 | </td></tr> |
|
2282 | </td></tr> | |
2283 | <tr><td> |
|
2283 | <tr><td> | |
2284 | <a href="/help/update"> |
|
2284 | <a href="/help/update"> | |
2285 | update |
|
2285 | update | |
2286 | </a> |
|
2286 | </a> | |
2287 | </td><td> |
|
2287 | </td><td> | |
2288 | update working directory (or switch revisions) |
|
2288 | update working directory (or switch revisions) | |
2289 | </td></tr> |
|
2289 | </td></tr> | |
2290 |
|
2290 | |||
2291 |
|
2291 | |||
2292 |
|
2292 | |||
2293 | <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr> |
|
2293 | <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr> | |
2294 |
|
2294 | |||
2295 | <tr><td> |
|
2295 | <tr><td> | |
2296 | <a href="/help/addremove"> |
|
2296 | <a href="/help/addremove"> | |
2297 | addremove |
|
2297 | addremove | |
2298 | </a> |
|
2298 | </a> | |
2299 | </td><td> |
|
2299 | </td><td> | |
2300 | add all new files, delete all missing files |
|
2300 | add all new files, delete all missing files | |
2301 | </td></tr> |
|
2301 | </td></tr> | |
2302 | <tr><td> |
|
2302 | <tr><td> | |
2303 | <a href="/help/archive"> |
|
2303 | <a href="/help/archive"> | |
2304 | archive |
|
2304 | archive | |
2305 | </a> |
|
2305 | </a> | |
2306 | </td><td> |
|
2306 | </td><td> | |
2307 | create an unversioned archive of a repository revision |
|
2307 | create an unversioned archive of a repository revision | |
2308 | </td></tr> |
|
2308 | </td></tr> | |
2309 | <tr><td> |
|
2309 | <tr><td> | |
2310 | <a href="/help/backout"> |
|
2310 | <a href="/help/backout"> | |
2311 | backout |
|
2311 | backout | |
2312 | </a> |
|
2312 | </a> | |
2313 | </td><td> |
|
2313 | </td><td> | |
2314 | reverse effect of earlier changeset |
|
2314 | reverse effect of earlier changeset | |
2315 | </td></tr> |
|
2315 | </td></tr> | |
2316 | <tr><td> |
|
2316 | <tr><td> | |
2317 | <a href="/help/bisect"> |
|
2317 | <a href="/help/bisect"> | |
2318 | bisect |
|
2318 | bisect | |
2319 | </a> |
|
2319 | </a> | |
2320 | </td><td> |
|
2320 | </td><td> | |
2321 | subdivision search of changesets |
|
2321 | subdivision search of changesets | |
2322 | </td></tr> |
|
2322 | </td></tr> | |
2323 | <tr><td> |
|
2323 | <tr><td> | |
2324 | <a href="/help/bookmarks"> |
|
2324 | <a href="/help/bookmarks"> | |
2325 | bookmarks |
|
2325 | bookmarks | |
2326 | </a> |
|
2326 | </a> | |
2327 | </td><td> |
|
2327 | </td><td> | |
2328 | create a new bookmark or list existing bookmarks |
|
2328 | create a new bookmark or list existing bookmarks | |
2329 | </td></tr> |
|
2329 | </td></tr> | |
2330 | <tr><td> |
|
2330 | <tr><td> | |
2331 | <a href="/help/branch"> |
|
2331 | <a href="/help/branch"> | |
2332 | branch |
|
2332 | branch | |
2333 | </a> |
|
2333 | </a> | |
2334 | </td><td> |
|
2334 | </td><td> | |
2335 | set or show the current branch name |
|
2335 | set or show the current branch name | |
2336 | </td></tr> |
|
2336 | </td></tr> | |
2337 | <tr><td> |
|
2337 | <tr><td> | |
2338 | <a href="/help/branches"> |
|
2338 | <a href="/help/branches"> | |
2339 | branches |
|
2339 | branches | |
2340 | </a> |
|
2340 | </a> | |
2341 | </td><td> |
|
2341 | </td><td> | |
2342 | list repository named branches |
|
2342 | list repository named branches | |
2343 | </td></tr> |
|
2343 | </td></tr> | |
2344 | <tr><td> |
|
2344 | <tr><td> | |
2345 | <a href="/help/bundle"> |
|
2345 | <a href="/help/bundle"> | |
2346 | bundle |
|
2346 | bundle | |
2347 | </a> |
|
2347 | </a> | |
2348 | </td><td> |
|
2348 | </td><td> | |
2349 | create a bundle file |
|
2349 | create a bundle file | |
2350 | </td></tr> |
|
2350 | </td></tr> | |
2351 | <tr><td> |
|
2351 | <tr><td> | |
2352 | <a href="/help/cat"> |
|
2352 | <a href="/help/cat"> | |
2353 | cat |
|
2353 | cat | |
2354 | </a> |
|
2354 | </a> | |
2355 | </td><td> |
|
2355 | </td><td> | |
2356 | output the current or given revision of files |
|
2356 | output the current or given revision of files | |
2357 | </td></tr> |
|
2357 | </td></tr> | |
2358 | <tr><td> |
|
2358 | <tr><td> | |
2359 | <a href="/help/config"> |
|
2359 | <a href="/help/config"> | |
2360 | config |
|
2360 | config | |
2361 | </a> |
|
2361 | </a> | |
2362 | </td><td> |
|
2362 | </td><td> | |
2363 | show combined config settings from all hgrc files |
|
2363 | show combined config settings from all hgrc files | |
2364 | </td></tr> |
|
2364 | </td></tr> | |
2365 | <tr><td> |
|
2365 | <tr><td> | |
2366 | <a href="/help/copy"> |
|
2366 | <a href="/help/copy"> | |
2367 | copy |
|
2367 | copy | |
2368 | </a> |
|
2368 | </a> | |
2369 | </td><td> |
|
2369 | </td><td> | |
2370 | mark files as copied for the next commit |
|
2370 | mark files as copied for the next commit | |
2371 | </td></tr> |
|
2371 | </td></tr> | |
2372 | <tr><td> |
|
2372 | <tr><td> | |
2373 | <a href="/help/files"> |
|
2373 | <a href="/help/files"> | |
2374 | files |
|
2374 | files | |
2375 | </a> |
|
2375 | </a> | |
2376 | </td><td> |
|
2376 | </td><td> | |
2377 | list tracked files |
|
2377 | list tracked files | |
2378 | </td></tr> |
|
2378 | </td></tr> | |
2379 | <tr><td> |
|
2379 | <tr><td> | |
2380 | <a href="/help/graft"> |
|
2380 | <a href="/help/graft"> | |
2381 | graft |
|
2381 | graft | |
2382 | </a> |
|
2382 | </a> | |
2383 | </td><td> |
|
2383 | </td><td> | |
2384 | copy changes from other branches onto the current branch |
|
2384 | copy changes from other branches onto the current branch | |
2385 | </td></tr> |
|
2385 | </td></tr> | |
2386 | <tr><td> |
|
2386 | <tr><td> | |
2387 | <a href="/help/grep"> |
|
2387 | <a href="/help/grep"> | |
2388 | grep |
|
2388 | grep | |
2389 | </a> |
|
2389 | </a> | |
2390 | </td><td> |
|
2390 | </td><td> | |
2391 | search revision history for a pattern in specified files |
|
2391 | search revision history for a pattern in specified files | |
2392 | </td></tr> |
|
2392 | </td></tr> | |
2393 | <tr><td> |
|
2393 | <tr><td> | |
2394 | <a href="/help/heads"> |
|
2394 | <a href="/help/heads"> | |
2395 | heads |
|
2395 | heads | |
2396 | </a> |
|
2396 | </a> | |
2397 | </td><td> |
|
2397 | </td><td> | |
2398 | show branch heads |
|
2398 | show branch heads | |
2399 | </td></tr> |
|
2399 | </td></tr> | |
2400 | <tr><td> |
|
2400 | <tr><td> | |
2401 | <a href="/help/help"> |
|
2401 | <a href="/help/help"> | |
2402 | help |
|
2402 | help | |
2403 | </a> |
|
2403 | </a> | |
2404 | </td><td> |
|
2404 | </td><td> | |
2405 | show help for a given topic or a help overview |
|
2405 | show help for a given topic or a help overview | |
2406 | </td></tr> |
|
2406 | </td></tr> | |
2407 | <tr><td> |
|
2407 | <tr><td> | |
2408 | <a href="/help/hgalias"> |
|
2408 | <a href="/help/hgalias"> | |
2409 | hgalias |
|
2409 | hgalias | |
2410 | </a> |
|
2410 | </a> | |
2411 | </td><td> |
|
2411 | </td><td> | |
2412 | summarize working directory state |
|
2412 | summarize working directory state | |
2413 | </td></tr> |
|
2413 | </td></tr> | |
2414 | <tr><td> |
|
2414 | <tr><td> | |
2415 | <a href="/help/identify"> |
|
2415 | <a href="/help/identify"> | |
2416 | identify |
|
2416 | identify | |
2417 | </a> |
|
2417 | </a> | |
2418 | </td><td> |
|
2418 | </td><td> | |
2419 | identify the working directory or specified revision |
|
2419 | identify the working directory or specified revision | |
2420 | </td></tr> |
|
2420 | </td></tr> | |
2421 | <tr><td> |
|
2421 | <tr><td> | |
2422 | <a href="/help/import"> |
|
2422 | <a href="/help/import"> | |
2423 | import |
|
2423 | import | |
2424 | </a> |
|
2424 | </a> | |
2425 | </td><td> |
|
2425 | </td><td> | |
2426 | import an ordered set of patches |
|
2426 | import an ordered set of patches | |
2427 | </td></tr> |
|
2427 | </td></tr> | |
2428 | <tr><td> |
|
2428 | <tr><td> | |
2429 | <a href="/help/incoming"> |
|
2429 | <a href="/help/incoming"> | |
2430 | incoming |
|
2430 | incoming | |
2431 | </a> |
|
2431 | </a> | |
2432 | </td><td> |
|
2432 | </td><td> | |
2433 | show new changesets found in source |
|
2433 | show new changesets found in source | |
2434 | </td></tr> |
|
2434 | </td></tr> | |
2435 | <tr><td> |
|
2435 | <tr><td> | |
2436 | <a href="/help/manifest"> |
|
2436 | <a href="/help/manifest"> | |
2437 | manifest |
|
2437 | manifest | |
2438 | </a> |
|
2438 | </a> | |
2439 | </td><td> |
|
2439 | </td><td> | |
2440 | output the current or given revision of the project manifest |
|
2440 | output the current or given revision of the project manifest | |
2441 | </td></tr> |
|
2441 | </td></tr> | |
2442 | <tr><td> |
|
2442 | <tr><td> | |
2443 | <a href="/help/nohelp"> |
|
2443 | <a href="/help/nohelp"> | |
2444 | nohelp |
|
2444 | nohelp | |
2445 | </a> |
|
2445 | </a> | |
2446 | </td><td> |
|
2446 | </td><td> | |
2447 | (no help text available) |
|
2447 | (no help text available) | |
2448 | </td></tr> |
|
2448 | </td></tr> | |
2449 | <tr><td> |
|
2449 | <tr><td> | |
2450 | <a href="/help/outgoing"> |
|
2450 | <a href="/help/outgoing"> | |
2451 | outgoing |
|
2451 | outgoing | |
2452 | </a> |
|
2452 | </a> | |
2453 | </td><td> |
|
2453 | </td><td> | |
2454 | show changesets not found in the destination |
|
2454 | show changesets not found in the destination | |
2455 | </td></tr> |
|
2455 | </td></tr> | |
2456 | <tr><td> |
|
2456 | <tr><td> | |
2457 | <a href="/help/paths"> |
|
2457 | <a href="/help/paths"> | |
2458 | paths |
|
2458 | paths | |
2459 | </a> |
|
2459 | </a> | |
2460 | </td><td> |
|
2460 | </td><td> | |
2461 | show aliases for remote repositories |
|
2461 | show aliases for remote repositories | |
2462 | </td></tr> |
|
2462 | </td></tr> | |
2463 | <tr><td> |
|
2463 | <tr><td> | |
2464 | <a href="/help/phase"> |
|
2464 | <a href="/help/phase"> | |
2465 | phase |
|
2465 | phase | |
2466 | </a> |
|
2466 | </a> | |
2467 | </td><td> |
|
2467 | </td><td> | |
2468 | set or show the current phase name |
|
2468 | set or show the current phase name | |
2469 | </td></tr> |
|
2469 | </td></tr> | |
2470 | <tr><td> |
|
2470 | <tr><td> | |
2471 | <a href="/help/recover"> |
|
2471 | <a href="/help/recover"> | |
2472 | recover |
|
2472 | recover | |
2473 | </a> |
|
2473 | </a> | |
2474 | </td><td> |
|
2474 | </td><td> | |
2475 | roll back an interrupted transaction |
|
2475 | roll back an interrupted transaction | |
2476 | </td></tr> |
|
2476 | </td></tr> | |
2477 | <tr><td> |
|
2477 | <tr><td> | |
2478 | <a href="/help/rename"> |
|
2478 | <a href="/help/rename"> | |
2479 | rename |
|
2479 | rename | |
2480 | </a> |
|
2480 | </a> | |
2481 | </td><td> |
|
2481 | </td><td> | |
2482 | rename files; equivalent of copy + remove |
|
2482 | rename files; equivalent of copy + remove | |
2483 | </td></tr> |
|
2483 | </td></tr> | |
2484 | <tr><td> |
|
2484 | <tr><td> | |
2485 | <a href="/help/resolve"> |
|
2485 | <a href="/help/resolve"> | |
2486 | resolve |
|
2486 | resolve | |
2487 | </a> |
|
2487 | </a> | |
2488 | </td><td> |
|
2488 | </td><td> | |
2489 | redo merges or set/view the merge status of files |
|
2489 | redo merges or set/view the merge status of files | |
2490 | </td></tr> |
|
2490 | </td></tr> | |
2491 | <tr><td> |
|
2491 | <tr><td> | |
2492 | <a href="/help/revert"> |
|
2492 | <a href="/help/revert"> | |
2493 | revert |
|
2493 | revert | |
2494 | </a> |
|
2494 | </a> | |
2495 | </td><td> |
|
2495 | </td><td> | |
2496 | restore files to their checkout state |
|
2496 | restore files to their checkout state | |
2497 | </td></tr> |
|
2497 | </td></tr> | |
2498 | <tr><td> |
|
2498 | <tr><td> | |
2499 | <a href="/help/root"> |
|
2499 | <a href="/help/root"> | |
2500 | root |
|
2500 | root | |
2501 | </a> |
|
2501 | </a> | |
2502 | </td><td> |
|
2502 | </td><td> | |
2503 | print the root (top) of the current working directory |
|
2503 | print the root (top) of the current working directory | |
2504 | </td></tr> |
|
2504 | </td></tr> | |
2505 | <tr><td> |
|
2505 | <tr><td> | |
2506 | <a href="/help/shellalias"> |
|
2506 | <a href="/help/shellalias"> | |
2507 | shellalias |
|
2507 | shellalias | |
2508 | </a> |
|
2508 | </a> | |
2509 | </td><td> |
|
2509 | </td><td> | |
2510 | (no help text available) |
|
2510 | (no help text available) | |
2511 | </td></tr> |
|
2511 | </td></tr> | |
2512 | <tr><td> |
|
2512 | <tr><td> | |
2513 | <a href="/help/tag"> |
|
2513 | <a href="/help/tag"> | |
2514 | tag |
|
2514 | tag | |
2515 | </a> |
|
2515 | </a> | |
2516 | </td><td> |
|
2516 | </td><td> | |
2517 | add one or more tags for the current or given revision |
|
2517 | add one or more tags for the current or given revision | |
2518 | </td></tr> |
|
2518 | </td></tr> | |
2519 | <tr><td> |
|
2519 | <tr><td> | |
2520 | <a href="/help/tags"> |
|
2520 | <a href="/help/tags"> | |
2521 | tags |
|
2521 | tags | |
2522 | </a> |
|
2522 | </a> | |
2523 | </td><td> |
|
2523 | </td><td> | |
2524 | list repository tags |
|
2524 | list repository tags | |
2525 | </td></tr> |
|
2525 | </td></tr> | |
2526 | <tr><td> |
|
2526 | <tr><td> | |
2527 | <a href="/help/unbundle"> |
|
2527 | <a href="/help/unbundle"> | |
2528 | unbundle |
|
2528 | unbundle | |
2529 | </a> |
|
2529 | </a> | |
2530 | </td><td> |
|
2530 | </td><td> | |
2531 | apply one or more bundle files |
|
2531 | apply one or more bundle files | |
2532 | </td></tr> |
|
2532 | </td></tr> | |
2533 | <tr><td> |
|
2533 | <tr><td> | |
2534 | <a href="/help/verify"> |
|
2534 | <a href="/help/verify"> | |
2535 | verify |
|
2535 | verify | |
2536 | </a> |
|
2536 | </a> | |
2537 | </td><td> |
|
2537 | </td><td> | |
2538 | verify the integrity of the repository |
|
2538 | verify the integrity of the repository | |
2539 | </td></tr> |
|
2539 | </td></tr> | |
2540 | <tr><td> |
|
2540 | <tr><td> | |
2541 | <a href="/help/version"> |
|
2541 | <a href="/help/version"> | |
2542 | version |
|
2542 | version | |
2543 | </a> |
|
2543 | </a> | |
2544 | </td><td> |
|
2544 | </td><td> | |
2545 | output version and copyright information |
|
2545 | output version and copyright information | |
2546 | </td></tr> |
|
2546 | </td></tr> | |
2547 |
|
2547 | |||
2548 |
|
2548 | |||
2549 | </table> |
|
2549 | </table> | |
2550 | </div> |
|
2550 | </div> | |
2551 | </div> |
|
2551 | </div> | |
2552 |
|
2552 | |||
2553 |
|
2553 | |||
2554 |
|
2554 | |||
2555 | </body> |
|
2555 | </body> | |
2556 | </html> |
|
2556 | </html> | |
2557 |
|
2557 | |||
2558 |
|
2558 | |||
2559 | $ get-with-headers.py $LOCALIP:$HGPORT "help/add" |
|
2559 | $ get-with-headers.py $LOCALIP:$HGPORT "help/add" | |
2560 | 200 Script output follows |
|
2560 | 200 Script output follows | |
2561 |
|
2561 | |||
2562 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2562 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
2563 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2563 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
2564 | <head> |
|
2564 | <head> | |
2565 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2565 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
2566 | <meta name="robots" content="index, nofollow" /> |
|
2566 | <meta name="robots" content="index, nofollow" /> | |
2567 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2567 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
2568 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2568 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
2569 |
|
2569 | |||
2570 | <title>Help: add</title> |
|
2570 | <title>Help: add</title> | |
2571 | </head> |
|
2571 | </head> | |
2572 | <body> |
|
2572 | <body> | |
2573 |
|
2573 | |||
2574 | <div class="container"> |
|
2574 | <div class="container"> | |
2575 | <div class="menu"> |
|
2575 | <div class="menu"> | |
2576 | <div class="logo"> |
|
2576 | <div class="logo"> | |
2577 | <a href="https://mercurial-scm.org/"> |
|
2577 | <a href="https://mercurial-scm.org/"> | |
2578 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2578 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
2579 | </div> |
|
2579 | </div> | |
2580 | <ul> |
|
2580 | <ul> | |
2581 | <li><a href="/shortlog">log</a></li> |
|
2581 | <li><a href="/shortlog">log</a></li> | |
2582 | <li><a href="/graph">graph</a></li> |
|
2582 | <li><a href="/graph">graph</a></li> | |
2583 | <li><a href="/tags">tags</a></li> |
|
2583 | <li><a href="/tags">tags</a></li> | |
2584 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2584 | <li><a href="/bookmarks">bookmarks</a></li> | |
2585 | <li><a href="/branches">branches</a></li> |
|
2585 | <li><a href="/branches">branches</a></li> | |
2586 | </ul> |
|
2586 | </ul> | |
2587 | <ul> |
|
2587 | <ul> | |
2588 | <li class="active"><a href="/help">help</a></li> |
|
2588 | <li class="active"><a href="/help">help</a></li> | |
2589 | </ul> |
|
2589 | </ul> | |
2590 | </div> |
|
2590 | </div> | |
2591 |
|
2591 | |||
2592 | <div class="main"> |
|
2592 | <div class="main"> | |
2593 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2593 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
2594 | <h3>Help: add</h3> |
|
2594 | <h3>Help: add</h3> | |
2595 |
|
2595 | |||
2596 | <form class="search" action="/log"> |
|
2596 | <form class="search" action="/log"> | |
2597 |
|
2597 | |||
2598 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2598 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
2599 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2599 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
2600 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2600 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
2601 | </form> |
|
2601 | </form> | |
2602 | <div id="doc"> |
|
2602 | <div id="doc"> | |
2603 | <p> |
|
2603 | <p> | |
2604 | hg add [OPTION]... [FILE]... |
|
2604 | hg add [OPTION]... [FILE]... | |
2605 | </p> |
|
2605 | </p> | |
2606 | <p> |
|
2606 | <p> | |
2607 | add the specified files on the next commit |
|
2607 | add the specified files on the next commit | |
2608 | </p> |
|
2608 | </p> | |
2609 | <p> |
|
2609 | <p> | |
2610 | Schedule files to be version controlled and added to the |
|
2610 | Schedule files to be version controlled and added to the | |
2611 | repository. |
|
2611 | repository. | |
2612 | </p> |
|
2612 | </p> | |
2613 | <p> |
|
2613 | <p> | |
2614 | The files will be added to the repository at the next commit. To |
|
2614 | The files will be added to the repository at the next commit. To | |
2615 | undo an add before that, see 'hg forget'. |
|
2615 | undo an add before that, see 'hg forget'. | |
2616 | </p> |
|
2616 | </p> | |
2617 | <p> |
|
2617 | <p> | |
2618 | If no names are given, add all files to the repository (except |
|
2618 | If no names are given, add all files to the repository (except | |
2619 | files matching ".hgignore"). |
|
2619 | files matching ".hgignore"). | |
2620 | </p> |
|
2620 | </p> | |
2621 | <p> |
|
2621 | <p> | |
2622 | Examples: |
|
2622 | Examples: | |
2623 | </p> |
|
2623 | </p> | |
2624 | <ul> |
|
2624 | <ul> | |
2625 | <li> New (unknown) files are added automatically by 'hg add': |
|
2625 | <li> New (unknown) files are added automatically by 'hg add': | |
2626 | <pre> |
|
2626 | <pre> | |
2627 | \$ ls (re) |
|
2627 | \$ ls (re) | |
2628 | foo.c |
|
2628 | foo.c | |
2629 | \$ hg status (re) |
|
2629 | \$ hg status (re) | |
2630 | ? foo.c |
|
2630 | ? foo.c | |
2631 | \$ hg add (re) |
|
2631 | \$ hg add (re) | |
2632 | adding foo.c |
|
2632 | adding foo.c | |
2633 | \$ hg status (re) |
|
2633 | \$ hg status (re) | |
2634 | A foo.c |
|
2634 | A foo.c | |
2635 | </pre> |
|
2635 | </pre> | |
2636 | <li> Specific files to be added can be specified: |
|
2636 | <li> Specific files to be added can be specified: | |
2637 | <pre> |
|
2637 | <pre> | |
2638 | \$ ls (re) |
|
2638 | \$ ls (re) | |
2639 | bar.c foo.c |
|
2639 | bar.c foo.c | |
2640 | \$ hg status (re) |
|
2640 | \$ hg status (re) | |
2641 | ? bar.c |
|
2641 | ? bar.c | |
2642 | ? foo.c |
|
2642 | ? foo.c | |
2643 | \$ hg add bar.c (re) |
|
2643 | \$ hg add bar.c (re) | |
2644 | \$ hg status (re) |
|
2644 | \$ hg status (re) | |
2645 | A bar.c |
|
2645 | A bar.c | |
2646 | ? foo.c |
|
2646 | ? foo.c | |
2647 | </pre> |
|
2647 | </pre> | |
2648 | </ul> |
|
2648 | </ul> | |
2649 | <p> |
|
2649 | <p> | |
2650 | Returns 0 if all files are successfully added. |
|
2650 | Returns 0 if all files are successfully added. | |
2651 | </p> |
|
2651 | </p> | |
2652 | <p> |
|
2652 | <p> | |
2653 | options ([+] can be repeated): |
|
2653 | options ([+] can be repeated): | |
2654 | </p> |
|
2654 | </p> | |
2655 | <table> |
|
2655 | <table> | |
2656 | <tr><td>-I</td> |
|
2656 | <tr><td>-I</td> | |
2657 | <td>--include PATTERN [+]</td> |
|
2657 | <td>--include PATTERN [+]</td> | |
2658 | <td>include names matching the given patterns</td></tr> |
|
2658 | <td>include names matching the given patterns</td></tr> | |
2659 | <tr><td>-X</td> |
|
2659 | <tr><td>-X</td> | |
2660 | <td>--exclude PATTERN [+]</td> |
|
2660 | <td>--exclude PATTERN [+]</td> | |
2661 | <td>exclude names matching the given patterns</td></tr> |
|
2661 | <td>exclude names matching the given patterns</td></tr> | |
2662 | <tr><td>-S</td> |
|
2662 | <tr><td>-S</td> | |
2663 | <td>--subrepos</td> |
|
2663 | <td>--subrepos</td> | |
2664 | <td>recurse into subrepositories</td></tr> |
|
2664 | <td>recurse into subrepositories</td></tr> | |
2665 | <tr><td>-n</td> |
|
2665 | <tr><td>-n</td> | |
2666 | <td>--dry-run</td> |
|
2666 | <td>--dry-run</td> | |
2667 | <td>do not perform actions, just print output</td></tr> |
|
2667 | <td>do not perform actions, just print output</td></tr> | |
2668 | </table> |
|
2668 | </table> | |
2669 | <p> |
|
2669 | <p> | |
2670 | global options ([+] can be repeated): |
|
2670 | global options ([+] can be repeated): | |
2671 | </p> |
|
2671 | </p> | |
2672 | <table> |
|
2672 | <table> | |
2673 | <tr><td>-R</td> |
|
2673 | <tr><td>-R</td> | |
2674 | <td>--repository REPO</td> |
|
2674 | <td>--repository REPO</td> | |
2675 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
2675 | <td>repository root directory or name of overlay bundle file</td></tr> | |
2676 | <tr><td></td> |
|
2676 | <tr><td></td> | |
2677 | <td>--cwd DIR</td> |
|
2677 | <td>--cwd DIR</td> | |
2678 | <td>change working directory</td></tr> |
|
2678 | <td>change working directory</td></tr> | |
2679 | <tr><td>-y</td> |
|
2679 | <tr><td>-y</td> | |
2680 | <td>--noninteractive</td> |
|
2680 | <td>--noninteractive</td> | |
2681 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
2681 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> | |
2682 | <tr><td>-q</td> |
|
2682 | <tr><td>-q</td> | |
2683 | <td>--quiet</td> |
|
2683 | <td>--quiet</td> | |
2684 | <td>suppress output</td></tr> |
|
2684 | <td>suppress output</td></tr> | |
2685 | <tr><td>-v</td> |
|
2685 | <tr><td>-v</td> | |
2686 | <td>--verbose</td> |
|
2686 | <td>--verbose</td> | |
2687 | <td>enable additional output</td></tr> |
|
2687 | <td>enable additional output</td></tr> | |
2688 | <tr><td></td> |
|
2688 | <tr><td></td> | |
2689 | <td>--color TYPE</td> |
|
2689 | <td>--color TYPE</td> | |
2690 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> |
|
2690 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> | |
2691 | <tr><td></td> |
|
2691 | <tr><td></td> | |
2692 | <td>--config CONFIG [+]</td> |
|
2692 | <td>--config CONFIG [+]</td> | |
2693 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
2693 | <td>set/override config option (use 'section.name=value')</td></tr> | |
2694 | <tr><td></td> |
|
2694 | <tr><td></td> | |
2695 | <td>--debug</td> |
|
2695 | <td>--debug</td> | |
2696 | <td>enable debugging output</td></tr> |
|
2696 | <td>enable debugging output</td></tr> | |
2697 | <tr><td></td> |
|
2697 | <tr><td></td> | |
2698 | <td>--debugger</td> |
|
2698 | <td>--debugger</td> | |
2699 | <td>start debugger</td></tr> |
|
2699 | <td>start debugger</td></tr> | |
2700 | <tr><td></td> |
|
2700 | <tr><td></td> | |
2701 | <td>--encoding ENCODE</td> |
|
2701 | <td>--encoding ENCODE</td> | |
2702 | <td>set the charset encoding (default: ascii)</td></tr> |
|
2702 | <td>set the charset encoding (default: ascii)</td></tr> | |
2703 | <tr><td></td> |
|
2703 | <tr><td></td> | |
2704 | <td>--encodingmode MODE</td> |
|
2704 | <td>--encodingmode MODE</td> | |
2705 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
2705 | <td>set the charset encoding mode (default: strict)</td></tr> | |
2706 | <tr><td></td> |
|
2706 | <tr><td></td> | |
2707 | <td>--traceback</td> |
|
2707 | <td>--traceback</td> | |
2708 | <td>always print a traceback on exception</td></tr> |
|
2708 | <td>always print a traceback on exception</td></tr> | |
2709 | <tr><td></td> |
|
2709 | <tr><td></td> | |
2710 | <td>--time</td> |
|
2710 | <td>--time</td> | |
2711 | <td>time how long the command takes</td></tr> |
|
2711 | <td>time how long the command takes</td></tr> | |
2712 | <tr><td></td> |
|
2712 | <tr><td></td> | |
2713 | <td>--profile</td> |
|
2713 | <td>--profile</td> | |
2714 | <td>print command execution profile</td></tr> |
|
2714 | <td>print command execution profile</td></tr> | |
2715 | <tr><td></td> |
|
2715 | <tr><td></td> | |
2716 | <td>--version</td> |
|
2716 | <td>--version</td> | |
2717 | <td>output version information and exit</td></tr> |
|
2717 | <td>output version information and exit</td></tr> | |
2718 | <tr><td>-h</td> |
|
2718 | <tr><td>-h</td> | |
2719 | <td>--help</td> |
|
2719 | <td>--help</td> | |
2720 | <td>display help and exit</td></tr> |
|
2720 | <td>display help and exit</td></tr> | |
2721 | <tr><td></td> |
|
2721 | <tr><td></td> | |
2722 | <td>--hidden</td> |
|
2722 | <td>--hidden</td> | |
2723 | <td>consider hidden changesets</td></tr> |
|
2723 | <td>consider hidden changesets</td></tr> | |
2724 | <tr><td></td> |
|
2724 | <tr><td></td> | |
2725 | <td>--pager TYPE</td> |
|
2725 | <td>--pager TYPE</td> | |
2726 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> |
|
2726 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> | |
2727 | </table> |
|
2727 | </table> | |
2728 |
|
2728 | |||
2729 | </div> |
|
2729 | </div> | |
2730 | </div> |
|
2730 | </div> | |
2731 | </div> |
|
2731 | </div> | |
2732 |
|
2732 | |||
2733 |
|
2733 | |||
2734 |
|
2734 | |||
2735 | </body> |
|
2735 | </body> | |
2736 | </html> |
|
2736 | </html> | |
2737 |
|
2737 | |||
2738 |
|
2738 | |||
2739 | $ get-with-headers.py $LOCALIP:$HGPORT "help/remove" |
|
2739 | $ get-with-headers.py $LOCALIP:$HGPORT "help/remove" | |
2740 | 200 Script output follows |
|
2740 | 200 Script output follows | |
2741 |
|
2741 | |||
2742 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2742 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
2743 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2743 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
2744 | <head> |
|
2744 | <head> | |
2745 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2745 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
2746 | <meta name="robots" content="index, nofollow" /> |
|
2746 | <meta name="robots" content="index, nofollow" /> | |
2747 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2747 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
2748 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2748 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
2749 |
|
2749 | |||
2750 | <title>Help: remove</title> |
|
2750 | <title>Help: remove</title> | |
2751 | </head> |
|
2751 | </head> | |
2752 | <body> |
|
2752 | <body> | |
2753 |
|
2753 | |||
2754 | <div class="container"> |
|
2754 | <div class="container"> | |
2755 | <div class="menu"> |
|
2755 | <div class="menu"> | |
2756 | <div class="logo"> |
|
2756 | <div class="logo"> | |
2757 | <a href="https://mercurial-scm.org/"> |
|
2757 | <a href="https://mercurial-scm.org/"> | |
2758 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2758 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
2759 | </div> |
|
2759 | </div> | |
2760 | <ul> |
|
2760 | <ul> | |
2761 | <li><a href="/shortlog">log</a></li> |
|
2761 | <li><a href="/shortlog">log</a></li> | |
2762 | <li><a href="/graph">graph</a></li> |
|
2762 | <li><a href="/graph">graph</a></li> | |
2763 | <li><a href="/tags">tags</a></li> |
|
2763 | <li><a href="/tags">tags</a></li> | |
2764 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2764 | <li><a href="/bookmarks">bookmarks</a></li> | |
2765 | <li><a href="/branches">branches</a></li> |
|
2765 | <li><a href="/branches">branches</a></li> | |
2766 | </ul> |
|
2766 | </ul> | |
2767 | <ul> |
|
2767 | <ul> | |
2768 | <li class="active"><a href="/help">help</a></li> |
|
2768 | <li class="active"><a href="/help">help</a></li> | |
2769 | </ul> |
|
2769 | </ul> | |
2770 | </div> |
|
2770 | </div> | |
2771 |
|
2771 | |||
2772 | <div class="main"> |
|
2772 | <div class="main"> | |
2773 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2773 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
2774 | <h3>Help: remove</h3> |
|
2774 | <h3>Help: remove</h3> | |
2775 |
|
2775 | |||
2776 | <form class="search" action="/log"> |
|
2776 | <form class="search" action="/log"> | |
2777 |
|
2777 | |||
2778 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2778 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
2779 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2779 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
2780 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2780 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
2781 | </form> |
|
2781 | </form> | |
2782 | <div id="doc"> |
|
2782 | <div id="doc"> | |
2783 | <p> |
|
2783 | <p> | |
2784 | hg remove [OPTION]... FILE... |
|
2784 | hg remove [OPTION]... FILE... | |
2785 | </p> |
|
2785 | </p> | |
2786 | <p> |
|
2786 | <p> | |
2787 | aliases: rm |
|
2787 | aliases: rm | |
2788 | </p> |
|
2788 | </p> | |
2789 | <p> |
|
2789 | <p> | |
2790 | remove the specified files on the next commit |
|
2790 | remove the specified files on the next commit | |
2791 | </p> |
|
2791 | </p> | |
2792 | <p> |
|
2792 | <p> | |
2793 | Schedule the indicated files for removal from the current branch. |
|
2793 | Schedule the indicated files for removal from the current branch. | |
2794 | </p> |
|
2794 | </p> | |
2795 | <p> |
|
2795 | <p> | |
2796 | This command schedules the files to be removed at the next commit. |
|
2796 | This command schedules the files to be removed at the next commit. | |
2797 | To undo a remove before that, see 'hg revert'. To undo added |
|
2797 | To undo a remove before that, see 'hg revert'. To undo added | |
2798 | files, see 'hg forget'. |
|
2798 | files, see 'hg forget'. | |
2799 | </p> |
|
2799 | </p> | |
2800 | <p> |
|
2800 | <p> | |
2801 | -A/--after can be used to remove only files that have already |
|
2801 | -A/--after can be used to remove only files that have already | |
2802 | been deleted, -f/--force can be used to force deletion, and -Af |
|
2802 | been deleted, -f/--force can be used to force deletion, and -Af | |
2803 | can be used to remove files from the next revision without |
|
2803 | can be used to remove files from the next revision without | |
2804 | deleting them from the working directory. |
|
2804 | deleting them from the working directory. | |
2805 | </p> |
|
2805 | </p> | |
2806 | <p> |
|
2806 | <p> | |
2807 | The following table details the behavior of remove for different |
|
2807 | The following table details the behavior of remove for different | |
2808 | file states (columns) and option combinations (rows). The file |
|
2808 | file states (columns) and option combinations (rows). The file | |
2809 | states are Added [A], Clean [C], Modified [M] and Missing [!] |
|
2809 | states are Added [A], Clean [C], Modified [M] and Missing [!] | |
2810 | (as reported by 'hg status'). The actions are Warn, Remove |
|
2810 | (as reported by 'hg status'). The actions are Warn, Remove | |
2811 | (from branch) and Delete (from disk): |
|
2811 | (from branch) and Delete (from disk): | |
2812 | </p> |
|
2812 | </p> | |
2813 | <table> |
|
2813 | <table> | |
2814 | <tr><td>opt/state</td> |
|
2814 | <tr><td>opt/state</td> | |
2815 | <td>A</td> |
|
2815 | <td>A</td> | |
2816 | <td>C</td> |
|
2816 | <td>C</td> | |
2817 | <td>M</td> |
|
2817 | <td>M</td> | |
2818 | <td>!</td></tr> |
|
2818 | <td>!</td></tr> | |
2819 | <tr><td>none</td> |
|
2819 | <tr><td>none</td> | |
2820 | <td>W</td> |
|
2820 | <td>W</td> | |
2821 | <td>RD</td> |
|
2821 | <td>RD</td> | |
2822 | <td>W</td> |
|
2822 | <td>W</td> | |
2823 | <td>R</td></tr> |
|
2823 | <td>R</td></tr> | |
2824 | <tr><td>-f</td> |
|
2824 | <tr><td>-f</td> | |
2825 | <td>R</td> |
|
2825 | <td>R</td> | |
2826 | <td>RD</td> |
|
2826 | <td>RD</td> | |
2827 | <td>RD</td> |
|
2827 | <td>RD</td> | |
2828 | <td>R</td></tr> |
|
2828 | <td>R</td></tr> | |
2829 | <tr><td>-A</td> |
|
2829 | <tr><td>-A</td> | |
2830 | <td>W</td> |
|
2830 | <td>W</td> | |
2831 | <td>W</td> |
|
2831 | <td>W</td> | |
2832 | <td>W</td> |
|
2832 | <td>W</td> | |
2833 | <td>R</td></tr> |
|
2833 | <td>R</td></tr> | |
2834 | <tr><td>-Af</td> |
|
2834 | <tr><td>-Af</td> | |
2835 | <td>R</td> |
|
2835 | <td>R</td> | |
2836 | <td>R</td> |
|
2836 | <td>R</td> | |
2837 | <td>R</td> |
|
2837 | <td>R</td> | |
2838 | <td>R</td></tr> |
|
2838 | <td>R</td></tr> | |
2839 | </table> |
|
2839 | </table> | |
2840 | <p> |
|
2840 | <p> | |
2841 | <b>Note:</b> |
|
2841 | <b>Note:</b> | |
2842 | </p> |
|
2842 | </p> | |
2843 | <p> |
|
2843 | <p> | |
2844 | 'hg remove' never deletes files in Added [A] state from the |
|
2844 | 'hg remove' never deletes files in Added [A] state from the | |
2845 | working directory, not even if "--force" is specified. |
|
2845 | working directory, not even if "--force" is specified. | |
2846 | </p> |
|
2846 | </p> | |
2847 | <p> |
|
2847 | <p> | |
2848 | Returns 0 on success, 1 if any warnings encountered. |
|
2848 | Returns 0 on success, 1 if any warnings encountered. | |
2849 | </p> |
|
2849 | </p> | |
2850 | <p> |
|
2850 | <p> | |
2851 | options ([+] can be repeated): |
|
2851 | options ([+] can be repeated): | |
2852 | </p> |
|
2852 | </p> | |
2853 | <table> |
|
2853 | <table> | |
2854 | <tr><td>-A</td> |
|
2854 | <tr><td>-A</td> | |
2855 | <td>--after</td> |
|
2855 | <td>--after</td> | |
2856 | <td>record delete for missing files</td></tr> |
|
2856 | <td>record delete for missing files</td></tr> | |
2857 | <tr><td>-f</td> |
|
2857 | <tr><td>-f</td> | |
2858 | <td>--force</td> |
|
2858 | <td>--force</td> | |
2859 | <td>forget added files, delete modified files</td></tr> |
|
2859 | <td>forget added files, delete modified files</td></tr> | |
2860 | <tr><td>-S</td> |
|
2860 | <tr><td>-S</td> | |
2861 | <td>--subrepos</td> |
|
2861 | <td>--subrepos</td> | |
2862 | <td>recurse into subrepositories</td></tr> |
|
2862 | <td>recurse into subrepositories</td></tr> | |
2863 | <tr><td>-I</td> |
|
2863 | <tr><td>-I</td> | |
2864 | <td>--include PATTERN [+]</td> |
|
2864 | <td>--include PATTERN [+]</td> | |
2865 | <td>include names matching the given patterns</td></tr> |
|
2865 | <td>include names matching the given patterns</td></tr> | |
2866 | <tr><td>-X</td> |
|
2866 | <tr><td>-X</td> | |
2867 | <td>--exclude PATTERN [+]</td> |
|
2867 | <td>--exclude PATTERN [+]</td> | |
2868 | <td>exclude names matching the given patterns</td></tr> |
|
2868 | <td>exclude names matching the given patterns</td></tr> | |
2869 | <tr><td>-n</td> |
|
2869 | <tr><td>-n</td> | |
2870 | <td>--dry-run</td> |
|
2870 | <td>--dry-run</td> | |
2871 | <td>do not perform actions, just print output</td></tr> |
|
2871 | <td>do not perform actions, just print output</td></tr> | |
2872 | </table> |
|
2872 | </table> | |
2873 | <p> |
|
2873 | <p> | |
2874 | global options ([+] can be repeated): |
|
2874 | global options ([+] can be repeated): | |
2875 | </p> |
|
2875 | </p> | |
2876 | <table> |
|
2876 | <table> | |
2877 | <tr><td>-R</td> |
|
2877 | <tr><td>-R</td> | |
2878 | <td>--repository REPO</td> |
|
2878 | <td>--repository REPO</td> | |
2879 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
2879 | <td>repository root directory or name of overlay bundle file</td></tr> | |
2880 | <tr><td></td> |
|
2880 | <tr><td></td> | |
2881 | <td>--cwd DIR</td> |
|
2881 | <td>--cwd DIR</td> | |
2882 | <td>change working directory</td></tr> |
|
2882 | <td>change working directory</td></tr> | |
2883 | <tr><td>-y</td> |
|
2883 | <tr><td>-y</td> | |
2884 | <td>--noninteractive</td> |
|
2884 | <td>--noninteractive</td> | |
2885 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
2885 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> | |
2886 | <tr><td>-q</td> |
|
2886 | <tr><td>-q</td> | |
2887 | <td>--quiet</td> |
|
2887 | <td>--quiet</td> | |
2888 | <td>suppress output</td></tr> |
|
2888 | <td>suppress output</td></tr> | |
2889 | <tr><td>-v</td> |
|
2889 | <tr><td>-v</td> | |
2890 | <td>--verbose</td> |
|
2890 | <td>--verbose</td> | |
2891 | <td>enable additional output</td></tr> |
|
2891 | <td>enable additional output</td></tr> | |
2892 | <tr><td></td> |
|
2892 | <tr><td></td> | |
2893 | <td>--color TYPE</td> |
|
2893 | <td>--color TYPE</td> | |
2894 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> |
|
2894 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> | |
2895 | <tr><td></td> |
|
2895 | <tr><td></td> | |
2896 | <td>--config CONFIG [+]</td> |
|
2896 | <td>--config CONFIG [+]</td> | |
2897 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
2897 | <td>set/override config option (use 'section.name=value')</td></tr> | |
2898 | <tr><td></td> |
|
2898 | <tr><td></td> | |
2899 | <td>--debug</td> |
|
2899 | <td>--debug</td> | |
2900 | <td>enable debugging output</td></tr> |
|
2900 | <td>enable debugging output</td></tr> | |
2901 | <tr><td></td> |
|
2901 | <tr><td></td> | |
2902 | <td>--debugger</td> |
|
2902 | <td>--debugger</td> | |
2903 | <td>start debugger</td></tr> |
|
2903 | <td>start debugger</td></tr> | |
2904 | <tr><td></td> |
|
2904 | <tr><td></td> | |
2905 | <td>--encoding ENCODE</td> |
|
2905 | <td>--encoding ENCODE</td> | |
2906 | <td>set the charset encoding (default: ascii)</td></tr> |
|
2906 | <td>set the charset encoding (default: ascii)</td></tr> | |
2907 | <tr><td></td> |
|
2907 | <tr><td></td> | |
2908 | <td>--encodingmode MODE</td> |
|
2908 | <td>--encodingmode MODE</td> | |
2909 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
2909 | <td>set the charset encoding mode (default: strict)</td></tr> | |
2910 | <tr><td></td> |
|
2910 | <tr><td></td> | |
2911 | <td>--traceback</td> |
|
2911 | <td>--traceback</td> | |
2912 | <td>always print a traceback on exception</td></tr> |
|
2912 | <td>always print a traceback on exception</td></tr> | |
2913 | <tr><td></td> |
|
2913 | <tr><td></td> | |
2914 | <td>--time</td> |
|
2914 | <td>--time</td> | |
2915 | <td>time how long the command takes</td></tr> |
|
2915 | <td>time how long the command takes</td></tr> | |
2916 | <tr><td></td> |
|
2916 | <tr><td></td> | |
2917 | <td>--profile</td> |
|
2917 | <td>--profile</td> | |
2918 | <td>print command execution profile</td></tr> |
|
2918 | <td>print command execution profile</td></tr> | |
2919 | <tr><td></td> |
|
2919 | <tr><td></td> | |
2920 | <td>--version</td> |
|
2920 | <td>--version</td> | |
2921 | <td>output version information and exit</td></tr> |
|
2921 | <td>output version information and exit</td></tr> | |
2922 | <tr><td>-h</td> |
|
2922 | <tr><td>-h</td> | |
2923 | <td>--help</td> |
|
2923 | <td>--help</td> | |
2924 | <td>display help and exit</td></tr> |
|
2924 | <td>display help and exit</td></tr> | |
2925 | <tr><td></td> |
|
2925 | <tr><td></td> | |
2926 | <td>--hidden</td> |
|
2926 | <td>--hidden</td> | |
2927 | <td>consider hidden changesets</td></tr> |
|
2927 | <td>consider hidden changesets</td></tr> | |
2928 | <tr><td></td> |
|
2928 | <tr><td></td> | |
2929 | <td>--pager TYPE</td> |
|
2929 | <td>--pager TYPE</td> | |
2930 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> |
|
2930 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> | |
2931 | </table> |
|
2931 | </table> | |
2932 |
|
2932 | |||
2933 | </div> |
|
2933 | </div> | |
2934 | </div> |
|
2934 | </div> | |
2935 | </div> |
|
2935 | </div> | |
2936 |
|
2936 | |||
2937 |
|
2937 | |||
2938 |
|
2938 | |||
2939 | </body> |
|
2939 | </body> | |
2940 | </html> |
|
2940 | </html> | |
2941 |
|
2941 | |||
2942 |
|
2942 | |||
2943 | $ get-with-headers.py $LOCALIP:$HGPORT "help/dates" |
|
2943 | $ get-with-headers.py $LOCALIP:$HGPORT "help/dates" | |
2944 | 200 Script output follows |
|
2944 | 200 Script output follows | |
2945 |
|
2945 | |||
2946 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2946 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
2947 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2947 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
2948 | <head> |
|
2948 | <head> | |
2949 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2949 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
2950 | <meta name="robots" content="index, nofollow" /> |
|
2950 | <meta name="robots" content="index, nofollow" /> | |
2951 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2951 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
2952 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2952 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
2953 |
|
2953 | |||
2954 | <title>Help: dates</title> |
|
2954 | <title>Help: dates</title> | |
2955 | </head> |
|
2955 | </head> | |
2956 | <body> |
|
2956 | <body> | |
2957 |
|
2957 | |||
2958 | <div class="container"> |
|
2958 | <div class="container"> | |
2959 | <div class="menu"> |
|
2959 | <div class="menu"> | |
2960 | <div class="logo"> |
|
2960 | <div class="logo"> | |
2961 | <a href="https://mercurial-scm.org/"> |
|
2961 | <a href="https://mercurial-scm.org/"> | |
2962 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2962 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
2963 | </div> |
|
2963 | </div> | |
2964 | <ul> |
|
2964 | <ul> | |
2965 | <li><a href="/shortlog">log</a></li> |
|
2965 | <li><a href="/shortlog">log</a></li> | |
2966 | <li><a href="/graph">graph</a></li> |
|
2966 | <li><a href="/graph">graph</a></li> | |
2967 | <li><a href="/tags">tags</a></li> |
|
2967 | <li><a href="/tags">tags</a></li> | |
2968 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2968 | <li><a href="/bookmarks">bookmarks</a></li> | |
2969 | <li><a href="/branches">branches</a></li> |
|
2969 | <li><a href="/branches">branches</a></li> | |
2970 | </ul> |
|
2970 | </ul> | |
2971 | <ul> |
|
2971 | <ul> | |
2972 | <li class="active"><a href="/help">help</a></li> |
|
2972 | <li class="active"><a href="/help">help</a></li> | |
2973 | </ul> |
|
2973 | </ul> | |
2974 | </div> |
|
2974 | </div> | |
2975 |
|
2975 | |||
2976 | <div class="main"> |
|
2976 | <div class="main"> | |
2977 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2977 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
2978 | <h3>Help: dates</h3> |
|
2978 | <h3>Help: dates</h3> | |
2979 |
|
2979 | |||
2980 | <form class="search" action="/log"> |
|
2980 | <form class="search" action="/log"> | |
2981 |
|
2981 | |||
2982 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2982 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
2983 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2983 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
2984 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2984 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
2985 | </form> |
|
2985 | </form> | |
2986 | <div id="doc"> |
|
2986 | <div id="doc"> | |
2987 | <h1>Date Formats</h1> |
|
2987 | <h1>Date Formats</h1> | |
2988 | <p> |
|
2988 | <p> | |
2989 | Some commands allow the user to specify a date, e.g.: |
|
2989 | Some commands allow the user to specify a date, e.g.: | |
2990 | </p> |
|
2990 | </p> | |
2991 | <ul> |
|
2991 | <ul> | |
2992 | <li> backout, commit, import, tag: Specify the commit date. |
|
2992 | <li> backout, commit, import, tag: Specify the commit date. | |
2993 | <li> log, revert, update: Select revision(s) by date. |
|
2993 | <li> log, revert, update: Select revision(s) by date. | |
2994 | </ul> |
|
2994 | </ul> | |
2995 | <p> |
|
2995 | <p> | |
2996 | Many date formats are valid. Here are some examples: |
|
2996 | Many date formats are valid. Here are some examples: | |
2997 | </p> |
|
2997 | </p> | |
2998 | <ul> |
|
2998 | <ul> | |
2999 | <li> "Wed Dec 6 13:18:29 2006" (local timezone assumed) |
|
2999 | <li> "Wed Dec 6 13:18:29 2006" (local timezone assumed) | |
3000 | <li> "Dec 6 13:18 -0600" (year assumed, time offset provided) |
|
3000 | <li> "Dec 6 13:18 -0600" (year assumed, time offset provided) | |
3001 | <li> "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) |
|
3001 | <li> "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) | |
3002 | <li> "Dec 6" (midnight) |
|
3002 | <li> "Dec 6" (midnight) | |
3003 | <li> "13:18" (today assumed) |
|
3003 | <li> "13:18" (today assumed) | |
3004 | <li> "3:39" (3:39AM assumed) |
|
3004 | <li> "3:39" (3:39AM assumed) | |
3005 | <li> "3:39pm" (15:39) |
|
3005 | <li> "3:39pm" (15:39) | |
3006 | <li> "2006-12-06 13:18:29" (ISO 8601 format) |
|
3006 | <li> "2006-12-06 13:18:29" (ISO 8601 format) | |
3007 | <li> "2006-12-6 13:18" |
|
3007 | <li> "2006-12-6 13:18" | |
3008 | <li> "2006-12-6" |
|
3008 | <li> "2006-12-6" | |
3009 | <li> "12-6" |
|
3009 | <li> "12-6" | |
3010 | <li> "12/6" |
|
3010 | <li> "12/6" | |
3011 | <li> "12/6/6" (Dec 6 2006) |
|
3011 | <li> "12/6/6" (Dec 6 2006) | |
3012 | <li> "today" (midnight) |
|
3012 | <li> "today" (midnight) | |
3013 | <li> "yesterday" (midnight) |
|
3013 | <li> "yesterday" (midnight) | |
3014 | <li> "now" - right now |
|
3014 | <li> "now" - right now | |
3015 | </ul> |
|
3015 | </ul> | |
3016 | <p> |
|
3016 | <p> | |
3017 | Lastly, there is Mercurial's internal format: |
|
3017 | Lastly, there is Mercurial's internal format: | |
3018 | </p> |
|
3018 | </p> | |
3019 | <ul> |
|
3019 | <ul> | |
3020 | <li> "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) |
|
3020 | <li> "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) | |
3021 | </ul> |
|
3021 | </ul> | |
3022 | <p> |
|
3022 | <p> | |
3023 | This is the internal representation format for dates. The first number |
|
3023 | This is the internal representation format for dates. The first number | |
3024 | is the number of seconds since the epoch (1970-01-01 00:00 UTC). The |
|
3024 | is the number of seconds since the epoch (1970-01-01 00:00 UTC). The | |
3025 | second is the offset of the local timezone, in seconds west of UTC |
|
3025 | second is the offset of the local timezone, in seconds west of UTC | |
3026 | (negative if the timezone is east of UTC). |
|
3026 | (negative if the timezone is east of UTC). | |
3027 | </p> |
|
3027 | </p> | |
3028 | <p> |
|
3028 | <p> | |
3029 | The log command also accepts date ranges: |
|
3029 | The log command also accepts date ranges: | |
3030 | </p> |
|
3030 | </p> | |
3031 | <ul> |
|
3031 | <ul> | |
3032 | <li> "<DATE" - at or before a given date/time |
|
3032 | <li> "<DATE" - at or before a given date/time | |
3033 | <li> ">DATE" - on or after a given date/time |
|
3033 | <li> ">DATE" - on or after a given date/time | |
3034 | <li> "DATE to DATE" - a date range, inclusive |
|
3034 | <li> "DATE to DATE" - a date range, inclusive | |
3035 | <li> "-DAYS" - within a given number of days of today |
|
3035 | <li> "-DAYS" - within a given number of days of today | |
3036 | </ul> |
|
3036 | </ul> | |
3037 |
|
3037 | |||
3038 | </div> |
|
3038 | </div> | |
3039 | </div> |
|
3039 | </div> | |
3040 | </div> |
|
3040 | </div> | |
3041 |
|
3041 | |||
3042 |
|
3042 | |||
3043 |
|
3043 | |||
3044 | </body> |
|
3044 | </body> | |
3045 | </html> |
|
3045 | </html> | |
3046 |
|
3046 | |||
3047 |
|
3047 | |||
3048 | $ get-with-headers.py $LOCALIP:$HGPORT "help/pager" |
|
3048 | $ get-with-headers.py $LOCALIP:$HGPORT "help/pager" | |
3049 | 200 Script output follows |
|
3049 | 200 Script output follows | |
3050 |
|
3050 | |||
3051 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3051 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
3052 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3052 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
3053 | <head> |
|
3053 | <head> | |
3054 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3054 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
3055 | <meta name="robots" content="index, nofollow" /> |
|
3055 | <meta name="robots" content="index, nofollow" /> | |
3056 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3056 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
3057 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3057 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
3058 |
|
3058 | |||
3059 | <title>Help: pager</title> |
|
3059 | <title>Help: pager</title> | |
3060 | </head> |
|
3060 | </head> | |
3061 | <body> |
|
3061 | <body> | |
3062 |
|
3062 | |||
3063 | <div class="container"> |
|
3063 | <div class="container"> | |
3064 | <div class="menu"> |
|
3064 | <div class="menu"> | |
3065 | <div class="logo"> |
|
3065 | <div class="logo"> | |
3066 | <a href="https://mercurial-scm.org/"> |
|
3066 | <a href="https://mercurial-scm.org/"> | |
3067 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3067 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
3068 | </div> |
|
3068 | </div> | |
3069 | <ul> |
|
3069 | <ul> | |
3070 | <li><a href="/shortlog">log</a></li> |
|
3070 | <li><a href="/shortlog">log</a></li> | |
3071 | <li><a href="/graph">graph</a></li> |
|
3071 | <li><a href="/graph">graph</a></li> | |
3072 | <li><a href="/tags">tags</a></li> |
|
3072 | <li><a href="/tags">tags</a></li> | |
3073 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3073 | <li><a href="/bookmarks">bookmarks</a></li> | |
3074 | <li><a href="/branches">branches</a></li> |
|
3074 | <li><a href="/branches">branches</a></li> | |
3075 | </ul> |
|
3075 | </ul> | |
3076 | <ul> |
|
3076 | <ul> | |
3077 | <li class="active"><a href="/help">help</a></li> |
|
3077 | <li class="active"><a href="/help">help</a></li> | |
3078 | </ul> |
|
3078 | </ul> | |
3079 | </div> |
|
3079 | </div> | |
3080 |
|
3080 | |||
3081 | <div class="main"> |
|
3081 | <div class="main"> | |
3082 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3082 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
3083 | <h3>Help: pager</h3> |
|
3083 | <h3>Help: pager</h3> | |
3084 |
|
3084 | |||
3085 | <form class="search" action="/log"> |
|
3085 | <form class="search" action="/log"> | |
3086 |
|
3086 | |||
3087 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3087 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
3088 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3088 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
3089 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3089 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
3090 | </form> |
|
3090 | </form> | |
3091 | <div id="doc"> |
|
3091 | <div id="doc"> | |
3092 | <h1>Pager Support</h1> |
|
3092 | <h1>Pager Support</h1> | |
3093 | <p> |
|
3093 | <p> | |
3094 | Some Mercurial commands can produce a lot of output, and Mercurial will |
|
3094 | Some Mercurial commands can produce a lot of output, and Mercurial will | |
3095 | attempt to use a pager to make those commands more pleasant. |
|
3095 | attempt to use a pager to make those commands more pleasant. | |
3096 | </p> |
|
3096 | </p> | |
3097 | <p> |
|
3097 | <p> | |
3098 | To set the pager that should be used, set the application variable: |
|
3098 | To set the pager that should be used, set the application variable: | |
3099 | </p> |
|
3099 | </p> | |
3100 | <pre> |
|
3100 | <pre> | |
3101 | [pager] |
|
3101 | [pager] | |
3102 | pager = less -FRX |
|
3102 | pager = less -FRX | |
3103 | </pre> |
|
3103 | </pre> | |
3104 | <p> |
|
3104 | <p> | |
3105 | If no pager is set in the user or repository configuration, Mercurial uses the |
|
3105 | If no pager is set in the user or repository configuration, Mercurial uses the | |
3106 | environment variable $PAGER. If $PAGER is not set, pager.pager from the default |
|
3106 | environment variable $PAGER. If $PAGER is not set, pager.pager from the default | |
3107 | or system configuration is used. If none of these are set, a default pager will |
|
3107 | or system configuration is used. If none of these are set, a default pager will | |
3108 | be used, typically 'less' on Unix and 'more' on Windows. |
|
3108 | be used, typically 'less' on Unix and 'more' on Windows. | |
3109 | </p> |
|
3109 | </p> | |
3110 | <p> |
|
3110 | <p> | |
3111 | You can disable the pager for certain commands by adding them to the |
|
3111 | You can disable the pager for certain commands by adding them to the | |
3112 | pager.ignore list: |
|
3112 | pager.ignore list: | |
3113 | </p> |
|
3113 | </p> | |
3114 | <pre> |
|
3114 | <pre> | |
3115 | [pager] |
|
3115 | [pager] | |
3116 | ignore = version, help, update |
|
3116 | ignore = version, help, update | |
3117 | </pre> |
|
3117 | </pre> | |
3118 | <p> |
|
3118 | <p> | |
3119 | To ignore global commands like 'hg version' or 'hg help', you have |
|
3119 | To ignore global commands like 'hg version' or 'hg help', you have | |
3120 | to specify them in your user configuration file. |
|
3120 | to specify them in your user configuration file. | |
3121 | </p> |
|
3121 | </p> | |
3122 | <p> |
|
3122 | <p> | |
3123 | To control whether the pager is used at all for an individual command, |
|
3123 | To control whether the pager is used at all for an individual command, | |
3124 | you can use --pager=<value>: |
|
3124 | you can use --pager=<value>: | |
3125 | </p> |
|
3125 | </p> | |
3126 | <ul> |
|
3126 | <ul> | |
3127 | <li> use as needed: 'auto'. |
|
3127 | <li> use as needed: 'auto'. | |
3128 | <li> require the pager: 'yes' or 'on'. |
|
3128 | <li> require the pager: 'yes' or 'on'. | |
3129 | <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work). |
|
3129 | <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work). | |
3130 | </ul> |
|
3130 | </ul> | |
3131 | <p> |
|
3131 | <p> | |
3132 | To globally turn off all attempts to use a pager, set: |
|
3132 | To globally turn off all attempts to use a pager, set: | |
3133 | </p> |
|
3133 | </p> | |
3134 | <pre> |
|
3134 | <pre> | |
3135 | [ui] |
|
3135 | [ui] | |
3136 | paginate = never |
|
3136 | paginate = never | |
3137 | </pre> |
|
3137 | </pre> | |
3138 | <p> |
|
3138 | <p> | |
3139 | which will prevent the pager from running. |
|
3139 | which will prevent the pager from running. | |
3140 | </p> |
|
3140 | </p> | |
3141 | windows |
|
3141 | ||
3142 | </div> |
|
3142 | </div> | |
3143 | </div> |
|
3143 | </div> | |
3144 | </div> |
|
3144 | </div> | |
3145 |
|
3145 | |||
3146 |
|
3146 | |||
3147 |
|
3147 | |||
3148 | </body> |
|
3148 | </body> | |
3149 | </html> |
|
3149 | </html> | |
3150 |
|
3150 | |||
3151 |
|
3151 | |||
3152 | Sub-topic indexes rendered properly |
|
3152 | Sub-topic indexes rendered properly | |
3153 |
|
3153 | |||
3154 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals" |
|
3154 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals" | |
3155 | 200 Script output follows |
|
3155 | 200 Script output follows | |
3156 |
|
3156 | |||
3157 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3157 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
3158 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3158 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
3159 | <head> |
|
3159 | <head> | |
3160 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3160 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
3161 | <meta name="robots" content="index, nofollow" /> |
|
3161 | <meta name="robots" content="index, nofollow" /> | |
3162 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3162 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
3163 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3163 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
3164 |
|
3164 | |||
3165 | <title>Help: internals</title> |
|
3165 | <title>Help: internals</title> | |
3166 | </head> |
|
3166 | </head> | |
3167 | <body> |
|
3167 | <body> | |
3168 |
|
3168 | |||
3169 | <div class="container"> |
|
3169 | <div class="container"> | |
3170 | <div class="menu"> |
|
3170 | <div class="menu"> | |
3171 | <div class="logo"> |
|
3171 | <div class="logo"> | |
3172 | <a href="https://mercurial-scm.org/"> |
|
3172 | <a href="https://mercurial-scm.org/"> | |
3173 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3173 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
3174 | </div> |
|
3174 | </div> | |
3175 | <ul> |
|
3175 | <ul> | |
3176 | <li><a href="/shortlog">log</a></li> |
|
3176 | <li><a href="/shortlog">log</a></li> | |
3177 | <li><a href="/graph">graph</a></li> |
|
3177 | <li><a href="/graph">graph</a></li> | |
3178 | <li><a href="/tags">tags</a></li> |
|
3178 | <li><a href="/tags">tags</a></li> | |
3179 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3179 | <li><a href="/bookmarks">bookmarks</a></li> | |
3180 | <li><a href="/branches">branches</a></li> |
|
3180 | <li><a href="/branches">branches</a></li> | |
3181 | </ul> |
|
3181 | </ul> | |
3182 | <ul> |
|
3182 | <ul> | |
3183 | <li><a href="/help">help</a></li> |
|
3183 | <li><a href="/help">help</a></li> | |
3184 | </ul> |
|
3184 | </ul> | |
3185 | </div> |
|
3185 | </div> | |
3186 |
|
3186 | |||
3187 | <div class="main"> |
|
3187 | <div class="main"> | |
3188 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3188 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
3189 |
|
3189 | |||
3190 | <form class="search" action="/log"> |
|
3190 | <form class="search" action="/log"> | |
3191 |
|
3191 | |||
3192 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3192 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
3193 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3193 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
3194 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3194 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
3195 | </form> |
|
3195 | </form> | |
3196 | <table class="bigtable"> |
|
3196 | <table class="bigtable"> | |
3197 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> |
|
3197 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> | |
3198 |
|
3198 | |||
3199 | <tr><td> |
|
3199 | <tr><td> | |
3200 | <a href="/help/internals.bundle2"> |
|
3200 | <a href="/help/internals.bundle2"> | |
3201 | bundle2 |
|
3201 | bundle2 | |
3202 | </a> |
|
3202 | </a> | |
3203 | </td><td> |
|
3203 | </td><td> | |
3204 | Bundle2 |
|
3204 | Bundle2 | |
3205 | </td></tr> |
|
3205 | </td></tr> | |
3206 | <tr><td> |
|
3206 | <tr><td> | |
3207 | <a href="/help/internals.bundles"> |
|
3207 | <a href="/help/internals.bundles"> | |
3208 | bundles |
|
3208 | bundles | |
3209 | </a> |
|
3209 | </a> | |
3210 | </td><td> |
|
3210 | </td><td> | |
3211 | Bundles |
|
3211 | Bundles | |
3212 | </td></tr> |
|
3212 | </td></tr> | |
3213 | <tr><td> |
|
3213 | <tr><td> | |
3214 | <a href="/help/internals.censor"> |
|
3214 | <a href="/help/internals.censor"> | |
3215 | censor |
|
3215 | censor | |
3216 | </a> |
|
3216 | </a> | |
3217 | </td><td> |
|
3217 | </td><td> | |
3218 | Censor |
|
3218 | Censor | |
3219 | </td></tr> |
|
3219 | </td></tr> | |
3220 | <tr><td> |
|
3220 | <tr><td> | |
3221 | <a href="/help/internals.changegroups"> |
|
3221 | <a href="/help/internals.changegroups"> | |
3222 | changegroups |
|
3222 | changegroups | |
3223 | </a> |
|
3223 | </a> | |
3224 | </td><td> |
|
3224 | </td><td> | |
3225 | Changegroups |
|
3225 | Changegroups | |
3226 | </td></tr> |
|
3226 | </td></tr> | |
3227 | <tr><td> |
|
3227 | <tr><td> | |
3228 | <a href="/help/internals.config"> |
|
3228 | <a href="/help/internals.config"> | |
3229 | config |
|
3229 | config | |
3230 | </a> |
|
3230 | </a> | |
3231 | </td><td> |
|
3231 | </td><td> | |
3232 | Config Registrar |
|
3232 | Config Registrar | |
3233 | </td></tr> |
|
3233 | </td></tr> | |
3234 | <tr><td> |
|
3234 | <tr><td> | |
3235 | <a href="/help/internals.requirements"> |
|
3235 | <a href="/help/internals.requirements"> | |
3236 | requirements |
|
3236 | requirements | |
3237 | </a> |
|
3237 | </a> | |
3238 | </td><td> |
|
3238 | </td><td> | |
3239 | Repository Requirements |
|
3239 | Repository Requirements | |
3240 | </td></tr> |
|
3240 | </td></tr> | |
3241 | <tr><td> |
|
3241 | <tr><td> | |
3242 | <a href="/help/internals.revlogs"> |
|
3242 | <a href="/help/internals.revlogs"> | |
3243 | revlogs |
|
3243 | revlogs | |
3244 | </a> |
|
3244 | </a> | |
3245 | </td><td> |
|
3245 | </td><td> | |
3246 | Revision Logs |
|
3246 | Revision Logs | |
3247 | </td></tr> |
|
3247 | </td></tr> | |
3248 | <tr><td> |
|
3248 | <tr><td> | |
3249 | <a href="/help/internals.wireprotocol"> |
|
3249 | <a href="/help/internals.wireprotocol"> | |
3250 | wireprotocol |
|
3250 | wireprotocol | |
3251 | </a> |
|
3251 | </a> | |
3252 | </td><td> |
|
3252 | </td><td> | |
3253 | Wire Protocol |
|
3253 | Wire Protocol | |
3254 | </td></tr> |
|
3254 | </td></tr> | |
3255 |
|
3255 | |||
3256 |
|
3256 | |||
3257 |
|
3257 | |||
3258 |
|
3258 | |||
3259 |
|
3259 | |||
3260 | </table> |
|
3260 | </table> | |
3261 | </div> |
|
3261 | </div> | |
3262 | </div> |
|
3262 | </div> | |
3263 |
|
3263 | |||
3264 |
|
3264 | |||
3265 |
|
3265 | |||
3266 | </body> |
|
3266 | </body> | |
3267 | </html> |
|
3267 | </html> | |
3268 |
|
3268 | |||
3269 |
|
3269 | |||
3270 | Sub-topic topics rendered properly |
|
3270 | Sub-topic topics rendered properly | |
3271 |
|
3271 | |||
3272 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups" |
|
3272 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups" | |
3273 | 200 Script output follows |
|
3273 | 200 Script output follows | |
3274 |
|
3274 | |||
3275 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3275 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
3276 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3276 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
3277 | <head> |
|
3277 | <head> | |
3278 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3278 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
3279 | <meta name="robots" content="index, nofollow" /> |
|
3279 | <meta name="robots" content="index, nofollow" /> | |
3280 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3280 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
3281 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3281 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
3282 |
|
3282 | |||
3283 | <title>Help: internals.changegroups</title> |
|
3283 | <title>Help: internals.changegroups</title> | |
3284 | </head> |
|
3284 | </head> | |
3285 | <body> |
|
3285 | <body> | |
3286 |
|
3286 | |||
3287 | <div class="container"> |
|
3287 | <div class="container"> | |
3288 | <div class="menu"> |
|
3288 | <div class="menu"> | |
3289 | <div class="logo"> |
|
3289 | <div class="logo"> | |
3290 | <a href="https://mercurial-scm.org/"> |
|
3290 | <a href="https://mercurial-scm.org/"> | |
3291 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3291 | <img src="/static/hglogo.png" alt="mercurial" /></a> | |
3292 | </div> |
|
3292 | </div> | |
3293 | <ul> |
|
3293 | <ul> | |
3294 | <li><a href="/shortlog">log</a></li> |
|
3294 | <li><a href="/shortlog">log</a></li> | |
3295 | <li><a href="/graph">graph</a></li> |
|
3295 | <li><a href="/graph">graph</a></li> | |
3296 | <li><a href="/tags">tags</a></li> |
|
3296 | <li><a href="/tags">tags</a></li> | |
3297 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3297 | <li><a href="/bookmarks">bookmarks</a></li> | |
3298 | <li><a href="/branches">branches</a></li> |
|
3298 | <li><a href="/branches">branches</a></li> | |
3299 | </ul> |
|
3299 | </ul> | |
3300 | <ul> |
|
3300 | <ul> | |
3301 | <li class="active"><a href="/help">help</a></li> |
|
3301 | <li class="active"><a href="/help">help</a></li> | |
3302 | </ul> |
|
3302 | </ul> | |
3303 | </div> |
|
3303 | </div> | |
3304 |
|
3304 | |||
3305 | <div class="main"> |
|
3305 | <div class="main"> | |
3306 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3306 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
3307 | <h3>Help: internals.changegroups</h3> |
|
3307 | <h3>Help: internals.changegroups</h3> | |
3308 |
|
3308 | |||
3309 | <form class="search" action="/log"> |
|
3309 | <form class="search" action="/log"> | |
3310 |
|
3310 | |||
3311 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3311 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
3312 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3312 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
3313 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3313 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
3314 | </form> |
|
3314 | </form> | |
3315 | <div id="doc"> |
|
3315 | <div id="doc"> | |
3316 | <h1>Changegroups</h1> |
|
3316 | <h1>Changegroups</h1> | |
3317 | <p> |
|
3317 | <p> | |
3318 | Changegroups are representations of repository revlog data, specifically |
|
3318 | Changegroups are representations of repository revlog data, specifically | |
3319 | the changelog data, root/flat manifest data, treemanifest data, and |
|
3319 | the changelog data, root/flat manifest data, treemanifest data, and | |
3320 | filelogs. |
|
3320 | filelogs. | |
3321 | </p> |
|
3321 | </p> | |
3322 | <p> |
|
3322 | <p> | |
3323 | There are 3 versions of changegroups: "1", "2", and "3". From a |
|
3323 | There are 3 versions of changegroups: "1", "2", and "3". From a | |
3324 | high-level, versions "1" and "2" are almost exactly the same, with the |
|
3324 | high-level, versions "1" and "2" are almost exactly the same, with the | |
3325 | only difference being an additional item in the *delta header*. Version |
|
3325 | only difference being an additional item in the *delta header*. Version | |
3326 | "3" adds support for revlog flags in the *delta header* and optionally |
|
3326 | "3" adds support for revlog flags in the *delta header* and optionally | |
3327 | exchanging treemanifests (enabled by setting an option on the |
|
3327 | exchanging treemanifests (enabled by setting an option on the | |
3328 | "changegroup" part in the bundle2). |
|
3328 | "changegroup" part in the bundle2). | |
3329 | </p> |
|
3329 | </p> | |
3330 | <p> |
|
3330 | <p> | |
3331 | Changegroups when not exchanging treemanifests consist of 3 logical |
|
3331 | Changegroups when not exchanging treemanifests consist of 3 logical | |
3332 | segments: |
|
3332 | segments: | |
3333 | </p> |
|
3333 | </p> | |
3334 | <pre> |
|
3334 | <pre> | |
3335 | +---------------------------------+ |
|
3335 | +---------------------------------+ | |
3336 | | | | | |
|
3336 | | | | | | |
3337 | | changeset | manifest | filelogs | |
|
3337 | | changeset | manifest | filelogs | | |
3338 | | | | | |
|
3338 | | | | | | |
3339 | | | | | |
|
3339 | | | | | | |
3340 | +---------------------------------+ |
|
3340 | +---------------------------------+ | |
3341 | </pre> |
|
3341 | </pre> | |
3342 | <p> |
|
3342 | <p> | |
3343 | When exchanging treemanifests, there are 4 logical segments: |
|
3343 | When exchanging treemanifests, there are 4 logical segments: | |
3344 | </p> |
|
3344 | </p> | |
3345 | <pre> |
|
3345 | <pre> | |
3346 | +-------------------------------------------------+ |
|
3346 | +-------------------------------------------------+ | |
3347 | | | | | | |
|
3347 | | | | | | | |
3348 | | changeset | root | treemanifests | filelogs | |
|
3348 | | changeset | root | treemanifests | filelogs | | |
3349 | | | manifest | | | |
|
3349 | | | manifest | | | | |
3350 | | | | | | |
|
3350 | | | | | | | |
3351 | +-------------------------------------------------+ |
|
3351 | +-------------------------------------------------+ | |
3352 | </pre> |
|
3352 | </pre> | |
3353 | <p> |
|
3353 | <p> | |
3354 | The principle building block of each segment is a *chunk*. A *chunk* |
|
3354 | The principle building block of each segment is a *chunk*. A *chunk* | |
3355 | is a framed piece of data: |
|
3355 | is a framed piece of data: | |
3356 | </p> |
|
3356 | </p> | |
3357 | <pre> |
|
3357 | <pre> | |
3358 | +---------------------------------------+ |
|
3358 | +---------------------------------------+ | |
3359 | | | | |
|
3359 | | | | | |
3360 | | length | data | |
|
3360 | | length | data | | |
3361 | | (4 bytes) | (<length - 4> bytes) | |
|
3361 | | (4 bytes) | (<length - 4> bytes) | | |
3362 | | | | |
|
3362 | | | | | |
3363 | +---------------------------------------+ |
|
3363 | +---------------------------------------+ | |
3364 | </pre> |
|
3364 | </pre> | |
3365 | <p> |
|
3365 | <p> | |
3366 | All integers are big-endian signed integers. Each chunk starts with a 32-bit |
|
3366 | All integers are big-endian signed integers. Each chunk starts with a 32-bit | |
3367 | integer indicating the length of the entire chunk (including the length field |
|
3367 | integer indicating the length of the entire chunk (including the length field | |
3368 | itself). |
|
3368 | itself). | |
3369 | </p> |
|
3369 | </p> | |
3370 | <p> |
|
3370 | <p> | |
3371 | There is a special case chunk that has a value of 0 for the length |
|
3371 | There is a special case chunk that has a value of 0 for the length | |
3372 | ("0x00000000"). We call this an *empty chunk*. |
|
3372 | ("0x00000000"). We call this an *empty chunk*. | |
3373 | </p> |
|
3373 | </p> | |
3374 | <h2>Delta Groups</h2> |
|
3374 | <h2>Delta Groups</h2> | |
3375 | <p> |
|
3375 | <p> | |
3376 | A *delta group* expresses the content of a revlog as a series of deltas, |
|
3376 | A *delta group* expresses the content of a revlog as a series of deltas, | |
3377 | or patches against previous revisions. |
|
3377 | or patches against previous revisions. | |
3378 | </p> |
|
3378 | </p> | |
3379 | <p> |
|
3379 | <p> | |
3380 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* |
|
3380 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* | |
3381 | to signal the end of the delta group: |
|
3381 | to signal the end of the delta group: | |
3382 | </p> |
|
3382 | </p> | |
3383 | <pre> |
|
3383 | <pre> | |
3384 | +------------------------------------------------------------------------+ |
|
3384 | +------------------------------------------------------------------------+ | |
3385 | | | | | | | |
|
3385 | | | | | | | | |
3386 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | |
|
3386 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | | |
3387 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | |
|
3387 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | | |
3388 | | | | | | | |
|
3388 | | | | | | | | |
3389 | +------------------------------------------------------------------------+ |
|
3389 | +------------------------------------------------------------------------+ | |
3390 | </pre> |
|
3390 | </pre> | |
3391 | <p> |
|
3391 | <p> | |
3392 | Each *chunk*'s data consists of the following: |
|
3392 | Each *chunk*'s data consists of the following: | |
3393 | </p> |
|
3393 | </p> | |
3394 | <pre> |
|
3394 | <pre> | |
3395 | +---------------------------------------+ |
|
3395 | +---------------------------------------+ | |
3396 | | | | |
|
3396 | | | | | |
3397 | | delta header | delta data | |
|
3397 | | delta header | delta data | | |
3398 | | (various by version) | (various) | |
|
3398 | | (various by version) | (various) | | |
3399 | | | | |
|
3399 | | | | | |
3400 | +---------------------------------------+ |
|
3400 | +---------------------------------------+ | |
3401 | </pre> |
|
3401 | </pre> | |
3402 | <p> |
|
3402 | <p> | |
3403 | The *delta data* is a series of *delta*s that describe a diff from an existing |
|
3403 | The *delta data* is a series of *delta*s that describe a diff from an existing | |
3404 | entry (either that the recipient already has, or previously specified in the |
|
3404 | entry (either that the recipient already has, or previously specified in the | |
3405 | bundle/changegroup). |
|
3405 | bundle/changegroup). | |
3406 | </p> |
|
3406 | </p> | |
3407 | <p> |
|
3407 | <p> | |
3408 | The *delta header* is different between versions "1", "2", and |
|
3408 | The *delta header* is different between versions "1", "2", and | |
3409 | "3" of the changegroup format. |
|
3409 | "3" of the changegroup format. | |
3410 | </p> |
|
3410 | </p> | |
3411 | <p> |
|
3411 | <p> | |
3412 | Version 1 (headerlen=80): |
|
3412 | Version 1 (headerlen=80): | |
3413 | </p> |
|
3413 | </p> | |
3414 | <pre> |
|
3414 | <pre> | |
3415 | +------------------------------------------------------+ |
|
3415 | +------------------------------------------------------+ | |
3416 | | | | | | |
|
3416 | | | | | | | |
3417 | | node | p1 node | p2 node | link node | |
|
3417 | | node | p1 node | p2 node | link node | | |
3418 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
3418 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | | |
3419 | | | | | | |
|
3419 | | | | | | | |
3420 | +------------------------------------------------------+ |
|
3420 | +------------------------------------------------------+ | |
3421 | </pre> |
|
3421 | </pre> | |
3422 | <p> |
|
3422 | <p> | |
3423 | Version 2 (headerlen=100): |
|
3423 | Version 2 (headerlen=100): | |
3424 | </p> |
|
3424 | </p> | |
3425 | <pre> |
|
3425 | <pre> | |
3426 | +------------------------------------------------------------------+ |
|
3426 | +------------------------------------------------------------------+ | |
3427 | | | | | | | |
|
3427 | | | | | | | | |
3428 | | node | p1 node | p2 node | base node | link node | |
|
3428 | | node | p1 node | p2 node | base node | link node | | |
3429 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
3429 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | | |
3430 | | | | | | | |
|
3430 | | | | | | | | |
3431 | +------------------------------------------------------------------+ |
|
3431 | +------------------------------------------------------------------+ | |
3432 | </pre> |
|
3432 | </pre> | |
3433 | <p> |
|
3433 | <p> | |
3434 | Version 3 (headerlen=102): |
|
3434 | Version 3 (headerlen=102): | |
3435 | </p> |
|
3435 | </p> | |
3436 | <pre> |
|
3436 | <pre> | |
3437 | +------------------------------------------------------------------------------+ |
|
3437 | +------------------------------------------------------------------------------+ | |
3438 | | | | | | | | |
|
3438 | | | | | | | | | |
3439 | | node | p1 node | p2 node | base node | link node | flags | |
|
3439 | | node | p1 node | p2 node | base node | link node | flags | | |
3440 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
|
3440 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | | |
3441 | | | | | | | | |
|
3441 | | | | | | | | | |
3442 | +------------------------------------------------------------------------------+ |
|
3442 | +------------------------------------------------------------------------------+ | |
3443 | </pre> |
|
3443 | </pre> | |
3444 | <p> |
|
3444 | <p> | |
3445 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which contain a |
|
3445 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which contain a | |
3446 | series of *delta*s, densely packed (no separators). These deltas describe a diff |
|
3446 | series of *delta*s, densely packed (no separators). These deltas describe a diff | |
3447 | from an existing entry (either that the recipient already has, or previously |
|
3447 | from an existing entry (either that the recipient already has, or previously | |
3448 | specified in the bundle/changegroup). The format is described more fully in |
|
3448 | specified in the bundle/changegroup). The format is described more fully in | |
3449 | "hg help internals.bdiff", but briefly: |
|
3449 | "hg help internals.bdiff", but briefly: | |
3450 | </p> |
|
3450 | </p> | |
3451 | <pre> |
|
3451 | <pre> | |
3452 | +---------------------------------------------------------------+ |
|
3452 | +---------------------------------------------------------------+ | |
3453 | | | | | | |
|
3453 | | | | | | | |
3454 | | start offset | end offset | new length | content | |
|
3454 | | start offset | end offset | new length | content | | |
3455 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | |
|
3455 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | | |
3456 | | | | | | |
|
3456 | | | | | | | |
3457 | +---------------------------------------------------------------+ |
|
3457 | +---------------------------------------------------------------+ | |
3458 | </pre> |
|
3458 | </pre> | |
3459 | <p> |
|
3459 | <p> | |
3460 | Please note that the length field in the delta data does *not* include itself. |
|
3460 | Please note that the length field in the delta data does *not* include itself. | |
3461 | </p> |
|
3461 | </p> | |
3462 | <p> |
|
3462 | <p> | |
3463 | In version 1, the delta is always applied against the previous node from |
|
3463 | In version 1, the delta is always applied against the previous node from | |
3464 | the changegroup or the first parent if this is the first entry in the |
|
3464 | the changegroup or the first parent if this is the first entry in the | |
3465 | changegroup. |
|
3465 | changegroup. | |
3466 | </p> |
|
3466 | </p> | |
3467 | <p> |
|
3467 | <p> | |
3468 | In version 2 and up, the delta base node is encoded in the entry in the |
|
3468 | In version 2 and up, the delta base node is encoded in the entry in the | |
3469 | changegroup. This allows the delta to be expressed against any parent, |
|
3469 | changegroup. This allows the delta to be expressed against any parent, | |
3470 | which can result in smaller deltas and more efficient encoding of data. |
|
3470 | which can result in smaller deltas and more efficient encoding of data. | |
3471 | </p> |
|
3471 | </p> | |
3472 | <h2>Changeset Segment</h2> |
|
3472 | <h2>Changeset Segment</h2> | |
3473 | <p> |
|
3473 | <p> | |
3474 | The *changeset segment* consists of a single *delta group* holding |
|
3474 | The *changeset segment* consists of a single *delta group* holding | |
3475 | changelog data. The *empty chunk* at the end of the *delta group* denotes |
|
3475 | changelog data. The *empty chunk* at the end of the *delta group* denotes | |
3476 | the boundary to the *manifest segment*. |
|
3476 | the boundary to the *manifest segment*. | |
3477 | </p> |
|
3477 | </p> | |
3478 | <h2>Manifest Segment</h2> |
|
3478 | <h2>Manifest Segment</h2> | |
3479 | <p> |
|
3479 | <p> | |
3480 | The *manifest segment* consists of a single *delta group* holding manifest |
|
3480 | The *manifest segment* consists of a single *delta group* holding manifest | |
3481 | data. If treemanifests are in use, it contains only the manifest for the |
|
3481 | data. If treemanifests are in use, it contains only the manifest for the | |
3482 | root directory of the repository. Otherwise, it contains the entire |
|
3482 | root directory of the repository. Otherwise, it contains the entire | |
3483 | manifest data. The *empty chunk* at the end of the *delta group* denotes |
|
3483 | manifest data. The *empty chunk* at the end of the *delta group* denotes | |
3484 | the boundary to the next segment (either the *treemanifests segment* or the |
|
3484 | the boundary to the next segment (either the *treemanifests segment* or the | |
3485 | *filelogs segment*, depending on version and the request options). |
|
3485 | *filelogs segment*, depending on version and the request options). | |
3486 | </p> |
|
3486 | </p> | |
3487 | <h3>Treemanifests Segment</h3> |
|
3487 | <h3>Treemanifests Segment</h3> | |
3488 | <p> |
|
3488 | <p> | |
3489 | The *treemanifests segment* only exists in changegroup version "3", and |
|
3489 | The *treemanifests segment* only exists in changegroup version "3", and | |
3490 | only if the 'treemanifest' param is part of the bundle2 changegroup part |
|
3490 | only if the 'treemanifest' param is part of the bundle2 changegroup part | |
3491 | (it is not possible to use changegroup version 3 outside of bundle2). |
|
3491 | (it is not possible to use changegroup version 3 outside of bundle2). | |
3492 | Aside from the filenames in the *treemanifests segment* containing a |
|
3492 | Aside from the filenames in the *treemanifests segment* containing a | |
3493 | trailing "/" character, it behaves identically to the *filelogs segment* |
|
3493 | trailing "/" character, it behaves identically to the *filelogs segment* | |
3494 | (see below). The final sub-segment is followed by an *empty chunk* (logically, |
|
3494 | (see below). The final sub-segment is followed by an *empty chunk* (logically, | |
3495 | a sub-segment with filename size 0). This denotes the boundary to the |
|
3495 | a sub-segment with filename size 0). This denotes the boundary to the | |
3496 | *filelogs segment*. |
|
3496 | *filelogs segment*. | |
3497 | </p> |
|
3497 | </p> | |
3498 | <h2>Filelogs Segment</h2> |
|
3498 | <h2>Filelogs Segment</h2> | |
3499 | <p> |
|
3499 | <p> | |
3500 | The *filelogs segment* consists of multiple sub-segments, each |
|
3500 | The *filelogs segment* consists of multiple sub-segments, each | |
3501 | corresponding to an individual file whose data is being described: |
|
3501 | corresponding to an individual file whose data is being described: | |
3502 | </p> |
|
3502 | </p> | |
3503 | <pre> |
|
3503 | <pre> | |
3504 | +--------------------------------------------------+ |
|
3504 | +--------------------------------------------------+ | |
3505 | | | | | | | |
|
3505 | | | | | | | | |
3506 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | |
|
3506 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | | |
3507 | | | | | | (4 bytes) | |
|
3507 | | | | | | (4 bytes) | | |
3508 | | | | | | | |
|
3508 | | | | | | | | |
3509 | +--------------------------------------------------+ |
|
3509 | +--------------------------------------------------+ | |
3510 | </pre> |
|
3510 | </pre> | |
3511 | <p> |
|
3511 | <p> | |
3512 | The final filelog sub-segment is followed by an *empty chunk* (logically, |
|
3512 | The final filelog sub-segment is followed by an *empty chunk* (logically, | |
3513 | a sub-segment with filename size 0). This denotes the end of the segment |
|
3513 | a sub-segment with filename size 0). This denotes the end of the segment | |
3514 | and of the overall changegroup. |
|
3514 | and of the overall changegroup. | |
3515 | </p> |
|
3515 | </p> | |
3516 | <p> |
|
3516 | <p> | |
3517 | Each filelog sub-segment consists of the following: |
|
3517 | Each filelog sub-segment consists of the following: | |
3518 | </p> |
|
3518 | </p> | |
3519 | <pre> |
|
3519 | <pre> | |
3520 | +------------------------------------------------------+ |
|
3520 | +------------------------------------------------------+ | |
3521 | | | | | |
|
3521 | | | | | | |
3522 | | filename length | filename | delta group | |
|
3522 | | filename length | filename | delta group | | |
3523 | | (4 bytes) | (<length - 4> bytes) | (various) | |
|
3523 | | (4 bytes) | (<length - 4> bytes) | (various) | | |
3524 | | | | | |
|
3524 | | | | | | |
3525 | +------------------------------------------------------+ |
|
3525 | +------------------------------------------------------+ | |
3526 | </pre> |
|
3526 | </pre> | |
3527 | <p> |
|
3527 | <p> | |
3528 | That is, a *chunk* consisting of the filename (not terminated or padded) |
|
3528 | That is, a *chunk* consisting of the filename (not terminated or padded) | |
3529 | followed by N chunks constituting the *delta group* for this file. The |
|
3529 | followed by N chunks constituting the *delta group* for this file. The | |
3530 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
3530 | *empty chunk* at the end of each *delta group* denotes the boundary to the | |
3531 | next filelog sub-segment. |
|
3531 | next filelog sub-segment. | |
3532 | </p> |
|
3532 | </p> | |
3533 |
|
3533 | |||
3534 | </div> |
|
3534 | </div> | |
3535 | </div> |
|
3535 | </div> | |
3536 | </div> |
|
3536 | </div> | |
3537 |
|
3537 | |||
3538 |
|
3538 | |||
3539 |
|
3539 | |||
3540 | </body> |
|
3540 | </body> | |
3541 | </html> |
|
3541 | </html> | |
3542 |
|
3542 | |||
3543 |
|
3543 | |||
3544 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic" |
|
3544 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic" | |
3545 | 404 Not Found |
|
3545 | 404 Not Found | |
3546 |
|
3546 | |||
3547 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3547 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
3548 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3548 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | |
3549 | <head> |
|
3549 | <head> | |
3550 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3550 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | |
3551 | <meta name="robots" content="index, nofollow" /> |
|
3551 | <meta name="robots" content="index, nofollow" /> | |
3552 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3552 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> | |
3553 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3553 | <script type="text/javascript" src="/static/mercurial.js"></script> | |
3554 |
|
3554 | |||
3555 | <title>test: error</title> |
|
3555 | <title>test: error</title> | |
3556 | </head> |
|
3556 | </head> | |
3557 | <body> |
|
3557 | <body> | |
3558 |
|
3558 | |||
3559 | <div class="container"> |
|
3559 | <div class="container"> | |
3560 | <div class="menu"> |
|
3560 | <div class="menu"> | |
3561 | <div class="logo"> |
|
3561 | <div class="logo"> | |
3562 | <a href="https://mercurial-scm.org/"> |
|
3562 | <a href="https://mercurial-scm.org/"> | |
3563 | <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> |
|
3563 | <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> | |
3564 | </div> |
|
3564 | </div> | |
3565 | <ul> |
|
3565 | <ul> | |
3566 | <li><a href="/shortlog">log</a></li> |
|
3566 | <li><a href="/shortlog">log</a></li> | |
3567 | <li><a href="/graph">graph</a></li> |
|
3567 | <li><a href="/graph">graph</a></li> | |
3568 | <li><a href="/tags">tags</a></li> |
|
3568 | <li><a href="/tags">tags</a></li> | |
3569 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3569 | <li><a href="/bookmarks">bookmarks</a></li> | |
3570 | <li><a href="/branches">branches</a></li> |
|
3570 | <li><a href="/branches">branches</a></li> | |
3571 | </ul> |
|
3571 | </ul> | |
3572 | <ul> |
|
3572 | <ul> | |
3573 | <li><a href="/help">help</a></li> |
|
3573 | <li><a href="/help">help</a></li> | |
3574 | </ul> |
|
3574 | </ul> | |
3575 | </div> |
|
3575 | </div> | |
3576 |
|
3576 | |||
3577 | <div class="main"> |
|
3577 | <div class="main"> | |
3578 |
|
3578 | |||
3579 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3579 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> | |
3580 | <h3>error</h3> |
|
3580 | <h3>error</h3> | |
3581 |
|
3581 | |||
3582 |
|
3582 | |||
3583 | <form class="search" action="/log"> |
|
3583 | <form class="search" action="/log"> | |
3584 |
|
3584 | |||
3585 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3585 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> | |
3586 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3586 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision | |
3587 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3587 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | |
3588 | </form> |
|
3588 | </form> | |
3589 |
|
3589 | |||
3590 | <div class="description"> |
|
3590 | <div class="description"> | |
3591 | <p> |
|
3591 | <p> | |
3592 | An error occurred while processing your request: |
|
3592 | An error occurred while processing your request: | |
3593 | </p> |
|
3593 | </p> | |
3594 | <p> |
|
3594 | <p> | |
3595 | Not Found |
|
3595 | Not Found | |
3596 | </p> |
|
3596 | </p> | |
3597 | </div> |
|
3597 | </div> | |
3598 | </div> |
|
3598 | </div> | |
3599 | </div> |
|
3599 | </div> | |
3600 |
|
3600 | |||
3601 |
|
3601 | |||
3602 |
|
3602 | |||
3603 | </body> |
|
3603 | </body> | |
3604 | </html> |
|
3604 | </html> | |
3605 |
|
3605 | |||
3606 | [1] |
|
3606 | [1] | |
3607 |
|
3607 | |||
3608 | $ killdaemons.py |
|
3608 | $ killdaemons.py | |
3609 |
|
3609 | |||
3610 | #endif |
|
3610 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now