Show More
@@ -1,2792 +1,2798 | |||
|
1 | 1 | # configitems.py - centralized declaration of configuration option |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | |
|
9 | 9 | import functools |
|
10 | 10 | import re |
|
11 | 11 | |
|
12 | 12 | from . import ( |
|
13 | 13 | encoding, |
|
14 | 14 | error, |
|
15 | 15 | ) |
|
16 | 16 | |
|
17 | 17 | |
|
18 | 18 | def loadconfigtable(ui, extname, configtable): |
|
19 | 19 | """update config item known to the ui with the extension ones""" |
|
20 | 20 | for section, items in sorted(configtable.items()): |
|
21 | 21 | knownitems = ui._knownconfig.setdefault(section, itemregister()) |
|
22 | 22 | knownkeys = set(knownitems) |
|
23 | 23 | newkeys = set(items) |
|
24 | 24 | for key in sorted(knownkeys & newkeys): |
|
25 | 25 | msg = b"extension '%s' overwrite config item '%s.%s'" |
|
26 | 26 | msg %= (extname, section, key) |
|
27 | 27 | ui.develwarn(msg, config=b'warn-config') |
|
28 | 28 | |
|
29 | 29 | knownitems.update(items) |
|
30 | 30 | |
|
31 | 31 | |
|
32 | 32 | class configitem: |
|
33 | 33 | """represent a known config item |
|
34 | 34 | |
|
35 | 35 | :section: the official config section where to find this item, |
|
36 | 36 | :name: the official name within the section, |
|
37 | 37 | :default: default value for this item, |
|
38 | 38 | :alias: optional list of tuples as alternatives, |
|
39 | 39 | :generic: this is a generic definition, match name using regular expression. |
|
40 | 40 | """ |
|
41 | 41 | |
|
42 | 42 | def __init__( |
|
43 | 43 | self, |
|
44 | 44 | section, |
|
45 | 45 | name, |
|
46 | 46 | default=None, |
|
47 | 47 | alias=(), |
|
48 | 48 | generic=False, |
|
49 | 49 | priority=0, |
|
50 | 50 | experimental=False, |
|
51 | 51 | ): |
|
52 | 52 | self.section = section |
|
53 | 53 | self.name = name |
|
54 | 54 | self.default = default |
|
55 | 55 | self.alias = list(alias) |
|
56 | 56 | self.generic = generic |
|
57 | 57 | self.priority = priority |
|
58 | 58 | self.experimental = experimental |
|
59 | 59 | self._re = None |
|
60 | 60 | if generic: |
|
61 | 61 | self._re = re.compile(self.name) |
|
62 | 62 | |
|
63 | 63 | |
|
64 | 64 | class itemregister(dict): |
|
65 | 65 | """A specialized dictionary that can handle wild-card selection""" |
|
66 | 66 | |
|
67 | 67 | def __init__(self): |
|
68 | 68 | super(itemregister, self).__init__() |
|
69 | 69 | self._generics = set() |
|
70 | 70 | |
|
71 | 71 | def update(self, other): |
|
72 | 72 | super(itemregister, self).update(other) |
|
73 | 73 | self._generics.update(other._generics) |
|
74 | 74 | |
|
75 | 75 | def __setitem__(self, key, item): |
|
76 | 76 | super(itemregister, self).__setitem__(key, item) |
|
77 | 77 | if item.generic: |
|
78 | 78 | self._generics.add(item) |
|
79 | 79 | |
|
80 | 80 | def get(self, key): |
|
81 | 81 | baseitem = super(itemregister, self).get(key) |
|
82 | 82 | if baseitem is not None and not baseitem.generic: |
|
83 | 83 | return baseitem |
|
84 | 84 | |
|
85 | 85 | # search for a matching generic item |
|
86 | 86 | generics = sorted(self._generics, key=(lambda x: (x.priority, x.name))) |
|
87 | 87 | for item in generics: |
|
88 | 88 | # we use 'match' instead of 'search' to make the matching simpler |
|
89 | 89 | # for people unfamiliar with regular expression. Having the match |
|
90 | 90 | # rooted to the start of the string will produce less surprising |
|
91 | 91 | # result for user writing simple regex for sub-attribute. |
|
92 | 92 | # |
|
93 | 93 | # For example using "color\..*" match produces an unsurprising |
|
94 | 94 | # result, while using search could suddenly match apparently |
|
95 | 95 | # unrelated configuration that happens to contains "color." |
|
96 | 96 | # anywhere. This is a tradeoff where we favor requiring ".*" on |
|
97 | 97 | # some match to avoid the need to prefix most pattern with "^". |
|
98 | 98 | # The "^" seems more error prone. |
|
99 | 99 | if item._re.match(key): |
|
100 | 100 | return item |
|
101 | 101 | |
|
102 | 102 | return None |
|
103 | 103 | |
|
104 | 104 | |
|
105 | 105 | coreitems = {} |
|
106 | 106 | |
|
107 | 107 | |
|
108 | 108 | def _register(configtable, *args, **kwargs): |
|
109 | 109 | item = configitem(*args, **kwargs) |
|
110 | 110 | section = configtable.setdefault(item.section, itemregister()) |
|
111 | 111 | if item.name in section: |
|
112 | 112 | msg = b"duplicated config item registration for '%s.%s'" |
|
113 | 113 | raise error.ProgrammingError(msg % (item.section, item.name)) |
|
114 | 114 | section[item.name] = item |
|
115 | 115 | |
|
116 | 116 | |
|
117 | 117 | # special value for case where the default is derived from other values |
|
118 | 118 | dynamicdefault = object() |
|
119 | 119 | |
|
120 | 120 | # Registering actual config items |
|
121 | 121 | |
|
122 | 122 | |
|
123 | 123 | def getitemregister(configtable): |
|
124 | 124 | f = functools.partial(_register, configtable) |
|
125 | 125 | # export pseudo enum as configitem.* |
|
126 | 126 | f.dynamicdefault = dynamicdefault |
|
127 | 127 | return f |
|
128 | 128 | |
|
129 | 129 | |
|
130 | 130 | coreconfigitem = getitemregister(coreitems) |
|
131 | 131 | |
|
132 | 132 | |
|
133 | 133 | def _registerdiffopts(section, configprefix=b''): |
|
134 | 134 | coreconfigitem( |
|
135 | 135 | section, |
|
136 | 136 | configprefix + b'nodates', |
|
137 | 137 | default=False, |
|
138 | 138 | ) |
|
139 | 139 | coreconfigitem( |
|
140 | 140 | section, |
|
141 | 141 | configprefix + b'showfunc', |
|
142 | 142 | default=False, |
|
143 | 143 | ) |
|
144 | 144 | coreconfigitem( |
|
145 | 145 | section, |
|
146 | 146 | configprefix + b'unified', |
|
147 | 147 | default=None, |
|
148 | 148 | ) |
|
149 | 149 | coreconfigitem( |
|
150 | 150 | section, |
|
151 | 151 | configprefix + b'git', |
|
152 | 152 | default=False, |
|
153 | 153 | ) |
|
154 | 154 | coreconfigitem( |
|
155 | 155 | section, |
|
156 | 156 | configprefix + b'ignorews', |
|
157 | 157 | default=False, |
|
158 | 158 | ) |
|
159 | 159 | coreconfigitem( |
|
160 | 160 | section, |
|
161 | 161 | configprefix + b'ignorewsamount', |
|
162 | 162 | default=False, |
|
163 | 163 | ) |
|
164 | 164 | coreconfigitem( |
|
165 | 165 | section, |
|
166 | 166 | configprefix + b'ignoreblanklines', |
|
167 | 167 | default=False, |
|
168 | 168 | ) |
|
169 | 169 | coreconfigitem( |
|
170 | 170 | section, |
|
171 | 171 | configprefix + b'ignorewseol', |
|
172 | 172 | default=False, |
|
173 | 173 | ) |
|
174 | 174 | coreconfigitem( |
|
175 | 175 | section, |
|
176 | 176 | configprefix + b'nobinary', |
|
177 | 177 | default=False, |
|
178 | 178 | ) |
|
179 | 179 | coreconfigitem( |
|
180 | 180 | section, |
|
181 | 181 | configprefix + b'noprefix', |
|
182 | 182 | default=False, |
|
183 | 183 | ) |
|
184 | 184 | coreconfigitem( |
|
185 | 185 | section, |
|
186 | 186 | configprefix + b'word-diff', |
|
187 | 187 | default=False, |
|
188 | 188 | ) |
|
189 | 189 | |
|
190 | 190 | |
|
191 | 191 | coreconfigitem( |
|
192 | 192 | b'alias', |
|
193 | 193 | b'.*', |
|
194 | 194 | default=dynamicdefault, |
|
195 | 195 | generic=True, |
|
196 | 196 | ) |
|
197 | 197 | coreconfigitem( |
|
198 | 198 | b'auth', |
|
199 | 199 | b'cookiefile', |
|
200 | 200 | default=None, |
|
201 | 201 | ) |
|
202 | 202 | _registerdiffopts(section=b'annotate') |
|
203 | 203 | # bookmarks.pushing: internal hack for discovery |
|
204 | 204 | coreconfigitem( |
|
205 | 205 | b'bookmarks', |
|
206 | 206 | b'pushing', |
|
207 | 207 | default=list, |
|
208 | 208 | ) |
|
209 | 209 | # bundle.mainreporoot: internal hack for bundlerepo |
|
210 | 210 | coreconfigitem( |
|
211 | 211 | b'bundle', |
|
212 | 212 | b'mainreporoot', |
|
213 | 213 | default=b'', |
|
214 | 214 | ) |
|
215 | 215 | coreconfigitem( |
|
216 | 216 | b'censor', |
|
217 | 217 | b'policy', |
|
218 | 218 | default=b'abort', |
|
219 | 219 | experimental=True, |
|
220 | 220 | ) |
|
221 | 221 | coreconfigitem( |
|
222 | 222 | b'chgserver', |
|
223 | 223 | b'idletimeout', |
|
224 | 224 | default=3600, |
|
225 | 225 | ) |
|
226 | 226 | coreconfigitem( |
|
227 | 227 | b'chgserver', |
|
228 | 228 | b'skiphash', |
|
229 | 229 | default=False, |
|
230 | 230 | ) |
|
231 | 231 | coreconfigitem( |
|
232 | 232 | b'cmdserver', |
|
233 | 233 | b'log', |
|
234 | 234 | default=None, |
|
235 | 235 | ) |
|
236 | 236 | coreconfigitem( |
|
237 | 237 | b'cmdserver', |
|
238 | 238 | b'max-log-files', |
|
239 | 239 | default=7, |
|
240 | 240 | ) |
|
241 | 241 | coreconfigitem( |
|
242 | 242 | b'cmdserver', |
|
243 | 243 | b'max-log-size', |
|
244 | 244 | default=b'1 MB', |
|
245 | 245 | ) |
|
246 | 246 | coreconfigitem( |
|
247 | 247 | b'cmdserver', |
|
248 | 248 | b'max-repo-cache', |
|
249 | 249 | default=0, |
|
250 | 250 | experimental=True, |
|
251 | 251 | ) |
|
252 | 252 | coreconfigitem( |
|
253 | 253 | b'cmdserver', |
|
254 | 254 | b'message-encodings', |
|
255 | 255 | default=list, |
|
256 | 256 | ) |
|
257 | 257 | coreconfigitem( |
|
258 | 258 | b'cmdserver', |
|
259 | 259 | b'track-log', |
|
260 | 260 | default=lambda: [b'chgserver', b'cmdserver', b'repocache'], |
|
261 | 261 | ) |
|
262 | 262 | coreconfigitem( |
|
263 | 263 | b'cmdserver', |
|
264 | 264 | b'shutdown-on-interrupt', |
|
265 | 265 | default=True, |
|
266 | 266 | ) |
|
267 | 267 | coreconfigitem( |
|
268 | 268 | b'color', |
|
269 | 269 | b'.*', |
|
270 | 270 | default=None, |
|
271 | 271 | generic=True, |
|
272 | 272 | ) |
|
273 | 273 | coreconfigitem( |
|
274 | 274 | b'color', |
|
275 | 275 | b'mode', |
|
276 | 276 | default=b'auto', |
|
277 | 277 | ) |
|
278 | 278 | coreconfigitem( |
|
279 | 279 | b'color', |
|
280 | 280 | b'pagermode', |
|
281 | 281 | default=dynamicdefault, |
|
282 | 282 | ) |
|
283 | 283 | coreconfigitem( |
|
284 | 284 | b'command-templates', |
|
285 | 285 | b'graphnode', |
|
286 | 286 | default=None, |
|
287 | 287 | alias=[(b'ui', b'graphnodetemplate')], |
|
288 | 288 | ) |
|
289 | 289 | coreconfigitem( |
|
290 | 290 | b'command-templates', |
|
291 | 291 | b'log', |
|
292 | 292 | default=None, |
|
293 | 293 | alias=[(b'ui', b'logtemplate')], |
|
294 | 294 | ) |
|
295 | 295 | coreconfigitem( |
|
296 | 296 | b'command-templates', |
|
297 | 297 | b'mergemarker', |
|
298 | 298 | default=( |
|
299 | 299 | b'{node|short} ' |
|
300 | 300 | b'{ifeq(tags, "tip", "", ' |
|
301 | 301 | b'ifeq(tags, "", "", "{tags} "))}' |
|
302 | 302 | b'{if(bookmarks, "{bookmarks} ")}' |
|
303 | 303 | b'{ifeq(branch, "default", "", "{branch} ")}' |
|
304 | 304 | b'- {author|user}: {desc|firstline}' |
|
305 | 305 | ), |
|
306 | 306 | alias=[(b'ui', b'mergemarkertemplate')], |
|
307 | 307 | ) |
|
308 | 308 | coreconfigitem( |
|
309 | 309 | b'command-templates', |
|
310 | 310 | b'pre-merge-tool-output', |
|
311 | 311 | default=None, |
|
312 | 312 | alias=[(b'ui', b'pre-merge-tool-output-template')], |
|
313 | 313 | ) |
|
314 | 314 | coreconfigitem( |
|
315 | 315 | b'command-templates', |
|
316 | 316 | b'oneline-summary', |
|
317 | 317 | default=None, |
|
318 | 318 | ) |
|
319 | 319 | coreconfigitem( |
|
320 | 320 | b'command-templates', |
|
321 | 321 | b'oneline-summary.*', |
|
322 | 322 | default=dynamicdefault, |
|
323 | 323 | generic=True, |
|
324 | 324 | ) |
|
325 | 325 | _registerdiffopts(section=b'commands', configprefix=b'commit.interactive.') |
|
326 | 326 | coreconfigitem( |
|
327 | 327 | b'commands', |
|
328 | 328 | b'commit.post-status', |
|
329 | 329 | default=False, |
|
330 | 330 | ) |
|
331 | 331 | coreconfigitem( |
|
332 | 332 | b'commands', |
|
333 | 333 | b'grep.all-files', |
|
334 | 334 | default=False, |
|
335 | 335 | experimental=True, |
|
336 | 336 | ) |
|
337 | 337 | coreconfigitem( |
|
338 | 338 | b'commands', |
|
339 | 339 | b'merge.require-rev', |
|
340 | 340 | default=False, |
|
341 | 341 | ) |
|
342 | 342 | coreconfigitem( |
|
343 | 343 | b'commands', |
|
344 | 344 | b'push.require-revs', |
|
345 | 345 | default=False, |
|
346 | 346 | ) |
|
347 | 347 | coreconfigitem( |
|
348 | 348 | b'commands', |
|
349 | 349 | b'resolve.confirm', |
|
350 | 350 | default=False, |
|
351 | 351 | ) |
|
352 | 352 | coreconfigitem( |
|
353 | 353 | b'commands', |
|
354 | 354 | b'resolve.explicit-re-merge', |
|
355 | 355 | default=False, |
|
356 | 356 | ) |
|
357 | 357 | coreconfigitem( |
|
358 | 358 | b'commands', |
|
359 | 359 | b'resolve.mark-check', |
|
360 | 360 | default=b'none', |
|
361 | 361 | ) |
|
362 | 362 | _registerdiffopts(section=b'commands', configprefix=b'revert.interactive.') |
|
363 | 363 | coreconfigitem( |
|
364 | 364 | b'commands', |
|
365 | 365 | b'show.aliasprefix', |
|
366 | 366 | default=list, |
|
367 | 367 | ) |
|
368 | 368 | coreconfigitem( |
|
369 | 369 | b'commands', |
|
370 | 370 | b'status.relative', |
|
371 | 371 | default=False, |
|
372 | 372 | ) |
|
373 | 373 | coreconfigitem( |
|
374 | 374 | b'commands', |
|
375 | 375 | b'status.skipstates', |
|
376 | 376 | default=[], |
|
377 | 377 | experimental=True, |
|
378 | 378 | ) |
|
379 | 379 | coreconfigitem( |
|
380 | 380 | b'commands', |
|
381 | 381 | b'status.terse', |
|
382 | 382 | default=b'', |
|
383 | 383 | ) |
|
384 | 384 | coreconfigitem( |
|
385 | 385 | b'commands', |
|
386 | 386 | b'status.verbose', |
|
387 | 387 | default=False, |
|
388 | 388 | ) |
|
389 | 389 | coreconfigitem( |
|
390 | 390 | b'commands', |
|
391 | 391 | b'update.check', |
|
392 | 392 | default=None, |
|
393 | 393 | ) |
|
394 | 394 | coreconfigitem( |
|
395 | 395 | b'commands', |
|
396 | 396 | b'update.requiredest', |
|
397 | 397 | default=False, |
|
398 | 398 | ) |
|
399 | 399 | coreconfigitem( |
|
400 | 400 | b'committemplate', |
|
401 | 401 | b'.*', |
|
402 | 402 | default=None, |
|
403 | 403 | generic=True, |
|
404 | 404 | ) |
|
405 | 405 | coreconfigitem( |
|
406 | 406 | b'convert', |
|
407 | 407 | b'bzr.saverev', |
|
408 | 408 | default=True, |
|
409 | 409 | ) |
|
410 | 410 | coreconfigitem( |
|
411 | 411 | b'convert', |
|
412 | 412 | b'cvsps.cache', |
|
413 | 413 | default=True, |
|
414 | 414 | ) |
|
415 | 415 | coreconfigitem( |
|
416 | 416 | b'convert', |
|
417 | 417 | b'cvsps.fuzz', |
|
418 | 418 | default=60, |
|
419 | 419 | ) |
|
420 | 420 | coreconfigitem( |
|
421 | 421 | b'convert', |
|
422 | 422 | b'cvsps.logencoding', |
|
423 | 423 | default=None, |
|
424 | 424 | ) |
|
425 | 425 | coreconfigitem( |
|
426 | 426 | b'convert', |
|
427 | 427 | b'cvsps.mergefrom', |
|
428 | 428 | default=None, |
|
429 | 429 | ) |
|
430 | 430 | coreconfigitem( |
|
431 | 431 | b'convert', |
|
432 | 432 | b'cvsps.mergeto', |
|
433 | 433 | default=None, |
|
434 | 434 | ) |
|
435 | 435 | coreconfigitem( |
|
436 | 436 | b'convert', |
|
437 | 437 | b'git.committeractions', |
|
438 | 438 | default=lambda: [b'messagedifferent'], |
|
439 | 439 | ) |
|
440 | 440 | coreconfigitem( |
|
441 | 441 | b'convert', |
|
442 | 442 | b'git.extrakeys', |
|
443 | 443 | default=list, |
|
444 | 444 | ) |
|
445 | 445 | coreconfigitem( |
|
446 | 446 | b'convert', |
|
447 | 447 | b'git.findcopiesharder', |
|
448 | 448 | default=False, |
|
449 | 449 | ) |
|
450 | 450 | coreconfigitem( |
|
451 | 451 | b'convert', |
|
452 | 452 | b'git.remoteprefix', |
|
453 | 453 | default=b'remote', |
|
454 | 454 | ) |
|
455 | 455 | coreconfigitem( |
|
456 | 456 | b'convert', |
|
457 | 457 | b'git.renamelimit', |
|
458 | 458 | default=400, |
|
459 | 459 | ) |
|
460 | 460 | coreconfigitem( |
|
461 | 461 | b'convert', |
|
462 | 462 | b'git.saverev', |
|
463 | 463 | default=True, |
|
464 | 464 | ) |
|
465 | 465 | coreconfigitem( |
|
466 | 466 | b'convert', |
|
467 | 467 | b'git.similarity', |
|
468 | 468 | default=50, |
|
469 | 469 | ) |
|
470 | 470 | coreconfigitem( |
|
471 | 471 | b'convert', |
|
472 | 472 | b'git.skipsubmodules', |
|
473 | 473 | default=False, |
|
474 | 474 | ) |
|
475 | 475 | coreconfigitem( |
|
476 | 476 | b'convert', |
|
477 | 477 | b'hg.clonebranches', |
|
478 | 478 | default=False, |
|
479 | 479 | ) |
|
480 | 480 | coreconfigitem( |
|
481 | 481 | b'convert', |
|
482 | 482 | b'hg.ignoreerrors', |
|
483 | 483 | default=False, |
|
484 | 484 | ) |
|
485 | 485 | coreconfigitem( |
|
486 | 486 | b'convert', |
|
487 | 487 | b'hg.preserve-hash', |
|
488 | 488 | default=False, |
|
489 | 489 | ) |
|
490 | 490 | coreconfigitem( |
|
491 | 491 | b'convert', |
|
492 | 492 | b'hg.revs', |
|
493 | 493 | default=None, |
|
494 | 494 | ) |
|
495 | 495 | coreconfigitem( |
|
496 | 496 | b'convert', |
|
497 | 497 | b'hg.saverev', |
|
498 | 498 | default=False, |
|
499 | 499 | ) |
|
500 | 500 | coreconfigitem( |
|
501 | 501 | b'convert', |
|
502 | 502 | b'hg.sourcename', |
|
503 | 503 | default=None, |
|
504 | 504 | ) |
|
505 | 505 | coreconfigitem( |
|
506 | 506 | b'convert', |
|
507 | 507 | b'hg.startrev', |
|
508 | 508 | default=None, |
|
509 | 509 | ) |
|
510 | 510 | coreconfigitem( |
|
511 | 511 | b'convert', |
|
512 | 512 | b'hg.tagsbranch', |
|
513 | 513 | default=b'default', |
|
514 | 514 | ) |
|
515 | 515 | coreconfigitem( |
|
516 | 516 | b'convert', |
|
517 | 517 | b'hg.usebranchnames', |
|
518 | 518 | default=True, |
|
519 | 519 | ) |
|
520 | 520 | coreconfigitem( |
|
521 | 521 | b'convert', |
|
522 | 522 | b'ignoreancestorcheck', |
|
523 | 523 | default=False, |
|
524 | 524 | experimental=True, |
|
525 | 525 | ) |
|
526 | 526 | coreconfigitem( |
|
527 | 527 | b'convert', |
|
528 | 528 | b'localtimezone', |
|
529 | 529 | default=False, |
|
530 | 530 | ) |
|
531 | 531 | coreconfigitem( |
|
532 | 532 | b'convert', |
|
533 | 533 | b'p4.encoding', |
|
534 | 534 | default=dynamicdefault, |
|
535 | 535 | ) |
|
536 | 536 | coreconfigitem( |
|
537 | 537 | b'convert', |
|
538 | 538 | b'p4.startrev', |
|
539 | 539 | default=0, |
|
540 | 540 | ) |
|
541 | 541 | coreconfigitem( |
|
542 | 542 | b'convert', |
|
543 | 543 | b'skiptags', |
|
544 | 544 | default=False, |
|
545 | 545 | ) |
|
546 | 546 | coreconfigitem( |
|
547 | 547 | b'convert', |
|
548 | 548 | b'svn.debugsvnlog', |
|
549 | 549 | default=True, |
|
550 | 550 | ) |
|
551 | 551 | coreconfigitem( |
|
552 | 552 | b'convert', |
|
553 | 553 | b'svn.trunk', |
|
554 | 554 | default=None, |
|
555 | 555 | ) |
|
556 | 556 | coreconfigitem( |
|
557 | 557 | b'convert', |
|
558 | 558 | b'svn.tags', |
|
559 | 559 | default=None, |
|
560 | 560 | ) |
|
561 | 561 | coreconfigitem( |
|
562 | 562 | b'convert', |
|
563 | 563 | b'svn.branches', |
|
564 | 564 | default=None, |
|
565 | 565 | ) |
|
566 | 566 | coreconfigitem( |
|
567 | 567 | b'convert', |
|
568 | 568 | b'svn.startrev', |
|
569 | 569 | default=0, |
|
570 | 570 | ) |
|
571 | 571 | coreconfigitem( |
|
572 | 572 | b'convert', |
|
573 | 573 | b'svn.dangerous-set-commit-dates', |
|
574 | 574 | default=False, |
|
575 | 575 | ) |
|
576 | 576 | coreconfigitem( |
|
577 | 577 | b'debug', |
|
578 | 578 | b'dirstate.delaywrite', |
|
579 | 579 | default=0, |
|
580 | 580 | ) |
|
581 | 581 | coreconfigitem( |
|
582 | 582 | b'debug', |
|
583 | 583 | b'revlog.verifyposition.changelog', |
|
584 | 584 | default=b'', |
|
585 | 585 | ) |
|
586 | 586 | coreconfigitem( |
|
587 | 587 | b'defaults', |
|
588 | 588 | b'.*', |
|
589 | 589 | default=None, |
|
590 | 590 | generic=True, |
|
591 | 591 | ) |
|
592 | 592 | coreconfigitem( |
|
593 | 593 | b'devel', |
|
594 | 594 | b'all-warnings', |
|
595 | 595 | default=False, |
|
596 | 596 | ) |
|
597 | 597 | coreconfigitem( |
|
598 | 598 | b'devel', |
|
599 | 599 | b'bundle2.debug', |
|
600 | 600 | default=False, |
|
601 | 601 | ) |
|
602 | 602 | coreconfigitem( |
|
603 | 603 | b'devel', |
|
604 | 604 | b'bundle.delta', |
|
605 | 605 | default=b'', |
|
606 | 606 | ) |
|
607 | 607 | coreconfigitem( |
|
608 | 608 | b'devel', |
|
609 | 609 | b'cache-vfs', |
|
610 | 610 | default=None, |
|
611 | 611 | ) |
|
612 | 612 | coreconfigitem( |
|
613 | 613 | b'devel', |
|
614 | 614 | b'check-locks', |
|
615 | 615 | default=False, |
|
616 | 616 | ) |
|
617 | 617 | coreconfigitem( |
|
618 | 618 | b'devel', |
|
619 | 619 | b'check-relroot', |
|
620 | 620 | default=False, |
|
621 | 621 | ) |
|
622 | 622 | # Track copy information for all file, not just "added" one (very slow) |
|
623 | 623 | coreconfigitem( |
|
624 | 624 | b'devel', |
|
625 | 625 | b'copy-tracing.trace-all-files', |
|
626 | 626 | default=False, |
|
627 | 627 | ) |
|
628 | 628 | coreconfigitem( |
|
629 | 629 | b'devel', |
|
630 | 630 | b'default-date', |
|
631 | 631 | default=None, |
|
632 | 632 | ) |
|
633 | 633 | coreconfigitem( |
|
634 | 634 | b'devel', |
|
635 | 635 | b'deprec-warn', |
|
636 | 636 | default=False, |
|
637 | 637 | ) |
|
638 | 638 | coreconfigitem( |
|
639 | 639 | b'devel', |
|
640 | 640 | b'disableloaddefaultcerts', |
|
641 | 641 | default=False, |
|
642 | 642 | ) |
|
643 | 643 | coreconfigitem( |
|
644 | 644 | b'devel', |
|
645 | 645 | b'warn-empty-changegroup', |
|
646 | 646 | default=False, |
|
647 | 647 | ) |
|
648 | 648 | coreconfigitem( |
|
649 | 649 | b'devel', |
|
650 | 650 | b'legacy.exchange', |
|
651 | 651 | default=list, |
|
652 | 652 | ) |
|
653 | 653 | # When True, revlogs use a special reference version of the nodemap, that is not |
|
654 | 654 | # performant but is "known" to behave properly. |
|
655 | 655 | coreconfigitem( |
|
656 | 656 | b'devel', |
|
657 | 657 | b'persistent-nodemap', |
|
658 | 658 | default=False, |
|
659 | 659 | ) |
|
660 | 660 | coreconfigitem( |
|
661 | 661 | b'devel', |
|
662 | 662 | b'servercafile', |
|
663 | 663 | default=b'', |
|
664 | 664 | ) |
|
665 | 665 | coreconfigitem( |
|
666 | 666 | b'devel', |
|
667 | 667 | b'serverexactprotocol', |
|
668 | 668 | default=b'', |
|
669 | 669 | ) |
|
670 | 670 | coreconfigitem( |
|
671 | 671 | b'devel', |
|
672 | 672 | b'serverrequirecert', |
|
673 | 673 | default=False, |
|
674 | 674 | ) |
|
675 | 675 | coreconfigitem( |
|
676 | 676 | b'devel', |
|
677 | 677 | b'strip-obsmarkers', |
|
678 | 678 | default=True, |
|
679 | 679 | ) |
|
680 | 680 | coreconfigitem( |
|
681 | 681 | b'devel', |
|
682 | 682 | b'warn-config', |
|
683 | 683 | default=None, |
|
684 | 684 | ) |
|
685 | 685 | coreconfigitem( |
|
686 | 686 | b'devel', |
|
687 | 687 | b'warn-config-default', |
|
688 | 688 | default=None, |
|
689 | 689 | ) |
|
690 | 690 | coreconfigitem( |
|
691 | 691 | b'devel', |
|
692 | 692 | b'user.obsmarker', |
|
693 | 693 | default=None, |
|
694 | 694 | ) |
|
695 | 695 | coreconfigitem( |
|
696 | 696 | b'devel', |
|
697 | 697 | b'warn-config-unknown', |
|
698 | 698 | default=None, |
|
699 | 699 | ) |
|
700 | 700 | coreconfigitem( |
|
701 | 701 | b'devel', |
|
702 | 702 | b'debug.copies', |
|
703 | 703 | default=False, |
|
704 | 704 | ) |
|
705 | 705 | coreconfigitem( |
|
706 | 706 | b'devel', |
|
707 | 707 | b'copy-tracing.multi-thread', |
|
708 | 708 | default=True, |
|
709 | 709 | ) |
|
710 | 710 | coreconfigitem( |
|
711 | 711 | b'devel', |
|
712 | 712 | b'debug.extensions', |
|
713 | 713 | default=False, |
|
714 | 714 | ) |
|
715 | 715 | coreconfigitem( |
|
716 | 716 | b'devel', |
|
717 | 717 | b'debug.repo-filters', |
|
718 | 718 | default=False, |
|
719 | 719 | ) |
|
720 | 720 | coreconfigitem( |
|
721 | 721 | b'devel', |
|
722 | 722 | b'debug.peer-request', |
|
723 | 723 | default=False, |
|
724 | 724 | ) |
|
725 | 725 | # If discovery.exchange-heads is False, the discovery will not start with |
|
726 | 726 | # remote head fetching and local head querying. |
|
727 | 727 | coreconfigitem( |
|
728 | 728 | b'devel', |
|
729 | 729 | b'discovery.exchange-heads', |
|
730 | 730 | default=True, |
|
731 | 731 | ) |
|
732 | 732 | # If discovery.grow-sample is False, the sample size used in set discovery will |
|
733 | 733 | # not be increased through the process |
|
734 | 734 | coreconfigitem( |
|
735 | 735 | b'devel', |
|
736 | 736 | b'discovery.grow-sample', |
|
737 | 737 | default=True, |
|
738 | 738 | ) |
|
739 | 739 | # When discovery.grow-sample.dynamic is True, the default, the sample size is |
|
740 | 740 | # adapted to the shape of the undecided set (it is set to the max of: |
|
741 | 741 | # <target-size>, len(roots(undecided)), len(heads(undecided) |
|
742 | 742 | coreconfigitem( |
|
743 | 743 | b'devel', |
|
744 | 744 | b'discovery.grow-sample.dynamic', |
|
745 | 745 | default=True, |
|
746 | 746 | ) |
|
747 | 747 | # discovery.grow-sample.rate control the rate at which the sample grow |
|
748 | 748 | coreconfigitem( |
|
749 | 749 | b'devel', |
|
750 | 750 | b'discovery.grow-sample.rate', |
|
751 | 751 | default=1.05, |
|
752 | 752 | ) |
|
753 | 753 | # If discovery.randomize is False, random sampling during discovery are |
|
754 | 754 | # deterministic. It is meant for integration tests. |
|
755 | 755 | coreconfigitem( |
|
756 | 756 | b'devel', |
|
757 | 757 | b'discovery.randomize', |
|
758 | 758 | default=True, |
|
759 | 759 | ) |
|
760 | 760 | # Control the initial size of the discovery sample |
|
761 | 761 | coreconfigitem( |
|
762 | 762 | b'devel', |
|
763 | 763 | b'discovery.sample-size', |
|
764 | 764 | default=200, |
|
765 | 765 | ) |
|
766 | 766 | # Control the initial size of the discovery for initial change |
|
767 | 767 | coreconfigitem( |
|
768 | 768 | b'devel', |
|
769 | 769 | b'discovery.sample-size.initial', |
|
770 | 770 | default=100, |
|
771 | 771 | ) |
|
772 | 772 | _registerdiffopts(section=b'diff') |
|
773 | 773 | coreconfigitem( |
|
774 | 774 | b'diff', |
|
775 | 775 | b'merge', |
|
776 | 776 | default=False, |
|
777 | 777 | experimental=True, |
|
778 | 778 | ) |
|
779 | 779 | coreconfigitem( |
|
780 | 780 | b'email', |
|
781 | 781 | b'bcc', |
|
782 | 782 | default=None, |
|
783 | 783 | ) |
|
784 | 784 | coreconfigitem( |
|
785 | 785 | b'email', |
|
786 | 786 | b'cc', |
|
787 | 787 | default=None, |
|
788 | 788 | ) |
|
789 | 789 | coreconfigitem( |
|
790 | 790 | b'email', |
|
791 | 791 | b'charsets', |
|
792 | 792 | default=list, |
|
793 | 793 | ) |
|
794 | 794 | coreconfigitem( |
|
795 | 795 | b'email', |
|
796 | 796 | b'from', |
|
797 | 797 | default=None, |
|
798 | 798 | ) |
|
799 | 799 | coreconfigitem( |
|
800 | 800 | b'email', |
|
801 | 801 | b'method', |
|
802 | 802 | default=b'smtp', |
|
803 | 803 | ) |
|
804 | 804 | coreconfigitem( |
|
805 | 805 | b'email', |
|
806 | 806 | b'reply-to', |
|
807 | 807 | default=None, |
|
808 | 808 | ) |
|
809 | 809 | coreconfigitem( |
|
810 | 810 | b'email', |
|
811 | 811 | b'to', |
|
812 | 812 | default=None, |
|
813 | 813 | ) |
|
814 | 814 | coreconfigitem( |
|
815 | 815 | b'experimental', |
|
816 | 816 | b'archivemetatemplate', |
|
817 | 817 | default=dynamicdefault, |
|
818 | 818 | ) |
|
819 | 819 | coreconfigitem( |
|
820 | 820 | b'experimental', |
|
821 | 821 | b'auto-publish', |
|
822 | 822 | default=b'publish', |
|
823 | 823 | ) |
|
824 | 824 | coreconfigitem( |
|
825 | 825 | b'experimental', |
|
826 | 826 | b'bundle-phases', |
|
827 | 827 | default=False, |
|
828 | 828 | ) |
|
829 | 829 | coreconfigitem( |
|
830 | 830 | b'experimental', |
|
831 | 831 | b'bundle2-advertise', |
|
832 | 832 | default=True, |
|
833 | 833 | ) |
|
834 | 834 | coreconfigitem( |
|
835 | 835 | b'experimental', |
|
836 | 836 | b'bundle2-output-capture', |
|
837 | 837 | default=False, |
|
838 | 838 | ) |
|
839 | 839 | coreconfigitem( |
|
840 | 840 | b'experimental', |
|
841 | 841 | b'bundle2.pushback', |
|
842 | 842 | default=False, |
|
843 | 843 | ) |
|
844 | 844 | coreconfigitem( |
|
845 | 845 | b'experimental', |
|
846 | 846 | b'bundle2lazylocking', |
|
847 | 847 | default=False, |
|
848 | 848 | ) |
|
849 | 849 | coreconfigitem( |
|
850 | 850 | b'experimental', |
|
851 | 851 | b'bundlecomplevel', |
|
852 | 852 | default=None, |
|
853 | 853 | ) |
|
854 | 854 | coreconfigitem( |
|
855 | 855 | b'experimental', |
|
856 | 856 | b'bundlecomplevel.bzip2', |
|
857 | 857 | default=None, |
|
858 | 858 | ) |
|
859 | 859 | coreconfigitem( |
|
860 | 860 | b'experimental', |
|
861 | 861 | b'bundlecomplevel.gzip', |
|
862 | 862 | default=None, |
|
863 | 863 | ) |
|
864 | 864 | coreconfigitem( |
|
865 | 865 | b'experimental', |
|
866 | 866 | b'bundlecomplevel.none', |
|
867 | 867 | default=None, |
|
868 | 868 | ) |
|
869 | 869 | coreconfigitem( |
|
870 | 870 | b'experimental', |
|
871 | 871 | b'bundlecomplevel.zstd', |
|
872 | 872 | default=None, |
|
873 | 873 | ) |
|
874 | 874 | coreconfigitem( |
|
875 | 875 | b'experimental', |
|
876 | 876 | b'bundlecompthreads', |
|
877 | 877 | default=None, |
|
878 | 878 | ) |
|
879 | 879 | coreconfigitem( |
|
880 | 880 | b'experimental', |
|
881 | 881 | b'bundlecompthreads.bzip2', |
|
882 | 882 | default=None, |
|
883 | 883 | ) |
|
884 | 884 | coreconfigitem( |
|
885 | 885 | b'experimental', |
|
886 | 886 | b'bundlecompthreads.gzip', |
|
887 | 887 | default=None, |
|
888 | 888 | ) |
|
889 | 889 | coreconfigitem( |
|
890 | 890 | b'experimental', |
|
891 | 891 | b'bundlecompthreads.none', |
|
892 | 892 | default=None, |
|
893 | 893 | ) |
|
894 | 894 | coreconfigitem( |
|
895 | 895 | b'experimental', |
|
896 | 896 | b'bundlecompthreads.zstd', |
|
897 | 897 | default=None, |
|
898 | 898 | ) |
|
899 | 899 | coreconfigitem( |
|
900 | 900 | b'experimental', |
|
901 | 901 | b'changegroup3', |
|
902 | 902 | default=False, |
|
903 | 903 | ) |
|
904 | 904 | coreconfigitem( |
|
905 | 905 | b'experimental', |
|
906 | 906 | b'changegroup4', |
|
907 | 907 | default=False, |
|
908 | 908 | ) |
|
909 | 909 | coreconfigitem( |
|
910 | 910 | b'experimental', |
|
911 | 911 | b'cleanup-as-archived', |
|
912 | 912 | default=False, |
|
913 | 913 | ) |
|
914 | 914 | coreconfigitem( |
|
915 | 915 | b'experimental', |
|
916 | 916 | b'clientcompressionengines', |
|
917 | 917 | default=list, |
|
918 | 918 | ) |
|
919 | 919 | coreconfigitem( |
|
920 | 920 | b'experimental', |
|
921 | 921 | b'copytrace', |
|
922 | 922 | default=b'on', |
|
923 | 923 | ) |
|
924 | 924 | coreconfigitem( |
|
925 | 925 | b'experimental', |
|
926 | 926 | b'copytrace.movecandidateslimit', |
|
927 | 927 | default=100, |
|
928 | 928 | ) |
|
929 | 929 | coreconfigitem( |
|
930 | 930 | b'experimental', |
|
931 | 931 | b'copytrace.sourcecommitlimit', |
|
932 | 932 | default=100, |
|
933 | 933 | ) |
|
934 | 934 | coreconfigitem( |
|
935 | 935 | b'experimental', |
|
936 | 936 | b'copies.read-from', |
|
937 | 937 | default=b"filelog-only", |
|
938 | 938 | ) |
|
939 | 939 | coreconfigitem( |
|
940 | 940 | b'experimental', |
|
941 | 941 | b'copies.write-to', |
|
942 | 942 | default=b'filelog-only', |
|
943 | 943 | ) |
|
944 | 944 | coreconfigitem( |
|
945 | 945 | b'experimental', |
|
946 | 946 | b'crecordtest', |
|
947 | 947 | default=None, |
|
948 | 948 | ) |
|
949 | 949 | coreconfigitem( |
|
950 | 950 | b'experimental', |
|
951 | 951 | b'directaccess', |
|
952 | 952 | default=False, |
|
953 | 953 | ) |
|
954 | 954 | coreconfigitem( |
|
955 | 955 | b'experimental', |
|
956 | 956 | b'directaccess.revnums', |
|
957 | 957 | default=False, |
|
958 | 958 | ) |
|
959 | 959 | coreconfigitem( |
|
960 | 960 | b'experimental', |
|
961 | 961 | b'editortmpinhg', |
|
962 | 962 | default=False, |
|
963 | 963 | ) |
|
964 | 964 | coreconfigitem( |
|
965 | 965 | b'experimental', |
|
966 | 966 | b'evolution', |
|
967 | 967 | default=list, |
|
968 | 968 | ) |
|
969 | 969 | coreconfigitem( |
|
970 | 970 | b'experimental', |
|
971 | 971 | b'evolution.allowdivergence', |
|
972 | 972 | default=False, |
|
973 | 973 | alias=[(b'experimental', b'allowdivergence')], |
|
974 | 974 | ) |
|
975 | 975 | coreconfigitem( |
|
976 | 976 | b'experimental', |
|
977 | 977 | b'evolution.allowunstable', |
|
978 | 978 | default=None, |
|
979 | 979 | ) |
|
980 | 980 | coreconfigitem( |
|
981 | 981 | b'experimental', |
|
982 | 982 | b'evolution.createmarkers', |
|
983 | 983 | default=None, |
|
984 | 984 | ) |
|
985 | 985 | coreconfigitem( |
|
986 | 986 | b'experimental', |
|
987 | 987 | b'evolution.effect-flags', |
|
988 | 988 | default=True, |
|
989 | 989 | alias=[(b'experimental', b'effect-flags')], |
|
990 | 990 | ) |
|
991 | 991 | coreconfigitem( |
|
992 | 992 | b'experimental', |
|
993 | 993 | b'evolution.exchange', |
|
994 | 994 | default=None, |
|
995 | 995 | ) |
|
996 | 996 | coreconfigitem( |
|
997 | 997 | b'experimental', |
|
998 | 998 | b'evolution.bundle-obsmarker', |
|
999 | 999 | default=False, |
|
1000 | 1000 | ) |
|
1001 | 1001 | coreconfigitem( |
|
1002 | 1002 | b'experimental', |
|
1003 | 1003 | b'evolution.bundle-obsmarker:mandatory', |
|
1004 | 1004 | default=True, |
|
1005 | 1005 | ) |
|
1006 | 1006 | coreconfigitem( |
|
1007 | 1007 | b'experimental', |
|
1008 | 1008 | b'log.topo', |
|
1009 | 1009 | default=False, |
|
1010 | 1010 | ) |
|
1011 | 1011 | coreconfigitem( |
|
1012 | 1012 | b'experimental', |
|
1013 | 1013 | b'evolution.report-instabilities', |
|
1014 | 1014 | default=True, |
|
1015 | 1015 | ) |
|
1016 | 1016 | coreconfigitem( |
|
1017 | 1017 | b'experimental', |
|
1018 | 1018 | b'evolution.track-operation', |
|
1019 | 1019 | default=True, |
|
1020 | 1020 | ) |
|
1021 | 1021 | # repo-level config to exclude a revset visibility |
|
1022 | 1022 | # |
|
1023 | 1023 | # The target use case is to use `share` to expose different subset of the same |
|
1024 | 1024 | # repository, especially server side. See also `server.view`. |
|
1025 | 1025 | coreconfigitem( |
|
1026 | 1026 | b'experimental', |
|
1027 | 1027 | b'extra-filter-revs', |
|
1028 | 1028 | default=None, |
|
1029 | 1029 | ) |
|
1030 | 1030 | coreconfigitem( |
|
1031 | 1031 | b'experimental', |
|
1032 | 1032 | b'maxdeltachainspan', |
|
1033 | 1033 | default=-1, |
|
1034 | 1034 | ) |
|
1035 | 1035 | # tracks files which were undeleted (merge might delete them but we explicitly |
|
1036 | 1036 | # kept/undeleted them) and creates new filenodes for them |
|
1037 | 1037 | coreconfigitem( |
|
1038 | 1038 | b'experimental', |
|
1039 | 1039 | b'merge-track-salvaged', |
|
1040 | 1040 | default=False, |
|
1041 | 1041 | ) |
|
1042 | 1042 | coreconfigitem( |
|
1043 | 1043 | b'experimental', |
|
1044 | 1044 | b'mmapindexthreshold', |
|
1045 | 1045 | default=None, |
|
1046 | 1046 | ) |
|
1047 | 1047 | coreconfigitem( |
|
1048 | 1048 | b'experimental', |
|
1049 | 1049 | b'narrow', |
|
1050 | 1050 | default=False, |
|
1051 | 1051 | ) |
|
1052 | 1052 | coreconfigitem( |
|
1053 | 1053 | b'experimental', |
|
1054 | 1054 | b'nonnormalparanoidcheck', |
|
1055 | 1055 | default=False, |
|
1056 | 1056 | ) |
|
1057 | 1057 | coreconfigitem( |
|
1058 | 1058 | b'experimental', |
|
1059 | 1059 | b'exportableenviron', |
|
1060 | 1060 | default=list, |
|
1061 | 1061 | ) |
|
1062 | 1062 | coreconfigitem( |
|
1063 | 1063 | b'experimental', |
|
1064 | 1064 | b'extendedheader.index', |
|
1065 | 1065 | default=None, |
|
1066 | 1066 | ) |
|
1067 | 1067 | coreconfigitem( |
|
1068 | 1068 | b'experimental', |
|
1069 | 1069 | b'extendedheader.similarity', |
|
1070 | 1070 | default=False, |
|
1071 | 1071 | ) |
|
1072 | 1072 | coreconfigitem( |
|
1073 | 1073 | b'experimental', |
|
1074 | 1074 | b'graphshorten', |
|
1075 | 1075 | default=False, |
|
1076 | 1076 | ) |
|
1077 | 1077 | coreconfigitem( |
|
1078 | 1078 | b'experimental', |
|
1079 | 1079 | b'graphstyle.parent', |
|
1080 | 1080 | default=dynamicdefault, |
|
1081 | 1081 | ) |
|
1082 | 1082 | coreconfigitem( |
|
1083 | 1083 | b'experimental', |
|
1084 | 1084 | b'graphstyle.missing', |
|
1085 | 1085 | default=dynamicdefault, |
|
1086 | 1086 | ) |
|
1087 | 1087 | coreconfigitem( |
|
1088 | 1088 | b'experimental', |
|
1089 | 1089 | b'graphstyle.grandparent', |
|
1090 | 1090 | default=dynamicdefault, |
|
1091 | 1091 | ) |
|
1092 | 1092 | coreconfigitem( |
|
1093 | 1093 | b'experimental', |
|
1094 | 1094 | b'hook-track-tags', |
|
1095 | 1095 | default=False, |
|
1096 | 1096 | ) |
|
1097 | 1097 | coreconfigitem( |
|
1098 | 1098 | b'experimental', |
|
1099 | 1099 | b'httppostargs', |
|
1100 | 1100 | default=False, |
|
1101 | 1101 | ) |
|
1102 | 1102 | coreconfigitem(b'experimental', b'nointerrupt', default=False) |
|
1103 | 1103 | coreconfigitem(b'experimental', b'nointerrupt-interactiveonly', default=True) |
|
1104 | 1104 | |
|
1105 | 1105 | coreconfigitem( |
|
1106 | 1106 | b'experimental', |
|
1107 | 1107 | b'obsmarkers-exchange-debug', |
|
1108 | 1108 | default=False, |
|
1109 | 1109 | ) |
|
1110 | 1110 | coreconfigitem( |
|
1111 | 1111 | b'experimental', |
|
1112 | 1112 | b'remotenames', |
|
1113 | 1113 | default=False, |
|
1114 | 1114 | ) |
|
1115 | 1115 | coreconfigitem( |
|
1116 | 1116 | b'experimental', |
|
1117 | 1117 | b'removeemptydirs', |
|
1118 | 1118 | default=True, |
|
1119 | 1119 | ) |
|
1120 | 1120 | coreconfigitem( |
|
1121 | 1121 | b'experimental', |
|
1122 | 1122 | b'revert.interactive.select-to-keep', |
|
1123 | 1123 | default=False, |
|
1124 | 1124 | ) |
|
1125 | 1125 | coreconfigitem( |
|
1126 | 1126 | b'experimental', |
|
1127 | 1127 | b'revisions.prefixhexnode', |
|
1128 | 1128 | default=False, |
|
1129 | 1129 | ) |
|
1130 | 1130 | # "out of experimental" todo list. |
|
1131 | 1131 | # |
|
1132 | 1132 | # * include management of a persistent nodemap in the main docket |
|
1133 | 1133 | # * enforce a "no-truncate" policy for mmap safety |
|
1134 | 1134 | # - for censoring operation |
|
1135 | 1135 | # - for stripping operation |
|
1136 | 1136 | # - for rollback operation |
|
1137 | 1137 | # * proper streaming (race free) of the docket file |
|
1138 | 1138 | # * track garbage data to evemtually allow rewriting -existing- sidedata. |
|
1139 | 1139 | # * Exchange-wise, we will also need to do something more efficient than |
|
1140 | 1140 | # keeping references to the affected revlogs, especially memory-wise when |
|
1141 | 1141 | # rewriting sidedata. |
|
1142 | 1142 | # * introduce a proper solution to reduce the number of filelog related files. |
|
1143 | 1143 | # * use caching for reading sidedata (similar to what we do for data). |
|
1144 | 1144 | # * no longer set offset=0 if sidedata_size=0 (simplify cutoff computation). |
|
1145 | 1145 | # * Improvement to consider |
|
1146 | 1146 | # - avoid compression header in chunk using the default compression? |
|
1147 | 1147 | # - forbid "inline" compression mode entirely? |
|
1148 | 1148 | # - split the data offset and flag field (the 2 bytes save are mostly trouble) |
|
1149 | 1149 | # - keep track of uncompressed -chunk- size (to preallocate memory better) |
|
1150 | 1150 | # - keep track of chain base or size (probably not that useful anymore) |
|
1151 | 1151 | coreconfigitem( |
|
1152 | 1152 | b'experimental', |
|
1153 | 1153 | b'revlogv2', |
|
1154 | 1154 | default=None, |
|
1155 | 1155 | ) |
|
1156 | 1156 | coreconfigitem( |
|
1157 | 1157 | b'experimental', |
|
1158 | 1158 | b'revisions.disambiguatewithin', |
|
1159 | 1159 | default=None, |
|
1160 | 1160 | ) |
|
1161 | 1161 | coreconfigitem( |
|
1162 | 1162 | b'experimental', |
|
1163 | 1163 | b'rust.index', |
|
1164 | 1164 | default=False, |
|
1165 | 1165 | ) |
|
1166 | 1166 | coreconfigitem( |
|
1167 | 1167 | b'experimental', |
|
1168 | 1168 | b'server.filesdata.recommended-batch-size', |
|
1169 | 1169 | default=50000, |
|
1170 | 1170 | ) |
|
1171 | 1171 | coreconfigitem( |
|
1172 | 1172 | b'experimental', |
|
1173 | 1173 | b'server.manifestdata.recommended-batch-size', |
|
1174 | 1174 | default=100000, |
|
1175 | 1175 | ) |
|
1176 | 1176 | coreconfigitem( |
|
1177 | 1177 | b'experimental', |
|
1178 | 1178 | b'server.stream-narrow-clones', |
|
1179 | 1179 | default=False, |
|
1180 | 1180 | ) |
|
1181 | 1181 | coreconfigitem( |
|
1182 | 1182 | b'experimental', |
|
1183 | 1183 | b'single-head-per-branch', |
|
1184 | 1184 | default=False, |
|
1185 | 1185 | ) |
|
1186 | 1186 | coreconfigitem( |
|
1187 | 1187 | b'experimental', |
|
1188 | 1188 | b'single-head-per-branch:account-closed-heads', |
|
1189 | 1189 | default=False, |
|
1190 | 1190 | ) |
|
1191 | 1191 | coreconfigitem( |
|
1192 | 1192 | b'experimental', |
|
1193 | 1193 | b'single-head-per-branch:public-changes-only', |
|
1194 | 1194 | default=False, |
|
1195 | 1195 | ) |
|
1196 | 1196 | coreconfigitem( |
|
1197 | 1197 | b'experimental', |
|
1198 | 1198 | b'sparse-read', |
|
1199 | 1199 | default=False, |
|
1200 | 1200 | ) |
|
1201 | 1201 | coreconfigitem( |
|
1202 | 1202 | b'experimental', |
|
1203 | 1203 | b'sparse-read.density-threshold', |
|
1204 | 1204 | default=0.50, |
|
1205 | 1205 | ) |
|
1206 | 1206 | coreconfigitem( |
|
1207 | 1207 | b'experimental', |
|
1208 | 1208 | b'sparse-read.min-gap-size', |
|
1209 | 1209 | default=b'65K', |
|
1210 | 1210 | ) |
|
1211 | 1211 | coreconfigitem( |
|
1212 | 1212 | b'experimental', |
|
1213 | 1213 | b'treemanifest', |
|
1214 | 1214 | default=False, |
|
1215 | 1215 | ) |
|
1216 | 1216 | coreconfigitem( |
|
1217 | 1217 | b'experimental', |
|
1218 | 1218 | b'update.atomic-file', |
|
1219 | 1219 | default=False, |
|
1220 | 1220 | ) |
|
1221 | 1221 | coreconfigitem( |
|
1222 | 1222 | b'experimental', |
|
1223 | 1223 | b'web.full-garbage-collection-rate', |
|
1224 | 1224 | default=1, # still forcing a full collection on each request |
|
1225 | 1225 | ) |
|
1226 | 1226 | coreconfigitem( |
|
1227 | 1227 | b'experimental', |
|
1228 | 1228 | b'worker.wdir-get-thread-safe', |
|
1229 | 1229 | default=False, |
|
1230 | 1230 | ) |
|
1231 | 1231 | coreconfigitem( |
|
1232 | 1232 | b'experimental', |
|
1233 | 1233 | b'worker.repository-upgrade', |
|
1234 | 1234 | default=False, |
|
1235 | 1235 | ) |
|
1236 | 1236 | coreconfigitem( |
|
1237 | 1237 | b'experimental', |
|
1238 | 1238 | b'xdiff', |
|
1239 | 1239 | default=False, |
|
1240 | 1240 | ) |
|
1241 | 1241 | coreconfigitem( |
|
1242 | 1242 | b'extensions', |
|
1243 | 1243 | b'[^:]*', |
|
1244 | 1244 | default=None, |
|
1245 | 1245 | generic=True, |
|
1246 | 1246 | ) |
|
1247 | 1247 | coreconfigitem( |
|
1248 | 1248 | b'extensions', |
|
1249 | 1249 | b'[^:]*:required', |
|
1250 | 1250 | default=False, |
|
1251 | 1251 | generic=True, |
|
1252 | 1252 | ) |
|
1253 | 1253 | coreconfigitem( |
|
1254 | 1254 | b'extdata', |
|
1255 | 1255 | b'.*', |
|
1256 | 1256 | default=None, |
|
1257 | 1257 | generic=True, |
|
1258 | 1258 | ) |
|
1259 | 1259 | coreconfigitem( |
|
1260 | 1260 | b'format', |
|
1261 | 1261 | b'bookmarks-in-store', |
|
1262 | 1262 | default=False, |
|
1263 | 1263 | ) |
|
1264 | 1264 | coreconfigitem( |
|
1265 | 1265 | b'format', |
|
1266 | 1266 | b'chunkcachesize', |
|
1267 | 1267 | default=None, |
|
1268 | 1268 | experimental=True, |
|
1269 | 1269 | ) |
|
1270 | 1270 | coreconfigitem( |
|
1271 | 1271 | # Enable this dirstate format *when creating a new repository*. |
|
1272 | 1272 | # Which format to use for existing repos is controlled by .hg/requires |
|
1273 | 1273 | b'format', |
|
1274 | 1274 | b'use-dirstate-v2', |
|
1275 | 1275 | default=False, |
|
1276 | 1276 | experimental=True, |
|
1277 | 1277 | alias=[(b'format', b'exp-rc-dirstate-v2')], |
|
1278 | 1278 | ) |
|
1279 | 1279 | coreconfigitem( |
|
1280 | 1280 | b'format', |
|
1281 | 1281 | b'use-dirstate-tracked-hint', |
|
1282 | 1282 | default=False, |
|
1283 | 1283 | experimental=True, |
|
1284 | 1284 | ) |
|
1285 | 1285 | coreconfigitem( |
|
1286 | 1286 | b'format', |
|
1287 | 1287 | b'use-dirstate-tracked-hint.version', |
|
1288 | 1288 | default=1, |
|
1289 | 1289 | experimental=True, |
|
1290 | 1290 | ) |
|
1291 | 1291 | coreconfigitem( |
|
1292 | 1292 | b'format', |
|
1293 | b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories', | |
|
1294 | default=False, | |
|
1295 | experimental=True, | |
|
1296 | ) | |
|
1297 | coreconfigitem( | |
|
1298 | b'format', | |
|
1293 | 1299 | b'dotencode', |
|
1294 | 1300 | default=True, |
|
1295 | 1301 | ) |
|
1296 | 1302 | coreconfigitem( |
|
1297 | 1303 | b'format', |
|
1298 | 1304 | b'generaldelta', |
|
1299 | 1305 | default=False, |
|
1300 | 1306 | experimental=True, |
|
1301 | 1307 | ) |
|
1302 | 1308 | coreconfigitem( |
|
1303 | 1309 | b'format', |
|
1304 | 1310 | b'manifestcachesize', |
|
1305 | 1311 | default=None, |
|
1306 | 1312 | experimental=True, |
|
1307 | 1313 | ) |
|
1308 | 1314 | coreconfigitem( |
|
1309 | 1315 | b'format', |
|
1310 | 1316 | b'maxchainlen', |
|
1311 | 1317 | default=dynamicdefault, |
|
1312 | 1318 | experimental=True, |
|
1313 | 1319 | ) |
|
1314 | 1320 | coreconfigitem( |
|
1315 | 1321 | b'format', |
|
1316 | 1322 | b'obsstore-version', |
|
1317 | 1323 | default=None, |
|
1318 | 1324 | ) |
|
1319 | 1325 | coreconfigitem( |
|
1320 | 1326 | b'format', |
|
1321 | 1327 | b'sparse-revlog', |
|
1322 | 1328 | default=True, |
|
1323 | 1329 | ) |
|
1324 | 1330 | coreconfigitem( |
|
1325 | 1331 | b'format', |
|
1326 | 1332 | b'revlog-compression', |
|
1327 | 1333 | default=lambda: [b'zstd', b'zlib'], |
|
1328 | 1334 | alias=[(b'experimental', b'format.compression')], |
|
1329 | 1335 | ) |
|
1330 | 1336 | # Experimental TODOs: |
|
1331 | 1337 | # |
|
1332 | 1338 | # * Same as for revlogv2 (but for the reduction of the number of files) |
|
1333 | 1339 | # * Actually computing the rank of changesets |
|
1334 | 1340 | # * Improvement to investigate |
|
1335 | 1341 | # - storing .hgtags fnode |
|
1336 | 1342 | # - storing branch related identifier |
|
1337 | 1343 | |
|
1338 | 1344 | coreconfigitem( |
|
1339 | 1345 | b'format', |
|
1340 | 1346 | b'exp-use-changelog-v2', |
|
1341 | 1347 | default=None, |
|
1342 | 1348 | experimental=True, |
|
1343 | 1349 | ) |
|
1344 | 1350 | coreconfigitem( |
|
1345 | 1351 | b'format', |
|
1346 | 1352 | b'usefncache', |
|
1347 | 1353 | default=True, |
|
1348 | 1354 | ) |
|
1349 | 1355 | coreconfigitem( |
|
1350 | 1356 | b'format', |
|
1351 | 1357 | b'usegeneraldelta', |
|
1352 | 1358 | default=True, |
|
1353 | 1359 | ) |
|
1354 | 1360 | coreconfigitem( |
|
1355 | 1361 | b'format', |
|
1356 | 1362 | b'usestore', |
|
1357 | 1363 | default=True, |
|
1358 | 1364 | ) |
|
1359 | 1365 | |
|
1360 | 1366 | |
|
1361 | 1367 | def _persistent_nodemap_default(): |
|
1362 | 1368 | """compute `use-persistent-nodemap` default value |
|
1363 | 1369 | |
|
1364 | 1370 | The feature is disabled unless a fast implementation is available. |
|
1365 | 1371 | """ |
|
1366 | 1372 | from . import policy |
|
1367 | 1373 | |
|
1368 | 1374 | return policy.importrust('revlog') is not None |
|
1369 | 1375 | |
|
1370 | 1376 | |
|
1371 | 1377 | coreconfigitem( |
|
1372 | 1378 | b'format', |
|
1373 | 1379 | b'use-persistent-nodemap', |
|
1374 | 1380 | default=_persistent_nodemap_default, |
|
1375 | 1381 | ) |
|
1376 | 1382 | coreconfigitem( |
|
1377 | 1383 | b'format', |
|
1378 | 1384 | b'exp-use-copies-side-data-changeset', |
|
1379 | 1385 | default=False, |
|
1380 | 1386 | experimental=True, |
|
1381 | 1387 | ) |
|
1382 | 1388 | coreconfigitem( |
|
1383 | 1389 | b'format', |
|
1384 | 1390 | b'use-share-safe', |
|
1385 | 1391 | default=True, |
|
1386 | 1392 | ) |
|
1387 | 1393 | coreconfigitem( |
|
1388 | 1394 | b'format', |
|
1389 | 1395 | b'use-share-safe.automatic-upgrade-of-mismatching-repositories', |
|
1390 | 1396 | default=False, |
|
1391 | 1397 | experimental=True, |
|
1392 | 1398 | ) |
|
1393 | 1399 | coreconfigitem( |
|
1394 | 1400 | b'format', |
|
1395 | 1401 | b'internal-phase', |
|
1396 | 1402 | default=False, |
|
1397 | 1403 | experimental=True, |
|
1398 | 1404 | ) |
|
1399 | 1405 | coreconfigitem( |
|
1400 | 1406 | b'fsmonitor', |
|
1401 | 1407 | b'warn_when_unused', |
|
1402 | 1408 | default=True, |
|
1403 | 1409 | ) |
|
1404 | 1410 | coreconfigitem( |
|
1405 | 1411 | b'fsmonitor', |
|
1406 | 1412 | b'warn_update_file_count', |
|
1407 | 1413 | default=50000, |
|
1408 | 1414 | ) |
|
1409 | 1415 | coreconfigitem( |
|
1410 | 1416 | b'fsmonitor', |
|
1411 | 1417 | b'warn_update_file_count_rust', |
|
1412 | 1418 | default=400000, |
|
1413 | 1419 | ) |
|
1414 | 1420 | coreconfigitem( |
|
1415 | 1421 | b'help', |
|
1416 | 1422 | br'hidden-command\..*', |
|
1417 | 1423 | default=False, |
|
1418 | 1424 | generic=True, |
|
1419 | 1425 | ) |
|
1420 | 1426 | coreconfigitem( |
|
1421 | 1427 | b'help', |
|
1422 | 1428 | br'hidden-topic\..*', |
|
1423 | 1429 | default=False, |
|
1424 | 1430 | generic=True, |
|
1425 | 1431 | ) |
|
1426 | 1432 | coreconfigitem( |
|
1427 | 1433 | b'hooks', |
|
1428 | 1434 | b'[^:]*', |
|
1429 | 1435 | default=dynamicdefault, |
|
1430 | 1436 | generic=True, |
|
1431 | 1437 | ) |
|
1432 | 1438 | coreconfigitem( |
|
1433 | 1439 | b'hooks', |
|
1434 | 1440 | b'.*:run-with-plain', |
|
1435 | 1441 | default=True, |
|
1436 | 1442 | generic=True, |
|
1437 | 1443 | ) |
|
1438 | 1444 | coreconfigitem( |
|
1439 | 1445 | b'hgweb-paths', |
|
1440 | 1446 | b'.*', |
|
1441 | 1447 | default=list, |
|
1442 | 1448 | generic=True, |
|
1443 | 1449 | ) |
|
1444 | 1450 | coreconfigitem( |
|
1445 | 1451 | b'hostfingerprints', |
|
1446 | 1452 | b'.*', |
|
1447 | 1453 | default=list, |
|
1448 | 1454 | generic=True, |
|
1449 | 1455 | ) |
|
1450 | 1456 | coreconfigitem( |
|
1451 | 1457 | b'hostsecurity', |
|
1452 | 1458 | b'ciphers', |
|
1453 | 1459 | default=None, |
|
1454 | 1460 | ) |
|
1455 | 1461 | coreconfigitem( |
|
1456 | 1462 | b'hostsecurity', |
|
1457 | 1463 | b'minimumprotocol', |
|
1458 | 1464 | default=dynamicdefault, |
|
1459 | 1465 | ) |
|
1460 | 1466 | coreconfigitem( |
|
1461 | 1467 | b'hostsecurity', |
|
1462 | 1468 | b'.*:minimumprotocol$', |
|
1463 | 1469 | default=dynamicdefault, |
|
1464 | 1470 | generic=True, |
|
1465 | 1471 | ) |
|
1466 | 1472 | coreconfigitem( |
|
1467 | 1473 | b'hostsecurity', |
|
1468 | 1474 | b'.*:ciphers$', |
|
1469 | 1475 | default=dynamicdefault, |
|
1470 | 1476 | generic=True, |
|
1471 | 1477 | ) |
|
1472 | 1478 | coreconfigitem( |
|
1473 | 1479 | b'hostsecurity', |
|
1474 | 1480 | b'.*:fingerprints$', |
|
1475 | 1481 | default=list, |
|
1476 | 1482 | generic=True, |
|
1477 | 1483 | ) |
|
1478 | 1484 | coreconfigitem( |
|
1479 | 1485 | b'hostsecurity', |
|
1480 | 1486 | b'.*:verifycertsfile$', |
|
1481 | 1487 | default=None, |
|
1482 | 1488 | generic=True, |
|
1483 | 1489 | ) |
|
1484 | 1490 | |
|
1485 | 1491 | coreconfigitem( |
|
1486 | 1492 | b'http_proxy', |
|
1487 | 1493 | b'always', |
|
1488 | 1494 | default=False, |
|
1489 | 1495 | ) |
|
1490 | 1496 | coreconfigitem( |
|
1491 | 1497 | b'http_proxy', |
|
1492 | 1498 | b'host', |
|
1493 | 1499 | default=None, |
|
1494 | 1500 | ) |
|
1495 | 1501 | coreconfigitem( |
|
1496 | 1502 | b'http_proxy', |
|
1497 | 1503 | b'no', |
|
1498 | 1504 | default=list, |
|
1499 | 1505 | ) |
|
1500 | 1506 | coreconfigitem( |
|
1501 | 1507 | b'http_proxy', |
|
1502 | 1508 | b'passwd', |
|
1503 | 1509 | default=None, |
|
1504 | 1510 | ) |
|
1505 | 1511 | coreconfigitem( |
|
1506 | 1512 | b'http_proxy', |
|
1507 | 1513 | b'user', |
|
1508 | 1514 | default=None, |
|
1509 | 1515 | ) |
|
1510 | 1516 | |
|
1511 | 1517 | coreconfigitem( |
|
1512 | 1518 | b'http', |
|
1513 | 1519 | b'timeout', |
|
1514 | 1520 | default=None, |
|
1515 | 1521 | ) |
|
1516 | 1522 | |
|
1517 | 1523 | coreconfigitem( |
|
1518 | 1524 | b'logtoprocess', |
|
1519 | 1525 | b'commandexception', |
|
1520 | 1526 | default=None, |
|
1521 | 1527 | ) |
|
1522 | 1528 | coreconfigitem( |
|
1523 | 1529 | b'logtoprocess', |
|
1524 | 1530 | b'commandfinish', |
|
1525 | 1531 | default=None, |
|
1526 | 1532 | ) |
|
1527 | 1533 | coreconfigitem( |
|
1528 | 1534 | b'logtoprocess', |
|
1529 | 1535 | b'command', |
|
1530 | 1536 | default=None, |
|
1531 | 1537 | ) |
|
1532 | 1538 | coreconfigitem( |
|
1533 | 1539 | b'logtoprocess', |
|
1534 | 1540 | b'develwarn', |
|
1535 | 1541 | default=None, |
|
1536 | 1542 | ) |
|
1537 | 1543 | coreconfigitem( |
|
1538 | 1544 | b'logtoprocess', |
|
1539 | 1545 | b'uiblocked', |
|
1540 | 1546 | default=None, |
|
1541 | 1547 | ) |
|
1542 | 1548 | coreconfigitem( |
|
1543 | 1549 | b'merge', |
|
1544 | 1550 | b'checkunknown', |
|
1545 | 1551 | default=b'abort', |
|
1546 | 1552 | ) |
|
1547 | 1553 | coreconfigitem( |
|
1548 | 1554 | b'merge', |
|
1549 | 1555 | b'checkignored', |
|
1550 | 1556 | default=b'abort', |
|
1551 | 1557 | ) |
|
1552 | 1558 | coreconfigitem( |
|
1553 | 1559 | b'experimental', |
|
1554 | 1560 | b'merge.checkpathconflicts', |
|
1555 | 1561 | default=False, |
|
1556 | 1562 | ) |
|
1557 | 1563 | coreconfigitem( |
|
1558 | 1564 | b'merge', |
|
1559 | 1565 | b'followcopies', |
|
1560 | 1566 | default=True, |
|
1561 | 1567 | ) |
|
1562 | 1568 | coreconfigitem( |
|
1563 | 1569 | b'merge', |
|
1564 | 1570 | b'on-failure', |
|
1565 | 1571 | default=b'continue', |
|
1566 | 1572 | ) |
|
1567 | 1573 | coreconfigitem( |
|
1568 | 1574 | b'merge', |
|
1569 | 1575 | b'preferancestor', |
|
1570 | 1576 | default=lambda: [b'*'], |
|
1571 | 1577 | experimental=True, |
|
1572 | 1578 | ) |
|
1573 | 1579 | coreconfigitem( |
|
1574 | 1580 | b'merge', |
|
1575 | 1581 | b'strict-capability-check', |
|
1576 | 1582 | default=False, |
|
1577 | 1583 | ) |
|
1578 | 1584 | coreconfigitem( |
|
1579 | 1585 | b'merge', |
|
1580 | 1586 | b'disable-partial-tools', |
|
1581 | 1587 | default=False, |
|
1582 | 1588 | experimental=True, |
|
1583 | 1589 | ) |
|
1584 | 1590 | coreconfigitem( |
|
1585 | 1591 | b'partial-merge-tools', |
|
1586 | 1592 | b'.*', |
|
1587 | 1593 | default=None, |
|
1588 | 1594 | generic=True, |
|
1589 | 1595 | experimental=True, |
|
1590 | 1596 | ) |
|
1591 | 1597 | coreconfigitem( |
|
1592 | 1598 | b'partial-merge-tools', |
|
1593 | 1599 | br'.*\.patterns', |
|
1594 | 1600 | default=dynamicdefault, |
|
1595 | 1601 | generic=True, |
|
1596 | 1602 | priority=-1, |
|
1597 | 1603 | experimental=True, |
|
1598 | 1604 | ) |
|
1599 | 1605 | coreconfigitem( |
|
1600 | 1606 | b'partial-merge-tools', |
|
1601 | 1607 | br'.*\.executable$', |
|
1602 | 1608 | default=dynamicdefault, |
|
1603 | 1609 | generic=True, |
|
1604 | 1610 | priority=-1, |
|
1605 | 1611 | experimental=True, |
|
1606 | 1612 | ) |
|
1607 | 1613 | coreconfigitem( |
|
1608 | 1614 | b'partial-merge-tools', |
|
1609 | 1615 | br'.*\.order', |
|
1610 | 1616 | default=0, |
|
1611 | 1617 | generic=True, |
|
1612 | 1618 | priority=-1, |
|
1613 | 1619 | experimental=True, |
|
1614 | 1620 | ) |
|
1615 | 1621 | coreconfigitem( |
|
1616 | 1622 | b'partial-merge-tools', |
|
1617 | 1623 | br'.*\.args', |
|
1618 | 1624 | default=b"$local $base $other", |
|
1619 | 1625 | generic=True, |
|
1620 | 1626 | priority=-1, |
|
1621 | 1627 | experimental=True, |
|
1622 | 1628 | ) |
|
1623 | 1629 | coreconfigitem( |
|
1624 | 1630 | b'partial-merge-tools', |
|
1625 | 1631 | br'.*\.disable', |
|
1626 | 1632 | default=False, |
|
1627 | 1633 | generic=True, |
|
1628 | 1634 | priority=-1, |
|
1629 | 1635 | experimental=True, |
|
1630 | 1636 | ) |
|
1631 | 1637 | coreconfigitem( |
|
1632 | 1638 | b'merge-tools', |
|
1633 | 1639 | b'.*', |
|
1634 | 1640 | default=None, |
|
1635 | 1641 | generic=True, |
|
1636 | 1642 | ) |
|
1637 | 1643 | coreconfigitem( |
|
1638 | 1644 | b'merge-tools', |
|
1639 | 1645 | br'.*\.args$', |
|
1640 | 1646 | default=b"$local $base $other", |
|
1641 | 1647 | generic=True, |
|
1642 | 1648 | priority=-1, |
|
1643 | 1649 | ) |
|
1644 | 1650 | coreconfigitem( |
|
1645 | 1651 | b'merge-tools', |
|
1646 | 1652 | br'.*\.binary$', |
|
1647 | 1653 | default=False, |
|
1648 | 1654 | generic=True, |
|
1649 | 1655 | priority=-1, |
|
1650 | 1656 | ) |
|
1651 | 1657 | coreconfigitem( |
|
1652 | 1658 | b'merge-tools', |
|
1653 | 1659 | br'.*\.check$', |
|
1654 | 1660 | default=list, |
|
1655 | 1661 | generic=True, |
|
1656 | 1662 | priority=-1, |
|
1657 | 1663 | ) |
|
1658 | 1664 | coreconfigitem( |
|
1659 | 1665 | b'merge-tools', |
|
1660 | 1666 | br'.*\.checkchanged$', |
|
1661 | 1667 | default=False, |
|
1662 | 1668 | generic=True, |
|
1663 | 1669 | priority=-1, |
|
1664 | 1670 | ) |
|
1665 | 1671 | coreconfigitem( |
|
1666 | 1672 | b'merge-tools', |
|
1667 | 1673 | br'.*\.executable$', |
|
1668 | 1674 | default=dynamicdefault, |
|
1669 | 1675 | generic=True, |
|
1670 | 1676 | priority=-1, |
|
1671 | 1677 | ) |
|
1672 | 1678 | coreconfigitem( |
|
1673 | 1679 | b'merge-tools', |
|
1674 | 1680 | br'.*\.fixeol$', |
|
1675 | 1681 | default=False, |
|
1676 | 1682 | generic=True, |
|
1677 | 1683 | priority=-1, |
|
1678 | 1684 | ) |
|
1679 | 1685 | coreconfigitem( |
|
1680 | 1686 | b'merge-tools', |
|
1681 | 1687 | br'.*\.gui$', |
|
1682 | 1688 | default=False, |
|
1683 | 1689 | generic=True, |
|
1684 | 1690 | priority=-1, |
|
1685 | 1691 | ) |
|
1686 | 1692 | coreconfigitem( |
|
1687 | 1693 | b'merge-tools', |
|
1688 | 1694 | br'.*\.mergemarkers$', |
|
1689 | 1695 | default=b'basic', |
|
1690 | 1696 | generic=True, |
|
1691 | 1697 | priority=-1, |
|
1692 | 1698 | ) |
|
1693 | 1699 | coreconfigitem( |
|
1694 | 1700 | b'merge-tools', |
|
1695 | 1701 | br'.*\.mergemarkertemplate$', |
|
1696 | 1702 | default=dynamicdefault, # take from command-templates.mergemarker |
|
1697 | 1703 | generic=True, |
|
1698 | 1704 | priority=-1, |
|
1699 | 1705 | ) |
|
1700 | 1706 | coreconfigitem( |
|
1701 | 1707 | b'merge-tools', |
|
1702 | 1708 | br'.*\.priority$', |
|
1703 | 1709 | default=0, |
|
1704 | 1710 | generic=True, |
|
1705 | 1711 | priority=-1, |
|
1706 | 1712 | ) |
|
1707 | 1713 | coreconfigitem( |
|
1708 | 1714 | b'merge-tools', |
|
1709 | 1715 | br'.*\.premerge$', |
|
1710 | 1716 | default=dynamicdefault, |
|
1711 | 1717 | generic=True, |
|
1712 | 1718 | priority=-1, |
|
1713 | 1719 | ) |
|
1714 | 1720 | coreconfigitem( |
|
1715 | 1721 | b'merge-tools', |
|
1716 | 1722 | br'.*\.symlink$', |
|
1717 | 1723 | default=False, |
|
1718 | 1724 | generic=True, |
|
1719 | 1725 | priority=-1, |
|
1720 | 1726 | ) |
|
1721 | 1727 | coreconfigitem( |
|
1722 | 1728 | b'pager', |
|
1723 | 1729 | b'attend-.*', |
|
1724 | 1730 | default=dynamicdefault, |
|
1725 | 1731 | generic=True, |
|
1726 | 1732 | ) |
|
1727 | 1733 | coreconfigitem( |
|
1728 | 1734 | b'pager', |
|
1729 | 1735 | b'ignore', |
|
1730 | 1736 | default=list, |
|
1731 | 1737 | ) |
|
1732 | 1738 | coreconfigitem( |
|
1733 | 1739 | b'pager', |
|
1734 | 1740 | b'pager', |
|
1735 | 1741 | default=dynamicdefault, |
|
1736 | 1742 | ) |
|
1737 | 1743 | coreconfigitem( |
|
1738 | 1744 | b'patch', |
|
1739 | 1745 | b'eol', |
|
1740 | 1746 | default=b'strict', |
|
1741 | 1747 | ) |
|
1742 | 1748 | coreconfigitem( |
|
1743 | 1749 | b'patch', |
|
1744 | 1750 | b'fuzz', |
|
1745 | 1751 | default=2, |
|
1746 | 1752 | ) |
|
1747 | 1753 | coreconfigitem( |
|
1748 | 1754 | b'paths', |
|
1749 | 1755 | b'default', |
|
1750 | 1756 | default=None, |
|
1751 | 1757 | ) |
|
1752 | 1758 | coreconfigitem( |
|
1753 | 1759 | b'paths', |
|
1754 | 1760 | b'default-push', |
|
1755 | 1761 | default=None, |
|
1756 | 1762 | ) |
|
1757 | 1763 | coreconfigitem( |
|
1758 | 1764 | b'paths', |
|
1759 | 1765 | b'.*', |
|
1760 | 1766 | default=None, |
|
1761 | 1767 | generic=True, |
|
1762 | 1768 | ) |
|
1763 | 1769 | coreconfigitem( |
|
1764 | 1770 | b'paths', |
|
1765 | 1771 | b'.*:bookmarks.mode', |
|
1766 | 1772 | default='default', |
|
1767 | 1773 | generic=True, |
|
1768 | 1774 | ) |
|
1769 | 1775 | coreconfigitem( |
|
1770 | 1776 | b'paths', |
|
1771 | 1777 | b'.*:multi-urls', |
|
1772 | 1778 | default=False, |
|
1773 | 1779 | generic=True, |
|
1774 | 1780 | ) |
|
1775 | 1781 | coreconfigitem( |
|
1776 | 1782 | b'paths', |
|
1777 | 1783 | b'.*:pushrev', |
|
1778 | 1784 | default=None, |
|
1779 | 1785 | generic=True, |
|
1780 | 1786 | ) |
|
1781 | 1787 | coreconfigitem( |
|
1782 | 1788 | b'paths', |
|
1783 | 1789 | b'.*:pushurl', |
|
1784 | 1790 | default=None, |
|
1785 | 1791 | generic=True, |
|
1786 | 1792 | ) |
|
1787 | 1793 | coreconfigitem( |
|
1788 | 1794 | b'phases', |
|
1789 | 1795 | b'checksubrepos', |
|
1790 | 1796 | default=b'follow', |
|
1791 | 1797 | ) |
|
1792 | 1798 | coreconfigitem( |
|
1793 | 1799 | b'phases', |
|
1794 | 1800 | b'new-commit', |
|
1795 | 1801 | default=b'draft', |
|
1796 | 1802 | ) |
|
1797 | 1803 | coreconfigitem( |
|
1798 | 1804 | b'phases', |
|
1799 | 1805 | b'publish', |
|
1800 | 1806 | default=True, |
|
1801 | 1807 | ) |
|
1802 | 1808 | coreconfigitem( |
|
1803 | 1809 | b'profiling', |
|
1804 | 1810 | b'enabled', |
|
1805 | 1811 | default=False, |
|
1806 | 1812 | ) |
|
1807 | 1813 | coreconfigitem( |
|
1808 | 1814 | b'profiling', |
|
1809 | 1815 | b'format', |
|
1810 | 1816 | default=b'text', |
|
1811 | 1817 | ) |
|
1812 | 1818 | coreconfigitem( |
|
1813 | 1819 | b'profiling', |
|
1814 | 1820 | b'freq', |
|
1815 | 1821 | default=1000, |
|
1816 | 1822 | ) |
|
1817 | 1823 | coreconfigitem( |
|
1818 | 1824 | b'profiling', |
|
1819 | 1825 | b'limit', |
|
1820 | 1826 | default=30, |
|
1821 | 1827 | ) |
|
1822 | 1828 | coreconfigitem( |
|
1823 | 1829 | b'profiling', |
|
1824 | 1830 | b'nested', |
|
1825 | 1831 | default=0, |
|
1826 | 1832 | ) |
|
1827 | 1833 | coreconfigitem( |
|
1828 | 1834 | b'profiling', |
|
1829 | 1835 | b'output', |
|
1830 | 1836 | default=None, |
|
1831 | 1837 | ) |
|
1832 | 1838 | coreconfigitem( |
|
1833 | 1839 | b'profiling', |
|
1834 | 1840 | b'showmax', |
|
1835 | 1841 | default=0.999, |
|
1836 | 1842 | ) |
|
1837 | 1843 | coreconfigitem( |
|
1838 | 1844 | b'profiling', |
|
1839 | 1845 | b'showmin', |
|
1840 | 1846 | default=dynamicdefault, |
|
1841 | 1847 | ) |
|
1842 | 1848 | coreconfigitem( |
|
1843 | 1849 | b'profiling', |
|
1844 | 1850 | b'showtime', |
|
1845 | 1851 | default=True, |
|
1846 | 1852 | ) |
|
1847 | 1853 | coreconfigitem( |
|
1848 | 1854 | b'profiling', |
|
1849 | 1855 | b'sort', |
|
1850 | 1856 | default=b'inlinetime', |
|
1851 | 1857 | ) |
|
1852 | 1858 | coreconfigitem( |
|
1853 | 1859 | b'profiling', |
|
1854 | 1860 | b'statformat', |
|
1855 | 1861 | default=b'hotpath', |
|
1856 | 1862 | ) |
|
1857 | 1863 | coreconfigitem( |
|
1858 | 1864 | b'profiling', |
|
1859 | 1865 | b'time-track', |
|
1860 | 1866 | default=dynamicdefault, |
|
1861 | 1867 | ) |
|
1862 | 1868 | coreconfigitem( |
|
1863 | 1869 | b'profiling', |
|
1864 | 1870 | b'type', |
|
1865 | 1871 | default=b'stat', |
|
1866 | 1872 | ) |
|
1867 | 1873 | coreconfigitem( |
|
1868 | 1874 | b'progress', |
|
1869 | 1875 | b'assume-tty', |
|
1870 | 1876 | default=False, |
|
1871 | 1877 | ) |
|
1872 | 1878 | coreconfigitem( |
|
1873 | 1879 | b'progress', |
|
1874 | 1880 | b'changedelay', |
|
1875 | 1881 | default=1, |
|
1876 | 1882 | ) |
|
1877 | 1883 | coreconfigitem( |
|
1878 | 1884 | b'progress', |
|
1879 | 1885 | b'clear-complete', |
|
1880 | 1886 | default=True, |
|
1881 | 1887 | ) |
|
1882 | 1888 | coreconfigitem( |
|
1883 | 1889 | b'progress', |
|
1884 | 1890 | b'debug', |
|
1885 | 1891 | default=False, |
|
1886 | 1892 | ) |
|
1887 | 1893 | coreconfigitem( |
|
1888 | 1894 | b'progress', |
|
1889 | 1895 | b'delay', |
|
1890 | 1896 | default=3, |
|
1891 | 1897 | ) |
|
1892 | 1898 | coreconfigitem( |
|
1893 | 1899 | b'progress', |
|
1894 | 1900 | b'disable', |
|
1895 | 1901 | default=False, |
|
1896 | 1902 | ) |
|
1897 | 1903 | coreconfigitem( |
|
1898 | 1904 | b'progress', |
|
1899 | 1905 | b'estimateinterval', |
|
1900 | 1906 | default=60.0, |
|
1901 | 1907 | ) |
|
1902 | 1908 | coreconfigitem( |
|
1903 | 1909 | b'progress', |
|
1904 | 1910 | b'format', |
|
1905 | 1911 | default=lambda: [b'topic', b'bar', b'number', b'estimate'], |
|
1906 | 1912 | ) |
|
1907 | 1913 | coreconfigitem( |
|
1908 | 1914 | b'progress', |
|
1909 | 1915 | b'refresh', |
|
1910 | 1916 | default=0.1, |
|
1911 | 1917 | ) |
|
1912 | 1918 | coreconfigitem( |
|
1913 | 1919 | b'progress', |
|
1914 | 1920 | b'width', |
|
1915 | 1921 | default=dynamicdefault, |
|
1916 | 1922 | ) |
|
1917 | 1923 | coreconfigitem( |
|
1918 | 1924 | b'pull', |
|
1919 | 1925 | b'confirm', |
|
1920 | 1926 | default=False, |
|
1921 | 1927 | ) |
|
1922 | 1928 | coreconfigitem( |
|
1923 | 1929 | b'push', |
|
1924 | 1930 | b'pushvars.server', |
|
1925 | 1931 | default=False, |
|
1926 | 1932 | ) |
|
1927 | 1933 | coreconfigitem( |
|
1928 | 1934 | b'rewrite', |
|
1929 | 1935 | b'backup-bundle', |
|
1930 | 1936 | default=True, |
|
1931 | 1937 | alias=[(b'ui', b'history-editing-backup')], |
|
1932 | 1938 | ) |
|
1933 | 1939 | coreconfigitem( |
|
1934 | 1940 | b'rewrite', |
|
1935 | 1941 | b'update-timestamp', |
|
1936 | 1942 | default=False, |
|
1937 | 1943 | ) |
|
1938 | 1944 | coreconfigitem( |
|
1939 | 1945 | b'rewrite', |
|
1940 | 1946 | b'empty-successor', |
|
1941 | 1947 | default=b'skip', |
|
1942 | 1948 | experimental=True, |
|
1943 | 1949 | ) |
|
1944 | 1950 | # experimental as long as format.use-dirstate-v2 is. |
|
1945 | 1951 | coreconfigitem( |
|
1946 | 1952 | b'storage', |
|
1947 | 1953 | b'dirstate-v2.slow-path', |
|
1948 | 1954 | default=b"abort", |
|
1949 | 1955 | experimental=True, |
|
1950 | 1956 | ) |
|
1951 | 1957 | coreconfigitem( |
|
1952 | 1958 | b'storage', |
|
1953 | 1959 | b'new-repo-backend', |
|
1954 | 1960 | default=b'revlogv1', |
|
1955 | 1961 | experimental=True, |
|
1956 | 1962 | ) |
|
1957 | 1963 | coreconfigitem( |
|
1958 | 1964 | b'storage', |
|
1959 | 1965 | b'revlog.optimize-delta-parent-choice', |
|
1960 | 1966 | default=True, |
|
1961 | 1967 | alias=[(b'format', b'aggressivemergedeltas')], |
|
1962 | 1968 | ) |
|
1963 | 1969 | coreconfigitem( |
|
1964 | 1970 | b'storage', |
|
1965 | 1971 | b'revlog.issue6528.fix-incoming', |
|
1966 | 1972 | default=True, |
|
1967 | 1973 | ) |
|
1968 | 1974 | # experimental as long as rust is experimental (or a C version is implemented) |
|
1969 | 1975 | coreconfigitem( |
|
1970 | 1976 | b'storage', |
|
1971 | 1977 | b'revlog.persistent-nodemap.mmap', |
|
1972 | 1978 | default=True, |
|
1973 | 1979 | ) |
|
1974 | 1980 | # experimental as long as format.use-persistent-nodemap is. |
|
1975 | 1981 | coreconfigitem( |
|
1976 | 1982 | b'storage', |
|
1977 | 1983 | b'revlog.persistent-nodemap.slow-path', |
|
1978 | 1984 | default=b"abort", |
|
1979 | 1985 | ) |
|
1980 | 1986 | |
|
1981 | 1987 | coreconfigitem( |
|
1982 | 1988 | b'storage', |
|
1983 | 1989 | b'revlog.reuse-external-delta', |
|
1984 | 1990 | default=True, |
|
1985 | 1991 | ) |
|
1986 | 1992 | coreconfigitem( |
|
1987 | 1993 | b'storage', |
|
1988 | 1994 | b'revlog.reuse-external-delta-parent', |
|
1989 | 1995 | default=None, |
|
1990 | 1996 | ) |
|
1991 | 1997 | coreconfigitem( |
|
1992 | 1998 | b'storage', |
|
1993 | 1999 | b'revlog.zlib.level', |
|
1994 | 2000 | default=None, |
|
1995 | 2001 | ) |
|
1996 | 2002 | coreconfigitem( |
|
1997 | 2003 | b'storage', |
|
1998 | 2004 | b'revlog.zstd.level', |
|
1999 | 2005 | default=None, |
|
2000 | 2006 | ) |
|
2001 | 2007 | coreconfigitem( |
|
2002 | 2008 | b'server', |
|
2003 | 2009 | b'bookmarks-pushkey-compat', |
|
2004 | 2010 | default=True, |
|
2005 | 2011 | ) |
|
2006 | 2012 | coreconfigitem( |
|
2007 | 2013 | b'server', |
|
2008 | 2014 | b'bundle1', |
|
2009 | 2015 | default=True, |
|
2010 | 2016 | ) |
|
2011 | 2017 | coreconfigitem( |
|
2012 | 2018 | b'server', |
|
2013 | 2019 | b'bundle1gd', |
|
2014 | 2020 | default=None, |
|
2015 | 2021 | ) |
|
2016 | 2022 | coreconfigitem( |
|
2017 | 2023 | b'server', |
|
2018 | 2024 | b'bundle1.pull', |
|
2019 | 2025 | default=None, |
|
2020 | 2026 | ) |
|
2021 | 2027 | coreconfigitem( |
|
2022 | 2028 | b'server', |
|
2023 | 2029 | b'bundle1gd.pull', |
|
2024 | 2030 | default=None, |
|
2025 | 2031 | ) |
|
2026 | 2032 | coreconfigitem( |
|
2027 | 2033 | b'server', |
|
2028 | 2034 | b'bundle1.push', |
|
2029 | 2035 | default=None, |
|
2030 | 2036 | ) |
|
2031 | 2037 | coreconfigitem( |
|
2032 | 2038 | b'server', |
|
2033 | 2039 | b'bundle1gd.push', |
|
2034 | 2040 | default=None, |
|
2035 | 2041 | ) |
|
2036 | 2042 | coreconfigitem( |
|
2037 | 2043 | b'server', |
|
2038 | 2044 | b'bundle2.stream', |
|
2039 | 2045 | default=True, |
|
2040 | 2046 | alias=[(b'experimental', b'bundle2.stream')], |
|
2041 | 2047 | ) |
|
2042 | 2048 | coreconfigitem( |
|
2043 | 2049 | b'server', |
|
2044 | 2050 | b'compressionengines', |
|
2045 | 2051 | default=list, |
|
2046 | 2052 | ) |
|
2047 | 2053 | coreconfigitem( |
|
2048 | 2054 | b'server', |
|
2049 | 2055 | b'concurrent-push-mode', |
|
2050 | 2056 | default=b'check-related', |
|
2051 | 2057 | ) |
|
2052 | 2058 | coreconfigitem( |
|
2053 | 2059 | b'server', |
|
2054 | 2060 | b'disablefullbundle', |
|
2055 | 2061 | default=False, |
|
2056 | 2062 | ) |
|
2057 | 2063 | coreconfigitem( |
|
2058 | 2064 | b'server', |
|
2059 | 2065 | b'maxhttpheaderlen', |
|
2060 | 2066 | default=1024, |
|
2061 | 2067 | ) |
|
2062 | 2068 | coreconfigitem( |
|
2063 | 2069 | b'server', |
|
2064 | 2070 | b'pullbundle', |
|
2065 | 2071 | default=False, |
|
2066 | 2072 | ) |
|
2067 | 2073 | coreconfigitem( |
|
2068 | 2074 | b'server', |
|
2069 | 2075 | b'preferuncompressed', |
|
2070 | 2076 | default=False, |
|
2071 | 2077 | ) |
|
2072 | 2078 | coreconfigitem( |
|
2073 | 2079 | b'server', |
|
2074 | 2080 | b'streamunbundle', |
|
2075 | 2081 | default=False, |
|
2076 | 2082 | ) |
|
2077 | 2083 | coreconfigitem( |
|
2078 | 2084 | b'server', |
|
2079 | 2085 | b'uncompressed', |
|
2080 | 2086 | default=True, |
|
2081 | 2087 | ) |
|
2082 | 2088 | coreconfigitem( |
|
2083 | 2089 | b'server', |
|
2084 | 2090 | b'uncompressedallowsecret', |
|
2085 | 2091 | default=False, |
|
2086 | 2092 | ) |
|
2087 | 2093 | coreconfigitem( |
|
2088 | 2094 | b'server', |
|
2089 | 2095 | b'view', |
|
2090 | 2096 | default=b'served', |
|
2091 | 2097 | ) |
|
2092 | 2098 | coreconfigitem( |
|
2093 | 2099 | b'server', |
|
2094 | 2100 | b'validate', |
|
2095 | 2101 | default=False, |
|
2096 | 2102 | ) |
|
2097 | 2103 | coreconfigitem( |
|
2098 | 2104 | b'server', |
|
2099 | 2105 | b'zliblevel', |
|
2100 | 2106 | default=-1, |
|
2101 | 2107 | ) |
|
2102 | 2108 | coreconfigitem( |
|
2103 | 2109 | b'server', |
|
2104 | 2110 | b'zstdlevel', |
|
2105 | 2111 | default=3, |
|
2106 | 2112 | ) |
|
2107 | 2113 | coreconfigitem( |
|
2108 | 2114 | b'share', |
|
2109 | 2115 | b'pool', |
|
2110 | 2116 | default=None, |
|
2111 | 2117 | ) |
|
2112 | 2118 | coreconfigitem( |
|
2113 | 2119 | b'share', |
|
2114 | 2120 | b'poolnaming', |
|
2115 | 2121 | default=b'identity', |
|
2116 | 2122 | ) |
|
2117 | 2123 | coreconfigitem( |
|
2118 | 2124 | b'share', |
|
2119 | 2125 | b'safe-mismatch.source-not-safe', |
|
2120 | 2126 | default=b'abort', |
|
2121 | 2127 | ) |
|
2122 | 2128 | coreconfigitem( |
|
2123 | 2129 | b'share', |
|
2124 | 2130 | b'safe-mismatch.source-safe', |
|
2125 | 2131 | default=b'abort', |
|
2126 | 2132 | ) |
|
2127 | 2133 | coreconfigitem( |
|
2128 | 2134 | b'share', |
|
2129 | 2135 | b'safe-mismatch.source-not-safe.warn', |
|
2130 | 2136 | default=True, |
|
2131 | 2137 | ) |
|
2132 | 2138 | coreconfigitem( |
|
2133 | 2139 | b'share', |
|
2134 | 2140 | b'safe-mismatch.source-safe.warn', |
|
2135 | 2141 | default=True, |
|
2136 | 2142 | ) |
|
2137 | 2143 | coreconfigitem( |
|
2138 | 2144 | b'shelve', |
|
2139 | 2145 | b'maxbackups', |
|
2140 | 2146 | default=10, |
|
2141 | 2147 | ) |
|
2142 | 2148 | coreconfigitem( |
|
2143 | 2149 | b'smtp', |
|
2144 | 2150 | b'host', |
|
2145 | 2151 | default=None, |
|
2146 | 2152 | ) |
|
2147 | 2153 | coreconfigitem( |
|
2148 | 2154 | b'smtp', |
|
2149 | 2155 | b'local_hostname', |
|
2150 | 2156 | default=None, |
|
2151 | 2157 | ) |
|
2152 | 2158 | coreconfigitem( |
|
2153 | 2159 | b'smtp', |
|
2154 | 2160 | b'password', |
|
2155 | 2161 | default=None, |
|
2156 | 2162 | ) |
|
2157 | 2163 | coreconfigitem( |
|
2158 | 2164 | b'smtp', |
|
2159 | 2165 | b'port', |
|
2160 | 2166 | default=dynamicdefault, |
|
2161 | 2167 | ) |
|
2162 | 2168 | coreconfigitem( |
|
2163 | 2169 | b'smtp', |
|
2164 | 2170 | b'tls', |
|
2165 | 2171 | default=b'none', |
|
2166 | 2172 | ) |
|
2167 | 2173 | coreconfigitem( |
|
2168 | 2174 | b'smtp', |
|
2169 | 2175 | b'username', |
|
2170 | 2176 | default=None, |
|
2171 | 2177 | ) |
|
2172 | 2178 | coreconfigitem( |
|
2173 | 2179 | b'sparse', |
|
2174 | 2180 | b'missingwarning', |
|
2175 | 2181 | default=True, |
|
2176 | 2182 | experimental=True, |
|
2177 | 2183 | ) |
|
2178 | 2184 | coreconfigitem( |
|
2179 | 2185 | b'subrepos', |
|
2180 | 2186 | b'allowed', |
|
2181 | 2187 | default=dynamicdefault, # to make backporting simpler |
|
2182 | 2188 | ) |
|
2183 | 2189 | coreconfigitem( |
|
2184 | 2190 | b'subrepos', |
|
2185 | 2191 | b'hg:allowed', |
|
2186 | 2192 | default=dynamicdefault, |
|
2187 | 2193 | ) |
|
2188 | 2194 | coreconfigitem( |
|
2189 | 2195 | b'subrepos', |
|
2190 | 2196 | b'git:allowed', |
|
2191 | 2197 | default=dynamicdefault, |
|
2192 | 2198 | ) |
|
2193 | 2199 | coreconfigitem( |
|
2194 | 2200 | b'subrepos', |
|
2195 | 2201 | b'svn:allowed', |
|
2196 | 2202 | default=dynamicdefault, |
|
2197 | 2203 | ) |
|
2198 | 2204 | coreconfigitem( |
|
2199 | 2205 | b'templates', |
|
2200 | 2206 | b'.*', |
|
2201 | 2207 | default=None, |
|
2202 | 2208 | generic=True, |
|
2203 | 2209 | ) |
|
2204 | 2210 | coreconfigitem( |
|
2205 | 2211 | b'templateconfig', |
|
2206 | 2212 | b'.*', |
|
2207 | 2213 | default=dynamicdefault, |
|
2208 | 2214 | generic=True, |
|
2209 | 2215 | ) |
|
2210 | 2216 | coreconfigitem( |
|
2211 | 2217 | b'trusted', |
|
2212 | 2218 | b'groups', |
|
2213 | 2219 | default=list, |
|
2214 | 2220 | ) |
|
2215 | 2221 | coreconfigitem( |
|
2216 | 2222 | b'trusted', |
|
2217 | 2223 | b'users', |
|
2218 | 2224 | default=list, |
|
2219 | 2225 | ) |
|
2220 | 2226 | coreconfigitem( |
|
2221 | 2227 | b'ui', |
|
2222 | 2228 | b'_usedassubrepo', |
|
2223 | 2229 | default=False, |
|
2224 | 2230 | ) |
|
2225 | 2231 | coreconfigitem( |
|
2226 | 2232 | b'ui', |
|
2227 | 2233 | b'allowemptycommit', |
|
2228 | 2234 | default=False, |
|
2229 | 2235 | ) |
|
2230 | 2236 | coreconfigitem( |
|
2231 | 2237 | b'ui', |
|
2232 | 2238 | b'archivemeta', |
|
2233 | 2239 | default=True, |
|
2234 | 2240 | ) |
|
2235 | 2241 | coreconfigitem( |
|
2236 | 2242 | b'ui', |
|
2237 | 2243 | b'askusername', |
|
2238 | 2244 | default=False, |
|
2239 | 2245 | ) |
|
2240 | 2246 | coreconfigitem( |
|
2241 | 2247 | b'ui', |
|
2242 | 2248 | b'available-memory', |
|
2243 | 2249 | default=None, |
|
2244 | 2250 | ) |
|
2245 | 2251 | |
|
2246 | 2252 | coreconfigitem( |
|
2247 | 2253 | b'ui', |
|
2248 | 2254 | b'clonebundlefallback', |
|
2249 | 2255 | default=False, |
|
2250 | 2256 | ) |
|
2251 | 2257 | coreconfigitem( |
|
2252 | 2258 | b'ui', |
|
2253 | 2259 | b'clonebundleprefers', |
|
2254 | 2260 | default=list, |
|
2255 | 2261 | ) |
|
2256 | 2262 | coreconfigitem( |
|
2257 | 2263 | b'ui', |
|
2258 | 2264 | b'clonebundles', |
|
2259 | 2265 | default=True, |
|
2260 | 2266 | ) |
|
2261 | 2267 | coreconfigitem( |
|
2262 | 2268 | b'ui', |
|
2263 | 2269 | b'color', |
|
2264 | 2270 | default=b'auto', |
|
2265 | 2271 | ) |
|
2266 | 2272 | coreconfigitem( |
|
2267 | 2273 | b'ui', |
|
2268 | 2274 | b'commitsubrepos', |
|
2269 | 2275 | default=False, |
|
2270 | 2276 | ) |
|
2271 | 2277 | coreconfigitem( |
|
2272 | 2278 | b'ui', |
|
2273 | 2279 | b'debug', |
|
2274 | 2280 | default=False, |
|
2275 | 2281 | ) |
|
2276 | 2282 | coreconfigitem( |
|
2277 | 2283 | b'ui', |
|
2278 | 2284 | b'debugger', |
|
2279 | 2285 | default=None, |
|
2280 | 2286 | ) |
|
2281 | 2287 | coreconfigitem( |
|
2282 | 2288 | b'ui', |
|
2283 | 2289 | b'editor', |
|
2284 | 2290 | default=dynamicdefault, |
|
2285 | 2291 | ) |
|
2286 | 2292 | coreconfigitem( |
|
2287 | 2293 | b'ui', |
|
2288 | 2294 | b'detailed-exit-code', |
|
2289 | 2295 | default=False, |
|
2290 | 2296 | experimental=True, |
|
2291 | 2297 | ) |
|
2292 | 2298 | coreconfigitem( |
|
2293 | 2299 | b'ui', |
|
2294 | 2300 | b'fallbackencoding', |
|
2295 | 2301 | default=None, |
|
2296 | 2302 | ) |
|
2297 | 2303 | coreconfigitem( |
|
2298 | 2304 | b'ui', |
|
2299 | 2305 | b'forcecwd', |
|
2300 | 2306 | default=None, |
|
2301 | 2307 | ) |
|
2302 | 2308 | coreconfigitem( |
|
2303 | 2309 | b'ui', |
|
2304 | 2310 | b'forcemerge', |
|
2305 | 2311 | default=None, |
|
2306 | 2312 | ) |
|
2307 | 2313 | coreconfigitem( |
|
2308 | 2314 | b'ui', |
|
2309 | 2315 | b'formatdebug', |
|
2310 | 2316 | default=False, |
|
2311 | 2317 | ) |
|
2312 | 2318 | coreconfigitem( |
|
2313 | 2319 | b'ui', |
|
2314 | 2320 | b'formatjson', |
|
2315 | 2321 | default=False, |
|
2316 | 2322 | ) |
|
2317 | 2323 | coreconfigitem( |
|
2318 | 2324 | b'ui', |
|
2319 | 2325 | b'formatted', |
|
2320 | 2326 | default=None, |
|
2321 | 2327 | ) |
|
2322 | 2328 | coreconfigitem( |
|
2323 | 2329 | b'ui', |
|
2324 | 2330 | b'interactive', |
|
2325 | 2331 | default=None, |
|
2326 | 2332 | ) |
|
2327 | 2333 | coreconfigitem( |
|
2328 | 2334 | b'ui', |
|
2329 | 2335 | b'interface', |
|
2330 | 2336 | default=None, |
|
2331 | 2337 | ) |
|
2332 | 2338 | coreconfigitem( |
|
2333 | 2339 | b'ui', |
|
2334 | 2340 | b'interface.chunkselector', |
|
2335 | 2341 | default=None, |
|
2336 | 2342 | ) |
|
2337 | 2343 | coreconfigitem( |
|
2338 | 2344 | b'ui', |
|
2339 | 2345 | b'large-file-limit', |
|
2340 | 2346 | default=10 * (2 ** 20), |
|
2341 | 2347 | ) |
|
2342 | 2348 | coreconfigitem( |
|
2343 | 2349 | b'ui', |
|
2344 | 2350 | b'logblockedtimes', |
|
2345 | 2351 | default=False, |
|
2346 | 2352 | ) |
|
2347 | 2353 | coreconfigitem( |
|
2348 | 2354 | b'ui', |
|
2349 | 2355 | b'merge', |
|
2350 | 2356 | default=None, |
|
2351 | 2357 | ) |
|
2352 | 2358 | coreconfigitem( |
|
2353 | 2359 | b'ui', |
|
2354 | 2360 | b'mergemarkers', |
|
2355 | 2361 | default=b'basic', |
|
2356 | 2362 | ) |
|
2357 | 2363 | coreconfigitem( |
|
2358 | 2364 | b'ui', |
|
2359 | 2365 | b'message-output', |
|
2360 | 2366 | default=b'stdio', |
|
2361 | 2367 | ) |
|
2362 | 2368 | coreconfigitem( |
|
2363 | 2369 | b'ui', |
|
2364 | 2370 | b'nontty', |
|
2365 | 2371 | default=False, |
|
2366 | 2372 | ) |
|
2367 | 2373 | coreconfigitem( |
|
2368 | 2374 | b'ui', |
|
2369 | 2375 | b'origbackuppath', |
|
2370 | 2376 | default=None, |
|
2371 | 2377 | ) |
|
2372 | 2378 | coreconfigitem( |
|
2373 | 2379 | b'ui', |
|
2374 | 2380 | b'paginate', |
|
2375 | 2381 | default=True, |
|
2376 | 2382 | ) |
|
2377 | 2383 | coreconfigitem( |
|
2378 | 2384 | b'ui', |
|
2379 | 2385 | b'patch', |
|
2380 | 2386 | default=None, |
|
2381 | 2387 | ) |
|
2382 | 2388 | coreconfigitem( |
|
2383 | 2389 | b'ui', |
|
2384 | 2390 | b'portablefilenames', |
|
2385 | 2391 | default=b'warn', |
|
2386 | 2392 | ) |
|
2387 | 2393 | coreconfigitem( |
|
2388 | 2394 | b'ui', |
|
2389 | 2395 | b'promptecho', |
|
2390 | 2396 | default=False, |
|
2391 | 2397 | ) |
|
2392 | 2398 | coreconfigitem( |
|
2393 | 2399 | b'ui', |
|
2394 | 2400 | b'quiet', |
|
2395 | 2401 | default=False, |
|
2396 | 2402 | ) |
|
2397 | 2403 | coreconfigitem( |
|
2398 | 2404 | b'ui', |
|
2399 | 2405 | b'quietbookmarkmove', |
|
2400 | 2406 | default=False, |
|
2401 | 2407 | ) |
|
2402 | 2408 | coreconfigitem( |
|
2403 | 2409 | b'ui', |
|
2404 | 2410 | b'relative-paths', |
|
2405 | 2411 | default=b'legacy', |
|
2406 | 2412 | ) |
|
2407 | 2413 | coreconfigitem( |
|
2408 | 2414 | b'ui', |
|
2409 | 2415 | b'remotecmd', |
|
2410 | 2416 | default=b'hg', |
|
2411 | 2417 | ) |
|
2412 | 2418 | coreconfigitem( |
|
2413 | 2419 | b'ui', |
|
2414 | 2420 | b'report_untrusted', |
|
2415 | 2421 | default=True, |
|
2416 | 2422 | ) |
|
2417 | 2423 | coreconfigitem( |
|
2418 | 2424 | b'ui', |
|
2419 | 2425 | b'rollback', |
|
2420 | 2426 | default=True, |
|
2421 | 2427 | ) |
|
2422 | 2428 | coreconfigitem( |
|
2423 | 2429 | b'ui', |
|
2424 | 2430 | b'signal-safe-lock', |
|
2425 | 2431 | default=True, |
|
2426 | 2432 | ) |
|
2427 | 2433 | coreconfigitem( |
|
2428 | 2434 | b'ui', |
|
2429 | 2435 | b'slash', |
|
2430 | 2436 | default=False, |
|
2431 | 2437 | ) |
|
2432 | 2438 | coreconfigitem( |
|
2433 | 2439 | b'ui', |
|
2434 | 2440 | b'ssh', |
|
2435 | 2441 | default=b'ssh', |
|
2436 | 2442 | ) |
|
2437 | 2443 | coreconfigitem( |
|
2438 | 2444 | b'ui', |
|
2439 | 2445 | b'ssherrorhint', |
|
2440 | 2446 | default=None, |
|
2441 | 2447 | ) |
|
2442 | 2448 | coreconfigitem( |
|
2443 | 2449 | b'ui', |
|
2444 | 2450 | b'statuscopies', |
|
2445 | 2451 | default=False, |
|
2446 | 2452 | ) |
|
2447 | 2453 | coreconfigitem( |
|
2448 | 2454 | b'ui', |
|
2449 | 2455 | b'strict', |
|
2450 | 2456 | default=False, |
|
2451 | 2457 | ) |
|
2452 | 2458 | coreconfigitem( |
|
2453 | 2459 | b'ui', |
|
2454 | 2460 | b'style', |
|
2455 | 2461 | default=b'', |
|
2456 | 2462 | ) |
|
2457 | 2463 | coreconfigitem( |
|
2458 | 2464 | b'ui', |
|
2459 | 2465 | b'supportcontact', |
|
2460 | 2466 | default=None, |
|
2461 | 2467 | ) |
|
2462 | 2468 | coreconfigitem( |
|
2463 | 2469 | b'ui', |
|
2464 | 2470 | b'textwidth', |
|
2465 | 2471 | default=78, |
|
2466 | 2472 | ) |
|
2467 | 2473 | coreconfigitem( |
|
2468 | 2474 | b'ui', |
|
2469 | 2475 | b'timeout', |
|
2470 | 2476 | default=b'600', |
|
2471 | 2477 | ) |
|
2472 | 2478 | coreconfigitem( |
|
2473 | 2479 | b'ui', |
|
2474 | 2480 | b'timeout.warn', |
|
2475 | 2481 | default=0, |
|
2476 | 2482 | ) |
|
2477 | 2483 | coreconfigitem( |
|
2478 | 2484 | b'ui', |
|
2479 | 2485 | b'timestamp-output', |
|
2480 | 2486 | default=False, |
|
2481 | 2487 | ) |
|
2482 | 2488 | coreconfigitem( |
|
2483 | 2489 | b'ui', |
|
2484 | 2490 | b'traceback', |
|
2485 | 2491 | default=False, |
|
2486 | 2492 | ) |
|
2487 | 2493 | coreconfigitem( |
|
2488 | 2494 | b'ui', |
|
2489 | 2495 | b'tweakdefaults', |
|
2490 | 2496 | default=False, |
|
2491 | 2497 | ) |
|
2492 | 2498 | coreconfigitem(b'ui', b'username', alias=[(b'ui', b'user')]) |
|
2493 | 2499 | coreconfigitem( |
|
2494 | 2500 | b'ui', |
|
2495 | 2501 | b'verbose', |
|
2496 | 2502 | default=False, |
|
2497 | 2503 | ) |
|
2498 | 2504 | coreconfigitem( |
|
2499 | 2505 | b'verify', |
|
2500 | 2506 | b'skipflags', |
|
2501 | 2507 | default=None, |
|
2502 | 2508 | ) |
|
2503 | 2509 | coreconfigitem( |
|
2504 | 2510 | b'web', |
|
2505 | 2511 | b'allowbz2', |
|
2506 | 2512 | default=False, |
|
2507 | 2513 | ) |
|
2508 | 2514 | coreconfigitem( |
|
2509 | 2515 | b'web', |
|
2510 | 2516 | b'allowgz', |
|
2511 | 2517 | default=False, |
|
2512 | 2518 | ) |
|
2513 | 2519 | coreconfigitem( |
|
2514 | 2520 | b'web', |
|
2515 | 2521 | b'allow-pull', |
|
2516 | 2522 | alias=[(b'web', b'allowpull')], |
|
2517 | 2523 | default=True, |
|
2518 | 2524 | ) |
|
2519 | 2525 | coreconfigitem( |
|
2520 | 2526 | b'web', |
|
2521 | 2527 | b'allow-push', |
|
2522 | 2528 | alias=[(b'web', b'allow_push')], |
|
2523 | 2529 | default=list, |
|
2524 | 2530 | ) |
|
2525 | 2531 | coreconfigitem( |
|
2526 | 2532 | b'web', |
|
2527 | 2533 | b'allowzip', |
|
2528 | 2534 | default=False, |
|
2529 | 2535 | ) |
|
2530 | 2536 | coreconfigitem( |
|
2531 | 2537 | b'web', |
|
2532 | 2538 | b'archivesubrepos', |
|
2533 | 2539 | default=False, |
|
2534 | 2540 | ) |
|
2535 | 2541 | coreconfigitem( |
|
2536 | 2542 | b'web', |
|
2537 | 2543 | b'cache', |
|
2538 | 2544 | default=True, |
|
2539 | 2545 | ) |
|
2540 | 2546 | coreconfigitem( |
|
2541 | 2547 | b'web', |
|
2542 | 2548 | b'comparisoncontext', |
|
2543 | 2549 | default=5, |
|
2544 | 2550 | ) |
|
2545 | 2551 | coreconfigitem( |
|
2546 | 2552 | b'web', |
|
2547 | 2553 | b'contact', |
|
2548 | 2554 | default=None, |
|
2549 | 2555 | ) |
|
2550 | 2556 | coreconfigitem( |
|
2551 | 2557 | b'web', |
|
2552 | 2558 | b'deny_push', |
|
2553 | 2559 | default=list, |
|
2554 | 2560 | ) |
|
2555 | 2561 | coreconfigitem( |
|
2556 | 2562 | b'web', |
|
2557 | 2563 | b'guessmime', |
|
2558 | 2564 | default=False, |
|
2559 | 2565 | ) |
|
2560 | 2566 | coreconfigitem( |
|
2561 | 2567 | b'web', |
|
2562 | 2568 | b'hidden', |
|
2563 | 2569 | default=False, |
|
2564 | 2570 | ) |
|
2565 | 2571 | coreconfigitem( |
|
2566 | 2572 | b'web', |
|
2567 | 2573 | b'labels', |
|
2568 | 2574 | default=list, |
|
2569 | 2575 | ) |
|
2570 | 2576 | coreconfigitem( |
|
2571 | 2577 | b'web', |
|
2572 | 2578 | b'logoimg', |
|
2573 | 2579 | default=b'hglogo.png', |
|
2574 | 2580 | ) |
|
2575 | 2581 | coreconfigitem( |
|
2576 | 2582 | b'web', |
|
2577 | 2583 | b'logourl', |
|
2578 | 2584 | default=b'https://mercurial-scm.org/', |
|
2579 | 2585 | ) |
|
2580 | 2586 | coreconfigitem( |
|
2581 | 2587 | b'web', |
|
2582 | 2588 | b'accesslog', |
|
2583 | 2589 | default=b'-', |
|
2584 | 2590 | ) |
|
2585 | 2591 | coreconfigitem( |
|
2586 | 2592 | b'web', |
|
2587 | 2593 | b'address', |
|
2588 | 2594 | default=b'', |
|
2589 | 2595 | ) |
|
2590 | 2596 | coreconfigitem( |
|
2591 | 2597 | b'web', |
|
2592 | 2598 | b'allow-archive', |
|
2593 | 2599 | alias=[(b'web', b'allow_archive')], |
|
2594 | 2600 | default=list, |
|
2595 | 2601 | ) |
|
2596 | 2602 | coreconfigitem( |
|
2597 | 2603 | b'web', |
|
2598 | 2604 | b'allow_read', |
|
2599 | 2605 | default=list, |
|
2600 | 2606 | ) |
|
2601 | 2607 | coreconfigitem( |
|
2602 | 2608 | b'web', |
|
2603 | 2609 | b'baseurl', |
|
2604 | 2610 | default=None, |
|
2605 | 2611 | ) |
|
2606 | 2612 | coreconfigitem( |
|
2607 | 2613 | b'web', |
|
2608 | 2614 | b'cacerts', |
|
2609 | 2615 | default=None, |
|
2610 | 2616 | ) |
|
2611 | 2617 | coreconfigitem( |
|
2612 | 2618 | b'web', |
|
2613 | 2619 | b'certificate', |
|
2614 | 2620 | default=None, |
|
2615 | 2621 | ) |
|
2616 | 2622 | coreconfigitem( |
|
2617 | 2623 | b'web', |
|
2618 | 2624 | b'collapse', |
|
2619 | 2625 | default=False, |
|
2620 | 2626 | ) |
|
2621 | 2627 | coreconfigitem( |
|
2622 | 2628 | b'web', |
|
2623 | 2629 | b'csp', |
|
2624 | 2630 | default=None, |
|
2625 | 2631 | ) |
|
2626 | 2632 | coreconfigitem( |
|
2627 | 2633 | b'web', |
|
2628 | 2634 | b'deny_read', |
|
2629 | 2635 | default=list, |
|
2630 | 2636 | ) |
|
2631 | 2637 | coreconfigitem( |
|
2632 | 2638 | b'web', |
|
2633 | 2639 | b'descend', |
|
2634 | 2640 | default=True, |
|
2635 | 2641 | ) |
|
2636 | 2642 | coreconfigitem( |
|
2637 | 2643 | b'web', |
|
2638 | 2644 | b'description', |
|
2639 | 2645 | default=b"", |
|
2640 | 2646 | ) |
|
2641 | 2647 | coreconfigitem( |
|
2642 | 2648 | b'web', |
|
2643 | 2649 | b'encoding', |
|
2644 | 2650 | default=lambda: encoding.encoding, |
|
2645 | 2651 | ) |
|
2646 | 2652 | coreconfigitem( |
|
2647 | 2653 | b'web', |
|
2648 | 2654 | b'errorlog', |
|
2649 | 2655 | default=b'-', |
|
2650 | 2656 | ) |
|
2651 | 2657 | coreconfigitem( |
|
2652 | 2658 | b'web', |
|
2653 | 2659 | b'ipv6', |
|
2654 | 2660 | default=False, |
|
2655 | 2661 | ) |
|
2656 | 2662 | coreconfigitem( |
|
2657 | 2663 | b'web', |
|
2658 | 2664 | b'maxchanges', |
|
2659 | 2665 | default=10, |
|
2660 | 2666 | ) |
|
2661 | 2667 | coreconfigitem( |
|
2662 | 2668 | b'web', |
|
2663 | 2669 | b'maxfiles', |
|
2664 | 2670 | default=10, |
|
2665 | 2671 | ) |
|
2666 | 2672 | coreconfigitem( |
|
2667 | 2673 | b'web', |
|
2668 | 2674 | b'maxshortchanges', |
|
2669 | 2675 | default=60, |
|
2670 | 2676 | ) |
|
2671 | 2677 | coreconfigitem( |
|
2672 | 2678 | b'web', |
|
2673 | 2679 | b'motd', |
|
2674 | 2680 | default=b'', |
|
2675 | 2681 | ) |
|
2676 | 2682 | coreconfigitem( |
|
2677 | 2683 | b'web', |
|
2678 | 2684 | b'name', |
|
2679 | 2685 | default=dynamicdefault, |
|
2680 | 2686 | ) |
|
2681 | 2687 | coreconfigitem( |
|
2682 | 2688 | b'web', |
|
2683 | 2689 | b'port', |
|
2684 | 2690 | default=8000, |
|
2685 | 2691 | ) |
|
2686 | 2692 | coreconfigitem( |
|
2687 | 2693 | b'web', |
|
2688 | 2694 | b'prefix', |
|
2689 | 2695 | default=b'', |
|
2690 | 2696 | ) |
|
2691 | 2697 | coreconfigitem( |
|
2692 | 2698 | b'web', |
|
2693 | 2699 | b'push_ssl', |
|
2694 | 2700 | default=True, |
|
2695 | 2701 | ) |
|
2696 | 2702 | coreconfigitem( |
|
2697 | 2703 | b'web', |
|
2698 | 2704 | b'refreshinterval', |
|
2699 | 2705 | default=20, |
|
2700 | 2706 | ) |
|
2701 | 2707 | coreconfigitem( |
|
2702 | 2708 | b'web', |
|
2703 | 2709 | b'server-header', |
|
2704 | 2710 | default=None, |
|
2705 | 2711 | ) |
|
2706 | 2712 | coreconfigitem( |
|
2707 | 2713 | b'web', |
|
2708 | 2714 | b'static', |
|
2709 | 2715 | default=None, |
|
2710 | 2716 | ) |
|
2711 | 2717 | coreconfigitem( |
|
2712 | 2718 | b'web', |
|
2713 | 2719 | b'staticurl', |
|
2714 | 2720 | default=None, |
|
2715 | 2721 | ) |
|
2716 | 2722 | coreconfigitem( |
|
2717 | 2723 | b'web', |
|
2718 | 2724 | b'stripes', |
|
2719 | 2725 | default=1, |
|
2720 | 2726 | ) |
|
2721 | 2727 | coreconfigitem( |
|
2722 | 2728 | b'web', |
|
2723 | 2729 | b'style', |
|
2724 | 2730 | default=b'paper', |
|
2725 | 2731 | ) |
|
2726 | 2732 | coreconfigitem( |
|
2727 | 2733 | b'web', |
|
2728 | 2734 | b'templates', |
|
2729 | 2735 | default=None, |
|
2730 | 2736 | ) |
|
2731 | 2737 | coreconfigitem( |
|
2732 | 2738 | b'web', |
|
2733 | 2739 | b'view', |
|
2734 | 2740 | default=b'served', |
|
2735 | 2741 | experimental=True, |
|
2736 | 2742 | ) |
|
2737 | 2743 | coreconfigitem( |
|
2738 | 2744 | b'worker', |
|
2739 | 2745 | b'backgroundclose', |
|
2740 | 2746 | default=dynamicdefault, |
|
2741 | 2747 | ) |
|
2742 | 2748 | # Windows defaults to a limit of 512 open files. A buffer of 128 |
|
2743 | 2749 | # should give us enough headway. |
|
2744 | 2750 | coreconfigitem( |
|
2745 | 2751 | b'worker', |
|
2746 | 2752 | b'backgroundclosemaxqueue', |
|
2747 | 2753 | default=384, |
|
2748 | 2754 | ) |
|
2749 | 2755 | coreconfigitem( |
|
2750 | 2756 | b'worker', |
|
2751 | 2757 | b'backgroundcloseminfilecount', |
|
2752 | 2758 | default=2048, |
|
2753 | 2759 | ) |
|
2754 | 2760 | coreconfigitem( |
|
2755 | 2761 | b'worker', |
|
2756 | 2762 | b'backgroundclosethreadcount', |
|
2757 | 2763 | default=4, |
|
2758 | 2764 | ) |
|
2759 | 2765 | coreconfigitem( |
|
2760 | 2766 | b'worker', |
|
2761 | 2767 | b'enabled', |
|
2762 | 2768 | default=True, |
|
2763 | 2769 | ) |
|
2764 | 2770 | coreconfigitem( |
|
2765 | 2771 | b'worker', |
|
2766 | 2772 | b'numcpus', |
|
2767 | 2773 | default=None, |
|
2768 | 2774 | ) |
|
2769 | 2775 | |
|
2770 | 2776 | # Rebase related configuration moved to core because other extension are doing |
|
2771 | 2777 | # strange things. For example, shelve import the extensions to reuse some bit |
|
2772 | 2778 | # without formally loading it. |
|
2773 | 2779 | coreconfigitem( |
|
2774 | 2780 | b'commands', |
|
2775 | 2781 | b'rebase.requiredest', |
|
2776 | 2782 | default=False, |
|
2777 | 2783 | ) |
|
2778 | 2784 | coreconfigitem( |
|
2779 | 2785 | b'experimental', |
|
2780 | 2786 | b'rebaseskipobsolete', |
|
2781 | 2787 | default=True, |
|
2782 | 2788 | ) |
|
2783 | 2789 | coreconfigitem( |
|
2784 | 2790 | b'rebase', |
|
2785 | 2791 | b'singletransaction', |
|
2786 | 2792 | default=False, |
|
2787 | 2793 | ) |
|
2788 | 2794 | coreconfigitem( |
|
2789 | 2795 | b'rebase', |
|
2790 | 2796 | b'experimental.inmemory', |
|
2791 | 2797 | default=False, |
|
2792 | 2798 | ) |
@@ -1,3223 +1,3244 | |||
|
1 | 1 | The Mercurial system uses a set of configuration files to control |
|
2 | 2 | aspects of its behavior. |
|
3 | 3 | |
|
4 | 4 | Troubleshooting |
|
5 | 5 | =============== |
|
6 | 6 | |
|
7 | 7 | If you're having problems with your configuration, |
|
8 | 8 | :hg:`config --source` can help you understand what is introducing |
|
9 | 9 | a setting into your environment. |
|
10 | 10 | |
|
11 | 11 | See :hg:`help config.syntax` and :hg:`help config.files` |
|
12 | 12 | for information about how and where to override things. |
|
13 | 13 | |
|
14 | 14 | Structure |
|
15 | 15 | ========= |
|
16 | 16 | |
|
17 | 17 | The configuration files use a simple ini-file format. A configuration |
|
18 | 18 | file consists of sections, led by a ``[section]`` header and followed |
|
19 | 19 | by ``name = value`` entries:: |
|
20 | 20 | |
|
21 | 21 | [ui] |
|
22 | 22 | username = Firstname Lastname <firstname.lastname@example.net> |
|
23 | 23 | verbose = True |
|
24 | 24 | |
|
25 | 25 | The above entries will be referred to as ``ui.username`` and |
|
26 | 26 | ``ui.verbose``, respectively. See :hg:`help config.syntax`. |
|
27 | 27 | |
|
28 | 28 | Files |
|
29 | 29 | ===== |
|
30 | 30 | |
|
31 | 31 | Mercurial reads configuration data from several files, if they exist. |
|
32 | 32 | These files do not exist by default and you will have to create the |
|
33 | 33 | appropriate configuration files yourself: |
|
34 | 34 | |
|
35 | 35 | Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file. |
|
36 | 36 | |
|
37 | 37 | Global configuration like the username setting is typically put into: |
|
38 | 38 | |
|
39 | 39 | .. container:: windows |
|
40 | 40 | |
|
41 | 41 | - ``%USERPROFILE%\mercurial.ini`` (on Windows) |
|
42 | 42 | |
|
43 | 43 | .. container:: unix.plan9 |
|
44 | 44 | |
|
45 | 45 | - ``$HOME/.hgrc`` (on Unix, Plan9) |
|
46 | 46 | |
|
47 | 47 | The names of these files depend on the system on which Mercurial is |
|
48 | 48 | installed. ``*.rc`` files from a single directory are read in |
|
49 | 49 | alphabetical order, later ones overriding earlier ones. Where multiple |
|
50 | 50 | paths are given below, settings from earlier paths override later |
|
51 | 51 | ones. |
|
52 | 52 | |
|
53 | 53 | .. container:: verbose.unix |
|
54 | 54 | |
|
55 | 55 | On Unix, the following files are consulted: |
|
56 | 56 | |
|
57 | 57 | - ``<repo>/.hg/hgrc-not-shared`` (per-repository) |
|
58 | 58 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
59 | 59 | - ``$HOME/.hgrc`` (per-user) |
|
60 | 60 | - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user) |
|
61 | 61 | - ``<install-root>/etc/mercurial/hgrc`` (per-installation) |
|
62 | 62 | - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation) |
|
63 | 63 | - ``/etc/mercurial/hgrc`` (per-system) |
|
64 | 64 | - ``/etc/mercurial/hgrc.d/*.rc`` (per-system) |
|
65 | 65 | - ``<internal>/*.rc`` (defaults) |
|
66 | 66 | |
|
67 | 67 | .. container:: verbose.windows |
|
68 | 68 | |
|
69 | 69 | On Windows, the following files are consulted: |
|
70 | 70 | |
|
71 | 71 | - ``<repo>/.hg/hgrc-not-shared`` (per-repository) |
|
72 | 72 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
73 | 73 | - ``%USERPROFILE%\.hgrc`` (per-user) |
|
74 | 74 | - ``%USERPROFILE%\Mercurial.ini`` (per-user) |
|
75 | 75 | - ``%HOME%\.hgrc`` (per-user) |
|
76 | 76 | - ``%HOME%\Mercurial.ini`` (per-user) |
|
77 | 77 | - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-system) |
|
78 | 78 | - ``<install-dir>\hgrc.d\*.rc`` (per-installation) |
|
79 | 79 | - ``<install-dir>\Mercurial.ini`` (per-installation) |
|
80 | 80 | - ``%PROGRAMDATA%\Mercurial\hgrc`` (per-system) |
|
81 | 81 | - ``%PROGRAMDATA%\Mercurial\Mercurial.ini`` (per-system) |
|
82 | 82 | - ``%PROGRAMDATA%\Mercurial\hgrc.d\*.rc`` (per-system) |
|
83 | 83 | - ``<internal>/*.rc`` (defaults) |
|
84 | 84 | |
|
85 | 85 | .. note:: |
|
86 | 86 | |
|
87 | 87 | The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` |
|
88 | 88 | is used when running 32-bit Python on 64-bit Windows. |
|
89 | 89 | |
|
90 | 90 | .. container:: verbose.plan9 |
|
91 | 91 | |
|
92 | 92 | On Plan9, the following files are consulted: |
|
93 | 93 | |
|
94 | 94 | - ``<repo>/.hg/hgrc-not-shared`` (per-repository) |
|
95 | 95 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
96 | 96 | - ``$home/lib/hgrc`` (per-user) |
|
97 | 97 | - ``<install-root>/lib/mercurial/hgrc`` (per-installation) |
|
98 | 98 | - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation) |
|
99 | 99 | - ``/lib/mercurial/hgrc`` (per-system) |
|
100 | 100 | - ``/lib/mercurial/hgrc.d/*.rc`` (per-system) |
|
101 | 101 | - ``<internal>/*.rc`` (defaults) |
|
102 | 102 | |
|
103 | 103 | Per-repository configuration options only apply in a |
|
104 | 104 | particular repository. This file is not version-controlled, and |
|
105 | 105 | will not get transferred during a "clone" operation. Options in |
|
106 | 106 | this file override options in all other configuration files. |
|
107 | 107 | |
|
108 | 108 | .. container:: unix.plan9 |
|
109 | 109 | |
|
110 | 110 | On Plan 9 and Unix, most of this file will be ignored if it doesn't |
|
111 | 111 | belong to a trusted user or to a trusted group. See |
|
112 | 112 | :hg:`help config.trusted` for more details. |
|
113 | 113 | |
|
114 | 114 | Per-user configuration file(s) are for the user running Mercurial. Options |
|
115 | 115 | in these files apply to all Mercurial commands executed by this user in any |
|
116 | 116 | directory. Options in these files override per-system and per-installation |
|
117 | 117 | options. |
|
118 | 118 | |
|
119 | 119 | Per-installation configuration files are searched for in the |
|
120 | 120 | directory where Mercurial is installed. ``<install-root>`` is the |
|
121 | 121 | parent directory of the **hg** executable (or symlink) being run. |
|
122 | 122 | |
|
123 | 123 | .. container:: unix.plan9 |
|
124 | 124 | |
|
125 | 125 | For example, if installed in ``/shared/tools/bin/hg``, Mercurial |
|
126 | 126 | will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these |
|
127 | 127 | files apply to all Mercurial commands executed by any user in any |
|
128 | 128 | directory. |
|
129 | 129 | |
|
130 | 130 | Per-installation configuration files are for the system on |
|
131 | 131 | which Mercurial is running. Options in these files apply to all |
|
132 | 132 | Mercurial commands executed by any user in any directory. Registry |
|
133 | 133 | keys contain PATH-like strings, every part of which must reference |
|
134 | 134 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
|
135 | 135 | be read. Mercurial checks each of these locations in the specified |
|
136 | 136 | order until one or more configuration files are detected. |
|
137 | 137 | |
|
138 | 138 | Per-system configuration files are for the system on which Mercurial |
|
139 | 139 | is running. Options in these files apply to all Mercurial commands |
|
140 | 140 | executed by any user in any directory. Options in these files |
|
141 | 141 | override per-installation options. |
|
142 | 142 | |
|
143 | 143 | Mercurial comes with some default configuration. The default configuration |
|
144 | 144 | files are installed with Mercurial and will be overwritten on upgrades. Default |
|
145 | 145 | configuration files should never be edited by users or administrators but can |
|
146 | 146 | be overridden in other configuration files. So far the directory only contains |
|
147 | 147 | merge tool configuration but packagers can also put other default configuration |
|
148 | 148 | there. |
|
149 | 149 | |
|
150 | 150 | On versions 5.7 and later, if share-safe functionality is enabled, |
|
151 | 151 | shares will read config file of share source too. |
|
152 | 152 | `<share-source/.hg/hgrc>` is read before reading `<repo/.hg/hgrc>`. |
|
153 | 153 | |
|
154 | 154 | For configs which should not be shared, `<repo/.hg/hgrc-not-shared>` |
|
155 | 155 | should be used. |
|
156 | 156 | |
|
157 | 157 | Syntax |
|
158 | 158 | ====== |
|
159 | 159 | |
|
160 | 160 | A configuration file consists of sections, led by a ``[section]`` header |
|
161 | 161 | and followed by ``name = value`` entries (sometimes called |
|
162 | 162 | ``configuration keys``):: |
|
163 | 163 | |
|
164 | 164 | [spam] |
|
165 | 165 | eggs=ham |
|
166 | 166 | green= |
|
167 | 167 | eggs |
|
168 | 168 | |
|
169 | 169 | Each line contains one entry. If the lines that follow are indented, |
|
170 | 170 | they are treated as continuations of that entry. Leading whitespace is |
|
171 | 171 | removed from values. Empty lines are skipped. Lines beginning with |
|
172 | 172 | ``#`` or ``;`` are ignored and may be used to provide comments. |
|
173 | 173 | |
|
174 | 174 | Configuration keys can be set multiple times, in which case Mercurial |
|
175 | 175 | will use the value that was configured last. As an example:: |
|
176 | 176 | |
|
177 | 177 | [spam] |
|
178 | 178 | eggs=large |
|
179 | 179 | ham=serrano |
|
180 | 180 | eggs=small |
|
181 | 181 | |
|
182 | 182 | This would set the configuration key named ``eggs`` to ``small``. |
|
183 | 183 | |
|
184 | 184 | It is also possible to define a section multiple times. A section can |
|
185 | 185 | be redefined on the same and/or on different configuration files. For |
|
186 | 186 | example:: |
|
187 | 187 | |
|
188 | 188 | [foo] |
|
189 | 189 | eggs=large |
|
190 | 190 | ham=serrano |
|
191 | 191 | eggs=small |
|
192 | 192 | |
|
193 | 193 | [bar] |
|
194 | 194 | eggs=ham |
|
195 | 195 | green= |
|
196 | 196 | eggs |
|
197 | 197 | |
|
198 | 198 | [foo] |
|
199 | 199 | ham=prosciutto |
|
200 | 200 | eggs=medium |
|
201 | 201 | bread=toasted |
|
202 | 202 | |
|
203 | 203 | This would set the ``eggs``, ``ham``, and ``bread`` configuration keys |
|
204 | 204 | of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``, |
|
205 | 205 | respectively. As you can see there only thing that matters is the last |
|
206 | 206 | value that was set for each of the configuration keys. |
|
207 | 207 | |
|
208 | 208 | If a configuration key is set multiple times in different |
|
209 | 209 | configuration files the final value will depend on the order in which |
|
210 | 210 | the different configuration files are read, with settings from earlier |
|
211 | 211 | paths overriding later ones as described on the ``Files`` section |
|
212 | 212 | above. |
|
213 | 213 | |
|
214 | 214 | A line of the form ``%include file`` will include ``file`` into the |
|
215 | 215 | current configuration file. The inclusion is recursive, which means |
|
216 | 216 | that included files can include other files. Filenames are relative to |
|
217 | 217 | the configuration file in which the ``%include`` directive is found. |
|
218 | 218 | Environment variables and ``~user`` constructs are expanded in |
|
219 | 219 | ``file``. This lets you do something like:: |
|
220 | 220 | |
|
221 | 221 | %include ~/.hgrc.d/$HOST.rc |
|
222 | 222 | |
|
223 | 223 | to include a different configuration file on each computer you use. |
|
224 | 224 | |
|
225 | 225 | A line with ``%unset name`` will remove ``name`` from the current |
|
226 | 226 | section, if it has been set previously. |
|
227 | 227 | |
|
228 | 228 | The values are either free-form text strings, lists of text strings, |
|
229 | 229 | or Boolean values. Boolean values can be set to true using any of "1", |
|
230 | 230 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" |
|
231 | 231 | (all case insensitive). |
|
232 | 232 | |
|
233 | 233 | List values are separated by whitespace or comma, except when values are |
|
234 | 234 | placed in double quotation marks:: |
|
235 | 235 | |
|
236 | 236 | allow_read = "John Doe, PhD", brian, betty |
|
237 | 237 | |
|
238 | 238 | Quotation marks can be escaped by prefixing them with a backslash. Only |
|
239 | 239 | quotation marks at the beginning of a word is counted as a quotation |
|
240 | 240 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). |
|
241 | 241 | |
|
242 | 242 | Sections |
|
243 | 243 | ======== |
|
244 | 244 | |
|
245 | 245 | This section describes the different sections that may appear in a |
|
246 | 246 | Mercurial configuration file, the purpose of each section, its possible |
|
247 | 247 | keys, and their possible values. |
|
248 | 248 | |
|
249 | 249 | ``alias`` |
|
250 | 250 | --------- |
|
251 | 251 | |
|
252 | 252 | Defines command aliases. |
|
253 | 253 | |
|
254 | 254 | Aliases allow you to define your own commands in terms of other |
|
255 | 255 | commands (or aliases), optionally including arguments. Positional |
|
256 | 256 | arguments in the form of ``$1``, ``$2``, etc. in the alias definition |
|
257 | 257 | are expanded by Mercurial before execution. Positional arguments not |
|
258 | 258 | already used by ``$N`` in the definition are put at the end of the |
|
259 | 259 | command to be executed. |
|
260 | 260 | |
|
261 | 261 | Alias definitions consist of lines of the form:: |
|
262 | 262 | |
|
263 | 263 | <alias> = <command> [<argument>]... |
|
264 | 264 | |
|
265 | 265 | For example, this definition:: |
|
266 | 266 | |
|
267 | 267 | latest = log --limit 5 |
|
268 | 268 | |
|
269 | 269 | creates a new command ``latest`` that shows only the five most recent |
|
270 | 270 | changesets. You can define subsequent aliases using earlier ones:: |
|
271 | 271 | |
|
272 | 272 | stable5 = latest -b stable |
|
273 | 273 | |
|
274 | 274 | .. note:: |
|
275 | 275 | |
|
276 | 276 | It is possible to create aliases with the same names as |
|
277 | 277 | existing commands, which will then override the original |
|
278 | 278 | definitions. This is almost always a bad idea! |
|
279 | 279 | |
|
280 | 280 | An alias can start with an exclamation point (``!``) to make it a |
|
281 | 281 | shell alias. A shell alias is executed with the shell and will let you |
|
282 | 282 | run arbitrary commands. As an example, :: |
|
283 | 283 | |
|
284 | 284 | echo = !echo $@ |
|
285 | 285 | |
|
286 | 286 | will let you do ``hg echo foo`` to have ``foo`` printed in your |
|
287 | 287 | terminal. A better example might be:: |
|
288 | 288 | |
|
289 | 289 | purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f |
|
290 | 290 | |
|
291 | 291 | which will make ``hg purge`` delete all unknown files in the |
|
292 | 292 | repository in the same manner as the purge extension. |
|
293 | 293 | |
|
294 | 294 | Positional arguments like ``$1``, ``$2``, etc. in the alias definition |
|
295 | 295 | expand to the command arguments. Unmatched arguments are |
|
296 | 296 | removed. ``$0`` expands to the alias name and ``$@`` expands to all |
|
297 | 297 | arguments separated by a space. ``"$@"`` (with quotes) expands to all |
|
298 | 298 | arguments quoted individually and separated by a space. These expansions |
|
299 | 299 | happen before the command is passed to the shell. |
|
300 | 300 | |
|
301 | 301 | Shell aliases are executed in an environment where ``$HG`` expands to |
|
302 | 302 | the path of the Mercurial that was used to execute the alias. This is |
|
303 | 303 | useful when you want to call further Mercurial commands in a shell |
|
304 | 304 | alias, as was done above for the purge alias. In addition, |
|
305 | 305 | ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg |
|
306 | 306 | echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. |
|
307 | 307 | |
|
308 | 308 | .. note:: |
|
309 | 309 | |
|
310 | 310 | Some global configuration options such as ``-R`` are |
|
311 | 311 | processed before shell aliases and will thus not be passed to |
|
312 | 312 | aliases. |
|
313 | 313 | |
|
314 | 314 | |
|
315 | 315 | ``annotate`` |
|
316 | 316 | ------------ |
|
317 | 317 | |
|
318 | 318 | Settings used when displaying file annotations. All values are |
|
319 | 319 | Booleans and default to False. See :hg:`help config.diff` for |
|
320 | 320 | related options for the diff command. |
|
321 | 321 | |
|
322 | 322 | ``ignorews`` |
|
323 | 323 | Ignore white space when comparing lines. |
|
324 | 324 | |
|
325 | 325 | ``ignorewseol`` |
|
326 | 326 | Ignore white space at the end of a line when comparing lines. |
|
327 | 327 | |
|
328 | 328 | ``ignorewsamount`` |
|
329 | 329 | Ignore changes in the amount of white space. |
|
330 | 330 | |
|
331 | 331 | ``ignoreblanklines`` |
|
332 | 332 | Ignore changes whose lines are all blank. |
|
333 | 333 | |
|
334 | 334 | |
|
335 | 335 | ``auth`` |
|
336 | 336 | -------- |
|
337 | 337 | |
|
338 | 338 | Authentication credentials and other authentication-like configuration |
|
339 | 339 | for HTTP connections. This section allows you to store usernames and |
|
340 | 340 | passwords for use when logging *into* HTTP servers. See |
|
341 | 341 | :hg:`help config.web` if you want to configure *who* can login to |
|
342 | 342 | your HTTP server. |
|
343 | 343 | |
|
344 | 344 | The following options apply to all hosts. |
|
345 | 345 | |
|
346 | 346 | ``cookiefile`` |
|
347 | 347 | Path to a file containing HTTP cookie lines. Cookies matching a |
|
348 | 348 | host will be sent automatically. |
|
349 | 349 | |
|
350 | 350 | The file format uses the Mozilla cookies.txt format, which defines cookies |
|
351 | 351 | on their own lines. Each line contains 7 fields delimited by the tab |
|
352 | 352 | character (domain, is_domain_cookie, path, is_secure, expires, name, |
|
353 | 353 | value). For more info, do an Internet search for "Netscape cookies.txt |
|
354 | 354 | format." |
|
355 | 355 | |
|
356 | 356 | Note: the cookies parser does not handle port numbers on domains. You |
|
357 | 357 | will need to remove ports from the domain for the cookie to be recognized. |
|
358 | 358 | This could result in a cookie being disclosed to an unwanted server. |
|
359 | 359 | |
|
360 | 360 | The cookies file is read-only. |
|
361 | 361 | |
|
362 | 362 | Other options in this section are grouped by name and have the following |
|
363 | 363 | format:: |
|
364 | 364 | |
|
365 | 365 | <name>.<argument> = <value> |
|
366 | 366 | |
|
367 | 367 | where ``<name>`` is used to group arguments into authentication |
|
368 | 368 | entries. Example:: |
|
369 | 369 | |
|
370 | 370 | foo.prefix = hg.intevation.de/mercurial |
|
371 | 371 | foo.username = foo |
|
372 | 372 | foo.password = bar |
|
373 | 373 | foo.schemes = http https |
|
374 | 374 | |
|
375 | 375 | bar.prefix = secure.example.org |
|
376 | 376 | bar.key = path/to/file.key |
|
377 | 377 | bar.cert = path/to/file.cert |
|
378 | 378 | bar.schemes = https |
|
379 | 379 | |
|
380 | 380 | Supported arguments: |
|
381 | 381 | |
|
382 | 382 | ``prefix`` |
|
383 | 383 | Either ``*`` or a URI prefix with or without the scheme part. |
|
384 | 384 | The authentication entry with the longest matching prefix is used |
|
385 | 385 | (where ``*`` matches everything and counts as a match of length |
|
386 | 386 | 1). If the prefix doesn't include a scheme, the match is performed |
|
387 | 387 | against the URI with its scheme stripped as well, and the schemes |
|
388 | 388 | argument, q.v., is then subsequently consulted. |
|
389 | 389 | |
|
390 | 390 | ``username`` |
|
391 | 391 | Optional. Username to authenticate with. If not given, and the |
|
392 | 392 | remote site requires basic or digest authentication, the user will |
|
393 | 393 | be prompted for it. Environment variables are expanded in the |
|
394 | 394 | username letting you do ``foo.username = $USER``. If the URI |
|
395 | 395 | includes a username, only ``[auth]`` entries with a matching |
|
396 | 396 | username or without a username will be considered. |
|
397 | 397 | |
|
398 | 398 | ``password`` |
|
399 | 399 | Optional. Password to authenticate with. If not given, and the |
|
400 | 400 | remote site requires basic or digest authentication, the user |
|
401 | 401 | will be prompted for it. |
|
402 | 402 | |
|
403 | 403 | ``key`` |
|
404 | 404 | Optional. PEM encoded client certificate key file. Environment |
|
405 | 405 | variables are expanded in the filename. |
|
406 | 406 | |
|
407 | 407 | ``cert`` |
|
408 | 408 | Optional. PEM encoded client certificate chain file. Environment |
|
409 | 409 | variables are expanded in the filename. |
|
410 | 410 | |
|
411 | 411 | ``schemes`` |
|
412 | 412 | Optional. Space separated list of URI schemes to use this |
|
413 | 413 | authentication entry with. Only used if the prefix doesn't include |
|
414 | 414 | a scheme. Supported schemes are http and https. They will match |
|
415 | 415 | static-http and static-https respectively, as well. |
|
416 | 416 | (default: https) |
|
417 | 417 | |
|
418 | 418 | If no suitable authentication entry is found, the user is prompted |
|
419 | 419 | for credentials as usual if required by the remote. |
|
420 | 420 | |
|
421 | 421 | ``cmdserver`` |
|
422 | 422 | ------------- |
|
423 | 423 | |
|
424 | 424 | Controls command server settings. (ADVANCED) |
|
425 | 425 | |
|
426 | 426 | ``message-encodings`` |
|
427 | 427 | List of encodings for the ``m`` (message) channel. The first encoding |
|
428 | 428 | supported by the server will be selected and advertised in the hello |
|
429 | 429 | message. This is useful only when ``ui.message-output`` is set to |
|
430 | 430 | ``channel``. Supported encodings are ``cbor``. |
|
431 | 431 | |
|
432 | 432 | ``shutdown-on-interrupt`` |
|
433 | 433 | If set to false, the server's main loop will continue running after |
|
434 | 434 | SIGINT received. ``runcommand`` requests can still be interrupted by |
|
435 | 435 | SIGINT. Close the write end of the pipe to shut down the server |
|
436 | 436 | process gracefully. |
|
437 | 437 | (default: True) |
|
438 | 438 | |
|
439 | 439 | ``color`` |
|
440 | 440 | --------- |
|
441 | 441 | |
|
442 | 442 | Configure the Mercurial color mode. For details about how to define your custom |
|
443 | 443 | effect and style see :hg:`help color`. |
|
444 | 444 | |
|
445 | 445 | ``mode`` |
|
446 | 446 | String: control the method used to output color. One of ``auto``, ``ansi``, |
|
447 | 447 | ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will |
|
448 | 448 | use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a |
|
449 | 449 | terminal. Any invalid value will disable color. |
|
450 | 450 | |
|
451 | 451 | ``pagermode`` |
|
452 | 452 | String: optional override of ``color.mode`` used with pager. |
|
453 | 453 | |
|
454 | 454 | On some systems, terminfo mode may cause problems when using |
|
455 | 455 | color with ``less -R`` as a pager program. less with the -R option |
|
456 | 456 | will only display ECMA-48 color codes, and terminfo mode may sometimes |
|
457 | 457 | emit codes that less doesn't understand. You can work around this by |
|
458 | 458 | either using ansi mode (or auto mode), or by using less -r (which will |
|
459 | 459 | pass through all terminal control codes, not just color control |
|
460 | 460 | codes). |
|
461 | 461 | |
|
462 | 462 | On some systems (such as MSYS in Windows), the terminal may support |
|
463 | 463 | a different color mode than the pager program. |
|
464 | 464 | |
|
465 | 465 | ``commands`` |
|
466 | 466 | ------------ |
|
467 | 467 | |
|
468 | 468 | ``commit.post-status`` |
|
469 | 469 | Show status of files in the working directory after successful commit. |
|
470 | 470 | (default: False) |
|
471 | 471 | |
|
472 | 472 | ``merge.require-rev`` |
|
473 | 473 | Require that the revision to merge the current commit with be specified on |
|
474 | 474 | the command line. If this is enabled and a revision is not specified, the |
|
475 | 475 | command aborts. |
|
476 | 476 | (default: False) |
|
477 | 477 | |
|
478 | 478 | ``push.require-revs`` |
|
479 | 479 | Require revisions to push be specified using one or more mechanisms such as |
|
480 | 480 | specifying them positionally on the command line, using ``-r``, ``-b``, |
|
481 | 481 | and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the |
|
482 | 482 | configuration. If this is enabled and revisions are not specified, the |
|
483 | 483 | command aborts. |
|
484 | 484 | (default: False) |
|
485 | 485 | |
|
486 | 486 | ``resolve.confirm`` |
|
487 | 487 | Confirm before performing action if no filename is passed. |
|
488 | 488 | (default: False) |
|
489 | 489 | |
|
490 | 490 | ``resolve.explicit-re-merge`` |
|
491 | 491 | Require uses of ``hg resolve`` to specify which action it should perform, |
|
492 | 492 | instead of re-merging files by default. |
|
493 | 493 | (default: False) |
|
494 | 494 | |
|
495 | 495 | ``resolve.mark-check`` |
|
496 | 496 | Determines what level of checking :hg:`resolve --mark` will perform before |
|
497 | 497 | marking files as resolved. Valid values are ``none`, ``warn``, and |
|
498 | 498 | ``abort``. ``warn`` will output a warning listing the file(s) that still |
|
499 | 499 | have conflict markers in them, but will still mark everything resolved. |
|
500 | 500 | ``abort`` will output the same warning but will not mark things as resolved. |
|
501 | 501 | If --all is passed and this is set to ``abort``, only a warning will be |
|
502 | 502 | shown (an error will not be raised). |
|
503 | 503 | (default: ``none``) |
|
504 | 504 | |
|
505 | 505 | ``status.relative`` |
|
506 | 506 | Make paths in :hg:`status` output relative to the current directory. |
|
507 | 507 | (default: False) |
|
508 | 508 | |
|
509 | 509 | ``status.terse`` |
|
510 | 510 | Default value for the --terse flag, which condenses status output. |
|
511 | 511 | (default: empty) |
|
512 | 512 | |
|
513 | 513 | ``update.check`` |
|
514 | 514 | Determines what level of checking :hg:`update` will perform before moving |
|
515 | 515 | to a destination revision. Valid values are ``abort``, ``none``, |
|
516 | 516 | ``linear``, and ``noconflict``. |
|
517 | 517 | |
|
518 | 518 | - ``abort`` always fails if the working directory has uncommitted changes. |
|
519 | 519 | |
|
520 | 520 | - ``none`` performs no checking, and may result in a merge with uncommitted changes. |
|
521 | 521 | |
|
522 | 522 | - ``linear`` allows any update as long as it follows a straight line in the |
|
523 | 523 | revision history, and may trigger a merge with uncommitted changes. |
|
524 | 524 | |
|
525 | 525 | - ``noconflict`` will allow any update which would not trigger a merge with |
|
526 | 526 | uncommitted changes, if any are present. |
|
527 | 527 | |
|
528 | 528 | (default: ``linear``) |
|
529 | 529 | |
|
530 | 530 | ``update.requiredest`` |
|
531 | 531 | Require that the user pass a destination when running :hg:`update`. |
|
532 | 532 | For example, :hg:`update .::` will be allowed, but a plain :hg:`update` |
|
533 | 533 | will be disallowed. |
|
534 | 534 | (default: False) |
|
535 | 535 | |
|
536 | 536 | ``committemplate`` |
|
537 | 537 | ------------------ |
|
538 | 538 | |
|
539 | 539 | ``changeset`` |
|
540 | 540 | String: configuration in this section is used as the template to |
|
541 | 541 | customize the text shown in the editor when committing. |
|
542 | 542 | |
|
543 | 543 | In addition to pre-defined template keywords, commit log specific one |
|
544 | 544 | below can be used for customization: |
|
545 | 545 | |
|
546 | 546 | ``extramsg`` |
|
547 | 547 | String: Extra message (typically 'Leave message empty to abort |
|
548 | 548 | commit.'). This may be changed by some commands or extensions. |
|
549 | 549 | |
|
550 | 550 | For example, the template configuration below shows as same text as |
|
551 | 551 | one shown by default:: |
|
552 | 552 | |
|
553 | 553 | [committemplate] |
|
554 | 554 | changeset = {desc}\n\n |
|
555 | 555 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
556 | 556 | HG: {extramsg} |
|
557 | 557 | HG: -- |
|
558 | 558 | HG: user: {author}\n{ifeq(p2rev, "-1", "", |
|
559 | 559 | "HG: branch merge\n") |
|
560 | 560 | }HG: branch '{branch}'\n{if(activebookmark, |
|
561 | 561 | "HG: bookmark '{activebookmark}'\n") }{subrepos % |
|
562 | 562 | "HG: subrepo {subrepo}\n" }{file_adds % |
|
563 | 563 | "HG: added {file}\n" }{file_mods % |
|
564 | 564 | "HG: changed {file}\n" }{file_dels % |
|
565 | 565 | "HG: removed {file}\n" }{if(files, "", |
|
566 | 566 | "HG: no files changed\n")} |
|
567 | 567 | |
|
568 | 568 | ``diff()`` |
|
569 | 569 | String: show the diff (see :hg:`help templates` for detail) |
|
570 | 570 | |
|
571 | 571 | Sometimes it is helpful to show the diff of the changeset in the editor without |
|
572 | 572 | having to prefix 'HG: ' to each line so that highlighting works correctly. For |
|
573 | 573 | this, Mercurial provides a special string which will ignore everything below |
|
574 | 574 | it:: |
|
575 | 575 | |
|
576 | 576 | HG: ------------------------ >8 ------------------------ |
|
577 | 577 | |
|
578 | 578 | For example, the template configuration below will show the diff below the |
|
579 | 579 | extra message:: |
|
580 | 580 | |
|
581 | 581 | [committemplate] |
|
582 | 582 | changeset = {desc}\n\n |
|
583 | 583 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
584 | 584 | HG: {extramsg} |
|
585 | 585 | HG: ------------------------ >8 ------------------------ |
|
586 | 586 | HG: Do not touch the line above. |
|
587 | 587 | HG: Everything below will be removed. |
|
588 | 588 | {diff()} |
|
589 | 589 | |
|
590 | 590 | .. note:: |
|
591 | 591 | |
|
592 | 592 | For some problematic encodings (see :hg:`help win32mbcs` for |
|
593 | 593 | detail), this customization should be configured carefully, to |
|
594 | 594 | avoid showing broken characters. |
|
595 | 595 | |
|
596 | 596 | For example, if a multibyte character ending with backslash (0x5c) is |
|
597 | 597 | followed by the ASCII character 'n' in the customized template, |
|
598 | 598 | the sequence of backslash and 'n' is treated as line-feed unexpectedly |
|
599 | 599 | (and the multibyte character is broken, too). |
|
600 | 600 | |
|
601 | 601 | Customized template is used for commands below (``--edit`` may be |
|
602 | 602 | required): |
|
603 | 603 | |
|
604 | 604 | - :hg:`backout` |
|
605 | 605 | - :hg:`commit` |
|
606 | 606 | - :hg:`fetch` (for merge commit only) |
|
607 | 607 | - :hg:`graft` |
|
608 | 608 | - :hg:`histedit` |
|
609 | 609 | - :hg:`import` |
|
610 | 610 | - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh` |
|
611 | 611 | - :hg:`rebase` |
|
612 | 612 | - :hg:`shelve` |
|
613 | 613 | - :hg:`sign` |
|
614 | 614 | - :hg:`tag` |
|
615 | 615 | - :hg:`transplant` |
|
616 | 616 | |
|
617 | 617 | Configuring items below instead of ``changeset`` allows showing |
|
618 | 618 | customized message only for specific actions, or showing different |
|
619 | 619 | messages for each action. |
|
620 | 620 | |
|
621 | 621 | - ``changeset.backout`` for :hg:`backout` |
|
622 | 622 | - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges |
|
623 | 623 | - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other |
|
624 | 624 | - ``changeset.commit.normal.merge`` for :hg:`commit` on merges |
|
625 | 625 | - ``changeset.commit.normal.normal`` for :hg:`commit` on other |
|
626 | 626 | - ``changeset.fetch`` for :hg:`fetch` (impling merge commit) |
|
627 | 627 | - ``changeset.gpg.sign`` for :hg:`sign` |
|
628 | 628 | - ``changeset.graft`` for :hg:`graft` |
|
629 | 629 | - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit` |
|
630 | 630 | - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit` |
|
631 | 631 | - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit` |
|
632 | 632 | - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit` |
|
633 | 633 | - ``changeset.import.bypass`` for :hg:`import --bypass` |
|
634 | 634 | - ``changeset.import.normal.merge`` for :hg:`import` on merges |
|
635 | 635 | - ``changeset.import.normal.normal`` for :hg:`import` on other |
|
636 | 636 | - ``changeset.mq.qnew`` for :hg:`qnew` |
|
637 | 637 | - ``changeset.mq.qfold`` for :hg:`qfold` |
|
638 | 638 | - ``changeset.mq.qrefresh`` for :hg:`qrefresh` |
|
639 | 639 | - ``changeset.rebase.collapse`` for :hg:`rebase --collapse` |
|
640 | 640 | - ``changeset.rebase.merge`` for :hg:`rebase` on merges |
|
641 | 641 | - ``changeset.rebase.normal`` for :hg:`rebase` on other |
|
642 | 642 | - ``changeset.shelve.shelve`` for :hg:`shelve` |
|
643 | 643 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` |
|
644 | 644 | - ``changeset.tag.remove`` for :hg:`tag --remove` |
|
645 | 645 | - ``changeset.transplant.merge`` for :hg:`transplant` on merges |
|
646 | 646 | - ``changeset.transplant.normal`` for :hg:`transplant` on other |
|
647 | 647 | |
|
648 | 648 | These dot-separated lists of names are treated as hierarchical ones. |
|
649 | 649 | For example, ``changeset.tag.remove`` customizes the commit message |
|
650 | 650 | only for :hg:`tag --remove`, but ``changeset.tag`` customizes the |
|
651 | 651 | commit message for :hg:`tag` regardless of ``--remove`` option. |
|
652 | 652 | |
|
653 | 653 | When the external editor is invoked for a commit, the corresponding |
|
654 | 654 | dot-separated list of names without the ``changeset.`` prefix |
|
655 | 655 | (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment |
|
656 | 656 | variable. |
|
657 | 657 | |
|
658 | 658 | In this section, items other than ``changeset`` can be referred from |
|
659 | 659 | others. For example, the configuration to list committed files up |
|
660 | 660 | below can be referred as ``{listupfiles}``:: |
|
661 | 661 | |
|
662 | 662 | [committemplate] |
|
663 | 663 | listupfiles = {file_adds % |
|
664 | 664 | "HG: added {file}\n" }{file_mods % |
|
665 | 665 | "HG: changed {file}\n" }{file_dels % |
|
666 | 666 | "HG: removed {file}\n" }{if(files, "", |
|
667 | 667 | "HG: no files changed\n")} |
|
668 | 668 | |
|
669 | 669 | ``decode/encode`` |
|
670 | 670 | ----------------- |
|
671 | 671 | |
|
672 | 672 | Filters for transforming files on checkout/checkin. This would |
|
673 | 673 | typically be used for newline processing or other |
|
674 | 674 | localization/canonicalization of files. |
|
675 | 675 | |
|
676 | 676 | Filters consist of a filter pattern followed by a filter command. |
|
677 | 677 | Filter patterns are globs by default, rooted at the repository root. |
|
678 | 678 | For example, to match any file ending in ``.txt`` in the root |
|
679 | 679 | directory only, use the pattern ``*.txt``. To match any file ending |
|
680 | 680 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. |
|
681 | 681 | For each file only the first matching filter applies. |
|
682 | 682 | |
|
683 | 683 | The filter command can start with a specifier, either ``pipe:`` or |
|
684 | 684 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. |
|
685 | 685 | |
|
686 | 686 | A ``pipe:`` command must accept data on stdin and return the transformed |
|
687 | 687 | data on stdout. |
|
688 | 688 | |
|
689 | 689 | Pipe example:: |
|
690 | 690 | |
|
691 | 691 | [encode] |
|
692 | 692 | # uncompress gzip files on checkin to improve delta compression |
|
693 | 693 | # note: not necessarily a good idea, just an example |
|
694 | 694 | *.gz = pipe: gunzip |
|
695 | 695 | |
|
696 | 696 | [decode] |
|
697 | 697 | # recompress gzip files when writing them to the working dir (we |
|
698 | 698 | # can safely omit "pipe:", because it's the default) |
|
699 | 699 | *.gz = gzip |
|
700 | 700 | |
|
701 | 701 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced |
|
702 | 702 | with the name of a temporary file that contains the data to be |
|
703 | 703 | filtered by the command. The string ``OUTFILE`` is replaced with the name |
|
704 | 704 | of an empty temporary file, where the filtered data must be written by |
|
705 | 705 | the command. |
|
706 | 706 | |
|
707 | 707 | .. container:: windows |
|
708 | 708 | |
|
709 | 709 | .. note:: |
|
710 | 710 | |
|
711 | 711 | The tempfile mechanism is recommended for Windows systems, |
|
712 | 712 | where the standard shell I/O redirection operators often have |
|
713 | 713 | strange effects and may corrupt the contents of your files. |
|
714 | 714 | |
|
715 | 715 | This filter mechanism is used internally by the ``eol`` extension to |
|
716 | 716 | translate line ending characters between Windows (CRLF) and Unix (LF) |
|
717 | 717 | format. We suggest you use the ``eol`` extension for convenience. |
|
718 | 718 | |
|
719 | 719 | |
|
720 | 720 | ``defaults`` |
|
721 | 721 | ------------ |
|
722 | 722 | |
|
723 | 723 | (defaults are deprecated. Don't use them. Use aliases instead.) |
|
724 | 724 | |
|
725 | 725 | Use the ``[defaults]`` section to define command defaults, i.e. the |
|
726 | 726 | default options/arguments to pass to the specified commands. |
|
727 | 727 | |
|
728 | 728 | The following example makes :hg:`log` run in verbose mode, and |
|
729 | 729 | :hg:`status` show only the modified files, by default:: |
|
730 | 730 | |
|
731 | 731 | [defaults] |
|
732 | 732 | log = -v |
|
733 | 733 | status = -m |
|
734 | 734 | |
|
735 | 735 | The actual commands, instead of their aliases, must be used when |
|
736 | 736 | defining command defaults. The command defaults will also be applied |
|
737 | 737 | to the aliases of the commands defined. |
|
738 | 738 | |
|
739 | 739 | |
|
740 | 740 | ``diff`` |
|
741 | 741 | -------- |
|
742 | 742 | |
|
743 | 743 | Settings used when displaying diffs. Everything except for ``unified`` |
|
744 | 744 | is a Boolean and defaults to False. See :hg:`help config.annotate` |
|
745 | 745 | for related options for the annotate command. |
|
746 | 746 | |
|
747 | 747 | ``git`` |
|
748 | 748 | Use git extended diff format. |
|
749 | 749 | |
|
750 | 750 | ``nobinary`` |
|
751 | 751 | Omit git binary patches. |
|
752 | 752 | |
|
753 | 753 | ``nodates`` |
|
754 | 754 | Don't include dates in diff headers. |
|
755 | 755 | |
|
756 | 756 | ``noprefix`` |
|
757 | 757 | Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode. |
|
758 | 758 | |
|
759 | 759 | ``showfunc`` |
|
760 | 760 | Show which function each change is in. |
|
761 | 761 | |
|
762 | 762 | ``ignorews`` |
|
763 | 763 | Ignore white space when comparing lines. |
|
764 | 764 | |
|
765 | 765 | ``ignorewsamount`` |
|
766 | 766 | Ignore changes in the amount of white space. |
|
767 | 767 | |
|
768 | 768 | ``ignoreblanklines`` |
|
769 | 769 | Ignore changes whose lines are all blank. |
|
770 | 770 | |
|
771 | 771 | ``unified`` |
|
772 | 772 | Number of lines of context to show. |
|
773 | 773 | |
|
774 | 774 | ``word-diff`` |
|
775 | 775 | Highlight changed words. |
|
776 | 776 | |
|
777 | 777 | ``email`` |
|
778 | 778 | --------- |
|
779 | 779 | |
|
780 | 780 | Settings for extensions that send email messages. |
|
781 | 781 | |
|
782 | 782 | ``from`` |
|
783 | 783 | Optional. Email address to use in "From" header and SMTP envelope |
|
784 | 784 | of outgoing messages. |
|
785 | 785 | |
|
786 | 786 | ``to`` |
|
787 | 787 | Optional. Comma-separated list of recipients' email addresses. |
|
788 | 788 | |
|
789 | 789 | ``cc`` |
|
790 | 790 | Optional. Comma-separated list of carbon copy recipients' |
|
791 | 791 | email addresses. |
|
792 | 792 | |
|
793 | 793 | ``bcc`` |
|
794 | 794 | Optional. Comma-separated list of blind carbon copy recipients' |
|
795 | 795 | email addresses. |
|
796 | 796 | |
|
797 | 797 | ``method`` |
|
798 | 798 | Optional. Method to use to send email messages. If value is ``smtp`` |
|
799 | 799 | (default), use SMTP (see the ``[smtp]`` section for configuration). |
|
800 | 800 | Otherwise, use as name of program to run that acts like sendmail |
|
801 | 801 | (takes ``-f`` option for sender, list of recipients on command line, |
|
802 | 802 | message on stdin). Normally, setting this to ``sendmail`` or |
|
803 | 803 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. |
|
804 | 804 | |
|
805 | 805 | ``charsets`` |
|
806 | 806 | Optional. Comma-separated list of character sets considered |
|
807 | 807 | convenient for recipients. Addresses, headers, and parts not |
|
808 | 808 | containing patches of outgoing messages will be encoded in the |
|
809 | 809 | first character set to which conversion from local encoding |
|
810 | 810 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct |
|
811 | 811 | conversion fails, the text in question is sent as is. |
|
812 | 812 | (default: '') |
|
813 | 813 | |
|
814 | 814 | Order of outgoing email character sets: |
|
815 | 815 | |
|
816 | 816 | 1. ``us-ascii``: always first, regardless of settings |
|
817 | 817 | 2. ``email.charsets``: in order given by user |
|
818 | 818 | 3. ``ui.fallbackencoding``: if not in email.charsets |
|
819 | 819 | 4. ``$HGENCODING``: if not in email.charsets |
|
820 | 820 | 5. ``utf-8``: always last, regardless of settings |
|
821 | 821 | |
|
822 | 822 | Email example:: |
|
823 | 823 | |
|
824 | 824 | [email] |
|
825 | 825 | from = Joseph User <joe.user@example.com> |
|
826 | 826 | method = /usr/sbin/sendmail |
|
827 | 827 | # charsets for western Europeans |
|
828 | 828 | # us-ascii, utf-8 omitted, as they are tried first and last |
|
829 | 829 | charsets = iso-8859-1, iso-8859-15, windows-1252 |
|
830 | 830 | |
|
831 | 831 | |
|
832 | 832 | ``extensions`` |
|
833 | 833 | -------------- |
|
834 | 834 | |
|
835 | 835 | Mercurial has an extension mechanism for adding new features. To |
|
836 | 836 | enable an extension, create an entry for it in this section. |
|
837 | 837 | |
|
838 | 838 | If you know that the extension is already in Python's search path, |
|
839 | 839 | you can give the name of the module, followed by ``=``, with nothing |
|
840 | 840 | after the ``=``. |
|
841 | 841 | |
|
842 | 842 | Otherwise, give a name that you choose, followed by ``=``, followed by |
|
843 | 843 | the path to the ``.py`` file (including the file name extension) that |
|
844 | 844 | defines the extension. |
|
845 | 845 | |
|
846 | 846 | To explicitly disable an extension that is enabled in an hgrc of |
|
847 | 847 | broader scope, prepend its path with ``!``, as in ``foo = !/ext/path`` |
|
848 | 848 | or ``foo = !`` when path is not supplied. |
|
849 | 849 | |
|
850 | 850 | Example for ``~/.hgrc``:: |
|
851 | 851 | |
|
852 | 852 | [extensions] |
|
853 | 853 | # (the churn extension will get loaded from Mercurial's path) |
|
854 | 854 | churn = |
|
855 | 855 | # (this extension will get loaded from the file specified) |
|
856 | 856 | myfeature = ~/.hgext/myfeature.py |
|
857 | 857 | |
|
858 | 858 | If an extension fails to load, a warning will be issued, and Mercurial will |
|
859 | 859 | proceed. To enforce that an extension must be loaded, one can set the `required` |
|
860 | 860 | suboption in the config:: |
|
861 | 861 | |
|
862 | 862 | [extensions] |
|
863 | 863 | myfeature = ~/.hgext/myfeature.py |
|
864 | 864 | myfeature:required = yes |
|
865 | 865 | |
|
866 | 866 | To debug extension loading issue, one can add `--traceback` to their mercurial |
|
867 | 867 | invocation. |
|
868 | 868 | |
|
869 | 869 | A default setting can we set using the special `*` extension key:: |
|
870 | 870 | |
|
871 | 871 | [extensions] |
|
872 | 872 | *:required = yes |
|
873 | 873 | myfeature = ~/.hgext/myfeature.py |
|
874 | 874 | rebase= |
|
875 | 875 | |
|
876 | 876 | |
|
877 | 877 | ``format`` |
|
878 | 878 | ---------- |
|
879 | 879 | |
|
880 | 880 | Configuration that controls the repository format. Newer format options are more |
|
881 | 881 | powerful, but incompatible with some older versions of Mercurial. Format options |
|
882 | 882 | are considered at repository initialization only. You need to make a new clone |
|
883 | 883 | for config changes to be taken into account. |
|
884 | 884 | |
|
885 | 885 | For more details about repository format and version compatibility, see |
|
886 | 886 | https://www.mercurial-scm.org/wiki/MissingRequirement |
|
887 | 887 | |
|
888 | 888 | ``usegeneraldelta`` |
|
889 | 889 | Enable or disable the "generaldelta" repository format which improves |
|
890 | 890 | repository compression by allowing "revlog" to store deltas against |
|
891 | 891 | arbitrary revisions instead of the previously stored one. This provides |
|
892 | 892 | significant improvement for repositories with branches. |
|
893 | 893 | |
|
894 | 894 | Repositories with this on-disk format require Mercurial version 1.9. |
|
895 | 895 | |
|
896 | 896 | Enabled by default. |
|
897 | 897 | |
|
898 | 898 | ``dotencode`` |
|
899 | 899 | Enable or disable the "dotencode" repository format which enhances |
|
900 | 900 | the "fncache" repository format (which has to be enabled to use |
|
901 | 901 | dotencode) to avoid issues with filenames starting with "._" on |
|
902 | 902 | Mac OS X and spaces on Windows. |
|
903 | 903 | |
|
904 | 904 | Repositories with this on-disk format require Mercurial version 1.7. |
|
905 | 905 | |
|
906 | 906 | Enabled by default. |
|
907 | 907 | |
|
908 | 908 | ``usefncache`` |
|
909 | 909 | Enable or disable the "fncache" repository format which enhances |
|
910 | 910 | the "store" repository format (which has to be enabled to use |
|
911 | 911 | fncache) to allow longer filenames and avoids using Windows |
|
912 | 912 | reserved names, e.g. "nul". |
|
913 | 913 | |
|
914 | 914 | Repositories with this on-disk format require Mercurial version 1.1. |
|
915 | 915 | |
|
916 | 916 | Enabled by default. |
|
917 | 917 | |
|
918 | 918 | ``use-dirstate-v2`` |
|
919 | 919 | Enable or disable the experimental "dirstate-v2" feature. The dirstate |
|
920 | 920 | functionality is shared by all commands interacting with the working copy. |
|
921 | 921 | The new version is more robust, faster and stores more information. |
|
922 | 922 | |
|
923 | 923 | The performance-improving version of this feature is currently only |
|
924 | 924 | implemented in Rust (see :hg:`help rust`), so people not using a version of |
|
925 | 925 | Mercurial compiled with the Rust parts might actually suffer some slowdown. |
|
926 | 926 | For this reason, such versions will by default refuse to access repositories |
|
927 | 927 | with "dirstate-v2" enabled. |
|
928 | 928 | |
|
929 | 929 | This behavior can be adjusted via configuration: check |
|
930 | 930 | :hg:`help config.storage.dirstate-v2.slow-path` for details. |
|
931 | 931 | |
|
932 | 932 | Repositories with this on-disk format require Mercurial 6.0 or above. |
|
933 | 933 | |
|
934 | 934 | By default this format variant is disabled if the fast implementation is not |
|
935 | 935 | available, and enabled by default if the fast implementation is available. |
|
936 | 936 | |
|
937 | 937 | To accomodate installations of Mercurial without the fast implementation, |
|
938 | 938 | you can downgrade your repository. To do so run the following command: |
|
939 | 939 | |
|
940 | 940 | $ hg debugupgraderepo \ |
|
941 | 941 | --run \ |
|
942 | 942 | --config format.use-dirstate-v2=False \ |
|
943 | 943 | --config storage.dirstate-v2.slow-path=allow |
|
944 | 944 | |
|
945 | 945 | For a more comprehensive guide, see :hg:`help internals.dirstate-v2`. |
|
946 | 946 | |
|
947 | 947 | ``use-dirstate-tracked-hint`` |
|
948 | 948 | Enable or disable the writing of "tracked key" file alongside the dirstate. |
|
949 | 949 | (default to disabled) |
|
950 | 950 | |
|
951 | 951 | That "tracked-hint" can help external automations to detect changes to the |
|
952 | 952 | set of tracked files. (i.e the result of `hg files` or `hg status -macd`) |
|
953 | 953 | |
|
954 | 954 | The tracked-hint is written in a new `.hg/dirstate-tracked-hint`. That file |
|
955 | 955 | contains two lines: |
|
956 | 956 | - the first line is the file version (currently: 1), |
|
957 | 957 | - the second line contains the "tracked-hint". |
|
958 | 958 | That file is written right after the dirstate is written. |
|
959 | 959 | |
|
960 | 960 | The tracked-hint changes whenever the set of file tracked in the dirstate |
|
961 | 961 | changes. The general idea is: |
|
962 | 962 | - if the hint is identical, the set of tracked file SHOULD be identical, |
|
963 | 963 | - if the hint is different, the set of tracked file MIGHT be different. |
|
964 | 964 | |
|
965 | 965 | The "hint is identical" case uses `SHOULD` as the dirstate and the hint file |
|
966 | 966 | are two distinct files and therefore that cannot be read or written to in an |
|
967 | 967 | atomic way. If the key is identical, nothing garantees that the dirstate is |
|
968 | 968 | not updated right after the hint file. This is considered a negligible |
|
969 | 969 | limitation for the intended usecase. It is actually possible to prevent this |
|
970 | 970 | race by taking the repository lock during read operations. |
|
971 | 971 | |
|
972 | 972 | They are two "ways" to use this feature: |
|
973 | 973 | |
|
974 | 974 | 1) monitoring changes to the `.hg/dirstate-tracked-hint`, if the file |
|
975 | 975 | changes, the tracked set might have changed. |
|
976 | 976 | |
|
977 | 977 | 2) storing the value and comparing it to a later value. |
|
978 | 978 | |
|
979 | ||
|
980 | ``use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories`` | |
|
981 | When enabled, an automatic upgrade will be triggered when a repository format | |
|
982 | does not match its `use-dirstate-tracked-hint` config. | |
|
983 | ||
|
984 | This is an advanced behavior that most users will not need. We recommend you | |
|
985 | don't use this unless you are a seasoned administrator of a Mercurial install | |
|
986 | base. | |
|
987 | ||
|
988 | Automatic upgrade means that any process accessing the repository will | |
|
989 | upgrade the repository format to use `dirstate-tracked-hint`. This only | |
|
990 | triggers if a change is needed. This also applies to operations that would | |
|
991 | have been read-only (like hg status). | |
|
992 | ||
|
993 | This configuration will apply for moves in any direction, either adding the | |
|
994 | `dirstate-tracked-hint` format if `format.use-dirstate-tracked-hint=yes` or | |
|
995 | removing the `dirstate-tracked-hint` requirement if | |
|
996 | `format.use-dirstate-tracked-hint=no`. So we recommend setting both this | |
|
997 | value and `format.use-dirstate-tracked-hint` at the same time. | |
|
998 | ||
|
999 | ||
|
979 | 1000 | ``use-persistent-nodemap`` |
|
980 | 1001 | Enable or disable the "persistent-nodemap" feature which improves |
|
981 | 1002 | performance if the Rust extensions are available. |
|
982 | 1003 | |
|
983 | 1004 | The "persistent-nodemap" persist the "node -> rev" on disk removing the |
|
984 | 1005 | need to dynamically build that mapping for each Mercurial invocation. This |
|
985 | 1006 | significantly reduces the startup cost of various local and server-side |
|
986 | 1007 | operation for larger repositories. |
|
987 | 1008 | |
|
988 | 1009 | The performance-improving version of this feature is currently only |
|
989 | 1010 | implemented in Rust (see :hg:`help rust`), so people not using a version of |
|
990 | 1011 | Mercurial compiled with the Rust parts might actually suffer some slowdown. |
|
991 | 1012 | For this reason, such versions will by default refuse to access repositories |
|
992 | 1013 | with "persistent-nodemap". |
|
993 | 1014 | |
|
994 | 1015 | This behavior can be adjusted via configuration: check |
|
995 | 1016 | :hg:`help config.storage.revlog.persistent-nodemap.slow-path` for details. |
|
996 | 1017 | |
|
997 | 1018 | Repositories with this on-disk format require Mercurial 5.4 or above. |
|
998 | 1019 | |
|
999 | 1020 | By default this format variant is disabled if the fast implementation is not |
|
1000 | 1021 | available, and enabled by default if the fast implementation is available. |
|
1001 | 1022 | |
|
1002 | 1023 | To accomodate installations of Mercurial without the fast implementation, |
|
1003 | 1024 | you can downgrade your repository. To do so run the following command: |
|
1004 | 1025 | |
|
1005 | 1026 | $ hg debugupgraderepo \ |
|
1006 | 1027 | --run \ |
|
1007 | 1028 | --config format.use-persistent-nodemap=False \ |
|
1008 | 1029 | --config storage.revlog.persistent-nodemap.slow-path=allow |
|
1009 | 1030 | |
|
1010 | 1031 | ``use-share-safe`` |
|
1011 | 1032 | Enforce "safe" behaviors for all "shares" that access this repository. |
|
1012 | 1033 | |
|
1013 | 1034 | With this feature, "shares" using this repository as a source will: |
|
1014 | 1035 | |
|
1015 | 1036 | * read the source repository's configuration (`<source>/.hg/hgrc`). |
|
1016 | 1037 | * read and use the source repository's "requirements" |
|
1017 | 1038 | (except the working copy specific one). |
|
1018 | 1039 | |
|
1019 | 1040 | Without this feature, "shares" using this repository as a source will: |
|
1020 | 1041 | |
|
1021 | 1042 | * keep tracking the repository "requirements" in the share only, ignoring |
|
1022 | 1043 | the source "requirements", possibly diverging from them. |
|
1023 | 1044 | * ignore source repository config. This can create problems, like silently |
|
1024 | 1045 | ignoring important hooks. |
|
1025 | 1046 | |
|
1026 | 1047 | Beware that existing shares will not be upgraded/downgraded, and by |
|
1027 | 1048 | default, Mercurial will refuse to interact with them until the mismatch |
|
1028 | 1049 | is resolved. See :hg:`help config.share.safe-mismatch.source-safe` and |
|
1029 | 1050 | :hg:`help config.share.safe-mismatch.source-not-safe` for details. |
|
1030 | 1051 | |
|
1031 | 1052 | Introduced in Mercurial 5.7. |
|
1032 | 1053 | |
|
1033 | 1054 | Enabled by default in Mercurial 6.1. |
|
1034 | 1055 | |
|
1035 | 1056 | ``use-share-safe.automatic-upgrade-of-mismatching-repositories`` |
|
1036 | 1057 | When enabled, an automatic upgrade will be triggered when a repository format |
|
1037 | 1058 | does not match its `use-share-safe` config. |
|
1038 | 1059 | |
|
1039 | 1060 | This is an advanced behavior that most users will not need. We recommend you |
|
1040 | 1061 | don't use this unless you are a seasoned administrator of a Mercurial install |
|
1041 | 1062 | base. |
|
1042 | 1063 | |
|
1043 | 1064 | Automatic upgrade means that any process accessing the repository will |
|
1044 | 1065 | upgrade the repository format to use `share-safe`. This only triggers if a |
|
1045 | 1066 | change is needed. This also applies to operation that would have been |
|
1046 | 1067 | read-only (like hg status). |
|
1047 | 1068 | |
|
1048 | 1069 | This configuration will apply for moves in any direction, either adding the |
|
1049 | 1070 | `share-safe` format if `format.use-share-safe=yes` or removing the |
|
1050 | 1071 | `share-safe` requirement if `format.use-share-safe=no`. So we recommend |
|
1051 | 1072 | setting both this value and `format.use-share-safe` at the same time. |
|
1052 | 1073 | |
|
1053 | 1074 | ``usestore`` |
|
1054 | 1075 | Enable or disable the "store" repository format which improves |
|
1055 | 1076 | compatibility with systems that fold case or otherwise mangle |
|
1056 | 1077 | filenames. Disabling this option will allow you to store longer filenames |
|
1057 | 1078 | in some situations at the expense of compatibility. |
|
1058 | 1079 | |
|
1059 | 1080 | Repositories with this on-disk format require Mercurial version 0.9.4. |
|
1060 | 1081 | |
|
1061 | 1082 | Enabled by default. |
|
1062 | 1083 | |
|
1063 | 1084 | ``sparse-revlog`` |
|
1064 | 1085 | Enable or disable the ``sparse-revlog`` delta strategy. This format improves |
|
1065 | 1086 | delta re-use inside revlog. For very branchy repositories, it results in a |
|
1066 | 1087 | smaller store. For repositories with many revisions, it also helps |
|
1067 | 1088 | performance (by using shortened delta chains.) |
|
1068 | 1089 | |
|
1069 | 1090 | Repositories with this on-disk format require Mercurial version 4.7 |
|
1070 | 1091 | |
|
1071 | 1092 | Enabled by default. |
|
1072 | 1093 | |
|
1073 | 1094 | ``revlog-compression`` |
|
1074 | 1095 | Compression algorithm used by revlog. Supported values are `zlib` and |
|
1075 | 1096 | `zstd`. The `zlib` engine is the historical default of Mercurial. `zstd` is |
|
1076 | 1097 | a newer format that is usually a net win over `zlib`, operating faster at |
|
1077 | 1098 | better compression rates. Use `zstd` to reduce CPU usage. Multiple values |
|
1078 | 1099 | can be specified, the first available one will be used. |
|
1079 | 1100 | |
|
1080 | 1101 | On some systems, the Mercurial installation may lack `zstd` support. |
|
1081 | 1102 | |
|
1082 | 1103 | Default is `zstd` if available, `zlib` otherwise. |
|
1083 | 1104 | |
|
1084 | 1105 | ``bookmarks-in-store`` |
|
1085 | 1106 | Store bookmarks in .hg/store/. This means that bookmarks are shared when |
|
1086 | 1107 | using `hg share` regardless of the `-B` option. |
|
1087 | 1108 | |
|
1088 | 1109 | Repositories with this on-disk format require Mercurial version 5.1. |
|
1089 | 1110 | |
|
1090 | 1111 | Disabled by default. |
|
1091 | 1112 | |
|
1092 | 1113 | |
|
1093 | 1114 | ``graph`` |
|
1094 | 1115 | --------- |
|
1095 | 1116 | |
|
1096 | 1117 | Web graph view configuration. This section let you change graph |
|
1097 | 1118 | elements display properties by branches, for instance to make the |
|
1098 | 1119 | ``default`` branch stand out. |
|
1099 | 1120 | |
|
1100 | 1121 | Each line has the following format:: |
|
1101 | 1122 | |
|
1102 | 1123 | <branch>.<argument> = <value> |
|
1103 | 1124 | |
|
1104 | 1125 | where ``<branch>`` is the name of the branch being |
|
1105 | 1126 | customized. Example:: |
|
1106 | 1127 | |
|
1107 | 1128 | [graph] |
|
1108 | 1129 | # 2px width |
|
1109 | 1130 | default.width = 2 |
|
1110 | 1131 | # red color |
|
1111 | 1132 | default.color = FF0000 |
|
1112 | 1133 | |
|
1113 | 1134 | Supported arguments: |
|
1114 | 1135 | |
|
1115 | 1136 | ``width`` |
|
1116 | 1137 | Set branch edges width in pixels. |
|
1117 | 1138 | |
|
1118 | 1139 | ``color`` |
|
1119 | 1140 | Set branch edges color in hexadecimal RGB notation. |
|
1120 | 1141 | |
|
1121 | 1142 | ``hooks`` |
|
1122 | 1143 | --------- |
|
1123 | 1144 | |
|
1124 | 1145 | Commands or Python functions that get automatically executed by |
|
1125 | 1146 | various actions such as starting or finishing a commit. Multiple |
|
1126 | 1147 | hooks can be run for the same action by appending a suffix to the |
|
1127 | 1148 | action. Overriding a site-wide hook can be done by changing its |
|
1128 | 1149 | value or setting it to an empty string. Hooks can be prioritized |
|
1129 | 1150 | by adding a prefix of ``priority.`` to the hook name on a new line |
|
1130 | 1151 | and setting the priority. The default priority is 0. |
|
1131 | 1152 | |
|
1132 | 1153 | Example ``.hg/hgrc``:: |
|
1133 | 1154 | |
|
1134 | 1155 | [hooks] |
|
1135 | 1156 | # update working directory after adding changesets |
|
1136 | 1157 | changegroup.update = hg update |
|
1137 | 1158 | # do not use the site-wide hook |
|
1138 | 1159 | incoming = |
|
1139 | 1160 | incoming.email = /my/email/hook |
|
1140 | 1161 | incoming.autobuild = /my/build/hook |
|
1141 | 1162 | # force autobuild hook to run before other incoming hooks |
|
1142 | 1163 | priority.incoming.autobuild = 1 |
|
1143 | 1164 | ### control HGPLAIN setting when running autobuild hook |
|
1144 | 1165 | # HGPLAIN always set (default from Mercurial 5.7) |
|
1145 | 1166 | incoming.autobuild:run-with-plain = yes |
|
1146 | 1167 | # HGPLAIN never set |
|
1147 | 1168 | incoming.autobuild:run-with-plain = no |
|
1148 | 1169 | # HGPLAIN inherited from environment (default before Mercurial 5.7) |
|
1149 | 1170 | incoming.autobuild:run-with-plain = auto |
|
1150 | 1171 | |
|
1151 | 1172 | Most hooks are run with environment variables set that give useful |
|
1152 | 1173 | additional information. For each hook below, the environment variables |
|
1153 | 1174 | it is passed are listed with names in the form ``$HG_foo``. The |
|
1154 | 1175 | ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks. |
|
1155 | 1176 | They contain the type of hook which triggered the run and the full name |
|
1156 | 1177 | of the hook in the config, respectively. In the example above, this will |
|
1157 | 1178 | be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``. |
|
1158 | 1179 | |
|
1159 | 1180 | .. container:: windows |
|
1160 | 1181 | |
|
1161 | 1182 | Some basic Unix syntax can be enabled for portability, including ``$VAR`` |
|
1162 | 1183 | and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will |
|
1163 | 1184 | be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion |
|
1164 | 1185 | on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back |
|
1165 | 1186 | slash or inside of a strong quote. Strong quotes will be replaced by |
|
1166 | 1187 | double quotes after processing. |
|
1167 | 1188 | |
|
1168 | 1189 | This feature is enabled by adding a prefix of ``tonative.`` to the hook |
|
1169 | 1190 | name on a new line, and setting it to ``True``. For example:: |
|
1170 | 1191 | |
|
1171 | 1192 | [hooks] |
|
1172 | 1193 | incoming.autobuild = /my/build/hook |
|
1173 | 1194 | # enable translation to cmd.exe syntax for autobuild hook |
|
1174 | 1195 | tonative.incoming.autobuild = True |
|
1175 | 1196 | |
|
1176 | 1197 | ``changegroup`` |
|
1177 | 1198 | Run after a changegroup has been added via push, pull or unbundle. The ID of |
|
1178 | 1199 | the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``. |
|
1179 | 1200 | The URL from which changes came is in ``$HG_URL``. |
|
1180 | 1201 | |
|
1181 | 1202 | ``commit`` |
|
1182 | 1203 | Run after a changeset has been created in the local repository. The ID |
|
1183 | 1204 | of the newly created changeset is in ``$HG_NODE``. Parent changeset |
|
1184 | 1205 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
1185 | 1206 | |
|
1186 | 1207 | ``incoming`` |
|
1187 | 1208 | Run after a changeset has been pulled, pushed, or unbundled into |
|
1188 | 1209 | the local repository. The ID of the newly arrived changeset is in |
|
1189 | 1210 | ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``. |
|
1190 | 1211 | |
|
1191 | 1212 | ``outgoing`` |
|
1192 | 1213 | Run after sending changes from the local repository to another. The ID of |
|
1193 | 1214 | first changeset sent is in ``$HG_NODE``. The source of operation is in |
|
1194 | 1215 | ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`. |
|
1195 | 1216 | |
|
1196 | 1217 | ``post-<command>`` |
|
1197 | 1218 | Run after successful invocations of the associated command. The |
|
1198 | 1219 | contents of the command line are passed as ``$HG_ARGS`` and the result |
|
1199 | 1220 | code in ``$HG_RESULT``. Parsed command line arguments are passed as |
|
1200 | 1221 | ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of |
|
1201 | 1222 | the python data internally passed to <command>. ``$HG_OPTS`` is a |
|
1202 | 1223 | dictionary of options (with unspecified options set to their defaults). |
|
1203 | 1224 | ``$HG_PATS`` is a list of arguments. Hook failure is ignored. |
|
1204 | 1225 | |
|
1205 | 1226 | ``fail-<command>`` |
|
1206 | 1227 | Run after a failed invocation of an associated command. The contents |
|
1207 | 1228 | of the command line are passed as ``$HG_ARGS``. Parsed command line |
|
1208 | 1229 | arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain |
|
1209 | 1230 | string representations of the python data internally passed to |
|
1210 | 1231 | <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified |
|
1211 | 1232 | options set to their defaults). ``$HG_PATS`` is a list of arguments. |
|
1212 | 1233 | Hook failure is ignored. |
|
1213 | 1234 | |
|
1214 | 1235 | ``pre-<command>`` |
|
1215 | 1236 | Run before executing the associated command. The contents of the |
|
1216 | 1237 | command line are passed as ``$HG_ARGS``. Parsed command line arguments |
|
1217 | 1238 | are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string |
|
1218 | 1239 | representations of the data internally passed to <command>. ``$HG_OPTS`` |
|
1219 | 1240 | is a dictionary of options (with unspecified options set to their |
|
1220 | 1241 | defaults). ``$HG_PATS`` is a list of arguments. If the hook returns |
|
1221 | 1242 | failure, the command doesn't execute and Mercurial returns the failure |
|
1222 | 1243 | code. |
|
1223 | 1244 | |
|
1224 | 1245 | ``prechangegroup`` |
|
1225 | 1246 | Run before a changegroup is added via push, pull or unbundle. Exit |
|
1226 | 1247 | status 0 allows the changegroup to proceed. A non-zero status will |
|
1227 | 1248 | cause the push, pull or unbundle to fail. The URL from which changes |
|
1228 | 1249 | will come is in ``$HG_URL``. |
|
1229 | 1250 | |
|
1230 | 1251 | ``precommit`` |
|
1231 | 1252 | Run before starting a local commit. Exit status 0 allows the |
|
1232 | 1253 | commit to proceed. A non-zero status will cause the commit to fail. |
|
1233 | 1254 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
1234 | 1255 | |
|
1235 | 1256 | ``prelistkeys`` |
|
1236 | 1257 | Run before listing pushkeys (like bookmarks) in the |
|
1237 | 1258 | repository. A non-zero status will cause failure. The key namespace is |
|
1238 | 1259 | in ``$HG_NAMESPACE``. |
|
1239 | 1260 | |
|
1240 | 1261 | ``preoutgoing`` |
|
1241 | 1262 | Run before collecting changes to send from the local repository to |
|
1242 | 1263 | another. A non-zero status will cause failure. This lets you prevent |
|
1243 | 1264 | pull over HTTP or SSH. It can also prevent propagating commits (via |
|
1244 | 1265 | local pull, push (outbound) or bundle commands), but not completely, |
|
1245 | 1266 | since you can just copy files instead. The source of operation is in |
|
1246 | 1267 | ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote |
|
1247 | 1268 | SSH or HTTP repository. If "push", "pull" or "bundle", the operation |
|
1248 | 1269 | is happening on behalf of a repository on same system. |
|
1249 | 1270 | |
|
1250 | 1271 | ``prepushkey`` |
|
1251 | 1272 | Run before a pushkey (like a bookmark) is added to the |
|
1252 | 1273 | repository. A non-zero status will cause the key to be rejected. The |
|
1253 | 1274 | key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``, |
|
1254 | 1275 | the old value (if any) is in ``$HG_OLD``, and the new value is in |
|
1255 | 1276 | ``$HG_NEW``. |
|
1256 | 1277 | |
|
1257 | 1278 | ``pretag`` |
|
1258 | 1279 | Run before creating a tag. Exit status 0 allows the tag to be |
|
1259 | 1280 | created. A non-zero status will cause the tag to fail. The ID of the |
|
1260 | 1281 | changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The |
|
1261 | 1282 | tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``. |
|
1262 | 1283 | |
|
1263 | 1284 | ``pretxnopen`` |
|
1264 | 1285 | Run before any new repository transaction is open. The reason for the |
|
1265 | 1286 | transaction will be in ``$HG_TXNNAME``, and a unique identifier for the |
|
1266 | 1287 | transaction will be in ``$HG_TXNID``. A non-zero status will prevent the |
|
1267 | 1288 | transaction from being opened. |
|
1268 | 1289 | |
|
1269 | 1290 | ``pretxnclose`` |
|
1270 | 1291 | Run right before the transaction is actually finalized. Any repository change |
|
1271 | 1292 | will be visible to the hook program. This lets you validate the transaction |
|
1272 | 1293 | content or change it. Exit status 0 allows the commit to proceed. A non-zero |
|
1273 | 1294 | status will cause the transaction to be rolled back. The reason for the |
|
1274 | 1295 | transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for |
|
1275 | 1296 | the transaction will be in ``$HG_TXNID``. The rest of the available data will |
|
1276 | 1297 | vary according the transaction type. Changes unbundled to the repository will |
|
1277 | 1298 | add ``$HG_URL`` and ``$HG_SOURCE``. New changesets will add ``$HG_NODE`` (the |
|
1278 | 1299 | ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last added |
|
1279 | 1300 | changeset). Bookmark and phase changes will set ``$HG_BOOKMARK_MOVED`` and |
|
1280 | 1301 | ``$HG_PHASES_MOVED`` to ``1`` respectively. The number of new obsmarkers, if |
|
1281 | 1302 | any, will be in ``$HG_NEW_OBSMARKERS``, etc. |
|
1282 | 1303 | |
|
1283 | 1304 | ``pretxnclose-bookmark`` |
|
1284 | 1305 | Run right before a bookmark change is actually finalized. Any repository |
|
1285 | 1306 | change will be visible to the hook program. This lets you validate the |
|
1286 | 1307 | transaction content or change it. Exit status 0 allows the commit to |
|
1287 | 1308 | proceed. A non-zero status will cause the transaction to be rolled back. |
|
1288 | 1309 | The name of the bookmark will be available in ``$HG_BOOKMARK``, the new |
|
1289 | 1310 | bookmark location will be available in ``$HG_NODE`` while the previous |
|
1290 | 1311 | location will be available in ``$HG_OLDNODE``. In case of a bookmark |
|
1291 | 1312 | creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE`` |
|
1292 | 1313 | will be empty. |
|
1293 | 1314 | In addition, the reason for the transaction opening will be in |
|
1294 | 1315 | ``$HG_TXNNAME``, and a unique identifier for the transaction will be in |
|
1295 | 1316 | ``$HG_TXNID``. |
|
1296 | 1317 | |
|
1297 | 1318 | ``pretxnclose-phase`` |
|
1298 | 1319 | Run right before a phase change is actually finalized. Any repository change |
|
1299 | 1320 | will be visible to the hook program. This lets you validate the transaction |
|
1300 | 1321 | content or change it. Exit status 0 allows the commit to proceed. A non-zero |
|
1301 | 1322 | status will cause the transaction to be rolled back. The hook is called |
|
1302 | 1323 | multiple times, once for each revision affected by a phase change. |
|
1303 | 1324 | The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE`` |
|
1304 | 1325 | while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE`` |
|
1305 | 1326 | will be empty. In addition, the reason for the transaction opening will be in |
|
1306 | 1327 | ``$HG_TXNNAME``, and a unique identifier for the transaction will be in |
|
1307 | 1328 | ``$HG_TXNID``. The hook is also run for newly added revisions. In this case |
|
1308 | 1329 | the ``$HG_OLDPHASE`` entry will be empty. |
|
1309 | 1330 | |
|
1310 | 1331 | ``txnclose`` |
|
1311 | 1332 | Run after any repository transaction has been committed. At this |
|
1312 | 1333 | point, the transaction can no longer be rolled back. The hook will run |
|
1313 | 1334 | after the lock is released. See :hg:`help config.hooks.pretxnclose` for |
|
1314 | 1335 | details about available variables. |
|
1315 | 1336 | |
|
1316 | 1337 | ``txnclose-bookmark`` |
|
1317 | 1338 | Run after any bookmark change has been committed. At this point, the |
|
1318 | 1339 | transaction can no longer be rolled back. The hook will run after the lock |
|
1319 | 1340 | is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details |
|
1320 | 1341 | about available variables. |
|
1321 | 1342 | |
|
1322 | 1343 | ``txnclose-phase`` |
|
1323 | 1344 | Run after any phase change has been committed. At this point, the |
|
1324 | 1345 | transaction can no longer be rolled back. The hook will run after the lock |
|
1325 | 1346 | is released. See :hg:`help config.hooks.pretxnclose-phase` for details about |
|
1326 | 1347 | available variables. |
|
1327 | 1348 | |
|
1328 | 1349 | ``txnabort`` |
|
1329 | 1350 | Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose` |
|
1330 | 1351 | for details about available variables. |
|
1331 | 1352 | |
|
1332 | 1353 | ``pretxnchangegroup`` |
|
1333 | 1354 | Run after a changegroup has been added via push, pull or unbundle, but before |
|
1334 | 1355 | the transaction has been committed. The changegroup is visible to the hook |
|
1335 | 1356 | program. This allows validation of incoming changes before accepting them. |
|
1336 | 1357 | The ID of the first new changeset is in ``$HG_NODE`` and last is in |
|
1337 | 1358 | ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero |
|
1338 | 1359 | status will cause the transaction to be rolled back, and the push, pull or |
|
1339 | 1360 | unbundle will fail. The URL that was the source of changes is in ``$HG_URL``. |
|
1340 | 1361 | |
|
1341 | 1362 | ``pretxncommit`` |
|
1342 | 1363 | Run after a changeset has been created, but before the transaction is |
|
1343 | 1364 | committed. The changeset is visible to the hook program. This allows |
|
1344 | 1365 | validation of the commit message and changes. Exit status 0 allows the |
|
1345 | 1366 | commit to proceed. A non-zero status will cause the transaction to |
|
1346 | 1367 | be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent |
|
1347 | 1368 | changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
1348 | 1369 | |
|
1349 | 1370 | ``preupdate`` |
|
1350 | 1371 | Run before updating the working directory. Exit status 0 allows |
|
1351 | 1372 | the update to proceed. A non-zero status will prevent the update. |
|
1352 | 1373 | The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a |
|
1353 | 1374 | merge, the ID of second new parent is in ``$HG_PARENT2``. |
|
1354 | 1375 | |
|
1355 | 1376 | ``listkeys`` |
|
1356 | 1377 | Run after listing pushkeys (like bookmarks) in the repository. The |
|
1357 | 1378 | key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a |
|
1358 | 1379 | dictionary containing the keys and values. |
|
1359 | 1380 | |
|
1360 | 1381 | ``pushkey`` |
|
1361 | 1382 | Run after a pushkey (like a bookmark) is added to the |
|
1362 | 1383 | repository. The key namespace is in ``$HG_NAMESPACE``, the key is in |
|
1363 | 1384 | ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new |
|
1364 | 1385 | value is in ``$HG_NEW``. |
|
1365 | 1386 | |
|
1366 | 1387 | ``tag`` |
|
1367 | 1388 | Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``. |
|
1368 | 1389 | The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in |
|
1369 | 1390 | the repository if ``$HG_LOCAL=0``. |
|
1370 | 1391 | |
|
1371 | 1392 | ``update`` |
|
1372 | 1393 | Run after updating the working directory. The changeset ID of first |
|
1373 | 1394 | new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new |
|
1374 | 1395 | parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
|
1375 | 1396 | update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``. |
|
1376 | 1397 | |
|
1377 | 1398 | .. note:: |
|
1378 | 1399 | |
|
1379 | 1400 | It is generally better to use standard hooks rather than the |
|
1380 | 1401 | generic pre- and post- command hooks, as they are guaranteed to be |
|
1381 | 1402 | called in the appropriate contexts for influencing transactions. |
|
1382 | 1403 | Also, hooks like "commit" will be called in all contexts that |
|
1383 | 1404 | generate a commit (e.g. tag) and not just the commit command. |
|
1384 | 1405 | |
|
1385 | 1406 | .. note:: |
|
1386 | 1407 | |
|
1387 | 1408 | Environment variables with empty values may not be passed to |
|
1388 | 1409 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
|
1389 | 1410 | will have an empty value under Unix-like platforms for non-merge |
|
1390 | 1411 | changesets, while it will not be available at all under Windows. |
|
1391 | 1412 | |
|
1392 | 1413 | The syntax for Python hooks is as follows:: |
|
1393 | 1414 | |
|
1394 | 1415 | hookname = python:modulename.submodule.callable |
|
1395 | 1416 | hookname = python:/path/to/python/module.py:callable |
|
1396 | 1417 | |
|
1397 | 1418 | Python hooks are run within the Mercurial process. Each hook is |
|
1398 | 1419 | called with at least three keyword arguments: a ui object (keyword |
|
1399 | 1420 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` |
|
1400 | 1421 | keyword that tells what kind of hook is used. Arguments listed as |
|
1401 | 1422 | environment variables above are passed as keyword arguments, with no |
|
1402 | 1423 | ``HG_`` prefix, and names in lower case. |
|
1403 | 1424 | |
|
1404 | 1425 | If a Python hook returns a "true" value or raises an exception, this |
|
1405 | 1426 | is treated as a failure. |
|
1406 | 1427 | |
|
1407 | 1428 | |
|
1408 | 1429 | ``hostfingerprints`` |
|
1409 | 1430 | -------------------- |
|
1410 | 1431 | |
|
1411 | 1432 | (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.) |
|
1412 | 1433 | |
|
1413 | 1434 | Fingerprints of the certificates of known HTTPS servers. |
|
1414 | 1435 | |
|
1415 | 1436 | A HTTPS connection to a server with a fingerprint configured here will |
|
1416 | 1437 | only succeed if the servers certificate matches the fingerprint. |
|
1417 | 1438 | This is very similar to how ssh known hosts works. |
|
1418 | 1439 | |
|
1419 | 1440 | The fingerprint is the SHA-1 hash value of the DER encoded certificate. |
|
1420 | 1441 | Multiple values can be specified (separated by spaces or commas). This can |
|
1421 | 1442 | be used to define both old and new fingerprints while a host transitions |
|
1422 | 1443 | to a new certificate. |
|
1423 | 1444 | |
|
1424 | 1445 | The CA chain and web.cacerts is not used for servers with a fingerprint. |
|
1425 | 1446 | |
|
1426 | 1447 | For example:: |
|
1427 | 1448 | |
|
1428 | 1449 | [hostfingerprints] |
|
1429 | 1450 | hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1430 | 1451 | hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1431 | 1452 | |
|
1432 | 1453 | ``hostsecurity`` |
|
1433 | 1454 | ---------------- |
|
1434 | 1455 | |
|
1435 | 1456 | Used to specify global and per-host security settings for connecting to |
|
1436 | 1457 | other machines. |
|
1437 | 1458 | |
|
1438 | 1459 | The following options control default behavior for all hosts. |
|
1439 | 1460 | |
|
1440 | 1461 | ``ciphers`` |
|
1441 | 1462 | Defines the cryptographic ciphers to use for connections. |
|
1442 | 1463 | |
|
1443 | 1464 | Value must be a valid OpenSSL Cipher List Format as documented at |
|
1444 | 1465 | https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT. |
|
1445 | 1466 | |
|
1446 | 1467 | This setting is for advanced users only. Setting to incorrect values |
|
1447 | 1468 | can significantly lower connection security or decrease performance. |
|
1448 | 1469 | You have been warned. |
|
1449 | 1470 | |
|
1450 | 1471 | This option requires Python 2.7. |
|
1451 | 1472 | |
|
1452 | 1473 | ``minimumprotocol`` |
|
1453 | 1474 | Defines the minimum channel encryption protocol to use. |
|
1454 | 1475 | |
|
1455 | 1476 | By default, the highest version of TLS supported by both client and server |
|
1456 | 1477 | is used. |
|
1457 | 1478 | |
|
1458 | 1479 | Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``. |
|
1459 | 1480 | |
|
1460 | 1481 | When running on an old Python version, only ``tls1.0`` is allowed since |
|
1461 | 1482 | old versions of Python only support up to TLS 1.0. |
|
1462 | 1483 | |
|
1463 | 1484 | When running a Python that supports modern TLS versions, the default is |
|
1464 | 1485 | ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this |
|
1465 | 1486 | weakens security and should only be used as a feature of last resort if |
|
1466 | 1487 | a server does not support TLS 1.1+. |
|
1467 | 1488 | |
|
1468 | 1489 | Options in the ``[hostsecurity]`` section can have the form |
|
1469 | 1490 | ``hostname``:``setting``. This allows multiple settings to be defined on a |
|
1470 | 1491 | per-host basis. |
|
1471 | 1492 | |
|
1472 | 1493 | The following per-host settings can be defined. |
|
1473 | 1494 | |
|
1474 | 1495 | ``ciphers`` |
|
1475 | 1496 | This behaves like ``ciphers`` as described above except it only applies |
|
1476 | 1497 | to the host on which it is defined. |
|
1477 | 1498 | |
|
1478 | 1499 | ``fingerprints`` |
|
1479 | 1500 | A list of hashes of the DER encoded peer/remote certificate. Values have |
|
1480 | 1501 | the form ``algorithm``:``fingerprint``. e.g. |
|
1481 | 1502 | ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``. |
|
1482 | 1503 | In addition, colons (``:``) can appear in the fingerprint part. |
|
1483 | 1504 | |
|
1484 | 1505 | The following algorithms/prefixes are supported: ``sha1``, ``sha256``, |
|
1485 | 1506 | ``sha512``. |
|
1486 | 1507 | |
|
1487 | 1508 | Use of ``sha256`` or ``sha512`` is preferred. |
|
1488 | 1509 | |
|
1489 | 1510 | If a fingerprint is specified, the CA chain is not validated for this |
|
1490 | 1511 | host and Mercurial will require the remote certificate to match one |
|
1491 | 1512 | of the fingerprints specified. This means if the server updates its |
|
1492 | 1513 | certificate, Mercurial will abort until a new fingerprint is defined. |
|
1493 | 1514 | This can provide stronger security than traditional CA-based validation |
|
1494 | 1515 | at the expense of convenience. |
|
1495 | 1516 | |
|
1496 | 1517 | This option takes precedence over ``verifycertsfile``. |
|
1497 | 1518 | |
|
1498 | 1519 | ``minimumprotocol`` |
|
1499 | 1520 | This behaves like ``minimumprotocol`` as described above except it |
|
1500 | 1521 | only applies to the host on which it is defined. |
|
1501 | 1522 | |
|
1502 | 1523 | ``verifycertsfile`` |
|
1503 | 1524 | Path to file a containing a list of PEM encoded certificates used to |
|
1504 | 1525 | verify the server certificate. Environment variables and ``~user`` |
|
1505 | 1526 | constructs are expanded in the filename. |
|
1506 | 1527 | |
|
1507 | 1528 | The server certificate or the certificate's certificate authority (CA) |
|
1508 | 1529 | must match a certificate from this file or certificate verification |
|
1509 | 1530 | will fail and connections to the server will be refused. |
|
1510 | 1531 | |
|
1511 | 1532 | If defined, only certificates provided by this file will be used: |
|
1512 | 1533 | ``web.cacerts`` and any system/default certificates will not be |
|
1513 | 1534 | used. |
|
1514 | 1535 | |
|
1515 | 1536 | This option has no effect if the per-host ``fingerprints`` option |
|
1516 | 1537 | is set. |
|
1517 | 1538 | |
|
1518 | 1539 | The format of the file is as follows:: |
|
1519 | 1540 | |
|
1520 | 1541 | -----BEGIN CERTIFICATE----- |
|
1521 | 1542 | ... (certificate in base64 PEM encoding) ... |
|
1522 | 1543 | -----END CERTIFICATE----- |
|
1523 | 1544 | -----BEGIN CERTIFICATE----- |
|
1524 | 1545 | ... (certificate in base64 PEM encoding) ... |
|
1525 | 1546 | -----END CERTIFICATE----- |
|
1526 | 1547 | |
|
1527 | 1548 | For example:: |
|
1528 | 1549 | |
|
1529 | 1550 | [hostsecurity] |
|
1530 | 1551 | hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 |
|
1531 | 1552 | hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1532 | 1553 | hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2 |
|
1533 | 1554 | foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem |
|
1534 | 1555 | |
|
1535 | 1556 | To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1 |
|
1536 | 1557 | when connecting to ``hg.example.com``:: |
|
1537 | 1558 | |
|
1538 | 1559 | [hostsecurity] |
|
1539 | 1560 | minimumprotocol = tls1.2 |
|
1540 | 1561 | hg.example.com:minimumprotocol = tls1.1 |
|
1541 | 1562 | |
|
1542 | 1563 | ``http_proxy`` |
|
1543 | 1564 | -------------- |
|
1544 | 1565 | |
|
1545 | 1566 | Used to access web-based Mercurial repositories through a HTTP |
|
1546 | 1567 | proxy. |
|
1547 | 1568 | |
|
1548 | 1569 | ``host`` |
|
1549 | 1570 | Host name and (optional) port of the proxy server, for example |
|
1550 | 1571 | "myproxy:8000". |
|
1551 | 1572 | |
|
1552 | 1573 | ``no`` |
|
1553 | 1574 | Optional. Comma-separated list of host names that should bypass |
|
1554 | 1575 | the proxy. |
|
1555 | 1576 | |
|
1556 | 1577 | ``passwd`` |
|
1557 | 1578 | Optional. Password to authenticate with at the proxy server. |
|
1558 | 1579 | |
|
1559 | 1580 | ``user`` |
|
1560 | 1581 | Optional. User name to authenticate with at the proxy server. |
|
1561 | 1582 | |
|
1562 | 1583 | ``always`` |
|
1563 | 1584 | Optional. Always use the proxy, even for localhost and any entries |
|
1564 | 1585 | in ``http_proxy.no``. (default: False) |
|
1565 | 1586 | |
|
1566 | 1587 | ``http`` |
|
1567 | 1588 | ---------- |
|
1568 | 1589 | |
|
1569 | 1590 | Used to configure access to Mercurial repositories via HTTP. |
|
1570 | 1591 | |
|
1571 | 1592 | ``timeout`` |
|
1572 | 1593 | If set, blocking operations will timeout after that many seconds. |
|
1573 | 1594 | (default: None) |
|
1574 | 1595 | |
|
1575 | 1596 | ``merge`` |
|
1576 | 1597 | --------- |
|
1577 | 1598 | |
|
1578 | 1599 | This section specifies behavior during merges and updates. |
|
1579 | 1600 | |
|
1580 | 1601 | ``checkignored`` |
|
1581 | 1602 | Controls behavior when an ignored file on disk has the same name as a tracked |
|
1582 | 1603 | file in the changeset being merged or updated to, and has different |
|
1583 | 1604 | contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``, |
|
1584 | 1605 | abort on such files. With ``warn``, warn on such files and back them up as |
|
1585 | 1606 | ``.orig``. With ``ignore``, don't print a warning and back them up as |
|
1586 | 1607 | ``.orig``. (default: ``abort``) |
|
1587 | 1608 | |
|
1588 | 1609 | ``checkunknown`` |
|
1589 | 1610 | Controls behavior when an unknown file that isn't ignored has the same name |
|
1590 | 1611 | as a tracked file in the changeset being merged or updated to, and has |
|
1591 | 1612 | different contents. Similar to ``merge.checkignored``, except for files that |
|
1592 | 1613 | are not ignored. (default: ``abort``) |
|
1593 | 1614 | |
|
1594 | 1615 | ``on-failure`` |
|
1595 | 1616 | When set to ``continue`` (the default), the merge process attempts to |
|
1596 | 1617 | merge all unresolved files using the merge chosen tool, regardless of |
|
1597 | 1618 | whether previous file merge attempts during the process succeeded or not. |
|
1598 | 1619 | Setting this to ``prompt`` will prompt after any merge failure continue |
|
1599 | 1620 | or halt the merge process. Setting this to ``halt`` will automatically |
|
1600 | 1621 | halt the merge process on any merge tool failure. The merge process |
|
1601 | 1622 | can be restarted by using the ``resolve`` command. When a merge is |
|
1602 | 1623 | halted, the repository is left in a normal ``unresolved`` merge state. |
|
1603 | 1624 | (default: ``continue``) |
|
1604 | 1625 | |
|
1605 | 1626 | ``strict-capability-check`` |
|
1606 | 1627 | Whether capabilities of internal merge tools are checked strictly |
|
1607 | 1628 | or not, while examining rules to decide merge tool to be used. |
|
1608 | 1629 | (default: False) |
|
1609 | 1630 | |
|
1610 | 1631 | ``merge-patterns`` |
|
1611 | 1632 | ------------------ |
|
1612 | 1633 | |
|
1613 | 1634 | This section specifies merge tools to associate with particular file |
|
1614 | 1635 | patterns. Tools matched here will take precedence over the default |
|
1615 | 1636 | merge tool. Patterns are globs by default, rooted at the repository |
|
1616 | 1637 | root. |
|
1617 | 1638 | |
|
1618 | 1639 | Example:: |
|
1619 | 1640 | |
|
1620 | 1641 | [merge-patterns] |
|
1621 | 1642 | **.c = kdiff3 |
|
1622 | 1643 | **.jpg = myimgmerge |
|
1623 | 1644 | |
|
1624 | 1645 | ``merge-tools`` |
|
1625 | 1646 | --------------- |
|
1626 | 1647 | |
|
1627 | 1648 | This section configures external merge tools to use for file-level |
|
1628 | 1649 | merges. This section has likely been preconfigured at install time. |
|
1629 | 1650 | Use :hg:`config merge-tools` to check the existing configuration. |
|
1630 | 1651 | Also see :hg:`help merge-tools` for more details. |
|
1631 | 1652 | |
|
1632 | 1653 | Example ``~/.hgrc``:: |
|
1633 | 1654 | |
|
1634 | 1655 | [merge-tools] |
|
1635 | 1656 | # Override stock tool location |
|
1636 | 1657 | kdiff3.executable = ~/bin/kdiff3 |
|
1637 | 1658 | # Specify command line |
|
1638 | 1659 | kdiff3.args = $base $local $other -o $output |
|
1639 | 1660 | # Give higher priority |
|
1640 | 1661 | kdiff3.priority = 1 |
|
1641 | 1662 | |
|
1642 | 1663 | # Changing the priority of preconfigured tool |
|
1643 | 1664 | meld.priority = 0 |
|
1644 | 1665 | |
|
1645 | 1666 | # Disable a preconfigured tool |
|
1646 | 1667 | vimdiff.disabled = yes |
|
1647 | 1668 | |
|
1648 | 1669 | # Define new tool |
|
1649 | 1670 | myHtmlTool.args = -m $local $other $base $output |
|
1650 | 1671 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge |
|
1651 | 1672 | myHtmlTool.priority = 1 |
|
1652 | 1673 | |
|
1653 | 1674 | Supported arguments: |
|
1654 | 1675 | |
|
1655 | 1676 | ``priority`` |
|
1656 | 1677 | The priority in which to evaluate this tool. |
|
1657 | 1678 | (default: 0) |
|
1658 | 1679 | |
|
1659 | 1680 | ``executable`` |
|
1660 | 1681 | Either just the name of the executable or its pathname. |
|
1661 | 1682 | |
|
1662 | 1683 | .. container:: windows |
|
1663 | 1684 | |
|
1664 | 1685 | On Windows, the path can use environment variables with ${ProgramFiles} |
|
1665 | 1686 | syntax. |
|
1666 | 1687 | |
|
1667 | 1688 | (default: the tool name) |
|
1668 | 1689 | |
|
1669 | 1690 | ``args`` |
|
1670 | 1691 | The arguments to pass to the tool executable. You can refer to the |
|
1671 | 1692 | files being merged as well as the output file through these |
|
1672 | 1693 | variables: ``$base``, ``$local``, ``$other``, ``$output``. |
|
1673 | 1694 | |
|
1674 | 1695 | The meaning of ``$local`` and ``$other`` can vary depending on which action is |
|
1675 | 1696 | being performed. During an update or merge, ``$local`` represents the original |
|
1676 | 1697 | state of the file, while ``$other`` represents the commit you are updating to or |
|
1677 | 1698 | the commit you are merging with. During a rebase, ``$local`` represents the |
|
1678 | 1699 | destination of the rebase, and ``$other`` represents the commit being rebased. |
|
1679 | 1700 | |
|
1680 | 1701 | Some operations define custom labels to assist with identifying the revisions, |
|
1681 | 1702 | accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom |
|
1682 | 1703 | labels are not available, these will be ``local``, ``other``, and ``base``, |
|
1683 | 1704 | respectively. |
|
1684 | 1705 | (default: ``$local $base $other``) |
|
1685 | 1706 | |
|
1686 | 1707 | ``premerge`` |
|
1687 | 1708 | Attempt to run internal non-interactive 3-way merge tool before |
|
1688 | 1709 | launching external tool. Options are ``true``, ``false``, ``keep``, |
|
1689 | 1710 | ``keep-merge3``, or ``keep-mergediff`` (experimental). The ``keep`` option |
|
1690 | 1711 | will leave markers in the file if the premerge fails. The ``keep-merge3`` |
|
1691 | 1712 | will do the same but include information about the base of the merge in the |
|
1692 | 1713 | marker (see internal :merge3 in :hg:`help merge-tools`). The |
|
1693 | 1714 | ``keep-mergediff`` option is similar but uses a different marker style |
|
1694 | 1715 | (see internal :merge3 in :hg:`help merge-tools`). (default: True) |
|
1695 | 1716 | |
|
1696 | 1717 | ``binary`` |
|
1697 | 1718 | This tool can merge binary files. (default: False, unless tool |
|
1698 | 1719 | was selected by file pattern match) |
|
1699 | 1720 | |
|
1700 | 1721 | ``symlink`` |
|
1701 | 1722 | This tool can merge symlinks. (default: False) |
|
1702 | 1723 | |
|
1703 | 1724 | ``check`` |
|
1704 | 1725 | A list of merge success-checking options: |
|
1705 | 1726 | |
|
1706 | 1727 | ``changed`` |
|
1707 | 1728 | Ask whether merge was successful when the merged file shows no changes. |
|
1708 | 1729 | ``conflicts`` |
|
1709 | 1730 | Check whether there are conflicts even though the tool reported success. |
|
1710 | 1731 | ``prompt`` |
|
1711 | 1732 | Always prompt for merge success, regardless of success reported by tool. |
|
1712 | 1733 | |
|
1713 | 1734 | ``fixeol`` |
|
1714 | 1735 | Attempt to fix up EOL changes caused by the merge tool. |
|
1715 | 1736 | (default: False) |
|
1716 | 1737 | |
|
1717 | 1738 | ``gui`` |
|
1718 | 1739 | This tool requires a graphical interface to run. (default: False) |
|
1719 | 1740 | |
|
1720 | 1741 | ``mergemarkers`` |
|
1721 | 1742 | Controls whether the labels passed via ``$labellocal``, ``$labelother``, and |
|
1722 | 1743 | ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or |
|
1723 | 1744 | ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict |
|
1724 | 1745 | markers generated during premerge will be ``detailed`` if either this option or |
|
1725 | 1746 | the corresponding option in the ``[ui]`` section is ``detailed``. |
|
1726 | 1747 | (default: ``basic``) |
|
1727 | 1748 | |
|
1728 | 1749 | ``mergemarkertemplate`` |
|
1729 | 1750 | This setting can be used to override ``mergemarker`` from the |
|
1730 | 1751 | ``[command-templates]`` section on a per-tool basis; this applies to the |
|
1731 | 1752 | ``$label``-prefixed variables and to the conflict markers that are generated |
|
1732 | 1753 | if ``premerge`` is ``keep` or ``keep-merge3``. See the corresponding variable |
|
1733 | 1754 | in ``[ui]`` for more information. |
|
1734 | 1755 | |
|
1735 | 1756 | .. container:: windows |
|
1736 | 1757 | |
|
1737 | 1758 | ``regkey`` |
|
1738 | 1759 | Windows registry key which describes install location of this |
|
1739 | 1760 | tool. Mercurial will search for this key first under |
|
1740 | 1761 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. |
|
1741 | 1762 | (default: None) |
|
1742 | 1763 | |
|
1743 | 1764 | ``regkeyalt`` |
|
1744 | 1765 | An alternate Windows registry key to try if the first key is not |
|
1745 | 1766 | found. The alternate key uses the same ``regname`` and ``regappend`` |
|
1746 | 1767 | semantics of the primary key. The most common use for this key |
|
1747 | 1768 | is to search for 32bit applications on 64bit operating systems. |
|
1748 | 1769 | (default: None) |
|
1749 | 1770 | |
|
1750 | 1771 | ``regname`` |
|
1751 | 1772 | Name of value to read from specified registry key. |
|
1752 | 1773 | (default: the unnamed (default) value) |
|
1753 | 1774 | |
|
1754 | 1775 | ``regappend`` |
|
1755 | 1776 | String to append to the value read from the registry, typically |
|
1756 | 1777 | the executable name of the tool. |
|
1757 | 1778 | (default: None) |
|
1758 | 1779 | |
|
1759 | 1780 | ``pager`` |
|
1760 | 1781 | --------- |
|
1761 | 1782 | |
|
1762 | 1783 | Setting used to control when to paginate and with what external tool. See |
|
1763 | 1784 | :hg:`help pager` for details. |
|
1764 | 1785 | |
|
1765 | 1786 | ``pager`` |
|
1766 | 1787 | Define the external tool used as pager. |
|
1767 | 1788 | |
|
1768 | 1789 | If no pager is set, Mercurial uses the environment variable $PAGER. |
|
1769 | 1790 | If neither pager.pager, nor $PAGER is set, a default pager will be |
|
1770 | 1791 | used, typically `less` on Unix and `more` on Windows. Example:: |
|
1771 | 1792 | |
|
1772 | 1793 | [pager] |
|
1773 | 1794 | pager = less -FRX |
|
1774 | 1795 | |
|
1775 | 1796 | ``ignore`` |
|
1776 | 1797 | List of commands to disable the pager for. Example:: |
|
1777 | 1798 | |
|
1778 | 1799 | [pager] |
|
1779 | 1800 | ignore = version, help, update |
|
1780 | 1801 | |
|
1781 | 1802 | ``patch`` |
|
1782 | 1803 | --------- |
|
1783 | 1804 | |
|
1784 | 1805 | Settings used when applying patches, for instance through the 'import' |
|
1785 | 1806 | command or with Mercurial Queues extension. |
|
1786 | 1807 | |
|
1787 | 1808 | ``eol`` |
|
1788 | 1809 | When set to 'strict' patch content and patched files end of lines |
|
1789 | 1810 | are preserved. When set to ``lf`` or ``crlf``, both files end of |
|
1790 | 1811 | lines are ignored when patching and the result line endings are |
|
1791 | 1812 | normalized to either LF (Unix) or CRLF (Windows). When set to |
|
1792 | 1813 | ``auto``, end of lines are again ignored while patching but line |
|
1793 | 1814 | endings in patched files are normalized to their original setting |
|
1794 | 1815 | on a per-file basis. If target file does not exist or has no end |
|
1795 | 1816 | of line, patch line endings are preserved. |
|
1796 | 1817 | (default: strict) |
|
1797 | 1818 | |
|
1798 | 1819 | ``fuzz`` |
|
1799 | 1820 | The number of lines of 'fuzz' to allow when applying patches. This |
|
1800 | 1821 | controls how much context the patcher is allowed to ignore when |
|
1801 | 1822 | trying to apply a patch. |
|
1802 | 1823 | (default: 2) |
|
1803 | 1824 | |
|
1804 | 1825 | ``paths`` |
|
1805 | 1826 | --------- |
|
1806 | 1827 | |
|
1807 | 1828 | Assigns symbolic names and behavior to repositories. |
|
1808 | 1829 | |
|
1809 | 1830 | Options are symbolic names defining the URL or directory that is the |
|
1810 | 1831 | location of the repository. Example:: |
|
1811 | 1832 | |
|
1812 | 1833 | [paths] |
|
1813 | 1834 | my_server = https://example.com/my_repo |
|
1814 | 1835 | local_path = /home/me/repo |
|
1815 | 1836 | |
|
1816 | 1837 | These symbolic names can be used from the command line. To pull |
|
1817 | 1838 | from ``my_server``: :hg:`pull my_server`. To push to ``local_path``: |
|
1818 | 1839 | :hg:`push local_path`. You can check :hg:`help urls` for details about |
|
1819 | 1840 | valid URLs. |
|
1820 | 1841 | |
|
1821 | 1842 | Options containing colons (``:``) denote sub-options that can influence |
|
1822 | 1843 | behavior for that specific path. Example:: |
|
1823 | 1844 | |
|
1824 | 1845 | [paths] |
|
1825 | 1846 | my_server = https://example.com/my_path |
|
1826 | 1847 | my_server:pushurl = ssh://example.com/my_path |
|
1827 | 1848 | |
|
1828 | 1849 | Paths using the `path://otherpath` scheme will inherit the sub-options value from |
|
1829 | 1850 | the path they point to. |
|
1830 | 1851 | |
|
1831 | 1852 | The following sub-options can be defined: |
|
1832 | 1853 | |
|
1833 | 1854 | ``multi-urls`` |
|
1834 | 1855 | A boolean option. When enabled the value of the `[paths]` entry will be |
|
1835 | 1856 | parsed as a list and the alias will resolve to multiple destination. If some |
|
1836 | 1857 | of the list entry use the `path://` syntax, the suboption will be inherited |
|
1837 | 1858 | individually. |
|
1838 | 1859 | |
|
1839 | 1860 | ``pushurl`` |
|
1840 | 1861 | The URL to use for push operations. If not defined, the location |
|
1841 | 1862 | defined by the path's main entry is used. |
|
1842 | 1863 | |
|
1843 | 1864 | ``pushrev`` |
|
1844 | 1865 | A revset defining which revisions to push by default. |
|
1845 | 1866 | |
|
1846 | 1867 | When :hg:`push` is executed without a ``-r`` argument, the revset |
|
1847 | 1868 | defined by this sub-option is evaluated to determine what to push. |
|
1848 | 1869 | |
|
1849 | 1870 | For example, a value of ``.`` will push the working directory's |
|
1850 | 1871 | revision by default. |
|
1851 | 1872 | |
|
1852 | 1873 | Revsets specifying bookmarks will not result in the bookmark being |
|
1853 | 1874 | pushed. |
|
1854 | 1875 | |
|
1855 | 1876 | ``bookmarks.mode`` |
|
1856 | 1877 | How bookmark will be dealt during the exchange. It support the following value |
|
1857 | 1878 | |
|
1858 | 1879 | - ``default``: the default behavior, local and remote bookmarks are "merged" |
|
1859 | 1880 | on push/pull. |
|
1860 | 1881 | |
|
1861 | 1882 | - ``mirror``: when pulling, replace local bookmarks by remote bookmarks. This |
|
1862 | 1883 | is useful to replicate a repository, or as an optimization. |
|
1863 | 1884 | |
|
1864 | 1885 | - ``ignore``: ignore bookmarks during exchange. |
|
1865 | 1886 | (This currently only affect pulling) |
|
1866 | 1887 | |
|
1867 | 1888 | The following special named paths exist: |
|
1868 | 1889 | |
|
1869 | 1890 | ``default`` |
|
1870 | 1891 | The URL or directory to use when no source or remote is specified. |
|
1871 | 1892 | |
|
1872 | 1893 | :hg:`clone` will automatically define this path to the location the |
|
1873 | 1894 | repository was cloned from. |
|
1874 | 1895 | |
|
1875 | 1896 | ``default-push`` |
|
1876 | 1897 | (deprecated) The URL or directory for the default :hg:`push` location. |
|
1877 | 1898 | ``default:pushurl`` should be used instead. |
|
1878 | 1899 | |
|
1879 | 1900 | ``phases`` |
|
1880 | 1901 | ---------- |
|
1881 | 1902 | |
|
1882 | 1903 | Specifies default handling of phases. See :hg:`help phases` for more |
|
1883 | 1904 | information about working with phases. |
|
1884 | 1905 | |
|
1885 | 1906 | ``publish`` |
|
1886 | 1907 | Controls draft phase behavior when working as a server. When true, |
|
1887 | 1908 | pushed changesets are set to public in both client and server and |
|
1888 | 1909 | pulled or cloned changesets are set to public in the client. |
|
1889 | 1910 | (default: True) |
|
1890 | 1911 | |
|
1891 | 1912 | ``new-commit`` |
|
1892 | 1913 | Phase of newly-created commits. |
|
1893 | 1914 | (default: draft) |
|
1894 | 1915 | |
|
1895 | 1916 | ``checksubrepos`` |
|
1896 | 1917 | Check the phase of the current revision of each subrepository. Allowed |
|
1897 | 1918 | values are "ignore", "follow" and "abort". For settings other than |
|
1898 | 1919 | "ignore", the phase of the current revision of each subrepository is |
|
1899 | 1920 | checked before committing the parent repository. If any of those phases is |
|
1900 | 1921 | greater than the phase of the parent repository (e.g. if a subrepo is in a |
|
1901 | 1922 | "secret" phase while the parent repo is in "draft" phase), the commit is |
|
1902 | 1923 | either aborted (if checksubrepos is set to "abort") or the higher phase is |
|
1903 | 1924 | used for the parent repository commit (if set to "follow"). |
|
1904 | 1925 | (default: follow) |
|
1905 | 1926 | |
|
1906 | 1927 | |
|
1907 | 1928 | ``profiling`` |
|
1908 | 1929 | ------------- |
|
1909 | 1930 | |
|
1910 | 1931 | Specifies profiling type, format, and file output. Two profilers are |
|
1911 | 1932 | supported: an instrumenting profiler (named ``ls``), and a sampling |
|
1912 | 1933 | profiler (named ``stat``). |
|
1913 | 1934 | |
|
1914 | 1935 | In this section description, 'profiling data' stands for the raw data |
|
1915 | 1936 | collected during profiling, while 'profiling report' stands for a |
|
1916 | 1937 | statistical text report generated from the profiling data. |
|
1917 | 1938 | |
|
1918 | 1939 | ``enabled`` |
|
1919 | 1940 | Enable the profiler. |
|
1920 | 1941 | (default: false) |
|
1921 | 1942 | |
|
1922 | 1943 | This is equivalent to passing ``--profile`` on the command line. |
|
1923 | 1944 | |
|
1924 | 1945 | ``type`` |
|
1925 | 1946 | The type of profiler to use. |
|
1926 | 1947 | (default: stat) |
|
1927 | 1948 | |
|
1928 | 1949 | ``ls`` |
|
1929 | 1950 | Use Python's built-in instrumenting profiler. This profiler |
|
1930 | 1951 | works on all platforms, but each line number it reports is the |
|
1931 | 1952 | first line of a function. This restriction makes it difficult to |
|
1932 | 1953 | identify the expensive parts of a non-trivial function. |
|
1933 | 1954 | ``stat`` |
|
1934 | 1955 | Use a statistical profiler, statprof. This profiler is most |
|
1935 | 1956 | useful for profiling commands that run for longer than about 0.1 |
|
1936 | 1957 | seconds. |
|
1937 | 1958 | |
|
1938 | 1959 | ``format`` |
|
1939 | 1960 | Profiling format. Specific to the ``ls`` instrumenting profiler. |
|
1940 | 1961 | (default: text) |
|
1941 | 1962 | |
|
1942 | 1963 | ``text`` |
|
1943 | 1964 | Generate a profiling report. When saving to a file, it should be |
|
1944 | 1965 | noted that only the report is saved, and the profiling data is |
|
1945 | 1966 | not kept. |
|
1946 | 1967 | ``kcachegrind`` |
|
1947 | 1968 | Format profiling data for kcachegrind use: when saving to a |
|
1948 | 1969 | file, the generated file can directly be loaded into |
|
1949 | 1970 | kcachegrind. |
|
1950 | 1971 | |
|
1951 | 1972 | ``statformat`` |
|
1952 | 1973 | Profiling format for the ``stat`` profiler. |
|
1953 | 1974 | (default: hotpath) |
|
1954 | 1975 | |
|
1955 | 1976 | ``hotpath`` |
|
1956 | 1977 | Show a tree-based display containing the hot path of execution (where |
|
1957 | 1978 | most time was spent). |
|
1958 | 1979 | ``bymethod`` |
|
1959 | 1980 | Show a table of methods ordered by how frequently they are active. |
|
1960 | 1981 | ``byline`` |
|
1961 | 1982 | Show a table of lines in files ordered by how frequently they are active. |
|
1962 | 1983 | ``json`` |
|
1963 | 1984 | Render profiling data as JSON. |
|
1964 | 1985 | |
|
1965 | 1986 | ``freq`` |
|
1966 | 1987 | Sampling frequency. Specific to the ``stat`` sampling profiler. |
|
1967 | 1988 | (default: 1000) |
|
1968 | 1989 | |
|
1969 | 1990 | ``output`` |
|
1970 | 1991 | File path where profiling data or report should be saved. If the |
|
1971 | 1992 | file exists, it is replaced. (default: None, data is printed on |
|
1972 | 1993 | stderr) |
|
1973 | 1994 | |
|
1974 | 1995 | ``sort`` |
|
1975 | 1996 | Sort field. Specific to the ``ls`` instrumenting profiler. |
|
1976 | 1997 | One of ``callcount``, ``reccallcount``, ``totaltime`` and |
|
1977 | 1998 | ``inlinetime``. |
|
1978 | 1999 | (default: inlinetime) |
|
1979 | 2000 | |
|
1980 | 2001 | ``time-track`` |
|
1981 | 2002 | Control if the stat profiler track ``cpu`` or ``real`` time. |
|
1982 | 2003 | (default: ``cpu`` on Windows, otherwise ``real``) |
|
1983 | 2004 | |
|
1984 | 2005 | ``limit`` |
|
1985 | 2006 | Number of lines to show. Specific to the ``ls`` instrumenting profiler. |
|
1986 | 2007 | (default: 30) |
|
1987 | 2008 | |
|
1988 | 2009 | ``nested`` |
|
1989 | 2010 | Show at most this number of lines of drill-down info after each main entry. |
|
1990 | 2011 | This can help explain the difference between Total and Inline. |
|
1991 | 2012 | Specific to the ``ls`` instrumenting profiler. |
|
1992 | 2013 | (default: 0) |
|
1993 | 2014 | |
|
1994 | 2015 | ``showmin`` |
|
1995 | 2016 | Minimum fraction of samples an entry must have for it to be displayed. |
|
1996 | 2017 | Can be specified as a float between ``0.0`` and ``1.0`` or can have a |
|
1997 | 2018 | ``%`` afterwards to allow values up to ``100``. e.g. ``5%``. |
|
1998 | 2019 | |
|
1999 | 2020 | Only used by the ``stat`` profiler. |
|
2000 | 2021 | |
|
2001 | 2022 | For the ``hotpath`` format, default is ``0.05``. |
|
2002 | 2023 | For the ``chrome`` format, default is ``0.005``. |
|
2003 | 2024 | |
|
2004 | 2025 | The option is unused on other formats. |
|
2005 | 2026 | |
|
2006 | 2027 | ``showmax`` |
|
2007 | 2028 | Maximum fraction of samples an entry can have before it is ignored in |
|
2008 | 2029 | display. Values format is the same as ``showmin``. |
|
2009 | 2030 | |
|
2010 | 2031 | Only used by the ``stat`` profiler. |
|
2011 | 2032 | |
|
2012 | 2033 | For the ``chrome`` format, default is ``0.999``. |
|
2013 | 2034 | |
|
2014 | 2035 | The option is unused on other formats. |
|
2015 | 2036 | |
|
2016 | 2037 | ``showtime`` |
|
2017 | 2038 | Show time taken as absolute durations, in addition to percentages. |
|
2018 | 2039 | Only used by the ``hotpath`` format. |
|
2019 | 2040 | (default: true) |
|
2020 | 2041 | |
|
2021 | 2042 | ``progress`` |
|
2022 | 2043 | ------------ |
|
2023 | 2044 | |
|
2024 | 2045 | Mercurial commands can draw progress bars that are as informative as |
|
2025 | 2046 | possible. Some progress bars only offer indeterminate information, while others |
|
2026 | 2047 | have a definite end point. |
|
2027 | 2048 | |
|
2028 | 2049 | ``debug`` |
|
2029 | 2050 | Whether to print debug info when updating the progress bar. (default: False) |
|
2030 | 2051 | |
|
2031 | 2052 | ``delay`` |
|
2032 | 2053 | Number of seconds (float) before showing the progress bar. (default: 3) |
|
2033 | 2054 | |
|
2034 | 2055 | ``changedelay`` |
|
2035 | 2056 | Minimum delay before showing a new topic. When set to less than 3 * refresh, |
|
2036 | 2057 | that value will be used instead. (default: 1) |
|
2037 | 2058 | |
|
2038 | 2059 | ``estimateinterval`` |
|
2039 | 2060 | Maximum sampling interval in seconds for speed and estimated time |
|
2040 | 2061 | calculation. (default: 60) |
|
2041 | 2062 | |
|
2042 | 2063 | ``refresh`` |
|
2043 | 2064 | Time in seconds between refreshes of the progress bar. (default: 0.1) |
|
2044 | 2065 | |
|
2045 | 2066 | ``format`` |
|
2046 | 2067 | Format of the progress bar. |
|
2047 | 2068 | |
|
2048 | 2069 | Valid entries for the format field are ``topic``, ``bar``, ``number``, |
|
2049 | 2070 | ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the |
|
2050 | 2071 | last 20 characters of the item, but this can be changed by adding either |
|
2051 | 2072 | ``-<num>`` which would take the last num characters, or ``+<num>`` for the |
|
2052 | 2073 | first num characters. |
|
2053 | 2074 | |
|
2054 | 2075 | (default: topic bar number estimate) |
|
2055 | 2076 | |
|
2056 | 2077 | ``width`` |
|
2057 | 2078 | If set, the maximum width of the progress information (that is, min(width, |
|
2058 | 2079 | term width) will be used). |
|
2059 | 2080 | |
|
2060 | 2081 | ``clear-complete`` |
|
2061 | 2082 | Clear the progress bar after it's done. (default: True) |
|
2062 | 2083 | |
|
2063 | 2084 | ``disable`` |
|
2064 | 2085 | If true, don't show a progress bar. |
|
2065 | 2086 | |
|
2066 | 2087 | ``assume-tty`` |
|
2067 | 2088 | If true, ALWAYS show a progress bar, unless disable is given. |
|
2068 | 2089 | |
|
2069 | 2090 | ``rebase`` |
|
2070 | 2091 | ---------- |
|
2071 | 2092 | |
|
2072 | 2093 | ``evolution.allowdivergence`` |
|
2073 | 2094 | Default to False, when True allow creating divergence when performing |
|
2074 | 2095 | rebase of obsolete changesets. |
|
2075 | 2096 | |
|
2076 | 2097 | ``revsetalias`` |
|
2077 | 2098 | --------------- |
|
2078 | 2099 | |
|
2079 | 2100 | Alias definitions for revsets. See :hg:`help revsets` for details. |
|
2080 | 2101 | |
|
2081 | 2102 | ``rewrite`` |
|
2082 | 2103 | ----------- |
|
2083 | 2104 | |
|
2084 | 2105 | ``backup-bundle`` |
|
2085 | 2106 | Whether to save stripped changesets to a bundle file. (default: True) |
|
2086 | 2107 | |
|
2087 | 2108 | ``update-timestamp`` |
|
2088 | 2109 | If true, updates the date and time of the changeset to current. It is only |
|
2089 | 2110 | applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the |
|
2090 | 2111 | current version. |
|
2091 | 2112 | |
|
2092 | 2113 | ``empty-successor`` |
|
2093 | 2114 | |
|
2094 | 2115 | Control what happens with empty successors that are the result of rewrite |
|
2095 | 2116 | operations. If set to ``skip``, the successor is not created. If set to |
|
2096 | 2117 | ``keep``, the empty successor is created and kept. |
|
2097 | 2118 | |
|
2098 | 2119 | Currently, only the rebase and absorb commands consider this configuration. |
|
2099 | 2120 | (EXPERIMENTAL) |
|
2100 | 2121 | |
|
2101 | 2122 | ``share`` |
|
2102 | 2123 | --------- |
|
2103 | 2124 | |
|
2104 | 2125 | ``safe-mismatch.source-safe`` |
|
2105 | 2126 | Controls what happens when the shared repository does not use the |
|
2106 | 2127 | share-safe mechanism but its source repository does. |
|
2107 | 2128 | |
|
2108 | 2129 | Possible values are `abort` (default), `allow`, `upgrade-abort` and |
|
2109 | 2130 | `upgrade-allow`. |
|
2110 | 2131 | |
|
2111 | 2132 | ``abort`` |
|
2112 | 2133 | Disallows running any command and aborts |
|
2113 | 2134 | ``allow`` |
|
2114 | 2135 | Respects the feature presence in the share source |
|
2115 | 2136 | ``upgrade-abort`` |
|
2116 | 2137 | tries to upgrade the share to use share-safe; if it fails, aborts |
|
2117 | 2138 | ``upgrade-allow`` |
|
2118 | 2139 | tries to upgrade the share; if it fails, continue by |
|
2119 | 2140 | respecting the share source setting |
|
2120 | 2141 | |
|
2121 | 2142 | Check :hg:`help config.format.use-share-safe` for details about the |
|
2122 | 2143 | share-safe feature. |
|
2123 | 2144 | |
|
2124 | 2145 | ``safe-mismatch.source-safe.warn`` |
|
2125 | 2146 | Shows a warning on operations if the shared repository does not use |
|
2126 | 2147 | share-safe, but the source repository does. |
|
2127 | 2148 | (default: True) |
|
2128 | 2149 | |
|
2129 | 2150 | ``safe-mismatch.source-not-safe`` |
|
2130 | 2151 | Controls what happens when the shared repository uses the share-safe |
|
2131 | 2152 | mechanism but its source does not. |
|
2132 | 2153 | |
|
2133 | 2154 | Possible values are `abort` (default), `allow`, `downgrade-abort` and |
|
2134 | 2155 | `downgrade-allow`. |
|
2135 | 2156 | |
|
2136 | 2157 | ``abort`` |
|
2137 | 2158 | Disallows running any command and aborts |
|
2138 | 2159 | ``allow`` |
|
2139 | 2160 | Respects the feature presence in the share source |
|
2140 | 2161 | ``downgrade-abort`` |
|
2141 | 2162 | tries to downgrade the share to not use share-safe; if it fails, aborts |
|
2142 | 2163 | ``downgrade-allow`` |
|
2143 | 2164 | tries to downgrade the share to not use share-safe; |
|
2144 | 2165 | if it fails, continue by respecting the shared source setting |
|
2145 | 2166 | |
|
2146 | 2167 | Check :hg:`help config.format.use-share-safe` for details about the |
|
2147 | 2168 | share-safe feature. |
|
2148 | 2169 | |
|
2149 | 2170 | ``safe-mismatch.source-not-safe.warn`` |
|
2150 | 2171 | Shows a warning on operations if the shared repository uses share-safe, |
|
2151 | 2172 | but the source repository does not. |
|
2152 | 2173 | (default: True) |
|
2153 | 2174 | |
|
2154 | 2175 | ``storage`` |
|
2155 | 2176 | ----------- |
|
2156 | 2177 | |
|
2157 | 2178 | Control the strategy Mercurial uses internally to store history. Options in this |
|
2158 | 2179 | category impact performance and repository size. |
|
2159 | 2180 | |
|
2160 | 2181 | ``revlog.issue6528.fix-incoming`` |
|
2161 | 2182 | Version 5.8 of Mercurial had a bug leading to altering the parent of file |
|
2162 | 2183 | revision with copy information (or any other metadata) on exchange. This |
|
2163 | 2184 | leads to the copy metadata to be overlooked by various internal logic. The |
|
2164 | 2185 | issue was fixed in Mercurial 5.8.1. |
|
2165 | 2186 | (See https://bz.mercurial-scm.org/show_bug.cgi?id=6528 for details) |
|
2166 | 2187 | |
|
2167 | 2188 | As a result Mercurial is now checking and fixing incoming file revisions to |
|
2168 | 2189 | make sure there parents are in the right order. This behavior can be |
|
2169 | 2190 | disabled by setting this option to `no`. This apply to revisions added |
|
2170 | 2191 | through push, pull, clone and unbundle. |
|
2171 | 2192 | |
|
2172 | 2193 | To fix affected revisions that already exist within the repository, one can |
|
2173 | 2194 | use :hg:`debug-repair-issue-6528`. |
|
2174 | 2195 | |
|
2175 | 2196 | ``revlog.optimize-delta-parent-choice`` |
|
2176 | 2197 | When storing a merge revision, both parents will be equally considered as |
|
2177 | 2198 | a possible delta base. This results in better delta selection and improved |
|
2178 | 2199 | revlog compression. This option is enabled by default. |
|
2179 | 2200 | |
|
2180 | 2201 | Turning this option off can result in large increase of repository size for |
|
2181 | 2202 | repository with many merges. |
|
2182 | 2203 | |
|
2183 | 2204 | ``revlog.persistent-nodemap.mmap`` |
|
2184 | 2205 | Whether to use the Operating System "memory mapping" feature (when |
|
2185 | 2206 | possible) to access the persistent nodemap data. This improve performance |
|
2186 | 2207 | and reduce memory pressure. |
|
2187 | 2208 | |
|
2188 | 2209 | Default to True. |
|
2189 | 2210 | |
|
2190 | 2211 | For details on the "persistent-nodemap" feature, see: |
|
2191 | 2212 | :hg:`help config.format.use-persistent-nodemap`. |
|
2192 | 2213 | |
|
2193 | 2214 | ``revlog.persistent-nodemap.slow-path`` |
|
2194 | 2215 | Control the behavior of Merucrial when using a repository with "persistent" |
|
2195 | 2216 | nodemap with an installation of Mercurial without a fast implementation for |
|
2196 | 2217 | the feature: |
|
2197 | 2218 | |
|
2198 | 2219 | ``allow``: Silently use the slower implementation to access the repository. |
|
2199 | 2220 | ``warn``: Warn, but use the slower implementation to access the repository. |
|
2200 | 2221 | ``abort``: Prevent access to such repositories. (This is the default) |
|
2201 | 2222 | |
|
2202 | 2223 | For details on the "persistent-nodemap" feature, see: |
|
2203 | 2224 | :hg:`help config.format.use-persistent-nodemap`. |
|
2204 | 2225 | |
|
2205 | 2226 | ``revlog.reuse-external-delta-parent`` |
|
2206 | 2227 | Control the order in which delta parents are considered when adding new |
|
2207 | 2228 | revisions from an external source. |
|
2208 | 2229 | (typically: apply bundle from `hg pull` or `hg push`). |
|
2209 | 2230 | |
|
2210 | 2231 | New revisions are usually provided as a delta against other revisions. By |
|
2211 | 2232 | default, Mercurial will try to reuse this delta first, therefore using the |
|
2212 | 2233 | same "delta parent" as the source. Directly using delta's from the source |
|
2213 | 2234 | reduces CPU usage and usually speeds up operation. However, in some case, |
|
2214 | 2235 | the source might have sub-optimal delta bases and forcing their reevaluation |
|
2215 | 2236 | is useful. For example, pushes from an old client could have sub-optimal |
|
2216 | 2237 | delta's parent that the server want to optimize. (lack of general delta, bad |
|
2217 | 2238 | parents, choice, lack of sparse-revlog, etc). |
|
2218 | 2239 | |
|
2219 | 2240 | This option is enabled by default. Turning it off will ensure bad delta |
|
2220 | 2241 | parent choices from older client do not propagate to this repository, at |
|
2221 | 2242 | the cost of a small increase in CPU consumption. |
|
2222 | 2243 | |
|
2223 | 2244 | Note: this option only control the order in which delta parents are |
|
2224 | 2245 | considered. Even when disabled, the existing delta from the source will be |
|
2225 | 2246 | reused if the same delta parent is selected. |
|
2226 | 2247 | |
|
2227 | 2248 | ``revlog.reuse-external-delta`` |
|
2228 | 2249 | Control the reuse of delta from external source. |
|
2229 | 2250 | (typically: apply bundle from `hg pull` or `hg push`). |
|
2230 | 2251 | |
|
2231 | 2252 | New revisions are usually provided as a delta against another revision. By |
|
2232 | 2253 | default, Mercurial will not recompute the same delta again, trusting |
|
2233 | 2254 | externally provided deltas. There have been rare cases of small adjustment |
|
2234 | 2255 | to the diffing algorithm in the past. So in some rare case, recomputing |
|
2235 | 2256 | delta provided by ancient clients can provides better results. Disabling |
|
2236 | 2257 | this option means going through a full delta recomputation for all incoming |
|
2237 | 2258 | revisions. It means a large increase in CPU usage and will slow operations |
|
2238 | 2259 | down. |
|
2239 | 2260 | |
|
2240 | 2261 | This option is enabled by default. When disabled, it also disables the |
|
2241 | 2262 | related ``storage.revlog.reuse-external-delta-parent`` option. |
|
2242 | 2263 | |
|
2243 | 2264 | ``revlog.zlib.level`` |
|
2244 | 2265 | Zlib compression level used when storing data into the repository. Accepted |
|
2245 | 2266 | Value range from 1 (lowest compression) to 9 (highest compression). Zlib |
|
2246 | 2267 | default value is 6. |
|
2247 | 2268 | |
|
2248 | 2269 | |
|
2249 | 2270 | ``revlog.zstd.level`` |
|
2250 | 2271 | zstd compression level used when storing data into the repository. Accepted |
|
2251 | 2272 | Value range from 1 (lowest compression) to 22 (highest compression). |
|
2252 | 2273 | (default 3) |
|
2253 | 2274 | |
|
2254 | 2275 | ``server`` |
|
2255 | 2276 | ---------- |
|
2256 | 2277 | |
|
2257 | 2278 | Controls generic server settings. |
|
2258 | 2279 | |
|
2259 | 2280 | ``bookmarks-pushkey-compat`` |
|
2260 | 2281 | Trigger pushkey hook when being pushed bookmark updates. This config exist |
|
2261 | 2282 | for compatibility purpose (default to True) |
|
2262 | 2283 | |
|
2263 | 2284 | If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark |
|
2264 | 2285 | movement we recommend you migrate them to ``txnclose-bookmark`` and |
|
2265 | 2286 | ``pretxnclose-bookmark``. |
|
2266 | 2287 | |
|
2267 | 2288 | ``compressionengines`` |
|
2268 | 2289 | List of compression engines and their relative priority to advertise |
|
2269 | 2290 | to clients. |
|
2270 | 2291 | |
|
2271 | 2292 | The order of compression engines determines their priority, the first |
|
2272 | 2293 | having the highest priority. If a compression engine is not listed |
|
2273 | 2294 | here, it won't be advertised to clients. |
|
2274 | 2295 | |
|
2275 | 2296 | If not set (the default), built-in defaults are used. Run |
|
2276 | 2297 | :hg:`debuginstall` to list available compression engines and their |
|
2277 | 2298 | default wire protocol priority. |
|
2278 | 2299 | |
|
2279 | 2300 | Older Mercurial clients only support zlib compression and this setting |
|
2280 | 2301 | has no effect for legacy clients. |
|
2281 | 2302 | |
|
2282 | 2303 | ``uncompressed`` |
|
2283 | 2304 | Whether to allow clients to clone a repository using the |
|
2284 | 2305 | uncompressed streaming protocol. This transfers about 40% more |
|
2285 | 2306 | data than a regular clone, but uses less memory and CPU on both |
|
2286 | 2307 | server and client. Over a LAN (100 Mbps or better) or a very fast |
|
2287 | 2308 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a |
|
2288 | 2309 | regular clone. Over most WAN connections (anything slower than |
|
2289 | 2310 | about 6 Mbps), uncompressed streaming is slower, because of the |
|
2290 | 2311 | extra data transfer overhead. This mode will also temporarily hold |
|
2291 | 2312 | the write lock while determining what data to transfer. |
|
2292 | 2313 | (default: True) |
|
2293 | 2314 | |
|
2294 | 2315 | ``uncompressedallowsecret`` |
|
2295 | 2316 | Whether to allow stream clones when the repository contains secret |
|
2296 | 2317 | changesets. (default: False) |
|
2297 | 2318 | |
|
2298 | 2319 | ``preferuncompressed`` |
|
2299 | 2320 | When set, clients will try to use the uncompressed streaming |
|
2300 | 2321 | protocol. (default: False) |
|
2301 | 2322 | |
|
2302 | 2323 | ``disablefullbundle`` |
|
2303 | 2324 | When set, servers will refuse attempts to do pull-based clones. |
|
2304 | 2325 | If this option is set, ``preferuncompressed`` and/or clone bundles |
|
2305 | 2326 | are highly recommended. Partial clones will still be allowed. |
|
2306 | 2327 | (default: False) |
|
2307 | 2328 | |
|
2308 | 2329 | ``streamunbundle`` |
|
2309 | 2330 | When set, servers will apply data sent from the client directly, |
|
2310 | 2331 | otherwise it will be written to a temporary file first. This option |
|
2311 | 2332 | effectively prevents concurrent pushes. |
|
2312 | 2333 | |
|
2313 | 2334 | ``pullbundle`` |
|
2314 | 2335 | When set, the server will check pullbundles.manifest for bundles |
|
2315 | 2336 | covering the requested heads and common nodes. The first matching |
|
2316 | 2337 | entry will be streamed to the client. |
|
2317 | 2338 | |
|
2318 | 2339 | For HTTP transport, the stream will still use zlib compression |
|
2319 | 2340 | for older clients. |
|
2320 | 2341 | |
|
2321 | 2342 | ``concurrent-push-mode`` |
|
2322 | 2343 | Level of allowed race condition between two pushing clients. |
|
2323 | 2344 | |
|
2324 | 2345 | - 'strict': push is abort if another client touched the repository |
|
2325 | 2346 | while the push was preparing. |
|
2326 | 2347 | - 'check-related': push is only aborted if it affects head that got also |
|
2327 | 2348 | affected while the push was preparing. (default since 5.4) |
|
2328 | 2349 | |
|
2329 | 2350 | 'check-related' only takes effect for compatible clients (version |
|
2330 | 2351 | 4.3 and later). Older clients will use 'strict'. |
|
2331 | 2352 | |
|
2332 | 2353 | ``validate`` |
|
2333 | 2354 | Whether to validate the completeness of pushed changesets by |
|
2334 | 2355 | checking that all new file revisions specified in manifests are |
|
2335 | 2356 | present. (default: False) |
|
2336 | 2357 | |
|
2337 | 2358 | ``maxhttpheaderlen`` |
|
2338 | 2359 | Instruct HTTP clients not to send request headers longer than this |
|
2339 | 2360 | many bytes. (default: 1024) |
|
2340 | 2361 | |
|
2341 | 2362 | ``bundle1`` |
|
2342 | 2363 | Whether to allow clients to push and pull using the legacy bundle1 |
|
2343 | 2364 | exchange format. (default: True) |
|
2344 | 2365 | |
|
2345 | 2366 | ``bundle1gd`` |
|
2346 | 2367 | Like ``bundle1`` but only used if the repository is using the |
|
2347 | 2368 | *generaldelta* storage format. (default: True) |
|
2348 | 2369 | |
|
2349 | 2370 | ``bundle1.push`` |
|
2350 | 2371 | Whether to allow clients to push using the legacy bundle1 exchange |
|
2351 | 2372 | format. (default: True) |
|
2352 | 2373 | |
|
2353 | 2374 | ``bundle1gd.push`` |
|
2354 | 2375 | Like ``bundle1.push`` but only used if the repository is using the |
|
2355 | 2376 | *generaldelta* storage format. (default: True) |
|
2356 | 2377 | |
|
2357 | 2378 | ``bundle1.pull`` |
|
2358 | 2379 | Whether to allow clients to pull using the legacy bundle1 exchange |
|
2359 | 2380 | format. (default: True) |
|
2360 | 2381 | |
|
2361 | 2382 | ``bundle1gd.pull`` |
|
2362 | 2383 | Like ``bundle1.pull`` but only used if the repository is using the |
|
2363 | 2384 | *generaldelta* storage format. (default: True) |
|
2364 | 2385 | |
|
2365 | 2386 | Large repositories using the *generaldelta* storage format should |
|
2366 | 2387 | consider setting this option because converting *generaldelta* |
|
2367 | 2388 | repositories to the exchange format required by the bundle1 data |
|
2368 | 2389 | format can consume a lot of CPU. |
|
2369 | 2390 | |
|
2370 | 2391 | ``bundle2.stream`` |
|
2371 | 2392 | Whether to allow clients to pull using the bundle2 streaming protocol. |
|
2372 | 2393 | (default: True) |
|
2373 | 2394 | |
|
2374 | 2395 | ``zliblevel`` |
|
2375 | 2396 | Integer between ``-1`` and ``9`` that controls the zlib compression level |
|
2376 | 2397 | for wire protocol commands that send zlib compressed output (notably the |
|
2377 | 2398 | commands that send repository history data). |
|
2378 | 2399 | |
|
2379 | 2400 | The default (``-1``) uses the default zlib compression level, which is |
|
2380 | 2401 | likely equivalent to ``6``. ``0`` means no compression. ``9`` means |
|
2381 | 2402 | maximum compression. |
|
2382 | 2403 | |
|
2383 | 2404 | Setting this option allows server operators to make trade-offs between |
|
2384 | 2405 | bandwidth and CPU used. Lowering the compression lowers CPU utilization |
|
2385 | 2406 | but sends more bytes to clients. |
|
2386 | 2407 | |
|
2387 | 2408 | This option only impacts the HTTP server. |
|
2388 | 2409 | |
|
2389 | 2410 | ``zstdlevel`` |
|
2390 | 2411 | Integer between ``1`` and ``22`` that controls the zstd compression level |
|
2391 | 2412 | for wire protocol commands. ``1`` is the minimal amount of compression and |
|
2392 | 2413 | ``22`` is the highest amount of compression. |
|
2393 | 2414 | |
|
2394 | 2415 | The default (``3``) should be significantly faster than zlib while likely |
|
2395 | 2416 | delivering better compression ratios. |
|
2396 | 2417 | |
|
2397 | 2418 | This option only impacts the HTTP server. |
|
2398 | 2419 | |
|
2399 | 2420 | See also ``server.zliblevel``. |
|
2400 | 2421 | |
|
2401 | 2422 | ``view`` |
|
2402 | 2423 | Repository filter used when exchanging revisions with the peer. |
|
2403 | 2424 | |
|
2404 | 2425 | The default view (``served``) excludes secret and hidden changesets. |
|
2405 | 2426 | Another useful value is ``immutable`` (no draft, secret or hidden |
|
2406 | 2427 | changesets). (EXPERIMENTAL) |
|
2407 | 2428 | |
|
2408 | 2429 | ``smtp`` |
|
2409 | 2430 | -------- |
|
2410 | 2431 | |
|
2411 | 2432 | Configuration for extensions that need to send email messages. |
|
2412 | 2433 | |
|
2413 | 2434 | ``host`` |
|
2414 | 2435 | Host name of mail server, e.g. "mail.example.com". |
|
2415 | 2436 | |
|
2416 | 2437 | ``port`` |
|
2417 | 2438 | Optional. Port to connect to on mail server. (default: 465 if |
|
2418 | 2439 | ``tls`` is smtps; 25 otherwise) |
|
2419 | 2440 | |
|
2420 | 2441 | ``tls`` |
|
2421 | 2442 | Optional. Method to enable TLS when connecting to mail server: starttls, |
|
2422 | 2443 | smtps or none. (default: none) |
|
2423 | 2444 | |
|
2424 | 2445 | ``username`` |
|
2425 | 2446 | Optional. User name for authenticating with the SMTP server. |
|
2426 | 2447 | (default: None) |
|
2427 | 2448 | |
|
2428 | 2449 | ``password`` |
|
2429 | 2450 | Optional. Password for authenticating with the SMTP server. If not |
|
2430 | 2451 | specified, interactive sessions will prompt the user for a |
|
2431 | 2452 | password; non-interactive sessions will fail. (default: None) |
|
2432 | 2453 | |
|
2433 | 2454 | ``local_hostname`` |
|
2434 | 2455 | Optional. The hostname that the sender can use to identify |
|
2435 | 2456 | itself to the MTA. |
|
2436 | 2457 | |
|
2437 | 2458 | |
|
2438 | 2459 | ``subpaths`` |
|
2439 | 2460 | ------------ |
|
2440 | 2461 | |
|
2441 | 2462 | Subrepository source URLs can go stale if a remote server changes name |
|
2442 | 2463 | or becomes temporarily unavailable. This section lets you define |
|
2443 | 2464 | rewrite rules of the form:: |
|
2444 | 2465 | |
|
2445 | 2466 | <pattern> = <replacement> |
|
2446 | 2467 | |
|
2447 | 2468 | where ``pattern`` is a regular expression matching a subrepository |
|
2448 | 2469 | source URL and ``replacement`` is the replacement string used to |
|
2449 | 2470 | rewrite it. Groups can be matched in ``pattern`` and referenced in |
|
2450 | 2471 | ``replacements``. For instance:: |
|
2451 | 2472 | |
|
2452 | 2473 | http://server/(.*)-hg/ = http://hg.server/\1/ |
|
2453 | 2474 | |
|
2454 | 2475 | rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``. |
|
2455 | 2476 | |
|
2456 | 2477 | Relative subrepository paths are first made absolute, and the |
|
2457 | 2478 | rewrite rules are then applied on the full (absolute) path. If ``pattern`` |
|
2458 | 2479 | doesn't match the full path, an attempt is made to apply it on the |
|
2459 | 2480 | relative path alone. The rules are applied in definition order. |
|
2460 | 2481 | |
|
2461 | 2482 | ``subrepos`` |
|
2462 | 2483 | ------------ |
|
2463 | 2484 | |
|
2464 | 2485 | This section contains options that control the behavior of the |
|
2465 | 2486 | subrepositories feature. See also :hg:`help subrepos`. |
|
2466 | 2487 | |
|
2467 | 2488 | Security note: auditing in Mercurial is known to be insufficient to |
|
2468 | 2489 | prevent clone-time code execution with carefully constructed Git |
|
2469 | 2490 | subrepos. It is unknown if a similar detect is present in Subversion |
|
2470 | 2491 | subrepos. Both Git and Subversion subrepos are disabled by default |
|
2471 | 2492 | out of security concerns. These subrepo types can be enabled using |
|
2472 | 2493 | the respective options below. |
|
2473 | 2494 | |
|
2474 | 2495 | ``allowed`` |
|
2475 | 2496 | Whether subrepositories are allowed in the working directory. |
|
2476 | 2497 | |
|
2477 | 2498 | When false, commands involving subrepositories (like :hg:`update`) |
|
2478 | 2499 | will fail for all subrepository types. |
|
2479 | 2500 | (default: true) |
|
2480 | 2501 | |
|
2481 | 2502 | ``hg:allowed`` |
|
2482 | 2503 | Whether Mercurial subrepositories are allowed in the working |
|
2483 | 2504 | directory. This option only has an effect if ``subrepos.allowed`` |
|
2484 | 2505 | is true. |
|
2485 | 2506 | (default: true) |
|
2486 | 2507 | |
|
2487 | 2508 | ``git:allowed`` |
|
2488 | 2509 | Whether Git subrepositories are allowed in the working directory. |
|
2489 | 2510 | This option only has an effect if ``subrepos.allowed`` is true. |
|
2490 | 2511 | |
|
2491 | 2512 | See the security note above before enabling Git subrepos. |
|
2492 | 2513 | (default: false) |
|
2493 | 2514 | |
|
2494 | 2515 | ``svn:allowed`` |
|
2495 | 2516 | Whether Subversion subrepositories are allowed in the working |
|
2496 | 2517 | directory. This option only has an effect if ``subrepos.allowed`` |
|
2497 | 2518 | is true. |
|
2498 | 2519 | |
|
2499 | 2520 | See the security note above before enabling Subversion subrepos. |
|
2500 | 2521 | (default: false) |
|
2501 | 2522 | |
|
2502 | 2523 | ``templatealias`` |
|
2503 | 2524 | ----------------- |
|
2504 | 2525 | |
|
2505 | 2526 | Alias definitions for templates. See :hg:`help templates` for details. |
|
2506 | 2527 | |
|
2507 | 2528 | ``templates`` |
|
2508 | 2529 | ------------- |
|
2509 | 2530 | |
|
2510 | 2531 | Use the ``[templates]`` section to define template strings. |
|
2511 | 2532 | See :hg:`help templates` for details. |
|
2512 | 2533 | |
|
2513 | 2534 | ``trusted`` |
|
2514 | 2535 | ----------- |
|
2515 | 2536 | |
|
2516 | 2537 | Mercurial will not use the settings in the |
|
2517 | 2538 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted |
|
2518 | 2539 | user or to a trusted group, as various hgrc features allow arbitrary |
|
2519 | 2540 | commands to be run. This issue is often encountered when configuring |
|
2520 | 2541 | hooks or extensions for shared repositories or servers. However, |
|
2521 | 2542 | the web interface will use some safe settings from the ``[web]`` |
|
2522 | 2543 | section. |
|
2523 | 2544 | |
|
2524 | 2545 | This section specifies what users and groups are trusted. The |
|
2525 | 2546 | current user is always trusted. To trust everybody, list a user or a |
|
2526 | 2547 | group with name ``*``. These settings must be placed in an |
|
2527 | 2548 | *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the |
|
2528 | 2549 | user or service running Mercurial. |
|
2529 | 2550 | |
|
2530 | 2551 | ``users`` |
|
2531 | 2552 | Comma-separated list of trusted users. |
|
2532 | 2553 | |
|
2533 | 2554 | ``groups`` |
|
2534 | 2555 | Comma-separated list of trusted groups. |
|
2535 | 2556 | |
|
2536 | 2557 | |
|
2537 | 2558 | ``ui`` |
|
2538 | 2559 | ------ |
|
2539 | 2560 | |
|
2540 | 2561 | User interface controls. |
|
2541 | 2562 | |
|
2542 | 2563 | ``archivemeta`` |
|
2543 | 2564 | Whether to include the .hg_archival.txt file containing meta data |
|
2544 | 2565 | (hashes for the repository base and for tip) in archives created |
|
2545 | 2566 | by the :hg:`archive` command or downloaded via hgweb. |
|
2546 | 2567 | (default: True) |
|
2547 | 2568 | |
|
2548 | 2569 | ``askusername`` |
|
2549 | 2570 | Whether to prompt for a username when committing. If True, and |
|
2550 | 2571 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will |
|
2551 | 2572 | be prompted to enter a username. If no username is entered, the |
|
2552 | 2573 | default ``USER@HOST`` is used instead. |
|
2553 | 2574 | (default: False) |
|
2554 | 2575 | |
|
2555 | 2576 | ``clonebundles`` |
|
2556 | 2577 | Whether the "clone bundles" feature is enabled. |
|
2557 | 2578 | |
|
2558 | 2579 | When enabled, :hg:`clone` may download and apply a server-advertised |
|
2559 | 2580 | bundle file from a URL instead of using the normal exchange mechanism. |
|
2560 | 2581 | |
|
2561 | 2582 | This can likely result in faster and more reliable clones. |
|
2562 | 2583 | |
|
2563 | 2584 | (default: True) |
|
2564 | 2585 | |
|
2565 | 2586 | ``clonebundlefallback`` |
|
2566 | 2587 | Whether failure to apply an advertised "clone bundle" from a server |
|
2567 | 2588 | should result in fallback to a regular clone. |
|
2568 | 2589 | |
|
2569 | 2590 | This is disabled by default because servers advertising "clone |
|
2570 | 2591 | bundles" often do so to reduce server load. If advertised bundles |
|
2571 | 2592 | start mass failing and clients automatically fall back to a regular |
|
2572 | 2593 | clone, this would add significant and unexpected load to the server |
|
2573 | 2594 | since the server is expecting clone operations to be offloaded to |
|
2574 | 2595 | pre-generated bundles. Failing fast (the default behavior) ensures |
|
2575 | 2596 | clients don't overwhelm the server when "clone bundle" application |
|
2576 | 2597 | fails. |
|
2577 | 2598 | |
|
2578 | 2599 | (default: False) |
|
2579 | 2600 | |
|
2580 | 2601 | ``clonebundleprefers`` |
|
2581 | 2602 | Defines preferences for which "clone bundles" to use. |
|
2582 | 2603 | |
|
2583 | 2604 | Servers advertising "clone bundles" may advertise multiple available |
|
2584 | 2605 | bundles. Each bundle may have different attributes, such as the bundle |
|
2585 | 2606 | type and compression format. This option is used to prefer a particular |
|
2586 | 2607 | bundle over another. |
|
2587 | 2608 | |
|
2588 | 2609 | The following keys are defined by Mercurial: |
|
2589 | 2610 | |
|
2590 | 2611 | BUNDLESPEC |
|
2591 | 2612 | A bundle type specifier. These are strings passed to :hg:`bundle -t`. |
|
2592 | 2613 | e.g. ``gzip-v2`` or ``bzip2-v1``. |
|
2593 | 2614 | |
|
2594 | 2615 | COMPRESSION |
|
2595 | 2616 | The compression format of the bundle. e.g. ``gzip`` and ``bzip2``. |
|
2596 | 2617 | |
|
2597 | 2618 | Server operators may define custom keys. |
|
2598 | 2619 | |
|
2599 | 2620 | Example values: ``COMPRESSION=bzip2``, |
|
2600 | 2621 | ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``. |
|
2601 | 2622 | |
|
2602 | 2623 | By default, the first bundle advertised by the server is used. |
|
2603 | 2624 | |
|
2604 | 2625 | ``color`` |
|
2605 | 2626 | When to colorize output. Possible value are Boolean ("yes" or "no"), or |
|
2606 | 2627 | "debug", or "always". (default: "yes"). "yes" will use color whenever it |
|
2607 | 2628 | seems possible. See :hg:`help color` for details. |
|
2608 | 2629 | |
|
2609 | 2630 | ``commitsubrepos`` |
|
2610 | 2631 | Whether to commit modified subrepositories when committing the |
|
2611 | 2632 | parent repository. If False and one subrepository has uncommitted |
|
2612 | 2633 | changes, abort the commit. |
|
2613 | 2634 | (default: False) |
|
2614 | 2635 | |
|
2615 | 2636 | ``debug`` |
|
2616 | 2637 | Print debugging information. (default: False) |
|
2617 | 2638 | |
|
2618 | 2639 | ``editor`` |
|
2619 | 2640 | The editor to use during a commit. (default: ``$EDITOR`` or ``vi``) |
|
2620 | 2641 | |
|
2621 | 2642 | ``fallbackencoding`` |
|
2622 | 2643 | Encoding to try if it's not possible to decode the changelog using |
|
2623 | 2644 | UTF-8. (default: ISO-8859-1) |
|
2624 | 2645 | |
|
2625 | 2646 | ``graphnodetemplate`` |
|
2626 | 2647 | (DEPRECATED) Use ``command-templates.graphnode`` instead. |
|
2627 | 2648 | |
|
2628 | 2649 | ``ignore`` |
|
2629 | 2650 | A file to read per-user ignore patterns from. This file should be |
|
2630 | 2651 | in the same format as a repository-wide .hgignore file. Filenames |
|
2631 | 2652 | are relative to the repository root. This option supports hook syntax, |
|
2632 | 2653 | so if you want to specify multiple ignore files, you can do so by |
|
2633 | 2654 | setting something like ``ignore.other = ~/.hgignore2``. For details |
|
2634 | 2655 | of the ignore file format, see the ``hgignore(5)`` man page. |
|
2635 | 2656 | |
|
2636 | 2657 | ``interactive`` |
|
2637 | 2658 | Allow to prompt the user. (default: True) |
|
2638 | 2659 | |
|
2639 | 2660 | ``interface`` |
|
2640 | 2661 | Select the default interface for interactive features (default: text). |
|
2641 | 2662 | Possible values are 'text' and 'curses'. |
|
2642 | 2663 | |
|
2643 | 2664 | ``interface.chunkselector`` |
|
2644 | 2665 | Select the interface for change recording (e.g. :hg:`commit -i`). |
|
2645 | 2666 | Possible values are 'text' and 'curses'. |
|
2646 | 2667 | This config overrides the interface specified by ui.interface. |
|
2647 | 2668 | |
|
2648 | 2669 | ``large-file-limit`` |
|
2649 | 2670 | Largest file size that gives no memory use warning. |
|
2650 | 2671 | Possible values are integers or 0 to disable the check. |
|
2651 | 2672 | Value is expressed in bytes by default, one can use standard units for |
|
2652 | 2673 | convenience (e.g. 10MB, 0.1GB, etc) (default: 10MB) |
|
2653 | 2674 | |
|
2654 | 2675 | ``logtemplate`` |
|
2655 | 2676 | (DEPRECATED) Use ``command-templates.log`` instead. |
|
2656 | 2677 | |
|
2657 | 2678 | ``merge`` |
|
2658 | 2679 | The conflict resolution program to use during a manual merge. |
|
2659 | 2680 | For more information on merge tools see :hg:`help merge-tools`. |
|
2660 | 2681 | For configuring merge tools see the ``[merge-tools]`` section. |
|
2661 | 2682 | |
|
2662 | 2683 | ``mergemarkers`` |
|
2663 | 2684 | Sets the merge conflict marker label styling. The ``detailed`` style |
|
2664 | 2685 | uses the ``command-templates.mergemarker`` setting to style the labels. |
|
2665 | 2686 | The ``basic`` style just uses 'local' and 'other' as the marker label. |
|
2666 | 2687 | One of ``basic`` or ``detailed``. |
|
2667 | 2688 | (default: ``basic``) |
|
2668 | 2689 | |
|
2669 | 2690 | ``mergemarkertemplate`` |
|
2670 | 2691 | (DEPRECATED) Use ``command-templates.mergemarker`` instead. |
|
2671 | 2692 | |
|
2672 | 2693 | ``message-output`` |
|
2673 | 2694 | Where to write status and error messages. (default: ``stdio``) |
|
2674 | 2695 | |
|
2675 | 2696 | ``channel`` |
|
2676 | 2697 | Use separate channel for structured output. (Command-server only) |
|
2677 | 2698 | ``stderr`` |
|
2678 | 2699 | Everything to stderr. |
|
2679 | 2700 | ``stdio`` |
|
2680 | 2701 | Status to stdout, and error to stderr. |
|
2681 | 2702 | |
|
2682 | 2703 | ``origbackuppath`` |
|
2683 | 2704 | The path to a directory used to store generated .orig files. If the path is |
|
2684 | 2705 | not a directory, one will be created. If set, files stored in this |
|
2685 | 2706 | directory have the same name as the original file and do not have a .orig |
|
2686 | 2707 | suffix. |
|
2687 | 2708 | |
|
2688 | 2709 | ``paginate`` |
|
2689 | 2710 | Control the pagination of command output (default: True). See :hg:`help pager` |
|
2690 | 2711 | for details. |
|
2691 | 2712 | |
|
2692 | 2713 | ``patch`` |
|
2693 | 2714 | An optional external tool that ``hg import`` and some extensions |
|
2694 | 2715 | will use for applying patches. By default Mercurial uses an |
|
2695 | 2716 | internal patch utility. The external tool must work as the common |
|
2696 | 2717 | Unix ``patch`` program. In particular, it must accept a ``-p`` |
|
2697 | 2718 | argument to strip patch headers, a ``-d`` argument to specify the |
|
2698 | 2719 | current directory, a file name to patch, and a patch file to take |
|
2699 | 2720 | from stdin. |
|
2700 | 2721 | |
|
2701 | 2722 | It is possible to specify a patch tool together with extra |
|
2702 | 2723 | arguments. For example, setting this option to ``patch --merge`` |
|
2703 | 2724 | will use the ``patch`` program with its 2-way merge option. |
|
2704 | 2725 | |
|
2705 | 2726 | ``portablefilenames`` |
|
2706 | 2727 | Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``. |
|
2707 | 2728 | (default: ``warn``) |
|
2708 | 2729 | |
|
2709 | 2730 | ``warn`` |
|
2710 | 2731 | Print a warning message on POSIX platforms, if a file with a non-portable |
|
2711 | 2732 | filename is added (e.g. a file with a name that can't be created on |
|
2712 | 2733 | Windows because it contains reserved parts like ``AUX``, reserved |
|
2713 | 2734 | characters like ``:``, or would cause a case collision with an existing |
|
2714 | 2735 | file). |
|
2715 | 2736 | |
|
2716 | 2737 | ``ignore`` |
|
2717 | 2738 | Don't print a warning. |
|
2718 | 2739 | |
|
2719 | 2740 | ``abort`` |
|
2720 | 2741 | The command is aborted. |
|
2721 | 2742 | |
|
2722 | 2743 | ``true`` |
|
2723 | 2744 | Alias for ``warn``. |
|
2724 | 2745 | |
|
2725 | 2746 | ``false`` |
|
2726 | 2747 | Alias for ``ignore``. |
|
2727 | 2748 | |
|
2728 | 2749 | .. container:: windows |
|
2729 | 2750 | |
|
2730 | 2751 | On Windows, this configuration option is ignored and the command aborted. |
|
2731 | 2752 | |
|
2732 | 2753 | ``pre-merge-tool-output-template`` |
|
2733 | 2754 | (DEPRECATED) Use ``command-template.pre-merge-tool-output`` instead. |
|
2734 | 2755 | |
|
2735 | 2756 | ``quiet`` |
|
2736 | 2757 | Reduce the amount of output printed. |
|
2737 | 2758 | (default: False) |
|
2738 | 2759 | |
|
2739 | 2760 | ``relative-paths`` |
|
2740 | 2761 | Prefer relative paths in the UI. |
|
2741 | 2762 | |
|
2742 | 2763 | ``remotecmd`` |
|
2743 | 2764 | Remote command to use for clone/push/pull operations. |
|
2744 | 2765 | (default: ``hg``) |
|
2745 | 2766 | |
|
2746 | 2767 | ``report_untrusted`` |
|
2747 | 2768 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a |
|
2748 | 2769 | trusted user or group. |
|
2749 | 2770 | (default: True) |
|
2750 | 2771 | |
|
2751 | 2772 | ``slash`` |
|
2752 | 2773 | (Deprecated. Use ``slashpath`` template filter instead.) |
|
2753 | 2774 | |
|
2754 | 2775 | Display paths using a slash (``/``) as the path separator. This |
|
2755 | 2776 | only makes a difference on systems where the default path |
|
2756 | 2777 | separator is not the slash character (e.g. Windows uses the |
|
2757 | 2778 | backslash character (``\``)). |
|
2758 | 2779 | (default: False) |
|
2759 | 2780 | |
|
2760 | 2781 | ``statuscopies`` |
|
2761 | 2782 | Display copies in the status command. |
|
2762 | 2783 | |
|
2763 | 2784 | ``ssh`` |
|
2764 | 2785 | Command to use for SSH connections. (default: ``ssh``) |
|
2765 | 2786 | |
|
2766 | 2787 | ``ssherrorhint`` |
|
2767 | 2788 | A hint shown to the user in the case of SSH error (e.g. |
|
2768 | 2789 | ``Please see http://company/internalwiki/ssh.html``) |
|
2769 | 2790 | |
|
2770 | 2791 | ``strict`` |
|
2771 | 2792 | Require exact command names, instead of allowing unambiguous |
|
2772 | 2793 | abbreviations. (default: False) |
|
2773 | 2794 | |
|
2774 | 2795 | ``style`` |
|
2775 | 2796 | Name of style to use for command output. |
|
2776 | 2797 | |
|
2777 | 2798 | ``supportcontact`` |
|
2778 | 2799 | A URL where users should report a Mercurial traceback. Use this if you are a |
|
2779 | 2800 | large organisation with its own Mercurial deployment process and crash |
|
2780 | 2801 | reports should be addressed to your internal support. |
|
2781 | 2802 | |
|
2782 | 2803 | ``textwidth`` |
|
2783 | 2804 | Maximum width of help text. A longer line generated by ``hg help`` or |
|
2784 | 2805 | ``hg subcommand --help`` will be broken after white space to get this |
|
2785 | 2806 | width or the terminal width, whichever comes first. |
|
2786 | 2807 | A non-positive value will disable this and the terminal width will be |
|
2787 | 2808 | used. (default: 78) |
|
2788 | 2809 | |
|
2789 | 2810 | ``timeout`` |
|
2790 | 2811 | The timeout used when a lock is held (in seconds), a negative value |
|
2791 | 2812 | means no timeout. (default: 600) |
|
2792 | 2813 | |
|
2793 | 2814 | ``timeout.warn`` |
|
2794 | 2815 | Time (in seconds) before a warning is printed about held lock. A negative |
|
2795 | 2816 | value means no warning. (default: 0) |
|
2796 | 2817 | |
|
2797 | 2818 | ``traceback`` |
|
2798 | 2819 | Mercurial always prints a traceback when an unknown exception |
|
2799 | 2820 | occurs. Setting this to True will make Mercurial print a traceback |
|
2800 | 2821 | on all exceptions, even those recognized by Mercurial (such as |
|
2801 | 2822 | IOError or MemoryError). (default: False) |
|
2802 | 2823 | |
|
2803 | 2824 | ``tweakdefaults`` |
|
2804 | 2825 | |
|
2805 | 2826 | By default Mercurial's behavior changes very little from release |
|
2806 | 2827 | to release, but over time the recommended config settings |
|
2807 | 2828 | shift. Enable this config to opt in to get automatic tweaks to |
|
2808 | 2829 | Mercurial's behavior over time. This config setting will have no |
|
2809 | 2830 | effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does |
|
2810 | 2831 | not include ``tweakdefaults``. (default: False) |
|
2811 | 2832 | |
|
2812 | 2833 | It currently means:: |
|
2813 | 2834 | |
|
2814 | 2835 | .. tweakdefaultsmarker |
|
2815 | 2836 | |
|
2816 | 2837 | ``username`` |
|
2817 | 2838 | The committer of a changeset created when running "commit". |
|
2818 | 2839 | Typically a person's name and email address, e.g. ``Fred Widget |
|
2819 | 2840 | <fred@example.com>``. Environment variables in the |
|
2820 | 2841 | username are expanded. |
|
2821 | 2842 | |
|
2822 | 2843 | (default: ``$EMAIL`` or ``username@hostname``. If the username in |
|
2823 | 2844 | hgrc is empty, e.g. if the system admin set ``username =`` in the |
|
2824 | 2845 | system hgrc, it has to be specified manually or in a different |
|
2825 | 2846 | hgrc file) |
|
2826 | 2847 | |
|
2827 | 2848 | ``verbose`` |
|
2828 | 2849 | Increase the amount of output printed. (default: False) |
|
2829 | 2850 | |
|
2830 | 2851 | |
|
2831 | 2852 | ``command-templates`` |
|
2832 | 2853 | --------------------- |
|
2833 | 2854 | |
|
2834 | 2855 | Templates used for customizing the output of commands. |
|
2835 | 2856 | |
|
2836 | 2857 | ``graphnode`` |
|
2837 | 2858 | The template used to print changeset nodes in an ASCII revision graph. |
|
2838 | 2859 | (default: ``{graphnode}``) |
|
2839 | 2860 | |
|
2840 | 2861 | ``log`` |
|
2841 | 2862 | Template string for commands that print changesets. |
|
2842 | 2863 | |
|
2843 | 2864 | ``mergemarker`` |
|
2844 | 2865 | The template used to print the commit description next to each conflict |
|
2845 | 2866 | marker during merge conflicts. See :hg:`help templates` for the template |
|
2846 | 2867 | format. |
|
2847 | 2868 | |
|
2848 | 2869 | Defaults to showing the hash, tags, branches, bookmarks, author, and |
|
2849 | 2870 | the first line of the commit description. |
|
2850 | 2871 | |
|
2851 | 2872 | If you use non-ASCII characters in names for tags, branches, bookmarks, |
|
2852 | 2873 | authors, and/or commit descriptions, you must pay attention to encodings of |
|
2853 | 2874 | managed files. At template expansion, non-ASCII characters use the encoding |
|
2854 | 2875 | specified by the ``--encoding`` global option, ``HGENCODING`` or other |
|
2855 | 2876 | environment variables that govern your locale. If the encoding of the merge |
|
2856 | 2877 | markers is different from the encoding of the merged files, |
|
2857 | 2878 | serious problems may occur. |
|
2858 | 2879 | |
|
2859 | 2880 | Can be overridden per-merge-tool, see the ``[merge-tools]`` section. |
|
2860 | 2881 | |
|
2861 | 2882 | ``oneline-summary`` |
|
2862 | 2883 | A template used by `hg rebase` and other commands for showing a one-line |
|
2863 | 2884 | summary of a commit. If the template configured here is longer than one |
|
2864 | 2885 | line, then only the first line is used. |
|
2865 | 2886 | |
|
2866 | 2887 | The template can be overridden per command by defining a template in |
|
2867 | 2888 | `oneline-summary.<command>`, where `<command>` can be e.g. "rebase". |
|
2868 | 2889 | |
|
2869 | 2890 | ``pre-merge-tool-output`` |
|
2870 | 2891 | A template that is printed before executing an external merge tool. This can |
|
2871 | 2892 | be used to print out additional context that might be useful to have during |
|
2872 | 2893 | the conflict resolution, such as the description of the various commits |
|
2873 | 2894 | involved or bookmarks/tags. |
|
2874 | 2895 | |
|
2875 | 2896 | Additional information is available in the ``local`, ``base``, and ``other`` |
|
2876 | 2897 | dicts. For example: ``{local.label}``, ``{base.name}``, or |
|
2877 | 2898 | ``{other.islink}``. |
|
2878 | 2899 | |
|
2879 | 2900 | |
|
2880 | 2901 | ``web`` |
|
2881 | 2902 | ------- |
|
2882 | 2903 | |
|
2883 | 2904 | Web interface configuration. The settings in this section apply to |
|
2884 | 2905 | both the builtin webserver (started by :hg:`serve`) and the script you |
|
2885 | 2906 | run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI |
|
2886 | 2907 | and WSGI). |
|
2887 | 2908 | |
|
2888 | 2909 | The Mercurial webserver does no authentication (it does not prompt for |
|
2889 | 2910 | usernames and passwords to validate *who* users are), but it does do |
|
2890 | 2911 | authorization (it grants or denies access for *authenticated users* |
|
2891 | 2912 | based on settings in this section). You must either configure your |
|
2892 | 2913 | webserver to do authentication for you, or disable the authorization |
|
2893 | 2914 | checks. |
|
2894 | 2915 | |
|
2895 | 2916 | For a quick setup in a trusted environment, e.g., a private LAN, where |
|
2896 | 2917 | you want it to accept pushes from anybody, you can use the following |
|
2897 | 2918 | command line:: |
|
2898 | 2919 | |
|
2899 | 2920 | $ hg --config web.allow-push=* --config web.push_ssl=False serve |
|
2900 | 2921 | |
|
2901 | 2922 | Note that this will allow anybody to push anything to the server and |
|
2902 | 2923 | that this should not be used for public servers. |
|
2903 | 2924 | |
|
2904 | 2925 | The full set of options is: |
|
2905 | 2926 | |
|
2906 | 2927 | ``accesslog`` |
|
2907 | 2928 | Where to output the access log. (default: stdout) |
|
2908 | 2929 | |
|
2909 | 2930 | ``address`` |
|
2910 | 2931 | Interface address to bind to. (default: all) |
|
2911 | 2932 | |
|
2912 | 2933 | ``allow-archive`` |
|
2913 | 2934 | List of archive format (bz2, gz, zip) allowed for downloading. |
|
2914 | 2935 | (default: empty) |
|
2915 | 2936 | |
|
2916 | 2937 | ``allowbz2`` |
|
2917 | 2938 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository |
|
2918 | 2939 | revisions. |
|
2919 | 2940 | (default: False) |
|
2920 | 2941 | |
|
2921 | 2942 | ``allowgz`` |
|
2922 | 2943 | (DEPRECATED) Whether to allow .tar.gz downloading of repository |
|
2923 | 2944 | revisions. |
|
2924 | 2945 | (default: False) |
|
2925 | 2946 | |
|
2926 | 2947 | ``allow-pull`` |
|
2927 | 2948 | Whether to allow pulling from the repository. (default: True) |
|
2928 | 2949 | |
|
2929 | 2950 | ``allow-push`` |
|
2930 | 2951 | Whether to allow pushing to the repository. If empty or not set, |
|
2931 | 2952 | pushing is not allowed. If the special value ``*``, any remote |
|
2932 | 2953 | user can push, including unauthenticated users. Otherwise, the |
|
2933 | 2954 | remote user must have been authenticated, and the authenticated |
|
2934 | 2955 | user name must be present in this list. The contents of the |
|
2935 | 2956 | allow-push list are examined after the deny_push list. |
|
2936 | 2957 | |
|
2937 | 2958 | ``allow_read`` |
|
2938 | 2959 | If the user has not already been denied repository access due to |
|
2939 | 2960 | the contents of deny_read, this list determines whether to grant |
|
2940 | 2961 | repository access to the user. If this list is not empty, and the |
|
2941 | 2962 | user is unauthenticated or not present in the list, then access is |
|
2942 | 2963 | denied for the user. If the list is empty or not set, then access |
|
2943 | 2964 | is permitted to all users by default. Setting allow_read to the |
|
2944 | 2965 | special value ``*`` is equivalent to it not being set (i.e. access |
|
2945 | 2966 | is permitted to all users). The contents of the allow_read list are |
|
2946 | 2967 | examined after the deny_read list. |
|
2947 | 2968 | |
|
2948 | 2969 | ``allowzip`` |
|
2949 | 2970 | (DEPRECATED) Whether to allow .zip downloading of repository |
|
2950 | 2971 | revisions. This feature creates temporary files. |
|
2951 | 2972 | (default: False) |
|
2952 | 2973 | |
|
2953 | 2974 | ``archivesubrepos`` |
|
2954 | 2975 | Whether to recurse into subrepositories when archiving. |
|
2955 | 2976 | (default: False) |
|
2956 | 2977 | |
|
2957 | 2978 | ``baseurl`` |
|
2958 | 2979 | Base URL to use when publishing URLs in other locations, so |
|
2959 | 2980 | third-party tools like email notification hooks can construct |
|
2960 | 2981 | URLs. Example: ``http://hgserver/repos/``. |
|
2961 | 2982 | |
|
2962 | 2983 | ``cacerts`` |
|
2963 | 2984 | Path to file containing a list of PEM encoded certificate |
|
2964 | 2985 | authority certificates. Environment variables and ``~user`` |
|
2965 | 2986 | constructs are expanded in the filename. If specified on the |
|
2966 | 2987 | client, then it will verify the identity of remote HTTPS servers |
|
2967 | 2988 | with these certificates. |
|
2968 | 2989 | |
|
2969 | 2990 | To disable SSL verification temporarily, specify ``--insecure`` from |
|
2970 | 2991 | command line. |
|
2971 | 2992 | |
|
2972 | 2993 | You can use OpenSSL's CA certificate file if your platform has |
|
2973 | 2994 | one. On most Linux systems this will be |
|
2974 | 2995 | ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to |
|
2975 | 2996 | generate this file manually. The form must be as follows:: |
|
2976 | 2997 | |
|
2977 | 2998 | -----BEGIN CERTIFICATE----- |
|
2978 | 2999 | ... (certificate in base64 PEM encoding) ... |
|
2979 | 3000 | -----END CERTIFICATE----- |
|
2980 | 3001 | -----BEGIN CERTIFICATE----- |
|
2981 | 3002 | ... (certificate in base64 PEM encoding) ... |
|
2982 | 3003 | -----END CERTIFICATE----- |
|
2983 | 3004 | |
|
2984 | 3005 | ``cache`` |
|
2985 | 3006 | Whether to support caching in hgweb. (default: True) |
|
2986 | 3007 | |
|
2987 | 3008 | ``certificate`` |
|
2988 | 3009 | Certificate to use when running :hg:`serve`. |
|
2989 | 3010 | |
|
2990 | 3011 | ``collapse`` |
|
2991 | 3012 | With ``descend`` enabled, repositories in subdirectories are shown at |
|
2992 | 3013 | a single level alongside repositories in the current path. With |
|
2993 | 3014 | ``collapse`` also enabled, repositories residing at a deeper level than |
|
2994 | 3015 | the current path are grouped behind navigable directory entries that |
|
2995 | 3016 | lead to the locations of these repositories. In effect, this setting |
|
2996 | 3017 | collapses each collection of repositories found within a subdirectory |
|
2997 | 3018 | into a single entry for that subdirectory. (default: False) |
|
2998 | 3019 | |
|
2999 | 3020 | ``comparisoncontext`` |
|
3000 | 3021 | Number of lines of context to show in side-by-side file comparison. If |
|
3001 | 3022 | negative or the value ``full``, whole files are shown. (default: 5) |
|
3002 | 3023 | |
|
3003 | 3024 | This setting can be overridden by a ``context`` request parameter to the |
|
3004 | 3025 | ``comparison`` command, taking the same values. |
|
3005 | 3026 | |
|
3006 | 3027 | ``contact`` |
|
3007 | 3028 | Name or email address of the person in charge of the repository. |
|
3008 | 3029 | (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty) |
|
3009 | 3030 | |
|
3010 | 3031 | ``csp`` |
|
3011 | 3032 | Send a ``Content-Security-Policy`` HTTP header with this value. |
|
3012 | 3033 | |
|
3013 | 3034 | The value may contain a special string ``%nonce%``, which will be replaced |
|
3014 | 3035 | by a randomly-generated one-time use value. If the value contains |
|
3015 | 3036 | ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the |
|
3016 | 3037 | one-time property of the nonce. This nonce will also be inserted into |
|
3017 | 3038 | ``<script>`` elements containing inline JavaScript. |
|
3018 | 3039 | |
|
3019 | 3040 | Note: lots of HTML content sent by the server is derived from repository |
|
3020 | 3041 | data. Please consider the potential for malicious repository data to |
|
3021 | 3042 | "inject" itself into generated HTML content as part of your security |
|
3022 | 3043 | threat model. |
|
3023 | 3044 | |
|
3024 | 3045 | ``deny_push`` |
|
3025 | 3046 | Whether to deny pushing to the repository. If empty or not set, |
|
3026 | 3047 | push is not denied. If the special value ``*``, all remote users are |
|
3027 | 3048 | denied push. Otherwise, unauthenticated users are all denied, and |
|
3028 | 3049 | any authenticated user name present in this list is also denied. The |
|
3029 | 3050 | contents of the deny_push list are examined before the allow-push list. |
|
3030 | 3051 | |
|
3031 | 3052 | ``deny_read`` |
|
3032 | 3053 | Whether to deny reading/viewing of the repository. If this list is |
|
3033 | 3054 | not empty, unauthenticated users are all denied, and any |
|
3034 | 3055 | authenticated user name present in this list is also denied access to |
|
3035 | 3056 | the repository. If set to the special value ``*``, all remote users |
|
3036 | 3057 | are denied access (rarely needed ;). If deny_read is empty or not set, |
|
3037 | 3058 | the determination of repository access depends on the presence and |
|
3038 | 3059 | content of the allow_read list (see description). If both |
|
3039 | 3060 | deny_read and allow_read are empty or not set, then access is |
|
3040 | 3061 | permitted to all users by default. If the repository is being |
|
3041 | 3062 | served via hgwebdir, denied users will not be able to see it in |
|
3042 | 3063 | the list of repositories. The contents of the deny_read list have |
|
3043 | 3064 | priority over (are examined before) the contents of the allow_read |
|
3044 | 3065 | list. |
|
3045 | 3066 | |
|
3046 | 3067 | ``descend`` |
|
3047 | 3068 | hgwebdir indexes will not descend into subdirectories. Only repositories |
|
3048 | 3069 | directly in the current path will be shown (other repositories are still |
|
3049 | 3070 | available from the index corresponding to their containing path). |
|
3050 | 3071 | |
|
3051 | 3072 | ``description`` |
|
3052 | 3073 | Textual description of the repository's purpose or contents. |
|
3053 | 3074 | (default: "unknown") |
|
3054 | 3075 | |
|
3055 | 3076 | ``encoding`` |
|
3056 | 3077 | Character encoding name. (default: the current locale charset) |
|
3057 | 3078 | Example: "UTF-8". |
|
3058 | 3079 | |
|
3059 | 3080 | ``errorlog`` |
|
3060 | 3081 | Where to output the error log. (default: stderr) |
|
3061 | 3082 | |
|
3062 | 3083 | ``guessmime`` |
|
3063 | 3084 | Control MIME types for raw download of file content. |
|
3064 | 3085 | Set to True to let hgweb guess the content type from the file |
|
3065 | 3086 | extension. This will serve HTML files as ``text/html`` and might |
|
3066 | 3087 | allow cross-site scripting attacks when serving untrusted |
|
3067 | 3088 | repositories. (default: False) |
|
3068 | 3089 | |
|
3069 | 3090 | ``hidden`` |
|
3070 | 3091 | Whether to hide the repository in the hgwebdir index. |
|
3071 | 3092 | (default: False) |
|
3072 | 3093 | |
|
3073 | 3094 | ``ipv6`` |
|
3074 | 3095 | Whether to use IPv6. (default: False) |
|
3075 | 3096 | |
|
3076 | 3097 | ``labels`` |
|
3077 | 3098 | List of string *labels* associated with the repository. |
|
3078 | 3099 | |
|
3079 | 3100 | Labels are exposed as a template keyword and can be used to customize |
|
3080 | 3101 | output. e.g. the ``index`` template can group or filter repositories |
|
3081 | 3102 | by labels and the ``summary`` template can display additional content |
|
3082 | 3103 | if a specific label is present. |
|
3083 | 3104 | |
|
3084 | 3105 | ``logoimg`` |
|
3085 | 3106 | File name of the logo image that some templates display on each page. |
|
3086 | 3107 | The file name is relative to ``staticurl``. That is, the full path to |
|
3087 | 3108 | the logo image is "staticurl/logoimg". |
|
3088 | 3109 | If unset, ``hglogo.png`` will be used. |
|
3089 | 3110 | |
|
3090 | 3111 | ``logourl`` |
|
3091 | 3112 | Base URL to use for logos. If unset, ``https://mercurial-scm.org/`` |
|
3092 | 3113 | will be used. |
|
3093 | 3114 | |
|
3094 | 3115 | ``maxchanges`` |
|
3095 | 3116 | Maximum number of changes to list on the changelog. (default: 10) |
|
3096 | 3117 | |
|
3097 | 3118 | ``maxfiles`` |
|
3098 | 3119 | Maximum number of files to list per changeset. (default: 10) |
|
3099 | 3120 | |
|
3100 | 3121 | ``maxshortchanges`` |
|
3101 | 3122 | Maximum number of changes to list on the shortlog, graph or filelog |
|
3102 | 3123 | pages. (default: 60) |
|
3103 | 3124 | |
|
3104 | 3125 | ``name`` |
|
3105 | 3126 | Repository name to use in the web interface. |
|
3106 | 3127 | (default: current working directory) |
|
3107 | 3128 | |
|
3108 | 3129 | ``port`` |
|
3109 | 3130 | Port to listen on. (default: 8000) |
|
3110 | 3131 | |
|
3111 | 3132 | ``prefix`` |
|
3112 | 3133 | Prefix path to serve from. (default: '' (server root)) |
|
3113 | 3134 | |
|
3114 | 3135 | ``push_ssl`` |
|
3115 | 3136 | Whether to require that inbound pushes be transported over SSL to |
|
3116 | 3137 | prevent password sniffing. (default: True) |
|
3117 | 3138 | |
|
3118 | 3139 | ``refreshinterval`` |
|
3119 | 3140 | How frequently directory listings re-scan the filesystem for new |
|
3120 | 3141 | repositories, in seconds. This is relevant when wildcards are used |
|
3121 | 3142 | to define paths. Depending on how much filesystem traversal is |
|
3122 | 3143 | required, refreshing may negatively impact performance. |
|
3123 | 3144 | |
|
3124 | 3145 | Values less than or equal to 0 always refresh. |
|
3125 | 3146 | (default: 20) |
|
3126 | 3147 | |
|
3127 | 3148 | ``server-header`` |
|
3128 | 3149 | Value for HTTP ``Server`` response header. |
|
3129 | 3150 | |
|
3130 | 3151 | ``static`` |
|
3131 | 3152 | Directory where static files are served from. |
|
3132 | 3153 | |
|
3133 | 3154 | ``staticurl`` |
|
3134 | 3155 | Base URL to use for static files. If unset, static files (e.g. the |
|
3135 | 3156 | hgicon.png favicon) will be served by the CGI script itself. Use |
|
3136 | 3157 | this setting to serve them directly with the HTTP server. |
|
3137 | 3158 | Example: ``http://hgserver/static/``. |
|
3138 | 3159 | |
|
3139 | 3160 | ``stripes`` |
|
3140 | 3161 | How many lines a "zebra stripe" should span in multi-line output. |
|
3141 | 3162 | Set to 0 to disable. (default: 1) |
|
3142 | 3163 | |
|
3143 | 3164 | ``style`` |
|
3144 | 3165 | Which template map style to use. The available options are the names of |
|
3145 | 3166 | subdirectories in the HTML templates path. (default: ``paper``) |
|
3146 | 3167 | Example: ``monoblue``. |
|
3147 | 3168 | |
|
3148 | 3169 | ``templates`` |
|
3149 | 3170 | Where to find the HTML templates. The default path to the HTML templates |
|
3150 | 3171 | can be obtained from ``hg debuginstall``. |
|
3151 | 3172 | |
|
3152 | 3173 | ``websub`` |
|
3153 | 3174 | ---------- |
|
3154 | 3175 | |
|
3155 | 3176 | Web substitution filter definition. You can use this section to |
|
3156 | 3177 | define a set of regular expression substitution patterns which |
|
3157 | 3178 | let you automatically modify the hgweb server output. |
|
3158 | 3179 | |
|
3159 | 3180 | The default hgweb templates only apply these substitution patterns |
|
3160 | 3181 | on the revision description fields. You can apply them anywhere |
|
3161 | 3182 | you want when you create your own templates by adding calls to the |
|
3162 | 3183 | "websub" filter (usually after calling the "escape" filter). |
|
3163 | 3184 | |
|
3164 | 3185 | This can be used, for example, to convert issue references to links |
|
3165 | 3186 | to your issue tracker, or to convert "markdown-like" syntax into |
|
3166 | 3187 | HTML (see the examples below). |
|
3167 | 3188 | |
|
3168 | 3189 | Each entry in this section names a substitution filter. |
|
3169 | 3190 | The value of each entry defines the substitution expression itself. |
|
3170 | 3191 | The websub expressions follow the old interhg extension syntax, |
|
3171 | 3192 | which in turn imitates the Unix sed replacement syntax:: |
|
3172 | 3193 | |
|
3173 | 3194 | patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i] |
|
3174 | 3195 | |
|
3175 | 3196 | You can use any separator other than "/". The final "i" is optional |
|
3176 | 3197 | and indicates that the search must be case insensitive. |
|
3177 | 3198 | |
|
3178 | 3199 | Examples:: |
|
3179 | 3200 | |
|
3180 | 3201 | [websub] |
|
3181 | 3202 | issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i |
|
3182 | 3203 | italic = s/\b_(\S+)_\b/<i>\1<\/i>/ |
|
3183 | 3204 | bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/ |
|
3184 | 3205 | |
|
3185 | 3206 | ``worker`` |
|
3186 | 3207 | ---------- |
|
3187 | 3208 | |
|
3188 | 3209 | Parallel master/worker configuration. We currently perform working |
|
3189 | 3210 | directory updates in parallel on Unix-like systems, which greatly |
|
3190 | 3211 | helps performance. |
|
3191 | 3212 | |
|
3192 | 3213 | ``enabled`` |
|
3193 | 3214 | Whether to enable workers code to be used. |
|
3194 | 3215 | (default: true) |
|
3195 | 3216 | |
|
3196 | 3217 | ``numcpus`` |
|
3197 | 3218 | Number of CPUs to use for parallel operations. A zero or |
|
3198 | 3219 | negative value is treated as ``use the default``. |
|
3199 | 3220 | (default: 4 or the number of CPUs on the system, whichever is larger) |
|
3200 | 3221 | |
|
3201 | 3222 | ``backgroundclose`` |
|
3202 | 3223 | Whether to enable closing file handles on background threads during certain |
|
3203 | 3224 | operations. Some platforms aren't very efficient at closing file |
|
3204 | 3225 | handles that have been written or appended to. By performing file closing |
|
3205 | 3226 | on background threads, file write rate can increase substantially. |
|
3206 | 3227 | (default: true on Windows, false elsewhere) |
|
3207 | 3228 | |
|
3208 | 3229 | ``backgroundcloseminfilecount`` |
|
3209 | 3230 | Minimum number of files required to trigger background file closing. |
|
3210 | 3231 | Operations not writing this many files won't start background close |
|
3211 | 3232 | threads. |
|
3212 | 3233 | (default: 2048) |
|
3213 | 3234 | |
|
3214 | 3235 | ``backgroundclosemaxqueue`` |
|
3215 | 3236 | The maximum number of opened file handles waiting to be closed in the |
|
3216 | 3237 | background. This option only has an effect if ``backgroundclose`` is |
|
3217 | 3238 | enabled. |
|
3218 | 3239 | (default: 384) |
|
3219 | 3240 | |
|
3220 | 3241 | ``backgroundclosethreadcount`` |
|
3221 | 3242 | Number of threads to process background file closes. Only relevant if |
|
3222 | 3243 | ``backgroundclose`` is enabled. |
|
3223 | 3244 | (default: 4) |
@@ -1,107 +1,178 | |||
|
1 | 1 | # upgrade.py - functions for automatic upgrade of Mercurial repository |
|
2 | 2 | # |
|
3 | 3 | # Copyright (c) 2022-present, Pierre-Yves David |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | from ..i18n import _ |
|
8 | 8 | |
|
9 | 9 | from .. import ( |
|
10 | 10 | error, |
|
11 | 11 | requirements as requirementsmod, |
|
12 | 12 | scmutil, |
|
13 | 13 | ) |
|
14 | 14 | |
|
15 | from . import ( | |
|
16 | actions, | |
|
17 | engine, | |
|
18 | ) | |
|
19 | ||
|
20 | ||
|
21 | class AutoUpgradeOperation(actions.BaseOperation): | |
|
22 | """A limited Upgrade Operation used to run simple auto upgrade task | |
|
23 | ||
|
24 | (Expand it as needed in the future) | |
|
25 | """ | |
|
26 | ||
|
27 | def __init__(self, req): | |
|
28 | super().__init__( | |
|
29 | new_requirements=req, | |
|
30 | backup_store=False, | |
|
31 | ) | |
|
32 | ||
|
15 | 33 | |
|
16 | 34 | def get_share_safe_action(repo): |
|
17 | 35 | """return an automatic-upgrade action for `share-safe` if applicable |
|
18 | 36 | |
|
19 | 37 | If no action is needed, return None, otherwise return a callback to upgrade |
|
20 | 38 | or downgrade the repository according the configuration and repository |
|
21 | 39 | format. |
|
22 | 40 | """ |
|
23 | 41 | ui = repo.ui |
|
24 | 42 | requirements = repo.requirements |
|
25 | 43 | auto_upgrade_share_source = ui.configbool( |
|
26 | 44 | b'format', |
|
27 | 45 | b'use-share-safe.automatic-upgrade-of-mismatching-repositories', |
|
28 | 46 | ) |
|
29 | 47 | |
|
30 | 48 | action = None |
|
31 | 49 | |
|
32 | 50 | if ( |
|
33 | 51 | auto_upgrade_share_source |
|
34 | 52 | and requirementsmod.SHARED_REQUIREMENT not in requirements |
|
35 | 53 | ): |
|
36 | 54 | sf_config = ui.configbool(b'format', b'use-share-safe') |
|
37 | 55 | sf_local = requirementsmod.SHARESAFE_REQUIREMENT in requirements |
|
38 | 56 | if sf_config and not sf_local: |
|
39 | 57 | msg = _( |
|
40 | 58 | b"automatically upgrading repository to the `share-safe`" |
|
41 | 59 | b" feature\n" |
|
42 | 60 | ) |
|
43 | 61 | hint = b"(see `hg help config.format.use-share-safe` for details)\n" |
|
44 | 62 | |
|
45 | 63 | def action(): |
|
46 | 64 | if not ui.quiet: |
|
47 | 65 | ui.write_err(msg) |
|
48 | 66 | ui.write_err(hint) |
|
49 | 67 | requirements.add(requirementsmod.SHARESAFE_REQUIREMENT) |
|
50 | 68 | scmutil.writereporequirements(repo, requirements) |
|
51 | 69 | |
|
52 | 70 | elif sf_local and not sf_config: |
|
53 | 71 | msg = _( |
|
54 | 72 | b"automatically downgrading repository from the `share-safe`" |
|
55 | 73 | b" feature\n" |
|
56 | 74 | ) |
|
57 | 75 | hint = b"(see `hg help config.format.use-share-safe` for details)\n" |
|
58 | 76 | |
|
59 | 77 | def action(): |
|
60 | 78 | if not ui.quiet: |
|
61 | 79 | ui.write_err(msg) |
|
62 | 80 | ui.write_err(hint) |
|
63 | 81 | requirements.discard(requirementsmod.SHARESAFE_REQUIREMENT) |
|
64 | 82 | scmutil.writereporequirements(repo, requirements) |
|
65 | 83 | |
|
66 | 84 | return action |
|
67 | 85 | |
|
68 | 86 | |
|
87 | def get_tracked_hint_action(repo): | |
|
88 | """return an automatic-upgrade action for `tracked-hint` if applicable | |
|
89 | ||
|
90 | If no action is needed, return None, otherwise return a callback to upgrade | |
|
91 | or downgrade the repository according the configuration and repository | |
|
92 | format. | |
|
93 | """ | |
|
94 | ui = repo.ui | |
|
95 | requirements = set(repo.requirements) | |
|
96 | auto_upgrade_tracked_hint = ui.configbool( | |
|
97 | b'format', | |
|
98 | b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories', | |
|
99 | ) | |
|
100 | ||
|
101 | action = None | |
|
102 | ||
|
103 | if auto_upgrade_tracked_hint: | |
|
104 | th_config = ui.configbool(b'format', b'use-dirstate-tracked-hint') | |
|
105 | th_local = requirementsmod.DIRSTATE_TRACKED_HINT_V1 in requirements | |
|
106 | if th_config and not th_local: | |
|
107 | msg = _( | |
|
108 | b"automatically upgrading repository to the `tracked-hint`" | |
|
109 | b" feature\n" | |
|
110 | ) | |
|
111 | hint = b"(see `hg help config.format.use-dirstate-tracked-hint` for details)\n" | |
|
112 | ||
|
113 | def action(): | |
|
114 | if not ui.quiet: | |
|
115 | ui.write_err(msg) | |
|
116 | ui.write_err(hint) | |
|
117 | requirements.add(requirementsmod.DIRSTATE_TRACKED_HINT_V1) | |
|
118 | op = AutoUpgradeOperation(requirements) | |
|
119 | engine.upgrade_tracked_hint(ui, repo, op, add=True) | |
|
120 | ||
|
121 | elif th_local and not th_config: | |
|
122 | msg = _( | |
|
123 | b"automatically downgrading repository from the `tracked-hint`" | |
|
124 | b" feature\n" | |
|
125 | ) | |
|
126 | hint = b"(see `hg help config.format.use-dirstate-tracked-hint` for details)\n" | |
|
127 | ||
|
128 | def action(): | |
|
129 | if not ui.quiet: | |
|
130 | ui.write_err(msg) | |
|
131 | ui.write_err(hint) | |
|
132 | requirements.discard(requirementsmod.DIRSTATE_TRACKED_HINT_V1) | |
|
133 | op = AutoUpgradeOperation(requirements) | |
|
134 | engine.upgrade_tracked_hint(ui, repo, op, add=False) | |
|
135 | ||
|
136 | return action | |
|
137 | ||
|
138 | ||
|
69 | 139 | AUTO_UPGRADE_ACTIONS = [ |
|
70 | 140 | get_share_safe_action, |
|
141 | get_tracked_hint_action, | |
|
71 | 142 | ] |
|
72 | 143 | |
|
73 | 144 | |
|
74 | 145 | def may_auto_upgrade(repo, maker_func): |
|
75 | 146 | """potentially perform auto-upgrade and return the final repository to use |
|
76 | 147 | |
|
77 | 148 | Auto-upgrade are "quick" repository upgrade that might automatically be run |
|
78 | 149 | by "any" repository access. See `hg help config.format` for automatic |
|
79 | 150 | upgrade documentation. |
|
80 | 151 | |
|
81 | 152 | note: each relevant upgrades are done one after the other for simplicity. |
|
82 | 153 | This avoid having repository is partially inconsistent state while |
|
83 | 154 | upgrading. |
|
84 | 155 | |
|
85 | 156 | repo: the current repository instance |
|
86 | 157 | maker_func: a factory function that can recreate a repository after an upgrade |
|
87 | 158 | """ |
|
88 | 159 | clear = False |
|
89 | 160 | |
|
90 | 161 | loop = 0 |
|
91 | 162 | |
|
92 | 163 | while not clear: |
|
93 | 164 | loop += 1 |
|
94 | 165 | if loop > 100: |
|
95 | 166 | # XXX basic protection against infinite loop, make it better. |
|
96 | 167 | raise error.ProgrammingError("Too many auto upgrade loops") |
|
97 | 168 | clear = True |
|
98 | 169 | for get_action in AUTO_UPGRADE_ACTIONS: |
|
99 | 170 | action = get_action(repo) |
|
100 | 171 | if action is not None: |
|
101 | 172 | clear = False |
|
102 | 173 | with repo.wlock(wait=False), repo.lock(wait=False): |
|
103 | 174 | action = get_action(repo) |
|
104 | 175 | if action is not None: |
|
105 | 176 | action() |
|
106 | 177 | repo = maker_func() |
|
107 | 178 | return repo |
@@ -1,168 +1,172 | |||
|
1 | 1 | use crate::errors::{HgError, HgResultExt}; |
|
2 | 2 | use crate::repo::Repo; |
|
3 | 3 | use crate::utils::join_display; |
|
4 | 4 | use crate::vfs::Vfs; |
|
5 | 5 | use std::collections::HashSet; |
|
6 | 6 | |
|
7 | 7 | fn parse(bytes: &[u8]) -> Result<HashSet<String>, HgError> { |
|
8 | 8 | // The Python code reading this file uses `str.splitlines` |
|
9 | 9 | // which looks for a number of line separators (even including a couple of |
|
10 | 10 | // non-ASCII ones), but Python code writing it always uses `\n`. |
|
11 | 11 | let lines = bytes.split(|&byte| byte == b'\n'); |
|
12 | 12 | |
|
13 | 13 | lines |
|
14 | 14 | .filter(|line| !line.is_empty()) |
|
15 | 15 | .map(|line| { |
|
16 | 16 | // Python uses Unicode `str.isalnum` but feature names are all |
|
17 | 17 | // ASCII |
|
18 | 18 | if line[0].is_ascii_alphanumeric() && line.is_ascii() { |
|
19 | 19 | Ok(String::from_utf8(line.into()).unwrap()) |
|
20 | 20 | } else { |
|
21 | 21 | Err(HgError::corrupted("parse error in 'requires' file")) |
|
22 | 22 | } |
|
23 | 23 | }) |
|
24 | 24 | .collect() |
|
25 | 25 | } |
|
26 | 26 | |
|
27 | 27 | pub(crate) fn load(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> { |
|
28 | 28 | parse(&hg_vfs.read("requires")?) |
|
29 | 29 | } |
|
30 | 30 | |
|
31 | 31 | pub(crate) fn load_if_exists(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> { |
|
32 | 32 | if let Some(bytes) = hg_vfs.read("requires").io_not_found_as_none()? { |
|
33 | 33 | parse(&bytes) |
|
34 | 34 | } else { |
|
35 | 35 | // Treat a missing file the same as an empty file. |
|
36 | 36 | // From `mercurial/localrepo.py`: |
|
37 | 37 | // > requires file contains a newline-delimited list of |
|
38 | 38 | // > features/capabilities the opener (us) must have in order to use |
|
39 | 39 | // > the repository. This file was introduced in Mercurial 0.9.2, |
|
40 | 40 | // > which means very old repositories may not have one. We assume |
|
41 | 41 | // > a missing file translates to no requirements. |
|
42 | 42 | Ok(HashSet::new()) |
|
43 | 43 | } |
|
44 | 44 | } |
|
45 | 45 | |
|
46 | 46 | pub(crate) fn check(repo: &Repo) -> Result<(), HgError> { |
|
47 | 47 | let unknown: Vec<_> = repo |
|
48 | 48 | .requirements() |
|
49 | 49 | .iter() |
|
50 | 50 | .map(String::as_str) |
|
51 | 51 | // .filter(|feature| !ALL_SUPPORTED.contains(feature.as_str())) |
|
52 | 52 | .filter(|feature| { |
|
53 | 53 | !REQUIRED.contains(feature) && !SUPPORTED.contains(feature) |
|
54 | 54 | }) |
|
55 | 55 | .collect(); |
|
56 | 56 | if !unknown.is_empty() { |
|
57 | 57 | return Err(HgError::unsupported(format!( |
|
58 | 58 | "repository requires feature unknown to this Mercurial: {}", |
|
59 | 59 | join_display(&unknown, ", ") |
|
60 | 60 | ))); |
|
61 | 61 | } |
|
62 | 62 | let missing: Vec<_> = REQUIRED |
|
63 | 63 | .iter() |
|
64 | 64 | .filter(|&&feature| !repo.requirements().contains(feature)) |
|
65 | 65 | .collect(); |
|
66 | 66 | if !missing.is_empty() { |
|
67 | 67 | return Err(HgError::unsupported(format!( |
|
68 | 68 | "repository is missing feature required by this Mercurial: {}", |
|
69 | 69 | join_display(&missing, ", ") |
|
70 | 70 | ))); |
|
71 | 71 | } |
|
72 | 72 | Ok(()) |
|
73 | 73 | } |
|
74 | 74 | |
|
75 | 75 | /// rhg does not support repositories that are *missing* any of these features |
|
76 | 76 | const REQUIRED: &[&str] = &["revlogv1", "store", "fncache", "dotencode"]; |
|
77 | 77 | |
|
78 | 78 | /// rhg supports repository with or without these |
|
79 | 79 | const SUPPORTED: &[&str] = &[ |
|
80 | 80 | "generaldelta", |
|
81 | 81 | SHARED_REQUIREMENT, |
|
82 | 82 | SHARESAFE_REQUIREMENT, |
|
83 | 83 | SPARSEREVLOG_REQUIREMENT, |
|
84 | 84 | RELATIVE_SHARED_REQUIREMENT, |
|
85 | 85 | REVLOG_COMPRESSION_ZSTD, |
|
86 | 86 | DIRSTATE_V2_REQUIREMENT, |
|
87 | 87 | // As of this writing everything rhg does is read-only. |
|
88 | 88 | // When it starts writing to the repository, itβll need to either keep the |
|
89 | 89 | // persistent nodemap up to date or remove this entry: |
|
90 | 90 | NODEMAP_REQUIREMENT, |
|
91 | 91 | // Not all commands support `sparse` and `narrow`. The commands that do |
|
92 | 92 | // not should opt out by checking `has_sparse` and `has_narrow`. |
|
93 | 93 | SPARSE_REQUIREMENT, |
|
94 | 94 | NARROW_REQUIREMENT, |
|
95 | 95 | // rhg doesn't care about bookmarks at all yet |
|
96 | 96 | BOOKMARKS_IN_STORE_REQUIREMENT, |
|
97 | 97 | ]; |
|
98 | 98 | |
|
99 | 99 | // Copied from mercurial/requirements.py: |
|
100 | 100 | |
|
101 | 101 | pub const DIRSTATE_V2_REQUIREMENT: &str = "dirstate-v2"; |
|
102 | 102 | |
|
103 | /// A repository that uses the tracked hint dirstate file | |
|
104 | #[allow(unused)] | |
|
105 | pub const DIRSTATE_TRACKED_HINT_V1: &str = "dirstate-tracked-key-v1"; | |
|
106 | ||
|
103 | 107 | /// When narrowing is finalized and no longer subject to format changes, |
|
104 | 108 | /// we should move this to just "narrow" or similar. |
|
105 | 109 | #[allow(unused)] |
|
106 | 110 | pub const NARROW_REQUIREMENT: &str = "narrowhg-experimental"; |
|
107 | 111 | |
|
108 | 112 | /// Bookmarks must be stored in the `store` part of the repository and will be |
|
109 | 113 | /// share accross shares |
|
110 | 114 | #[allow(unused)] |
|
111 | 115 | pub const BOOKMARKS_IN_STORE_REQUIREMENT: &str = "bookmarksinstore"; |
|
112 | 116 | |
|
113 | 117 | /// Enables sparse working directory usage |
|
114 | 118 | #[allow(unused)] |
|
115 | 119 | pub const SPARSE_REQUIREMENT: &str = "exp-sparse"; |
|
116 | 120 | |
|
117 | 121 | /// Enables the internal phase which is used to hide changesets instead |
|
118 | 122 | /// of stripping them |
|
119 | 123 | #[allow(unused)] |
|
120 | 124 | pub const INTERNAL_PHASE_REQUIREMENT: &str = "internal-phase"; |
|
121 | 125 | |
|
122 | 126 | /// Stores manifest in Tree structure |
|
123 | 127 | #[allow(unused)] |
|
124 | 128 | pub const TREEMANIFEST_REQUIREMENT: &str = "treemanifest"; |
|
125 | 129 | |
|
126 | 130 | /// Increment the sub-version when the revlog v2 format changes to lock out old |
|
127 | 131 | /// clients. |
|
128 | 132 | #[allow(unused)] |
|
129 | 133 | pub const REVLOGV2_REQUIREMENT: &str = "exp-revlogv2.1"; |
|
130 | 134 | |
|
131 | 135 | /// A repository with the sparserevlog feature will have delta chains that |
|
132 | 136 | /// can spread over a larger span. Sparse reading cuts these large spans into |
|
133 | 137 | /// pieces, so that each piece isn't too big. |
|
134 | 138 | /// Without the sparserevlog capability, reading from the repository could use |
|
135 | 139 | /// huge amounts of memory, because the whole span would be read at once, |
|
136 | 140 | /// including all the intermediate revisions that aren't pertinent for the |
|
137 | 141 | /// chain. This is why once a repository has enabled sparse-read, it becomes |
|
138 | 142 | /// required. |
|
139 | 143 | #[allow(unused)] |
|
140 | 144 | pub const SPARSEREVLOG_REQUIREMENT: &str = "sparserevlog"; |
|
141 | 145 | |
|
142 | 146 | /// A repository with the the copies-sidedata-changeset requirement will store |
|
143 | 147 | /// copies related information in changeset's sidedata. |
|
144 | 148 | #[allow(unused)] |
|
145 | 149 | pub const COPIESSDC_REQUIREMENT: &str = "exp-copies-sidedata-changeset"; |
|
146 | 150 | |
|
147 | 151 | /// The repository use persistent nodemap for the changelog and the manifest. |
|
148 | 152 | #[allow(unused)] |
|
149 | 153 | pub const NODEMAP_REQUIREMENT: &str = "persistent-nodemap"; |
|
150 | 154 | |
|
151 | 155 | /// Denotes that the current repository is a share |
|
152 | 156 | #[allow(unused)] |
|
153 | 157 | pub const SHARED_REQUIREMENT: &str = "shared"; |
|
154 | 158 | |
|
155 | 159 | /// Denotes that current repository is a share and the shared source path is |
|
156 | 160 | /// relative to the current repository root path |
|
157 | 161 | #[allow(unused)] |
|
158 | 162 | pub const RELATIVE_SHARED_REQUIREMENT: &str = "relshared"; |
|
159 | 163 | |
|
160 | 164 | /// A repository with share implemented safely. The repository has different |
|
161 | 165 | /// store and working copy requirements i.e. both `.hg/requires` and |
|
162 | 166 | /// `.hg/store/requires` are present. |
|
163 | 167 | #[allow(unused)] |
|
164 | 168 | pub const SHARESAFE_REQUIREMENT: &str = "share-safe"; |
|
165 | 169 | |
|
166 | 170 | /// A repository that use zstd compression inside its revlog |
|
167 | 171 | #[allow(unused)] |
|
168 | 172 | pub const REVLOG_COMPRESSION_ZSTD: &str = "revlog-compression-zstd"; |
@@ -1,799 +1,804 | |||
|
1 | 1 | extern crate log; |
|
2 | 2 | use crate::error::CommandError; |
|
3 | 3 | use crate::ui::{local_to_utf8, Ui}; |
|
4 | 4 | use clap::App; |
|
5 | 5 | use clap::AppSettings; |
|
6 | 6 | use clap::Arg; |
|
7 | 7 | use clap::ArgMatches; |
|
8 | 8 | use format_bytes::{format_bytes, join}; |
|
9 | 9 | use hg::config::{Config, ConfigSource}; |
|
10 | 10 | use hg::repo::{Repo, RepoError}; |
|
11 | 11 | use hg::utils::files::{get_bytes_from_os_str, get_path_from_bytes}; |
|
12 | 12 | use hg::utils::SliceExt; |
|
13 | 13 | use hg::{exit_codes, requirements}; |
|
14 | 14 | use std::collections::HashSet; |
|
15 | 15 | use std::ffi::OsString; |
|
16 | 16 | use std::os::unix::prelude::CommandExt; |
|
17 | 17 | use std::path::PathBuf; |
|
18 | 18 | use std::process::Command; |
|
19 | 19 | |
|
20 | 20 | mod blackbox; |
|
21 | 21 | mod color; |
|
22 | 22 | mod error; |
|
23 | 23 | mod ui; |
|
24 | 24 | pub mod utils { |
|
25 | 25 | pub mod path_utils; |
|
26 | 26 | } |
|
27 | 27 | |
|
28 | 28 | fn main_with_result( |
|
29 | 29 | argv: Vec<OsString>, |
|
30 | 30 | process_start_time: &blackbox::ProcessStartTime, |
|
31 | 31 | ui: &ui::Ui, |
|
32 | 32 | repo: Result<&Repo, &NoRepoInCwdError>, |
|
33 | 33 | config: &Config, |
|
34 | 34 | ) -> Result<(), CommandError> { |
|
35 | 35 | check_unsupported(config, repo)?; |
|
36 | 36 | |
|
37 | 37 | let app = App::new("rhg") |
|
38 | 38 | .global_setting(AppSettings::AllowInvalidUtf8) |
|
39 | 39 | .global_setting(AppSettings::DisableVersion) |
|
40 | 40 | .setting(AppSettings::SubcommandRequired) |
|
41 | 41 | .setting(AppSettings::VersionlessSubcommands) |
|
42 | 42 | .arg( |
|
43 | 43 | Arg::with_name("repository") |
|
44 | 44 | .help("repository root directory") |
|
45 | 45 | .short("-R") |
|
46 | 46 | .long("--repository") |
|
47 | 47 | .value_name("REPO") |
|
48 | 48 | .takes_value(true) |
|
49 | 49 | // Both ok: `hg -R ./foo log` or `hg log -R ./foo` |
|
50 | 50 | .global(true), |
|
51 | 51 | ) |
|
52 | 52 | .arg( |
|
53 | 53 | Arg::with_name("config") |
|
54 | 54 | .help("set/override config option (use 'section.name=value')") |
|
55 | 55 | .long("--config") |
|
56 | 56 | .value_name("CONFIG") |
|
57 | 57 | .takes_value(true) |
|
58 | 58 | .global(true) |
|
59 | 59 | // Ok: `--config section.key1=val --config section.key2=val2` |
|
60 | 60 | .multiple(true) |
|
61 | 61 | // Not ok: `--config section.key1=val section.key2=val2` |
|
62 | 62 | .number_of_values(1), |
|
63 | 63 | ) |
|
64 | 64 | .arg( |
|
65 | 65 | Arg::with_name("cwd") |
|
66 | 66 | .help("change working directory") |
|
67 | 67 | .long("--cwd") |
|
68 | 68 | .value_name("DIR") |
|
69 | 69 | .takes_value(true) |
|
70 | 70 | .global(true), |
|
71 | 71 | ) |
|
72 | 72 | .arg( |
|
73 | 73 | Arg::with_name("color") |
|
74 | 74 | .help("when to colorize (boolean, always, auto, never, or debug)") |
|
75 | 75 | .long("--color") |
|
76 | 76 | .value_name("TYPE") |
|
77 | 77 | .takes_value(true) |
|
78 | 78 | .global(true), |
|
79 | 79 | ) |
|
80 | 80 | .version("0.0.1"); |
|
81 | 81 | let app = add_subcommand_args(app); |
|
82 | 82 | |
|
83 | 83 | let matches = app.clone().get_matches_from_safe(argv.iter())?; |
|
84 | 84 | |
|
85 | 85 | let (subcommand_name, subcommand_matches) = matches.subcommand(); |
|
86 | 86 | |
|
87 | 87 | // Mercurial allows users to define "defaults" for commands, fallback |
|
88 | 88 | // if a default is detected for the current command |
|
89 | 89 | let defaults = config.get_str(b"defaults", subcommand_name.as_bytes()); |
|
90 | 90 | if defaults?.is_some() { |
|
91 | 91 | let msg = "`defaults` config set"; |
|
92 | 92 | return Err(CommandError::unsupported(msg)); |
|
93 | 93 | } |
|
94 | 94 | |
|
95 | 95 | for prefix in ["pre", "post", "fail"].iter() { |
|
96 | 96 | // Mercurial allows users to define generic hooks for commands, |
|
97 | 97 | // fallback if any are detected |
|
98 | 98 | let item = format!("{}-{}", prefix, subcommand_name); |
|
99 | 99 | let hook_for_command = config.get_str(b"hooks", item.as_bytes())?; |
|
100 | 100 | if hook_for_command.is_some() { |
|
101 | 101 | let msg = format!("{}-{} hook defined", prefix, subcommand_name); |
|
102 | 102 | return Err(CommandError::unsupported(msg)); |
|
103 | 103 | } |
|
104 | 104 | } |
|
105 | 105 | let run = subcommand_run_fn(subcommand_name) |
|
106 | 106 | .expect("unknown subcommand name from clap despite AppSettings::SubcommandRequired"); |
|
107 | 107 | let subcommand_args = subcommand_matches |
|
108 | 108 | .expect("no subcommand arguments from clap despite AppSettings::SubcommandRequired"); |
|
109 | 109 | |
|
110 | 110 | let invocation = CliInvocation { |
|
111 | 111 | ui, |
|
112 | 112 | subcommand_args, |
|
113 | 113 | config, |
|
114 | 114 | repo, |
|
115 | 115 | }; |
|
116 | 116 | |
|
117 | 117 | if let Ok(repo) = repo { |
|
118 | 118 | // We don't support subrepos, fallback if the subrepos file is present |
|
119 | 119 | if repo.working_directory_vfs().join(".hgsub").exists() { |
|
120 | 120 | let msg = "subrepos (.hgsub is present)"; |
|
121 | 121 | return Err(CommandError::unsupported(msg)); |
|
122 | 122 | } |
|
123 | 123 | } |
|
124 | 124 | |
|
125 | 125 | if config.is_extension_enabled(b"blackbox") { |
|
126 | 126 | let blackbox = |
|
127 | 127 | blackbox::Blackbox::new(&invocation, process_start_time)?; |
|
128 | 128 | blackbox.log_command_start(argv.iter()); |
|
129 | 129 | let result = run(&invocation); |
|
130 | 130 | blackbox.log_command_end( |
|
131 | 131 | argv.iter(), |
|
132 | 132 | exit_code( |
|
133 | 133 | &result, |
|
134 | 134 | // TODO: show a warning or combine with original error if |
|
135 | 135 | // `get_bool` returns an error |
|
136 | 136 | config |
|
137 | 137 | .get_bool(b"ui", b"detailed-exit-code") |
|
138 | 138 | .unwrap_or(false), |
|
139 | 139 | ), |
|
140 | 140 | ); |
|
141 | 141 | result |
|
142 | 142 | } else { |
|
143 | 143 | run(&invocation) |
|
144 | 144 | } |
|
145 | 145 | } |
|
146 | 146 | |
|
147 | 147 | fn rhg_main(argv: Vec<OsString>) -> ! { |
|
148 | 148 | // Run this first, before we find out if the blackbox extension is even |
|
149 | 149 | // enabled, in order to include everything in-between in the duration |
|
150 | 150 | // measurements. Reading config files can be slow if theyβre on NFS. |
|
151 | 151 | let process_start_time = blackbox::ProcessStartTime::now(); |
|
152 | 152 | |
|
153 | 153 | env_logger::init(); |
|
154 | 154 | |
|
155 | 155 | let early_args = EarlyArgs::parse(&argv); |
|
156 | 156 | |
|
157 | 157 | let initial_current_dir = early_args.cwd.map(|cwd| { |
|
158 | 158 | let cwd = get_path_from_bytes(&cwd); |
|
159 | 159 | std::env::current_dir() |
|
160 | 160 | .and_then(|initial| { |
|
161 | 161 | std::env::set_current_dir(cwd)?; |
|
162 | 162 | Ok(initial) |
|
163 | 163 | }) |
|
164 | 164 | .unwrap_or_else(|error| { |
|
165 | 165 | exit( |
|
166 | 166 | &argv, |
|
167 | 167 | &None, |
|
168 | 168 | &Ui::new_infallible(&Config::empty()), |
|
169 | 169 | OnUnsupported::Abort, |
|
170 | 170 | Err(CommandError::abort(format!( |
|
171 | 171 | "abort: {}: '{}'", |
|
172 | 172 | error, |
|
173 | 173 | cwd.display() |
|
174 | 174 | ))), |
|
175 | 175 | false, |
|
176 | 176 | ) |
|
177 | 177 | }) |
|
178 | 178 | }); |
|
179 | 179 | |
|
180 | 180 | let mut non_repo_config = |
|
181 | 181 | Config::load_non_repo().unwrap_or_else(|error| { |
|
182 | 182 | // Normally this is decided based on config, but we donβt have that |
|
183 | 183 | // available. As of this writing config loading never returns an |
|
184 | 184 | // "unsupported" error but that is not enforced by the type system. |
|
185 | 185 | let on_unsupported = OnUnsupported::Abort; |
|
186 | 186 | |
|
187 | 187 | exit( |
|
188 | 188 | &argv, |
|
189 | 189 | &initial_current_dir, |
|
190 | 190 | &Ui::new_infallible(&Config::empty()), |
|
191 | 191 | on_unsupported, |
|
192 | 192 | Err(error.into()), |
|
193 | 193 | false, |
|
194 | 194 | ) |
|
195 | 195 | }); |
|
196 | 196 | |
|
197 | 197 | non_repo_config |
|
198 | 198 | .load_cli_args(early_args.config, early_args.color) |
|
199 | 199 | .unwrap_or_else(|error| { |
|
200 | 200 | exit( |
|
201 | 201 | &argv, |
|
202 | 202 | &initial_current_dir, |
|
203 | 203 | &Ui::new_infallible(&non_repo_config), |
|
204 | 204 | OnUnsupported::from_config(&non_repo_config), |
|
205 | 205 | Err(error.into()), |
|
206 | 206 | non_repo_config |
|
207 | 207 | .get_bool(b"ui", b"detailed-exit-code") |
|
208 | 208 | .unwrap_or(false), |
|
209 | 209 | ) |
|
210 | 210 | }); |
|
211 | 211 | |
|
212 | 212 | if let Some(repo_path_bytes) = &early_args.repo { |
|
213 | 213 | lazy_static::lazy_static! { |
|
214 | 214 | static ref SCHEME_RE: regex::bytes::Regex = |
|
215 | 215 | // Same as `_matchscheme` in `mercurial/util.py` |
|
216 | 216 | regex::bytes::Regex::new("^[a-zA-Z0-9+.\\-]+:").unwrap(); |
|
217 | 217 | } |
|
218 | 218 | if SCHEME_RE.is_match(&repo_path_bytes) { |
|
219 | 219 | exit( |
|
220 | 220 | &argv, |
|
221 | 221 | &initial_current_dir, |
|
222 | 222 | &Ui::new_infallible(&non_repo_config), |
|
223 | 223 | OnUnsupported::from_config(&non_repo_config), |
|
224 | 224 | Err(CommandError::UnsupportedFeature { |
|
225 | 225 | message: format_bytes!( |
|
226 | 226 | b"URL-like --repository {}", |
|
227 | 227 | repo_path_bytes |
|
228 | 228 | ), |
|
229 | 229 | }), |
|
230 | 230 | // TODO: show a warning or combine with original error if |
|
231 | 231 | // `get_bool` returns an error |
|
232 | 232 | non_repo_config |
|
233 | 233 | .get_bool(b"ui", b"detailed-exit-code") |
|
234 | 234 | .unwrap_or(false), |
|
235 | 235 | ) |
|
236 | 236 | } |
|
237 | 237 | } |
|
238 | 238 | let repo_arg = early_args.repo.unwrap_or(Vec::new()); |
|
239 | 239 | let repo_path: Option<PathBuf> = { |
|
240 | 240 | if repo_arg.is_empty() { |
|
241 | 241 | None |
|
242 | 242 | } else { |
|
243 | 243 | let local_config = { |
|
244 | 244 | if std::env::var_os("HGRCSKIPREPO").is_none() { |
|
245 | 245 | // TODO: handle errors from find_repo_root |
|
246 | 246 | if let Ok(current_dir_path) = Repo::find_repo_root() { |
|
247 | 247 | let config_files = vec![ |
|
248 | 248 | ConfigSource::AbsPath( |
|
249 | 249 | current_dir_path.join(".hg/hgrc"), |
|
250 | 250 | ), |
|
251 | 251 | ConfigSource::AbsPath( |
|
252 | 252 | current_dir_path.join(".hg/hgrc-not-shared"), |
|
253 | 253 | ), |
|
254 | 254 | ]; |
|
255 | 255 | // TODO: handle errors from |
|
256 | 256 | // `load_from_explicit_sources` |
|
257 | 257 | Config::load_from_explicit_sources(config_files).ok() |
|
258 | 258 | } else { |
|
259 | 259 | None |
|
260 | 260 | } |
|
261 | 261 | } else { |
|
262 | 262 | None |
|
263 | 263 | } |
|
264 | 264 | }; |
|
265 | 265 | |
|
266 | 266 | let non_repo_config_val = { |
|
267 | 267 | let non_repo_val = non_repo_config.get(b"paths", &repo_arg); |
|
268 | 268 | match &non_repo_val { |
|
269 | 269 | Some(val) if val.len() > 0 => home::home_dir() |
|
270 | 270 | .unwrap_or_else(|| PathBuf::from("~")) |
|
271 | 271 | .join(get_path_from_bytes(val)) |
|
272 | 272 | .canonicalize() |
|
273 | 273 | // TODO: handle error and make it similar to python |
|
274 | 274 | // implementation maybe? |
|
275 | 275 | .ok(), |
|
276 | 276 | _ => None, |
|
277 | 277 | } |
|
278 | 278 | }; |
|
279 | 279 | |
|
280 | 280 | let config_val = match &local_config { |
|
281 | 281 | None => non_repo_config_val, |
|
282 | 282 | Some(val) => { |
|
283 | 283 | let local_config_val = val.get(b"paths", &repo_arg); |
|
284 | 284 | match &local_config_val { |
|
285 | 285 | Some(val) if val.len() > 0 => { |
|
286 | 286 | // presence of a local_config assures that |
|
287 | 287 | // current_dir |
|
288 | 288 | // wont result in an Error |
|
289 | 289 | let canpath = hg::utils::current_dir() |
|
290 | 290 | .unwrap() |
|
291 | 291 | .join(get_path_from_bytes(val)) |
|
292 | 292 | .canonicalize(); |
|
293 | 293 | canpath.ok().or(non_repo_config_val) |
|
294 | 294 | } |
|
295 | 295 | _ => non_repo_config_val, |
|
296 | 296 | } |
|
297 | 297 | } |
|
298 | 298 | }; |
|
299 | 299 | config_val.or(Some(get_path_from_bytes(&repo_arg).to_path_buf())) |
|
300 | 300 | } |
|
301 | 301 | }; |
|
302 | 302 | |
|
303 | 303 | let repo_result = match Repo::find(&non_repo_config, repo_path.to_owned()) |
|
304 | 304 | { |
|
305 | 305 | Ok(repo) => Ok(repo), |
|
306 | 306 | Err(RepoError::NotFound { at }) if repo_path.is_none() => { |
|
307 | 307 | // Not finding a repo is not fatal yet, if `-R` was not given |
|
308 | 308 | Err(NoRepoInCwdError { cwd: at }) |
|
309 | 309 | } |
|
310 | 310 | Err(error) => exit( |
|
311 | 311 | &argv, |
|
312 | 312 | &initial_current_dir, |
|
313 | 313 | &Ui::new_infallible(&non_repo_config), |
|
314 | 314 | OnUnsupported::from_config(&non_repo_config), |
|
315 | 315 | Err(error.into()), |
|
316 | 316 | // TODO: show a warning or combine with original error if |
|
317 | 317 | // `get_bool` returns an error |
|
318 | 318 | non_repo_config |
|
319 | 319 | .get_bool(b"ui", b"detailed-exit-code") |
|
320 | 320 | .unwrap_or(false), |
|
321 | 321 | ), |
|
322 | 322 | }; |
|
323 | 323 | |
|
324 | 324 | let config = if let Ok(repo) = &repo_result { |
|
325 | 325 | repo.config() |
|
326 | 326 | } else { |
|
327 | 327 | &non_repo_config |
|
328 | 328 | }; |
|
329 | 329 | let ui = Ui::new(&config).unwrap_or_else(|error| { |
|
330 | 330 | exit( |
|
331 | 331 | &argv, |
|
332 | 332 | &initial_current_dir, |
|
333 | 333 | &Ui::new_infallible(&config), |
|
334 | 334 | OnUnsupported::from_config(&config), |
|
335 | 335 | Err(error.into()), |
|
336 | 336 | config |
|
337 | 337 | .get_bool(b"ui", b"detailed-exit-code") |
|
338 | 338 | .unwrap_or(false), |
|
339 | 339 | ) |
|
340 | 340 | }); |
|
341 | 341 | let on_unsupported = OnUnsupported::from_config(config); |
|
342 | 342 | |
|
343 | 343 | let result = main_with_result( |
|
344 | 344 | argv.iter().map(|s| s.to_owned()).collect(), |
|
345 | 345 | &process_start_time, |
|
346 | 346 | &ui, |
|
347 | 347 | repo_result.as_ref(), |
|
348 | 348 | config, |
|
349 | 349 | ); |
|
350 | 350 | exit( |
|
351 | 351 | &argv, |
|
352 | 352 | &initial_current_dir, |
|
353 | 353 | &ui, |
|
354 | 354 | on_unsupported, |
|
355 | 355 | result, |
|
356 | 356 | // TODO: show a warning or combine with original error if `get_bool` |
|
357 | 357 | // returns an error |
|
358 | 358 | config |
|
359 | 359 | .get_bool(b"ui", b"detailed-exit-code") |
|
360 | 360 | .unwrap_or(false), |
|
361 | 361 | ) |
|
362 | 362 | } |
|
363 | 363 | |
|
364 | 364 | fn main() -> ! { |
|
365 | 365 | rhg_main(std::env::args_os().collect()) |
|
366 | 366 | } |
|
367 | 367 | |
|
368 | 368 | fn exit_code( |
|
369 | 369 | result: &Result<(), CommandError>, |
|
370 | 370 | use_detailed_exit_code: bool, |
|
371 | 371 | ) -> i32 { |
|
372 | 372 | match result { |
|
373 | 373 | Ok(()) => exit_codes::OK, |
|
374 | 374 | Err(CommandError::Abort { |
|
375 | 375 | message: _, |
|
376 | 376 | detailed_exit_code, |
|
377 | 377 | }) => { |
|
378 | 378 | if use_detailed_exit_code { |
|
379 | 379 | *detailed_exit_code |
|
380 | 380 | } else { |
|
381 | 381 | exit_codes::ABORT |
|
382 | 382 | } |
|
383 | 383 | } |
|
384 | 384 | Err(CommandError::Unsuccessful) => exit_codes::UNSUCCESSFUL, |
|
385 | 385 | // Exit with a specific code and no error message to let a potential |
|
386 | 386 | // wrapper script fallback to Python-based Mercurial. |
|
387 | 387 | Err(CommandError::UnsupportedFeature { .. }) => { |
|
388 | 388 | exit_codes::UNIMPLEMENTED |
|
389 | 389 | } |
|
390 | 390 | Err(CommandError::InvalidFallback { .. }) => { |
|
391 | 391 | exit_codes::INVALID_FALLBACK |
|
392 | 392 | } |
|
393 | 393 | } |
|
394 | 394 | } |
|
395 | 395 | |
|
396 | 396 | fn exit<'a>( |
|
397 | 397 | original_args: &'a [OsString], |
|
398 | 398 | initial_current_dir: &Option<PathBuf>, |
|
399 | 399 | ui: &Ui, |
|
400 | 400 | mut on_unsupported: OnUnsupported, |
|
401 | 401 | result: Result<(), CommandError>, |
|
402 | 402 | use_detailed_exit_code: bool, |
|
403 | 403 | ) -> ! { |
|
404 | 404 | if let ( |
|
405 | 405 | OnUnsupported::Fallback { executable }, |
|
406 | 406 | Err(CommandError::UnsupportedFeature { message }), |
|
407 | 407 | ) = (&on_unsupported, &result) |
|
408 | 408 | { |
|
409 | 409 | let mut args = original_args.iter(); |
|
410 | 410 | let executable = match executable { |
|
411 | 411 | None => { |
|
412 | 412 | exit_no_fallback( |
|
413 | 413 | ui, |
|
414 | 414 | OnUnsupported::Abort, |
|
415 | 415 | Err(CommandError::abort( |
|
416 | 416 | "abort: 'rhg.on-unsupported=fallback' without \ |
|
417 | 417 | 'rhg.fallback-executable' set.", |
|
418 | 418 | )), |
|
419 | 419 | false, |
|
420 | 420 | ); |
|
421 | 421 | } |
|
422 | 422 | Some(executable) => executable, |
|
423 | 423 | }; |
|
424 | 424 | let executable_path = get_path_from_bytes(&executable); |
|
425 | 425 | let this_executable = args.next().expect("exepcted argv[0] to exist"); |
|
426 | 426 | if executable_path == &PathBuf::from(this_executable) { |
|
427 | 427 | // Avoid spawning infinitely many processes until resource |
|
428 | 428 | // exhaustion. |
|
429 | 429 | let _ = ui.write_stderr(&format_bytes!( |
|
430 | 430 | b"Blocking recursive fallback. The 'rhg.fallback-executable = {}' config \ |
|
431 | 431 | points to `rhg` itself.\n", |
|
432 | 432 | executable |
|
433 | 433 | )); |
|
434 | 434 | on_unsupported = OnUnsupported::Abort |
|
435 | 435 | } else { |
|
436 | 436 | log::debug!("falling back (see trace-level log)"); |
|
437 | 437 | log::trace!("{}", local_to_utf8(message)); |
|
438 | 438 | if let Err(err) = which::which(executable_path) { |
|
439 | 439 | exit_no_fallback( |
|
440 | 440 | ui, |
|
441 | 441 | OnUnsupported::Abort, |
|
442 | 442 | Err(CommandError::InvalidFallback { |
|
443 | 443 | path: executable.to_owned(), |
|
444 | 444 | err: err.to_string(), |
|
445 | 445 | }), |
|
446 | 446 | use_detailed_exit_code, |
|
447 | 447 | ) |
|
448 | 448 | } |
|
449 | 449 | // `args` is now `argv[1..]` since weβve already consumed |
|
450 | 450 | // `argv[0]` |
|
451 | 451 | let mut command = Command::new(executable_path); |
|
452 | 452 | command.args(args); |
|
453 | 453 | if let Some(initial) = initial_current_dir { |
|
454 | 454 | command.current_dir(initial); |
|
455 | 455 | } |
|
456 | 456 | // We don't use subprocess because proper signal handling is harder |
|
457 | 457 | // and we don't want to keep `rhg` around after a fallback anyway. |
|
458 | 458 | // For example, if `rhg` is run in the background and falls back to |
|
459 | 459 | // `hg` which, in turn, waits for a signal, we'll get stuck if |
|
460 | 460 | // we're doing plain subprocess. |
|
461 | 461 | // |
|
462 | 462 | // If `exec` returns, we can only assume our process is very broken |
|
463 | 463 | // (see its documentation), so only try to forward the error code |
|
464 | 464 | // when exiting. |
|
465 | 465 | let err = command.exec(); |
|
466 | 466 | std::process::exit( |
|
467 | 467 | err.raw_os_error().unwrap_or(exit_codes::ABORT), |
|
468 | 468 | ); |
|
469 | 469 | } |
|
470 | 470 | } |
|
471 | 471 | exit_no_fallback(ui, on_unsupported, result, use_detailed_exit_code) |
|
472 | 472 | } |
|
473 | 473 | |
|
474 | 474 | fn exit_no_fallback( |
|
475 | 475 | ui: &Ui, |
|
476 | 476 | on_unsupported: OnUnsupported, |
|
477 | 477 | result: Result<(), CommandError>, |
|
478 | 478 | use_detailed_exit_code: bool, |
|
479 | 479 | ) -> ! { |
|
480 | 480 | match &result { |
|
481 | 481 | Ok(_) => {} |
|
482 | 482 | Err(CommandError::Unsuccessful) => {} |
|
483 | 483 | Err(CommandError::Abort { |
|
484 | 484 | message, |
|
485 | 485 | detailed_exit_code: _, |
|
486 | 486 | }) => { |
|
487 | 487 | if !message.is_empty() { |
|
488 | 488 | // Ignore errors when writing to stderr, weβre already exiting |
|
489 | 489 | // with failure code so thereβs not much more we can do. |
|
490 | 490 | let _ = ui.write_stderr(&format_bytes!(b"{}\n", message)); |
|
491 | 491 | } |
|
492 | 492 | } |
|
493 | 493 | Err(CommandError::UnsupportedFeature { message }) => { |
|
494 | 494 | match on_unsupported { |
|
495 | 495 | OnUnsupported::Abort => { |
|
496 | 496 | let _ = ui.write_stderr(&format_bytes!( |
|
497 | 497 | b"unsupported feature: {}\n", |
|
498 | 498 | message |
|
499 | 499 | )); |
|
500 | 500 | } |
|
501 | 501 | OnUnsupported::AbortSilent => {} |
|
502 | 502 | OnUnsupported::Fallback { .. } => unreachable!(), |
|
503 | 503 | } |
|
504 | 504 | } |
|
505 | 505 | Err(CommandError::InvalidFallback { path, err }) => { |
|
506 | 506 | let _ = ui.write_stderr(&format_bytes!( |
|
507 | 507 | b"abort: invalid fallback '{}': {}\n", |
|
508 | 508 | path, |
|
509 | 509 | err.as_bytes(), |
|
510 | 510 | )); |
|
511 | 511 | } |
|
512 | 512 | } |
|
513 | 513 | std::process::exit(exit_code(&result, use_detailed_exit_code)) |
|
514 | 514 | } |
|
515 | 515 | |
|
516 | 516 | macro_rules! subcommands { |
|
517 | 517 | ($( $command: ident )+) => { |
|
518 | 518 | mod commands { |
|
519 | 519 | $( |
|
520 | 520 | pub mod $command; |
|
521 | 521 | )+ |
|
522 | 522 | } |
|
523 | 523 | |
|
524 | 524 | fn add_subcommand_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> { |
|
525 | 525 | app |
|
526 | 526 | $( |
|
527 | 527 | .subcommand(commands::$command::args()) |
|
528 | 528 | )+ |
|
529 | 529 | } |
|
530 | 530 | |
|
531 | 531 | pub type RunFn = fn(&CliInvocation) -> Result<(), CommandError>; |
|
532 | 532 | |
|
533 | 533 | fn subcommand_run_fn(name: &str) -> Option<RunFn> { |
|
534 | 534 | match name { |
|
535 | 535 | $( |
|
536 | 536 | stringify!($command) => Some(commands::$command::run), |
|
537 | 537 | )+ |
|
538 | 538 | _ => None, |
|
539 | 539 | } |
|
540 | 540 | } |
|
541 | 541 | }; |
|
542 | 542 | } |
|
543 | 543 | |
|
544 | 544 | subcommands! { |
|
545 | 545 | cat |
|
546 | 546 | debugdata |
|
547 | 547 | debugrequirements |
|
548 | 548 | debugignorerhg |
|
549 | 549 | files |
|
550 | 550 | root |
|
551 | 551 | config |
|
552 | 552 | status |
|
553 | 553 | } |
|
554 | 554 | |
|
555 | 555 | pub struct CliInvocation<'a> { |
|
556 | 556 | ui: &'a Ui, |
|
557 | 557 | subcommand_args: &'a ArgMatches<'a>, |
|
558 | 558 | config: &'a Config, |
|
559 | 559 | /// References inside `Result` is a bit peculiar but allow |
|
560 | 560 | /// `invocation.repo?` to work out with `&CliInvocation` since this |
|
561 | 561 | /// `Result` type is `Copy`. |
|
562 | 562 | repo: Result<&'a Repo, &'a NoRepoInCwdError>, |
|
563 | 563 | } |
|
564 | 564 | |
|
565 | 565 | struct NoRepoInCwdError { |
|
566 | 566 | cwd: PathBuf, |
|
567 | 567 | } |
|
568 | 568 | |
|
569 | 569 | /// CLI arguments to be parsed "early" in order to be able to read |
|
570 | 570 | /// configuration before using Clap. Ideally we would also use Clap for this, |
|
571 | 571 | /// see <https://github.com/clap-rs/clap/discussions/2366>. |
|
572 | 572 | /// |
|
573 | 573 | /// These arguments are still declared when we do use Clap later, so that Clap |
|
574 | 574 | /// does not return an error for their presence. |
|
575 | 575 | struct EarlyArgs { |
|
576 | 576 | /// Values of all `--config` arguments. (Possibly none) |
|
577 | 577 | config: Vec<Vec<u8>>, |
|
578 | 578 | /// Value of all the `--color` argument, if any. |
|
579 | 579 | color: Option<Vec<u8>>, |
|
580 | 580 | /// Value of the `-R` or `--repository` argument, if any. |
|
581 | 581 | repo: Option<Vec<u8>>, |
|
582 | 582 | /// Value of the `--cwd` argument, if any. |
|
583 | 583 | cwd: Option<Vec<u8>>, |
|
584 | 584 | } |
|
585 | 585 | |
|
586 | 586 | impl EarlyArgs { |
|
587 | 587 | fn parse<'a>(args: impl IntoIterator<Item = &'a OsString>) -> Self { |
|
588 | 588 | let mut args = args.into_iter().map(get_bytes_from_os_str); |
|
589 | 589 | let mut config = Vec::new(); |
|
590 | 590 | let mut color = None; |
|
591 | 591 | let mut repo = None; |
|
592 | 592 | let mut cwd = None; |
|
593 | 593 | // Use `while let` instead of `for` so that we can also call |
|
594 | 594 | // `args.next()` inside the loop. |
|
595 | 595 | while let Some(arg) = args.next() { |
|
596 | 596 | if arg == b"--config" { |
|
597 | 597 | if let Some(value) = args.next() { |
|
598 | 598 | config.push(value) |
|
599 | 599 | } |
|
600 | 600 | } else if let Some(value) = arg.drop_prefix(b"--config=") { |
|
601 | 601 | config.push(value.to_owned()) |
|
602 | 602 | } |
|
603 | 603 | |
|
604 | 604 | if arg == b"--color" { |
|
605 | 605 | if let Some(value) = args.next() { |
|
606 | 606 | color = Some(value) |
|
607 | 607 | } |
|
608 | 608 | } else if let Some(value) = arg.drop_prefix(b"--color=") { |
|
609 | 609 | color = Some(value.to_owned()) |
|
610 | 610 | } |
|
611 | 611 | |
|
612 | 612 | if arg == b"--cwd" { |
|
613 | 613 | if let Some(value) = args.next() { |
|
614 | 614 | cwd = Some(value) |
|
615 | 615 | } |
|
616 | 616 | } else if let Some(value) = arg.drop_prefix(b"--cwd=") { |
|
617 | 617 | cwd = Some(value.to_owned()) |
|
618 | 618 | } |
|
619 | 619 | |
|
620 | 620 | if arg == b"--repository" || arg == b"-R" { |
|
621 | 621 | if let Some(value) = args.next() { |
|
622 | 622 | repo = Some(value) |
|
623 | 623 | } |
|
624 | 624 | } else if let Some(value) = arg.drop_prefix(b"--repository=") { |
|
625 | 625 | repo = Some(value.to_owned()) |
|
626 | 626 | } else if let Some(value) = arg.drop_prefix(b"-R") { |
|
627 | 627 | repo = Some(value.to_owned()) |
|
628 | 628 | } |
|
629 | 629 | } |
|
630 | 630 | Self { |
|
631 | 631 | config, |
|
632 | 632 | color, |
|
633 | 633 | repo, |
|
634 | 634 | cwd, |
|
635 | 635 | } |
|
636 | 636 | } |
|
637 | 637 | } |
|
638 | 638 | |
|
639 | 639 | /// What to do when encountering some unsupported feature. |
|
640 | 640 | /// |
|
641 | 641 | /// See `HgError::UnsupportedFeature` and `CommandError::UnsupportedFeature`. |
|
642 | 642 | enum OnUnsupported { |
|
643 | 643 | /// Print an error message describing what feature is not supported, |
|
644 | 644 | /// and exit with code 252. |
|
645 | 645 | Abort, |
|
646 | 646 | /// Silently exit with code 252. |
|
647 | 647 | AbortSilent, |
|
648 | 648 | /// Try running a Python implementation |
|
649 | 649 | Fallback { executable: Option<Vec<u8>> }, |
|
650 | 650 | } |
|
651 | 651 | |
|
652 | 652 | impl OnUnsupported { |
|
653 | 653 | const DEFAULT: Self = OnUnsupported::Abort; |
|
654 | 654 | |
|
655 | 655 | fn from_config(config: &Config) -> Self { |
|
656 | 656 | match config |
|
657 | 657 | .get(b"rhg", b"on-unsupported") |
|
658 | 658 | .map(|value| value.to_ascii_lowercase()) |
|
659 | 659 | .as_deref() |
|
660 | 660 | { |
|
661 | 661 | Some(b"abort") => OnUnsupported::Abort, |
|
662 | 662 | Some(b"abort-silent") => OnUnsupported::AbortSilent, |
|
663 | 663 | Some(b"fallback") => OnUnsupported::Fallback { |
|
664 | 664 | executable: config |
|
665 | 665 | .get(b"rhg", b"fallback-executable") |
|
666 | 666 | .map(|x| x.to_owned()), |
|
667 | 667 | }, |
|
668 | 668 | None => Self::DEFAULT, |
|
669 | 669 | Some(_) => { |
|
670 | 670 | // TODO: warn about unknown config value |
|
671 | 671 | Self::DEFAULT |
|
672 | 672 | } |
|
673 | 673 | } |
|
674 | 674 | } |
|
675 | 675 | } |
|
676 | 676 | |
|
677 | 677 | /// The `*` extension is an edge-case for config sub-options that apply to all |
|
678 | 678 | /// extensions. For now, only `:required` exists, but that may change in the |
|
679 | 679 | /// future. |
|
680 | 680 | const SUPPORTED_EXTENSIONS: &[&[u8]] = |
|
681 | 681 | &[b"blackbox", b"share", b"sparse", b"narrow", b"*"]; |
|
682 | 682 | |
|
683 | 683 | fn check_extensions(config: &Config) -> Result<(), CommandError> { |
|
684 | 684 | if let Some(b"*") = config.get(b"rhg", b"ignored-extensions") { |
|
685 | 685 | // All extensions are to be ignored, nothing to do here |
|
686 | 686 | return Ok(()); |
|
687 | 687 | } |
|
688 | 688 | |
|
689 | 689 | let enabled: HashSet<&[u8]> = config |
|
690 | 690 | .get_section_keys(b"extensions") |
|
691 | 691 | .into_iter() |
|
692 | 692 | .map(|extension| { |
|
693 | 693 | // Ignore extension suboptions. Only `required` exists for now. |
|
694 | 694 | // `rhg` either supports an extension or doesn't, so it doesn't |
|
695 | 695 | // make sense to consider the loading of an extension. |
|
696 | 696 | extension.split_2(b':').unwrap_or((extension, b"")).0 |
|
697 | 697 | }) |
|
698 | 698 | .collect(); |
|
699 | 699 | |
|
700 | 700 | let mut unsupported = enabled; |
|
701 | 701 | for supported in SUPPORTED_EXTENSIONS { |
|
702 | 702 | unsupported.remove(supported); |
|
703 | 703 | } |
|
704 | 704 | |
|
705 | 705 | if let Some(ignored_list) = config.get_list(b"rhg", b"ignored-extensions") |
|
706 | 706 | { |
|
707 | 707 | for ignored in ignored_list { |
|
708 | 708 | unsupported.remove(ignored.as_slice()); |
|
709 | 709 | } |
|
710 | 710 | } |
|
711 | 711 | |
|
712 | 712 | if unsupported.is_empty() { |
|
713 | 713 | Ok(()) |
|
714 | 714 | } else { |
|
715 | 715 | let mut unsupported: Vec<_> = unsupported.into_iter().collect(); |
|
716 | 716 | // Sort the extensions to get a stable output |
|
717 | 717 | unsupported.sort(); |
|
718 | 718 | Err(CommandError::UnsupportedFeature { |
|
719 | 719 | message: format_bytes!( |
|
720 | 720 | b"extensions: {} (consider adding them to 'rhg.ignored-extensions' config)", |
|
721 | 721 | join(unsupported, b", ") |
|
722 | 722 | ), |
|
723 | 723 | }) |
|
724 | 724 | } |
|
725 | 725 | } |
|
726 | 726 | |
|
727 | 727 | /// Array of tuples of (auto upgrade conf, feature conf, local requirement) |
|
728 | 728 | const AUTO_UPGRADES: &[((&str, &str), (&str, &str), &str)] = &[ |
|
729 | 729 | ( |
|
730 | 730 | ("format", "use-share-safe.automatic-upgrade-of-mismatching-repositories"), |
|
731 | 731 | ("format", "use-share-safe"), |
|
732 | 732 | requirements::SHARESAFE_REQUIREMENT, |
|
733 | 733 | ), |
|
734 | ( | |
|
735 | ("format", "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"), | |
|
736 | ("format", "use-dirstate-tracked-hint"), | |
|
737 | requirements::DIRSTATE_TRACKED_HINT_V1, | |
|
738 | ), | |
|
734 | 739 | ]; |
|
735 | 740 | |
|
736 | 741 | /// Mercurial allows users to automatically upgrade their repository. |
|
737 | 742 | /// `rhg` does not have the ability to upgrade yet, so fallback if an upgrade |
|
738 | 743 | /// is needed. |
|
739 | 744 | fn check_auto_upgrade( |
|
740 | 745 | config: &Config, |
|
741 | 746 | reqs: &HashSet<String>, |
|
742 | 747 | ) -> Result<(), CommandError> { |
|
743 | 748 | for (upgrade_conf, feature_conf, local_req) in AUTO_UPGRADES.iter() { |
|
744 | 749 | let auto_upgrade = config |
|
745 | 750 | .get_bool(upgrade_conf.0.as_bytes(), upgrade_conf.1.as_bytes())?; |
|
746 | 751 | |
|
747 | 752 | if auto_upgrade { |
|
748 | 753 | let want_it = config.get_bool( |
|
749 | 754 | feature_conf.0.as_bytes(), |
|
750 | 755 | feature_conf.1.as_bytes(), |
|
751 | 756 | )?; |
|
752 | 757 | let have_it = reqs.contains(*local_req); |
|
753 | 758 | |
|
754 | 759 | let action = match (want_it, have_it) { |
|
755 | 760 | (true, false) => Some("upgrade"), |
|
756 | 761 | (false, true) => Some("downgrade"), |
|
757 | 762 | _ => None, |
|
758 | 763 | }; |
|
759 | 764 | if let Some(action) = action { |
|
760 | 765 | let message = format!( |
|
761 | 766 | "automatic {} {}.{}", |
|
762 | 767 | action, upgrade_conf.0, upgrade_conf.1 |
|
763 | 768 | ); |
|
764 | 769 | return Err(CommandError::unsupported(message)); |
|
765 | 770 | } |
|
766 | 771 | } |
|
767 | 772 | } |
|
768 | 773 | Ok(()) |
|
769 | 774 | } |
|
770 | 775 | |
|
771 | 776 | fn check_unsupported( |
|
772 | 777 | config: &Config, |
|
773 | 778 | repo: Result<&Repo, &NoRepoInCwdError>, |
|
774 | 779 | ) -> Result<(), CommandError> { |
|
775 | 780 | check_extensions(config)?; |
|
776 | 781 | |
|
777 | 782 | if std::env::var_os("HG_PENDING").is_some() { |
|
778 | 783 | // TODO: only if the value is `== repo.working_directory`? |
|
779 | 784 | // What about relative v.s. absolute paths? |
|
780 | 785 | Err(CommandError::unsupported("$HG_PENDING"))? |
|
781 | 786 | } |
|
782 | 787 | |
|
783 | 788 | if let Ok(repo) = repo { |
|
784 | 789 | if repo.has_subrepos()? { |
|
785 | 790 | Err(CommandError::unsupported("sub-repositories"))? |
|
786 | 791 | } |
|
787 | 792 | check_auto_upgrade(config, repo.requirements())?; |
|
788 | 793 | } |
|
789 | 794 | |
|
790 | 795 | if config.has_non_empty_section(b"encode") { |
|
791 | 796 | Err(CommandError::unsupported("[encode] config"))? |
|
792 | 797 | } |
|
793 | 798 | |
|
794 | 799 | if config.has_non_empty_section(b"decode") { |
|
795 | 800 | Err(CommandError::unsupported("[decode] config"))? |
|
796 | 801 | } |
|
797 | 802 | |
|
798 | 803 | Ok(()) |
|
799 | 804 | } |
@@ -1,4059 +1,4061 | |||
|
1 | 1 | Short help: |
|
2 | 2 | |
|
3 | 3 | $ hg |
|
4 | 4 | Mercurial Distributed SCM |
|
5 | 5 | |
|
6 | 6 | basic commands: |
|
7 | 7 | |
|
8 | 8 | add add the specified files on the next commit |
|
9 | 9 | annotate show changeset information by line for each file |
|
10 | 10 | clone make a copy of an existing repository |
|
11 | 11 | commit commit the specified files or all outstanding changes |
|
12 | 12 | diff diff repository (or selected files) |
|
13 | 13 | export dump the header and diffs for one or more changesets |
|
14 | 14 | forget forget the specified files on the next commit |
|
15 | 15 | init create a new repository in the given directory |
|
16 | 16 | log show revision history of entire repository or files |
|
17 | 17 | merge merge another revision into working directory |
|
18 | 18 | pull pull changes from the specified source |
|
19 | 19 | push push changes to the specified destination |
|
20 | 20 | remove remove the specified files on the next commit |
|
21 | 21 | serve start stand-alone webserver |
|
22 | 22 | status show changed files in the working directory |
|
23 | 23 | summary summarize working directory state |
|
24 | 24 | update update working directory (or switch revisions) |
|
25 | 25 | |
|
26 | 26 | (use 'hg help' for the full list of commands or 'hg -v' for details) |
|
27 | 27 | |
|
28 | 28 | $ hg -q |
|
29 | 29 | add add the specified files on the next commit |
|
30 | 30 | annotate show changeset information by line for each file |
|
31 | 31 | clone make a copy of an existing repository |
|
32 | 32 | commit commit the specified files or all outstanding changes |
|
33 | 33 | diff diff repository (or selected files) |
|
34 | 34 | export dump the header and diffs for one or more changesets |
|
35 | 35 | forget forget the specified files on the next commit |
|
36 | 36 | init create a new repository in the given directory |
|
37 | 37 | log show revision history of entire repository or files |
|
38 | 38 | merge merge another revision into working directory |
|
39 | 39 | pull pull changes from the specified source |
|
40 | 40 | push push changes to the specified destination |
|
41 | 41 | remove remove the specified files on the next commit |
|
42 | 42 | serve start stand-alone webserver |
|
43 | 43 | status show changed files in the working directory |
|
44 | 44 | summary summarize working directory state |
|
45 | 45 | update update working directory (or switch revisions) |
|
46 | 46 | |
|
47 | 47 | Extra extensions will be printed in help output in a non-reliable order since |
|
48 | 48 | the extension is unknown. |
|
49 | 49 | #if no-extraextensions |
|
50 | 50 | |
|
51 | 51 | $ hg help |
|
52 | 52 | Mercurial Distributed SCM |
|
53 | 53 | |
|
54 | 54 | list of commands: |
|
55 | 55 | |
|
56 | 56 | Repository creation: |
|
57 | 57 | |
|
58 | 58 | clone make a copy of an existing repository |
|
59 | 59 | init create a new repository in the given directory |
|
60 | 60 | |
|
61 | 61 | Remote repository management: |
|
62 | 62 | |
|
63 | 63 | incoming show new changesets found in source |
|
64 | 64 | outgoing show changesets not found in the destination |
|
65 | 65 | paths show aliases for remote repositories |
|
66 | 66 | pull pull changes from the specified source |
|
67 | 67 | push push changes to the specified destination |
|
68 | 68 | serve start stand-alone webserver |
|
69 | 69 | |
|
70 | 70 | Change creation: |
|
71 | 71 | |
|
72 | 72 | commit commit the specified files or all outstanding changes |
|
73 | 73 | |
|
74 | 74 | Change manipulation: |
|
75 | 75 | |
|
76 | 76 | backout reverse effect of earlier changeset |
|
77 | 77 | graft copy changes from other branches onto the current branch |
|
78 | 78 | merge merge another revision into working directory |
|
79 | 79 | |
|
80 | 80 | Change organization: |
|
81 | 81 | |
|
82 | 82 | bookmarks create a new bookmark or list existing bookmarks |
|
83 | 83 | branch set or show the current branch name |
|
84 | 84 | branches list repository named branches |
|
85 | 85 | phase set or show the current phase name |
|
86 | 86 | tag add one or more tags for the current or given revision |
|
87 | 87 | tags list repository tags |
|
88 | 88 | |
|
89 | 89 | File content management: |
|
90 | 90 | |
|
91 | 91 | annotate show changeset information by line for each file |
|
92 | 92 | cat output the current or given revision of files |
|
93 | 93 | copy mark files as copied for the next commit |
|
94 | 94 | diff diff repository (or selected files) |
|
95 | 95 | grep search for a pattern in specified files |
|
96 | 96 | |
|
97 | 97 | Change navigation: |
|
98 | 98 | |
|
99 | 99 | bisect subdivision search of changesets |
|
100 | 100 | heads show branch heads |
|
101 | 101 | identify identify the working directory or specified revision |
|
102 | 102 | log show revision history of entire repository or files |
|
103 | 103 | |
|
104 | 104 | Working directory management: |
|
105 | 105 | |
|
106 | 106 | add add the specified files on the next commit |
|
107 | 107 | addremove add all new files, delete all missing files |
|
108 | 108 | files list tracked files |
|
109 | 109 | forget forget the specified files on the next commit |
|
110 | 110 | purge removes files not tracked by Mercurial |
|
111 | 111 | remove remove the specified files on the next commit |
|
112 | 112 | rename rename files; equivalent of copy + remove |
|
113 | 113 | resolve redo merges or set/view the merge status of files |
|
114 | 114 | revert restore files to their checkout state |
|
115 | 115 | root print the root (top) of the current working directory |
|
116 | 116 | shelve save and set aside changes from the working directory |
|
117 | 117 | status show changed files in the working directory |
|
118 | 118 | summary summarize working directory state |
|
119 | 119 | unshelve restore a shelved change to the working directory |
|
120 | 120 | update update working directory (or switch revisions) |
|
121 | 121 | |
|
122 | 122 | Change import/export: |
|
123 | 123 | |
|
124 | 124 | archive create an unversioned archive of a repository revision |
|
125 | 125 | bundle create a bundle file |
|
126 | 126 | export dump the header and diffs for one or more changesets |
|
127 | 127 | import import an ordered set of patches |
|
128 | 128 | unbundle apply one or more bundle files |
|
129 | 129 | |
|
130 | 130 | Repository maintenance: |
|
131 | 131 | |
|
132 | 132 | manifest output the current or given revision of the project manifest |
|
133 | 133 | recover roll back an interrupted transaction |
|
134 | 134 | verify verify the integrity of the repository |
|
135 | 135 | |
|
136 | 136 | Help: |
|
137 | 137 | |
|
138 | 138 | config show combined config settings from all hgrc files |
|
139 | 139 | help show help for a given topic or a help overview |
|
140 | 140 | version output version and copyright information |
|
141 | 141 | |
|
142 | 142 | additional help topics: |
|
143 | 143 | |
|
144 | 144 | Mercurial identifiers: |
|
145 | 145 | |
|
146 | 146 | filesets Specifying File Sets |
|
147 | 147 | hgignore Syntax for Mercurial Ignore Files |
|
148 | 148 | patterns File Name Patterns |
|
149 | 149 | revisions Specifying Revisions |
|
150 | 150 | urls URL Paths |
|
151 | 151 | |
|
152 | 152 | Mercurial output: |
|
153 | 153 | |
|
154 | 154 | color Colorizing Outputs |
|
155 | 155 | dates Date Formats |
|
156 | 156 | diffs Diff Formats |
|
157 | 157 | templating Template Usage |
|
158 | 158 | |
|
159 | 159 | Mercurial configuration: |
|
160 | 160 | |
|
161 | 161 | config Configuration Files |
|
162 | 162 | environment Environment Variables |
|
163 | 163 | extensions Using Additional Features |
|
164 | 164 | flags Command-line flags |
|
165 | 165 | hgweb Configuring hgweb |
|
166 | 166 | merge-tools Merge Tools |
|
167 | 167 | pager Pager Support |
|
168 | 168 | rust Rust in Mercurial |
|
169 | 169 | |
|
170 | 170 | Concepts: |
|
171 | 171 | |
|
172 | 172 | bundlespec Bundle File Formats |
|
173 | 173 | evolution Safely rewriting history (EXPERIMENTAL) |
|
174 | 174 | glossary Glossary |
|
175 | 175 | phases Working with Phases |
|
176 | 176 | subrepos Subrepositories |
|
177 | 177 | |
|
178 | 178 | Miscellaneous: |
|
179 | 179 | |
|
180 | 180 | deprecated Deprecated Features |
|
181 | 181 | internals Technical implementation topics |
|
182 | 182 | scripting Using Mercurial from scripts and automation |
|
183 | 183 | |
|
184 | 184 | (use 'hg help -v' to show built-in aliases and global options) |
|
185 | 185 | |
|
186 | 186 | $ hg -q help |
|
187 | 187 | Repository creation: |
|
188 | 188 | |
|
189 | 189 | clone make a copy of an existing repository |
|
190 | 190 | init create a new repository in the given directory |
|
191 | 191 | |
|
192 | 192 | Remote repository management: |
|
193 | 193 | |
|
194 | 194 | incoming show new changesets found in source |
|
195 | 195 | outgoing show changesets not found in the destination |
|
196 | 196 | paths show aliases for remote repositories |
|
197 | 197 | pull pull changes from the specified source |
|
198 | 198 | push push changes to the specified destination |
|
199 | 199 | serve start stand-alone webserver |
|
200 | 200 | |
|
201 | 201 | Change creation: |
|
202 | 202 | |
|
203 | 203 | commit commit the specified files or all outstanding changes |
|
204 | 204 | |
|
205 | 205 | Change manipulation: |
|
206 | 206 | |
|
207 | 207 | backout reverse effect of earlier changeset |
|
208 | 208 | graft copy changes from other branches onto the current branch |
|
209 | 209 | merge merge another revision into working directory |
|
210 | 210 | |
|
211 | 211 | Change organization: |
|
212 | 212 | |
|
213 | 213 | bookmarks create a new bookmark or list existing bookmarks |
|
214 | 214 | branch set or show the current branch name |
|
215 | 215 | branches list repository named branches |
|
216 | 216 | phase set or show the current phase name |
|
217 | 217 | tag add one or more tags for the current or given revision |
|
218 | 218 | tags list repository tags |
|
219 | 219 | |
|
220 | 220 | File content management: |
|
221 | 221 | |
|
222 | 222 | annotate show changeset information by line for each file |
|
223 | 223 | cat output the current or given revision of files |
|
224 | 224 | copy mark files as copied for the next commit |
|
225 | 225 | diff diff repository (or selected files) |
|
226 | 226 | grep search for a pattern in specified files |
|
227 | 227 | |
|
228 | 228 | Change navigation: |
|
229 | 229 | |
|
230 | 230 | bisect subdivision search of changesets |
|
231 | 231 | heads show branch heads |
|
232 | 232 | identify identify the working directory or specified revision |
|
233 | 233 | log show revision history of entire repository or files |
|
234 | 234 | |
|
235 | 235 | Working directory management: |
|
236 | 236 | |
|
237 | 237 | add add the specified files on the next commit |
|
238 | 238 | addremove add all new files, delete all missing files |
|
239 | 239 | files list tracked files |
|
240 | 240 | forget forget the specified files on the next commit |
|
241 | 241 | purge removes files not tracked by Mercurial |
|
242 | 242 | remove remove the specified files on the next commit |
|
243 | 243 | rename rename files; equivalent of copy + remove |
|
244 | 244 | resolve redo merges or set/view the merge status of files |
|
245 | 245 | revert restore files to their checkout state |
|
246 | 246 | root print the root (top) of the current working directory |
|
247 | 247 | shelve save and set aside changes from the working directory |
|
248 | 248 | status show changed files in the working directory |
|
249 | 249 | summary summarize working directory state |
|
250 | 250 | unshelve restore a shelved change to the working directory |
|
251 | 251 | update update working directory (or switch revisions) |
|
252 | 252 | |
|
253 | 253 | Change import/export: |
|
254 | 254 | |
|
255 | 255 | archive create an unversioned archive of a repository revision |
|
256 | 256 | bundle create a bundle file |
|
257 | 257 | export dump the header and diffs for one or more changesets |
|
258 | 258 | import import an ordered set of patches |
|
259 | 259 | unbundle apply one or more bundle files |
|
260 | 260 | |
|
261 | 261 | Repository maintenance: |
|
262 | 262 | |
|
263 | 263 | manifest output the current or given revision of the project manifest |
|
264 | 264 | recover roll back an interrupted transaction |
|
265 | 265 | verify verify the integrity of the repository |
|
266 | 266 | |
|
267 | 267 | Help: |
|
268 | 268 | |
|
269 | 269 | config show combined config settings from all hgrc files |
|
270 | 270 | help show help for a given topic or a help overview |
|
271 | 271 | version output version and copyright information |
|
272 | 272 | |
|
273 | 273 | additional help topics: |
|
274 | 274 | |
|
275 | 275 | Mercurial identifiers: |
|
276 | 276 | |
|
277 | 277 | filesets Specifying File Sets |
|
278 | 278 | hgignore Syntax for Mercurial Ignore Files |
|
279 | 279 | patterns File Name Patterns |
|
280 | 280 | revisions Specifying Revisions |
|
281 | 281 | urls URL Paths |
|
282 | 282 | |
|
283 | 283 | Mercurial output: |
|
284 | 284 | |
|
285 | 285 | color Colorizing Outputs |
|
286 | 286 | dates Date Formats |
|
287 | 287 | diffs Diff Formats |
|
288 | 288 | templating Template Usage |
|
289 | 289 | |
|
290 | 290 | Mercurial configuration: |
|
291 | 291 | |
|
292 | 292 | config Configuration Files |
|
293 | 293 | environment Environment Variables |
|
294 | 294 | extensions Using Additional Features |
|
295 | 295 | flags Command-line flags |
|
296 | 296 | hgweb Configuring hgweb |
|
297 | 297 | merge-tools Merge Tools |
|
298 | 298 | pager Pager Support |
|
299 | 299 | rust Rust in Mercurial |
|
300 | 300 | |
|
301 | 301 | Concepts: |
|
302 | 302 | |
|
303 | 303 | bundlespec Bundle File Formats |
|
304 | 304 | evolution Safely rewriting history (EXPERIMENTAL) |
|
305 | 305 | glossary Glossary |
|
306 | 306 | phases Working with Phases |
|
307 | 307 | subrepos Subrepositories |
|
308 | 308 | |
|
309 | 309 | Miscellaneous: |
|
310 | 310 | |
|
311 | 311 | deprecated Deprecated Features |
|
312 | 312 | internals Technical implementation topics |
|
313 | 313 | scripting Using Mercurial from scripts and automation |
|
314 | 314 | |
|
315 | 315 | Test extension help: |
|
316 | 316 | $ hg help extensions --config extensions.rebase= --config extensions.children= |
|
317 | 317 | Using Additional Features |
|
318 | 318 | """"""""""""""""""""""""" |
|
319 | 319 | |
|
320 | 320 | Mercurial has the ability to add new features through the use of |
|
321 | 321 | extensions. Extensions may add new commands, add options to existing |
|
322 | 322 | commands, change the default behavior of commands, or implement hooks. |
|
323 | 323 | |
|
324 | 324 | To enable the "foo" extension, either shipped with Mercurial or in the |
|
325 | 325 | Python search path, create an entry for it in your configuration file, |
|
326 | 326 | like this: |
|
327 | 327 | |
|
328 | 328 | [extensions] |
|
329 | 329 | foo = |
|
330 | 330 | |
|
331 | 331 | You may also specify the full path to an extension: |
|
332 | 332 | |
|
333 | 333 | [extensions] |
|
334 | 334 | myfeature = ~/.hgext/myfeature.py |
|
335 | 335 | |
|
336 | 336 | See 'hg help config' for more information on configuration files. |
|
337 | 337 | |
|
338 | 338 | Extensions are not loaded by default for a variety of reasons: they can |
|
339 | 339 | increase startup overhead; they may be meant for advanced usage only; they |
|
340 | 340 | may provide potentially dangerous abilities (such as letting you destroy |
|
341 | 341 | or modify history); they might not be ready for prime time; or they may |
|
342 | 342 | alter some usual behaviors of stock Mercurial. It is thus up to the user |
|
343 | 343 | to activate extensions as needed. |
|
344 | 344 | |
|
345 | 345 | To explicitly disable an extension enabled in a configuration file of |
|
346 | 346 | broader scope, prepend its path with !: |
|
347 | 347 | |
|
348 | 348 | [extensions] |
|
349 | 349 | # disabling extension bar residing in /path/to/extension/bar.py |
|
350 | 350 | bar = !/path/to/extension/bar.py |
|
351 | 351 | # ditto, but no path was supplied for extension baz |
|
352 | 352 | baz = ! |
|
353 | 353 | |
|
354 | 354 | enabled extensions: |
|
355 | 355 | |
|
356 | 356 | children command to display child changesets (DEPRECATED) |
|
357 | 357 | rebase command to move sets of revisions to a different ancestor |
|
358 | 358 | |
|
359 | 359 | disabled extensions: |
|
360 | 360 | |
|
361 | 361 | acl hooks for controlling repository access |
|
362 | 362 | blackbox log repository events to a blackbox for debugging |
|
363 | 363 | bugzilla hooks for integrating with the Bugzilla bug tracker |
|
364 | 364 | censor erase file content at a given revision |
|
365 | 365 | churn command to display statistics about repository history |
|
366 | 366 | clonebundles advertise pre-generated bundles to seed clones |
|
367 | 367 | closehead close arbitrary heads without checking them out first |
|
368 | 368 | convert import revisions from foreign VCS repositories into |
|
369 | 369 | Mercurial |
|
370 | 370 | eol automatically manage newlines in repository files |
|
371 | 371 | extdiff command to allow external programs to compare revisions |
|
372 | 372 | factotum http authentication with factotum |
|
373 | 373 | fastexport export repositories as git fast-import stream |
|
374 | 374 | githelp try mapping git commands to Mercurial commands |
|
375 | 375 | gpg commands to sign and verify changesets |
|
376 | 376 | hgk browse the repository in a graphical way |
|
377 | 377 | highlight syntax highlighting for hgweb (requires Pygments) |
|
378 | 378 | histedit interactive history editing |
|
379 | 379 | keyword expand keywords in tracked files |
|
380 | 380 | largefiles track large binary files |
|
381 | 381 | mq manage a stack of patches |
|
382 | 382 | notify hooks for sending email push notifications |
|
383 | 383 | patchbomb command to send changesets as (a series of) patch emails |
|
384 | 384 | relink recreates hardlinks between repository clones |
|
385 | 385 | schemes extend schemes with shortcuts to repository swarms |
|
386 | 386 | share share a common history between several working directories |
|
387 | 387 | transplant command to transplant changesets from another branch |
|
388 | 388 | win32mbcs allow the use of MBCS paths with problematic encodings |
|
389 | 389 | zeroconf discover and advertise repositories on the local network |
|
390 | 390 | |
|
391 | 391 | #endif |
|
392 | 392 | |
|
393 | 393 | Verify that deprecated extensions are included if --verbose: |
|
394 | 394 | |
|
395 | 395 | $ hg -v help extensions | grep children |
|
396 | 396 | children command to display child changesets (DEPRECATED) |
|
397 | 397 | |
|
398 | 398 | Verify that extension keywords appear in help templates |
|
399 | 399 | |
|
400 | 400 | $ hg help --config extensions.transplant= templating|grep transplant > /dev/null |
|
401 | 401 | |
|
402 | 402 | Test short command list with verbose option |
|
403 | 403 | |
|
404 | 404 | $ hg -v help shortlist |
|
405 | 405 | Mercurial Distributed SCM |
|
406 | 406 | |
|
407 | 407 | basic commands: |
|
408 | 408 | |
|
409 | 409 | abort abort an unfinished operation (EXPERIMENTAL) |
|
410 | 410 | add add the specified files on the next commit |
|
411 | 411 | annotate, blame |
|
412 | 412 | show changeset information by line for each file |
|
413 | 413 | clone make a copy of an existing repository |
|
414 | 414 | commit, ci commit the specified files or all outstanding changes |
|
415 | 415 | continue resumes an interrupted operation (EXPERIMENTAL) |
|
416 | 416 | diff diff repository (or selected files) |
|
417 | 417 | export dump the header and diffs for one or more changesets |
|
418 | 418 | forget forget the specified files on the next commit |
|
419 | 419 | init create a new repository in the given directory |
|
420 | 420 | log, history show revision history of entire repository or files |
|
421 | 421 | merge merge another revision into working directory |
|
422 | 422 | pull pull changes from the specified source |
|
423 | 423 | push push changes to the specified destination |
|
424 | 424 | remove, rm remove the specified files on the next commit |
|
425 | 425 | serve start stand-alone webserver |
|
426 | 426 | status, st show changed files in the working directory |
|
427 | 427 | summary, sum summarize working directory state |
|
428 | 428 | update, up, checkout, co |
|
429 | 429 | update working directory (or switch revisions) |
|
430 | 430 | |
|
431 | 431 | global options ([+] can be repeated): |
|
432 | 432 | |
|
433 | 433 | -R --repository REPO repository root directory or name of overlay bundle |
|
434 | 434 | file |
|
435 | 435 | --cwd DIR change working directory |
|
436 | 436 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
437 | 437 | all prompts |
|
438 | 438 | -q --quiet suppress output |
|
439 | 439 | -v --verbose enable additional output |
|
440 | 440 | --color TYPE when to colorize (boolean, always, auto, never, or |
|
441 | 441 | debug) |
|
442 | 442 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
443 | 443 | --debug enable debugging output |
|
444 | 444 | --debugger start debugger |
|
445 | 445 | --encoding ENCODE set the charset encoding (default: ascii) |
|
446 | 446 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
447 | 447 | --traceback always print a traceback on exception |
|
448 | 448 | --time time how long the command takes |
|
449 | 449 | --profile print command execution profile |
|
450 | 450 | --version output version information and exit |
|
451 | 451 | -h --help display help and exit |
|
452 | 452 | --hidden consider hidden changesets |
|
453 | 453 | --pager TYPE when to paginate (boolean, always, auto, or never) |
|
454 | 454 | (default: auto) |
|
455 | 455 | |
|
456 | 456 | (use 'hg help' for the full list of commands) |
|
457 | 457 | |
|
458 | 458 | $ hg add -h |
|
459 | 459 | hg add [OPTION]... [FILE]... |
|
460 | 460 | |
|
461 | 461 | add the specified files on the next commit |
|
462 | 462 | |
|
463 | 463 | Schedule files to be version controlled and added to the repository. |
|
464 | 464 | |
|
465 | 465 | The files will be added to the repository at the next commit. To undo an |
|
466 | 466 | add before that, see 'hg forget'. |
|
467 | 467 | |
|
468 | 468 | If no names are given, add all files to the repository (except files |
|
469 | 469 | matching ".hgignore"). |
|
470 | 470 | |
|
471 | 471 | Returns 0 if all files are successfully added. |
|
472 | 472 | |
|
473 | 473 | options ([+] can be repeated): |
|
474 | 474 | |
|
475 | 475 | -I --include PATTERN [+] include names matching the given patterns |
|
476 | 476 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
477 | 477 | -S --subrepos recurse into subrepositories |
|
478 | 478 | -n --dry-run do not perform actions, just print output |
|
479 | 479 | |
|
480 | 480 | (some details hidden, use --verbose to show complete help) |
|
481 | 481 | |
|
482 | 482 | Verbose help for add |
|
483 | 483 | |
|
484 | 484 | $ hg add -hv |
|
485 | 485 | hg add [OPTION]... [FILE]... |
|
486 | 486 | |
|
487 | 487 | add the specified files on the next commit |
|
488 | 488 | |
|
489 | 489 | Schedule files to be version controlled and added to the repository. |
|
490 | 490 | |
|
491 | 491 | The files will be added to the repository at the next commit. To undo an |
|
492 | 492 | add before that, see 'hg forget'. |
|
493 | 493 | |
|
494 | 494 | If no names are given, add all files to the repository (except files |
|
495 | 495 | matching ".hgignore"). |
|
496 | 496 | |
|
497 | 497 | Examples: |
|
498 | 498 | |
|
499 | 499 | - New (unknown) files are added automatically by 'hg add': |
|
500 | 500 | |
|
501 | 501 | $ ls |
|
502 | 502 | foo.c |
|
503 | 503 | $ hg status |
|
504 | 504 | ? foo.c |
|
505 | 505 | $ hg add |
|
506 | 506 | adding foo.c |
|
507 | 507 | $ hg status |
|
508 | 508 | A foo.c |
|
509 | 509 | |
|
510 | 510 | - Specific files to be added can be specified: |
|
511 | 511 | |
|
512 | 512 | $ ls |
|
513 | 513 | bar.c foo.c |
|
514 | 514 | $ hg status |
|
515 | 515 | ? bar.c |
|
516 | 516 | ? foo.c |
|
517 | 517 | $ hg add bar.c |
|
518 | 518 | $ hg status |
|
519 | 519 | A bar.c |
|
520 | 520 | ? foo.c |
|
521 | 521 | |
|
522 | 522 | Returns 0 if all files are successfully added. |
|
523 | 523 | |
|
524 | 524 | options ([+] can be repeated): |
|
525 | 525 | |
|
526 | 526 | -I --include PATTERN [+] include names matching the given patterns |
|
527 | 527 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
528 | 528 | -S --subrepos recurse into subrepositories |
|
529 | 529 | -n --dry-run do not perform actions, just print output |
|
530 | 530 | |
|
531 | 531 | global options ([+] can be repeated): |
|
532 | 532 | |
|
533 | 533 | -R --repository REPO repository root directory or name of overlay bundle |
|
534 | 534 | file |
|
535 | 535 | --cwd DIR change working directory |
|
536 | 536 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
537 | 537 | all prompts |
|
538 | 538 | -q --quiet suppress output |
|
539 | 539 | -v --verbose enable additional output |
|
540 | 540 | --color TYPE when to colorize (boolean, always, auto, never, or |
|
541 | 541 | debug) |
|
542 | 542 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
543 | 543 | --debug enable debugging output |
|
544 | 544 | --debugger start debugger |
|
545 | 545 | --encoding ENCODE set the charset encoding (default: ascii) |
|
546 | 546 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
547 | 547 | --traceback always print a traceback on exception |
|
548 | 548 | --time time how long the command takes |
|
549 | 549 | --profile print command execution profile |
|
550 | 550 | --version output version information and exit |
|
551 | 551 | -h --help display help and exit |
|
552 | 552 | --hidden consider hidden changesets |
|
553 | 553 | --pager TYPE when to paginate (boolean, always, auto, or never) |
|
554 | 554 | (default: auto) |
|
555 | 555 | |
|
556 | 556 | Test the textwidth config option |
|
557 | 557 | |
|
558 | 558 | $ hg root -h --config ui.textwidth=50 |
|
559 | 559 | hg root |
|
560 | 560 | |
|
561 | 561 | print the root (top) of the current working |
|
562 | 562 | directory |
|
563 | 563 | |
|
564 | 564 | Print the root directory of the current |
|
565 | 565 | repository. |
|
566 | 566 | |
|
567 | 567 | Returns 0 on success. |
|
568 | 568 | |
|
569 | 569 | options: |
|
570 | 570 | |
|
571 | 571 | -T --template TEMPLATE display with template |
|
572 | 572 | |
|
573 | 573 | (some details hidden, use --verbose to show |
|
574 | 574 | complete help) |
|
575 | 575 | |
|
576 | 576 | Test help option with version option |
|
577 | 577 | |
|
578 | 578 | $ hg add -h --version |
|
579 | 579 | Mercurial Distributed SCM (version *) (glob) |
|
580 | 580 | (see https://mercurial-scm.org for more information) |
|
581 | 581 | |
|
582 | 582 | Copyright (C) 2005-* Olivia Mackall and others (glob) |
|
583 | 583 | This is free software; see the source for copying conditions. There is NO |
|
584 | 584 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
585 | 585 | |
|
586 | 586 | $ hg add --skjdfks |
|
587 | 587 | hg add: option --skjdfks not recognized |
|
588 | 588 | hg add [OPTION]... [FILE]... |
|
589 | 589 | |
|
590 | 590 | add the specified files on the next commit |
|
591 | 591 | |
|
592 | 592 | options ([+] can be repeated): |
|
593 | 593 | |
|
594 | 594 | -I --include PATTERN [+] include names matching the given patterns |
|
595 | 595 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
596 | 596 | -S --subrepos recurse into subrepositories |
|
597 | 597 | -n --dry-run do not perform actions, just print output |
|
598 | 598 | |
|
599 | 599 | (use 'hg add -h' to show more help) |
|
600 | 600 | [10] |
|
601 | 601 | |
|
602 | 602 | Test ambiguous command help |
|
603 | 603 | |
|
604 | 604 | $ hg help ad |
|
605 | 605 | list of commands: |
|
606 | 606 | |
|
607 | 607 | add add the specified files on the next commit |
|
608 | 608 | addremove add all new files, delete all missing files |
|
609 | 609 | |
|
610 | 610 | (use 'hg help -v ad' to show built-in aliases and global options) |
|
611 | 611 | |
|
612 | 612 | Test command without options |
|
613 | 613 | |
|
614 | 614 | $ hg help verify |
|
615 | 615 | hg verify |
|
616 | 616 | |
|
617 | 617 | verify the integrity of the repository |
|
618 | 618 | |
|
619 | 619 | Verify the integrity of the current repository. |
|
620 | 620 | |
|
621 | 621 | This will perform an extensive check of the repository's integrity, |
|
622 | 622 | validating the hashes and checksums of each entry in the changelog, |
|
623 | 623 | manifest, and tracked files, as well as the integrity of their crosslinks |
|
624 | 624 | and indices. |
|
625 | 625 | |
|
626 | 626 | Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more |
|
627 | 627 | information about recovery from corruption of the repository. |
|
628 | 628 | |
|
629 | 629 | Returns 0 on success, 1 if errors are encountered. |
|
630 | 630 | |
|
631 | 631 | options: |
|
632 | 632 | |
|
633 | 633 | (some details hidden, use --verbose to show complete help) |
|
634 | 634 | |
|
635 | 635 | $ hg help diff |
|
636 | 636 | hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]... |
|
637 | 637 | |
|
638 | 638 | diff repository (or selected files) |
|
639 | 639 | |
|
640 | 640 | Show differences between revisions for the specified files. |
|
641 | 641 | |
|
642 | 642 | Differences between files are shown using the unified diff format. |
|
643 | 643 | |
|
644 | 644 | Note: |
|
645 | 645 | 'hg diff' may generate unexpected results for merges, as it will |
|
646 | 646 | default to comparing against the working directory's first parent |
|
647 | 647 | changeset if no revisions are specified. To diff against the conflict |
|
648 | 648 | regions, you can use '--config diff.merge=yes'. |
|
649 | 649 | |
|
650 | 650 | By default, the working directory files are compared to its first parent. |
|
651 | 651 | To see the differences from another revision, use --from. To see the |
|
652 | 652 | difference to another revision, use --to. For example, 'hg diff --from .^' |
|
653 | 653 | will show the differences from the working copy's grandparent to the |
|
654 | 654 | working copy, 'hg diff --to .' will show the diff from the working copy to |
|
655 | 655 | its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to |
|
656 | 656 | 1.2' will show the diff between those two revisions. |
|
657 | 657 | |
|
658 | 658 | Alternatively you can specify -c/--change with a revision to see the |
|
659 | 659 | changes in that changeset relative to its first parent (i.e. 'hg diff -c |
|
660 | 660 | 42' is equivalent to 'hg diff --from 42^ --to 42') |
|
661 | 661 | |
|
662 | 662 | Without the -a/--text option, diff will avoid generating diffs of files it |
|
663 | 663 | detects as binary. With -a, diff will generate a diff anyway, probably |
|
664 | 664 | with undesirable results. |
|
665 | 665 | |
|
666 | 666 | Use the -g/--git option to generate diffs in the git extended diff format. |
|
667 | 667 | For more information, read 'hg help diffs'. |
|
668 | 668 | |
|
669 | 669 | Returns 0 on success. |
|
670 | 670 | |
|
671 | 671 | options ([+] can be repeated): |
|
672 | 672 | |
|
673 | 673 | --from REV1 revision to diff from |
|
674 | 674 | --to REV2 revision to diff to |
|
675 | 675 | -c --change REV change made by revision |
|
676 | 676 | -a --text treat all files as text |
|
677 | 677 | -g --git use git extended diff format |
|
678 | 678 | --binary generate binary diffs in git mode (default) |
|
679 | 679 | --nodates omit dates from diff headers |
|
680 | 680 | --noprefix omit a/ and b/ prefixes from filenames |
|
681 | 681 | -p --show-function show which function each change is in |
|
682 | 682 | --reverse produce a diff that undoes the changes |
|
683 | 683 | -w --ignore-all-space ignore white space when comparing lines |
|
684 | 684 | -b --ignore-space-change ignore changes in the amount of white space |
|
685 | 685 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
686 | 686 | -Z --ignore-space-at-eol ignore changes in whitespace at EOL |
|
687 | 687 | -U --unified NUM number of lines of context to show |
|
688 | 688 | --stat output diffstat-style summary of changes |
|
689 | 689 | --root DIR produce diffs relative to subdirectory |
|
690 | 690 | -I --include PATTERN [+] include names matching the given patterns |
|
691 | 691 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
692 | 692 | -S --subrepos recurse into subrepositories |
|
693 | 693 | |
|
694 | 694 | (some details hidden, use --verbose to show complete help) |
|
695 | 695 | |
|
696 | 696 | $ hg help status |
|
697 | 697 | hg status [OPTION]... [FILE]... |
|
698 | 698 | |
|
699 | 699 | aliases: st |
|
700 | 700 | |
|
701 | 701 | show changed files in the working directory |
|
702 | 702 | |
|
703 | 703 | Show status of files in the repository. If names are given, only files |
|
704 | 704 | that match are shown. Files that are clean or ignored or the source of a |
|
705 | 705 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, |
|
706 | 706 | -C/--copies or -A/--all are given. Unless options described with "show |
|
707 | 707 | only ..." are given, the options -mardu are used. |
|
708 | 708 | |
|
709 | 709 | Option -q/--quiet hides untracked (unknown and ignored) files unless |
|
710 | 710 | explicitly requested with -u/--unknown or -i/--ignored. |
|
711 | 711 | |
|
712 | 712 | Note: |
|
713 | 713 | 'hg status' may appear to disagree with diff if permissions have |
|
714 | 714 | changed or a merge has occurred. The standard diff format does not |
|
715 | 715 | report permission changes and diff only reports changes relative to one |
|
716 | 716 | merge parent. |
|
717 | 717 | |
|
718 | 718 | If one revision is given, it is used as the base revision. If two |
|
719 | 719 | revisions are given, the differences between them are shown. The --change |
|
720 | 720 | option can also be used as a shortcut to list the changed files of a |
|
721 | 721 | revision from its first parent. |
|
722 | 722 | |
|
723 | 723 | The codes used to show the status of files are: |
|
724 | 724 | |
|
725 | 725 | M = modified |
|
726 | 726 | A = added |
|
727 | 727 | R = removed |
|
728 | 728 | C = clean |
|
729 | 729 | ! = missing (deleted by non-hg command, but still tracked) |
|
730 | 730 | ? = not tracked |
|
731 | 731 | I = ignored |
|
732 | 732 | = origin of the previous file (with --copies) |
|
733 | 733 | |
|
734 | 734 | Returns 0 on success. |
|
735 | 735 | |
|
736 | 736 | options ([+] can be repeated): |
|
737 | 737 | |
|
738 | 738 | -A --all show status of all files |
|
739 | 739 | -m --modified show only modified files |
|
740 | 740 | -a --added show only added files |
|
741 | 741 | -r --removed show only removed files |
|
742 | 742 | -d --deleted show only missing files |
|
743 | 743 | -c --clean show only files without changes |
|
744 | 744 | -u --unknown show only unknown (not tracked) files |
|
745 | 745 | -i --ignored show only ignored files |
|
746 | 746 | -n --no-status hide status prefix |
|
747 | 747 | -C --copies show source of copied files |
|
748 | 748 | -0 --print0 end filenames with NUL, for use with xargs |
|
749 | 749 | --rev REV [+] show difference from revision |
|
750 | 750 | --change REV list the changed files of a revision |
|
751 | 751 | -I --include PATTERN [+] include names matching the given patterns |
|
752 | 752 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
753 | 753 | -S --subrepos recurse into subrepositories |
|
754 | 754 | -T --template TEMPLATE display with template |
|
755 | 755 | |
|
756 | 756 | (some details hidden, use --verbose to show complete help) |
|
757 | 757 | |
|
758 | 758 | $ hg -q help status |
|
759 | 759 | hg status [OPTION]... [FILE]... |
|
760 | 760 | |
|
761 | 761 | show changed files in the working directory |
|
762 | 762 | |
|
763 | 763 | $ hg help foo |
|
764 | 764 | abort: no such help topic: foo |
|
765 | 765 | (try 'hg help --keyword foo') |
|
766 | 766 | [10] |
|
767 | 767 | |
|
768 | 768 | $ hg skjdfks |
|
769 | 769 | hg: unknown command 'skjdfks' |
|
770 | 770 | (use 'hg help' for a list of commands) |
|
771 | 771 | [10] |
|
772 | 772 | |
|
773 | 773 | Typoed command gives suggestion |
|
774 | 774 | $ hg puls |
|
775 | 775 | hg: unknown command 'puls' |
|
776 | 776 | (did you mean one of pull, push?) |
|
777 | 777 | [10] |
|
778 | 778 | |
|
779 | 779 | Not enabled extension gets suggested |
|
780 | 780 | |
|
781 | 781 | $ hg rebase |
|
782 | 782 | hg: unknown command 'rebase' |
|
783 | 783 | 'rebase' is provided by the following extension: |
|
784 | 784 | |
|
785 | 785 | rebase command to move sets of revisions to a different ancestor |
|
786 | 786 | |
|
787 | 787 | (use 'hg help extensions' for information on enabling extensions) |
|
788 | 788 | [10] |
|
789 | 789 | |
|
790 | 790 | Disabled extension gets suggested |
|
791 | 791 | $ hg --config extensions.rebase=! rebase |
|
792 | 792 | hg: unknown command 'rebase' |
|
793 | 793 | 'rebase' is provided by the following extension: |
|
794 | 794 | |
|
795 | 795 | rebase command to move sets of revisions to a different ancestor |
|
796 | 796 | |
|
797 | 797 | (use 'hg help extensions' for information on enabling extensions) |
|
798 | 798 | [10] |
|
799 | 799 | |
|
800 | 800 | Checking that help adapts based on the config: |
|
801 | 801 | |
|
802 | 802 | $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)' |
|
803 | 803 | -g --[no-]git use git extended diff format (default: on from |
|
804 | 804 | config) |
|
805 | 805 | |
|
806 | 806 | Make sure that we don't run afoul of the help system thinking that |
|
807 | 807 | this is a section and erroring out weirdly. |
|
808 | 808 | |
|
809 | 809 | $ hg .log |
|
810 | 810 | hg: unknown command '.log' |
|
811 | 811 | (did you mean log?) |
|
812 | 812 | [10] |
|
813 | 813 | |
|
814 | 814 | $ hg log. |
|
815 | 815 | hg: unknown command 'log.' |
|
816 | 816 | (did you mean log?) |
|
817 | 817 | [10] |
|
818 | 818 | $ hg pu.lh |
|
819 | 819 | hg: unknown command 'pu.lh' |
|
820 | 820 | (did you mean one of pull, push?) |
|
821 | 821 | [10] |
|
822 | 822 | |
|
823 | 823 | $ cat > helpext.py <<EOF |
|
824 | 824 | > import os |
|
825 | 825 | > from mercurial import commands, fancyopts, registrar |
|
826 | 826 | > |
|
827 | 827 | > def func(arg): |
|
828 | 828 | > return '%sfoo' % arg |
|
829 | 829 | > class customopt(fancyopts.customopt): |
|
830 | 830 | > def newstate(self, oldstate, newparam, abort): |
|
831 | 831 | > return '%sbar' % oldstate |
|
832 | 832 | > cmdtable = {} |
|
833 | 833 | > command = registrar.command(cmdtable) |
|
834 | 834 | > |
|
835 | 835 | > @command(b'nohelp', |
|
836 | 836 | > [(b'', b'longdesc', 3, b'x'*67), |
|
837 | 837 | > (b'n', b'', None, b'normal desc'), |
|
838 | 838 | > (b'', b'newline', b'', b'line1\nline2'), |
|
839 | 839 | > (b'', b'default-off', False, b'enable X'), |
|
840 | 840 | > (b'', b'default-on', True, b'enable Y'), |
|
841 | 841 | > (b'', b'callableopt', func, b'adds foo'), |
|
842 | 842 | > (b'', b'customopt', customopt(''), b'adds bar'), |
|
843 | 843 | > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')], |
|
844 | 844 | > b'hg nohelp', |
|
845 | 845 | > norepo=True) |
|
846 | 846 | > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) |
|
847 | 847 | > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) |
|
848 | 848 | > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) |
|
849 | 849 | > def nohelp(ui, *args, **kwargs): |
|
850 | 850 | > pass |
|
851 | 851 | > |
|
852 | 852 | > @command(b'hashelp', [], b'hg hashelp', norepo=True) |
|
853 | 853 | > def hashelp(ui, *args, **kwargs): |
|
854 | 854 | > """Extension command's help""" |
|
855 | 855 | > |
|
856 | 856 | > def uisetup(ui): |
|
857 | 857 | > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') |
|
858 | 858 | > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') |
|
859 | 859 | > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext') |
|
860 | 860 | > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext') |
|
861 | 861 | > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext') |
|
862 | 862 | > |
|
863 | 863 | > EOF |
|
864 | 864 | $ echo '[extensions]' >> $HGRCPATH |
|
865 | 865 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
|
866 | 866 | |
|
867 | 867 | Test for aliases |
|
868 | 868 | |
|
869 | 869 | $ hg help | grep hgalias |
|
870 | 870 | hgalias My doc |
|
871 | 871 | |
|
872 | 872 | $ hg help hgalias |
|
873 | 873 | hg hgalias [--remote] |
|
874 | 874 | |
|
875 | 875 | alias for: hg summary |
|
876 | 876 | |
|
877 | 877 | My doc |
|
878 | 878 | |
|
879 | 879 | defined by: helpext |
|
880 | 880 | |
|
881 | 881 | options: |
|
882 | 882 | |
|
883 | 883 | --remote check for push and pull |
|
884 | 884 | |
|
885 | 885 | (some details hidden, use --verbose to show complete help) |
|
886 | 886 | $ hg help hgaliasnodoc |
|
887 | 887 | hg hgaliasnodoc [--remote] |
|
888 | 888 | |
|
889 | 889 | alias for: hg summary |
|
890 | 890 | |
|
891 | 891 | summarize working directory state |
|
892 | 892 | |
|
893 | 893 | This generates a brief summary of the working directory state, including |
|
894 | 894 | parents, branch, commit status, phase and available updates. |
|
895 | 895 | |
|
896 | 896 | With the --remote option, this will check the default paths for incoming |
|
897 | 897 | and outgoing changes. This can be time-consuming. |
|
898 | 898 | |
|
899 | 899 | Returns 0 on success. |
|
900 | 900 | |
|
901 | 901 | defined by: helpext |
|
902 | 902 | |
|
903 | 903 | options: |
|
904 | 904 | |
|
905 | 905 | --remote check for push and pull |
|
906 | 906 | |
|
907 | 907 | (some details hidden, use --verbose to show complete help) |
|
908 | 908 | |
|
909 | 909 | $ hg help shellalias |
|
910 | 910 | hg shellalias |
|
911 | 911 | |
|
912 | 912 | shell alias for: echo hi |
|
913 | 913 | |
|
914 | 914 | (no help text available) |
|
915 | 915 | |
|
916 | 916 | defined by: helpext |
|
917 | 917 | |
|
918 | 918 | (some details hidden, use --verbose to show complete help) |
|
919 | 919 | |
|
920 | 920 | Test command with no help text |
|
921 | 921 | |
|
922 | 922 | $ hg help nohelp |
|
923 | 923 | hg nohelp |
|
924 | 924 | |
|
925 | 925 | (no help text available) |
|
926 | 926 | |
|
927 | 927 | options: |
|
928 | 928 | |
|
929 | 929 | --longdesc VALUE |
|
930 | 930 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
931 | 931 | xxxxxxxxxxxxxxxxxxxxxxx (default: 3) |
|
932 | 932 | -n -- normal desc |
|
933 | 933 | --newline VALUE line1 line2 |
|
934 | 934 | --default-off enable X |
|
935 | 935 | --[no-]default-on enable Y (default: on) |
|
936 | 936 | --callableopt VALUE adds foo |
|
937 | 937 | --customopt VALUE adds bar |
|
938 | 938 | --customopt-withdefault VALUE adds bar (default: foo) |
|
939 | 939 | |
|
940 | 940 | (some details hidden, use --verbose to show complete help) |
|
941 | 941 | |
|
942 | 942 | Test that default list of commands includes extension commands that have help, |
|
943 | 943 | but not those that don't, except in verbose mode, when a keyword is passed, or |
|
944 | 944 | when help about the extension is requested. |
|
945 | 945 | |
|
946 | 946 | #if no-extraextensions |
|
947 | 947 | |
|
948 | 948 | $ hg help | grep hashelp |
|
949 | 949 | hashelp Extension command's help |
|
950 | 950 | $ hg help | grep nohelp |
|
951 | 951 | [1] |
|
952 | 952 | $ hg help -v | grep nohelp |
|
953 | 953 | nohelp (no help text available) |
|
954 | 954 | |
|
955 | 955 | $ hg help -k nohelp |
|
956 | 956 | Commands: |
|
957 | 957 | |
|
958 | 958 | nohelp hg nohelp |
|
959 | 959 | |
|
960 | 960 | Extension Commands: |
|
961 | 961 | |
|
962 | 962 | nohelp (no help text available) |
|
963 | 963 | |
|
964 | 964 | $ hg help helpext |
|
965 | 965 | helpext extension - no help text available |
|
966 | 966 | |
|
967 | 967 | list of commands: |
|
968 | 968 | |
|
969 | 969 | hashelp Extension command's help |
|
970 | 970 | nohelp (no help text available) |
|
971 | 971 | |
|
972 | 972 | (use 'hg help -v helpext' to show built-in aliases and global options) |
|
973 | 973 | |
|
974 | 974 | #endif |
|
975 | 975 | |
|
976 | 976 | Test list of internal help commands |
|
977 | 977 | |
|
978 | 978 | $ hg help debug |
|
979 | 979 | debug commands (internal and unsupported): |
|
980 | 980 | |
|
981 | 981 | debug-repair-issue6528 |
|
982 | 982 | find affected revisions and repair them. See issue6528 for more |
|
983 | 983 | details. |
|
984 | 984 | debugancestor |
|
985 | 985 | find the ancestor revision of two revisions in a given index |
|
986 | 986 | debugantivirusrunning |
|
987 | 987 | attempt to trigger an antivirus scanner to see if one is active |
|
988 | 988 | debugapplystreamclonebundle |
|
989 | 989 | apply a stream clone bundle file |
|
990 | 990 | debugbackupbundle |
|
991 | 991 | lists the changesets available in backup bundles |
|
992 | 992 | debugbuilddag |
|
993 | 993 | builds a repo with a given DAG from scratch in the current |
|
994 | 994 | empty repo |
|
995 | 995 | debugbundle lists the contents of a bundle |
|
996 | 996 | debugcapabilities |
|
997 | 997 | lists the capabilities of a remote peer |
|
998 | 998 | debugchangedfiles |
|
999 | 999 | list the stored files changes for a revision |
|
1000 | 1000 | debugcheckstate |
|
1001 | 1001 | validate the correctness of the current dirstate |
|
1002 | 1002 | debugcolor show available color, effects or style |
|
1003 | 1003 | debugcommands |
|
1004 | 1004 | list all available commands and options |
|
1005 | 1005 | debugcomplete |
|
1006 | 1006 | returns the completion list associated with the given command |
|
1007 | 1007 | debugcreatestreamclonebundle |
|
1008 | 1008 | create a stream clone bundle file |
|
1009 | 1009 | debugdag format the changelog or an index DAG as a concise textual |
|
1010 | 1010 | description |
|
1011 | 1011 | debugdata dump the contents of a data file revision |
|
1012 | 1012 | debugdate parse and display a date |
|
1013 | 1013 | debugdeltachain |
|
1014 | 1014 | dump information about delta chains in a revlog |
|
1015 | 1015 | debugdirstate |
|
1016 | 1016 | show the contents of the current dirstate |
|
1017 | 1017 | debugdirstateignorepatternshash |
|
1018 | 1018 | show the hash of ignore patterns stored in dirstate if v2, |
|
1019 | 1019 | debugdiscovery |
|
1020 | 1020 | runs the changeset discovery protocol in isolation |
|
1021 | 1021 | debugdownload |
|
1022 | 1022 | download a resource using Mercurial logic and config |
|
1023 | 1023 | debugextensions |
|
1024 | 1024 | show information about active extensions |
|
1025 | 1025 | debugfileset parse and apply a fileset specification |
|
1026 | 1026 | debugformat display format information about the current repository |
|
1027 | 1027 | debugfsinfo show information detected about current filesystem |
|
1028 | 1028 | debuggetbundle |
|
1029 | 1029 | retrieves a bundle from a repo |
|
1030 | 1030 | debugignore display the combined ignore pattern and information about |
|
1031 | 1031 | ignored files |
|
1032 | 1032 | debugindex dump index data for a storage primitive |
|
1033 | 1033 | debugindexdot |
|
1034 | 1034 | dump an index DAG as a graphviz dot file |
|
1035 | 1035 | debugindexstats |
|
1036 | 1036 | show stats related to the changelog index |
|
1037 | 1037 | debuginstall test Mercurial installation |
|
1038 | 1038 | debugknown test whether node ids are known to a repo |
|
1039 | 1039 | debuglocks show or modify state of locks |
|
1040 | 1040 | debugmanifestfulltextcache |
|
1041 | 1041 | show, clear or amend the contents of the manifest fulltext |
|
1042 | 1042 | cache |
|
1043 | 1043 | debugmergestate |
|
1044 | 1044 | print merge state |
|
1045 | 1045 | debugnamecomplete |
|
1046 | 1046 | complete "names" - tags, open branch names, bookmark names |
|
1047 | 1047 | debugnodemap write and inspect on disk nodemap |
|
1048 | 1048 | debugobsolete |
|
1049 | 1049 | create arbitrary obsolete marker |
|
1050 | 1050 | debugoptADV (no help text available) |
|
1051 | 1051 | debugoptDEP (no help text available) |
|
1052 | 1052 | debugoptEXP (no help text available) |
|
1053 | 1053 | debugp1copies |
|
1054 | 1054 | dump copy information compared to p1 |
|
1055 | 1055 | debugp2copies |
|
1056 | 1056 | dump copy information compared to p2 |
|
1057 | 1057 | debugpathcomplete |
|
1058 | 1058 | complete part or all of a tracked path |
|
1059 | 1059 | debugpathcopies |
|
1060 | 1060 | show copies between two revisions |
|
1061 | 1061 | debugpeer establish a connection to a peer repository |
|
1062 | 1062 | debugpickmergetool |
|
1063 | 1063 | examine which merge tool is chosen for specified file |
|
1064 | 1064 | debugpushkey access the pushkey key/value protocol |
|
1065 | 1065 | debugpvec (no help text available) |
|
1066 | 1066 | debugrebuilddirstate |
|
1067 | 1067 | rebuild the dirstate as it would look like for the given |
|
1068 | 1068 | revision |
|
1069 | 1069 | debugrebuildfncache |
|
1070 | 1070 | rebuild the fncache file |
|
1071 | 1071 | debugrename dump rename information |
|
1072 | 1072 | debugrequires |
|
1073 | 1073 | print the current repo requirements |
|
1074 | 1074 | debugrevlog show data and statistics about a revlog |
|
1075 | 1075 | debugrevlogindex |
|
1076 | 1076 | dump the contents of a revlog index |
|
1077 | 1077 | debugrevspec parse and apply a revision specification |
|
1078 | 1078 | debugserve run a server with advanced settings |
|
1079 | 1079 | debugsetparents |
|
1080 | 1080 | manually set the parents of the current working directory |
|
1081 | 1081 | (DANGEROUS) |
|
1082 | 1082 | debugshell run an interactive Python interpreter |
|
1083 | 1083 | debugsidedata |
|
1084 | 1084 | dump the side data for a cl/manifest/file revision |
|
1085 | 1085 | debugssl test a secure connection to a server |
|
1086 | 1086 | debugstrip strip changesets and all their descendants from the repository |
|
1087 | 1087 | debugsub (no help text available) |
|
1088 | 1088 | debugsuccessorssets |
|
1089 | 1089 | show set of successors for revision |
|
1090 | 1090 | debugtagscache |
|
1091 | 1091 | display the contents of .hg/cache/hgtagsfnodes1 |
|
1092 | 1092 | debugtemplate |
|
1093 | 1093 | parse and apply a template |
|
1094 | 1094 | debuguigetpass |
|
1095 | 1095 | show prompt to type password |
|
1096 | 1096 | debuguiprompt |
|
1097 | 1097 | show plain prompt |
|
1098 | 1098 | debugupdatecaches |
|
1099 | 1099 | warm all known caches in the repository |
|
1100 | 1100 | debugupgraderepo |
|
1101 | 1101 | upgrade a repository to use different features |
|
1102 | 1102 | debugwalk show how files match on given patterns |
|
1103 | 1103 | debugwhyunstable |
|
1104 | 1104 | explain instabilities of a changeset |
|
1105 | 1105 | debugwireargs |
|
1106 | 1106 | (no help text available) |
|
1107 | 1107 | debugwireproto |
|
1108 | 1108 | send wire protocol commands to a server |
|
1109 | 1109 | |
|
1110 | 1110 | (use 'hg help -v debug' to show built-in aliases and global options) |
|
1111 | 1111 | |
|
1112 | 1112 | internals topic renders index of available sub-topics |
|
1113 | 1113 | |
|
1114 | 1114 | $ hg help internals |
|
1115 | 1115 | Technical implementation topics |
|
1116 | 1116 | """"""""""""""""""""""""""""""" |
|
1117 | 1117 | |
|
1118 | 1118 | To access a subtopic, use "hg help internals.{subtopic-name}" |
|
1119 | 1119 | |
|
1120 | 1120 | bid-merge Bid Merge Algorithm |
|
1121 | 1121 | bundle2 Bundle2 |
|
1122 | 1122 | bundles Bundles |
|
1123 | 1123 | cbor CBOR |
|
1124 | 1124 | censor Censor |
|
1125 | 1125 | changegroups Changegroups |
|
1126 | 1126 | config Config Registrar |
|
1127 | 1127 | dirstate-v2 dirstate-v2 file format |
|
1128 | 1128 | extensions Extension API |
|
1129 | 1129 | mergestate Mergestate |
|
1130 | 1130 | requirements Repository Requirements |
|
1131 | 1131 | revlogs Revision Logs |
|
1132 | 1132 | wireprotocol Wire Protocol |
|
1133 | 1133 | wireprotocolrpc |
|
1134 | 1134 | Wire Protocol RPC |
|
1135 | 1135 | wireprotocolv2 |
|
1136 | 1136 | Wire Protocol Version 2 |
|
1137 | 1137 | |
|
1138 | 1138 | sub-topics can be accessed |
|
1139 | 1139 | |
|
1140 | 1140 | $ hg help internals.changegroups |
|
1141 | 1141 | Changegroups |
|
1142 | 1142 | """""""""""" |
|
1143 | 1143 | |
|
1144 | 1144 | Changegroups are representations of repository revlog data, specifically |
|
1145 | 1145 | the changelog data, root/flat manifest data, treemanifest data, and |
|
1146 | 1146 | filelogs. |
|
1147 | 1147 | |
|
1148 | 1148 | There are 4 versions of changegroups: "1", "2", "3" and "4". From a high- |
|
1149 | 1149 | level, versions "1" and "2" are almost exactly the same, with the only |
|
1150 | 1150 | difference being an additional item in the *delta header*. Version "3" |
|
1151 | 1151 | adds support for storage flags in the *delta header* and optionally |
|
1152 | 1152 | exchanging treemanifests (enabled by setting an option on the |
|
1153 | 1153 | "changegroup" part in the bundle2). Version "4" adds support for |
|
1154 | 1154 | exchanging sidedata (additional revision metadata not part of the digest). |
|
1155 | 1155 | |
|
1156 | 1156 | Changegroups when not exchanging treemanifests consist of 3 logical |
|
1157 | 1157 | segments: |
|
1158 | 1158 | |
|
1159 | 1159 | +---------------------------------+ |
|
1160 | 1160 | | | | | |
|
1161 | 1161 | | changeset | manifest | filelogs | |
|
1162 | 1162 | | | | | |
|
1163 | 1163 | | | | | |
|
1164 | 1164 | +---------------------------------+ |
|
1165 | 1165 | |
|
1166 | 1166 | When exchanging treemanifests, there are 4 logical segments: |
|
1167 | 1167 | |
|
1168 | 1168 | +-------------------------------------------------+ |
|
1169 | 1169 | | | | | | |
|
1170 | 1170 | | changeset | root | treemanifests | filelogs | |
|
1171 | 1171 | | | manifest | | | |
|
1172 | 1172 | | | | | | |
|
1173 | 1173 | +-------------------------------------------------+ |
|
1174 | 1174 | |
|
1175 | 1175 | The principle building block of each segment is a *chunk*. A *chunk* is a |
|
1176 | 1176 | framed piece of data: |
|
1177 | 1177 | |
|
1178 | 1178 | +---------------------------------------+ |
|
1179 | 1179 | | | | |
|
1180 | 1180 | | length | data | |
|
1181 | 1181 | | (4 bytes) | (<length - 4> bytes) | |
|
1182 | 1182 | | | | |
|
1183 | 1183 | +---------------------------------------+ |
|
1184 | 1184 | |
|
1185 | 1185 | All integers are big-endian signed integers. Each chunk starts with a |
|
1186 | 1186 | 32-bit integer indicating the length of the entire chunk (including the |
|
1187 | 1187 | length field itself). |
|
1188 | 1188 | |
|
1189 | 1189 | There is a special case chunk that has a value of 0 for the length |
|
1190 | 1190 | ("0x00000000"). We call this an *empty chunk*. |
|
1191 | 1191 | |
|
1192 | 1192 | Delta Groups |
|
1193 | 1193 | ============ |
|
1194 | 1194 | |
|
1195 | 1195 | A *delta group* expresses the content of a revlog as a series of deltas, |
|
1196 | 1196 | or patches against previous revisions. |
|
1197 | 1197 | |
|
1198 | 1198 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* |
|
1199 | 1199 | to signal the end of the delta group: |
|
1200 | 1200 | |
|
1201 | 1201 | +------------------------------------------------------------------------+ |
|
1202 | 1202 | | | | | | | |
|
1203 | 1203 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | |
|
1204 | 1204 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | |
|
1205 | 1205 | | | | | | | |
|
1206 | 1206 | +------------------------------------------------------------------------+ |
|
1207 | 1207 | |
|
1208 | 1208 | Each *chunk*'s data consists of the following: |
|
1209 | 1209 | |
|
1210 | 1210 | +---------------------------------------+ |
|
1211 | 1211 | | | | |
|
1212 | 1212 | | delta header | delta data | |
|
1213 | 1213 | | (various by version) | (various) | |
|
1214 | 1214 | | | | |
|
1215 | 1215 | +---------------------------------------+ |
|
1216 | 1216 | |
|
1217 | 1217 | The *delta data* is a series of *delta*s that describe a diff from an |
|
1218 | 1218 | existing entry (either that the recipient already has, or previously |
|
1219 | 1219 | specified in the bundle/changegroup). |
|
1220 | 1220 | |
|
1221 | 1221 | The *delta header* is different between versions "1", "2", "3" and "4" of |
|
1222 | 1222 | the changegroup format. |
|
1223 | 1223 | |
|
1224 | 1224 | Version 1 (headerlen=80): |
|
1225 | 1225 | |
|
1226 | 1226 | +------------------------------------------------------+ |
|
1227 | 1227 | | | | | | |
|
1228 | 1228 | | node | p1 node | p2 node | link node | |
|
1229 | 1229 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
1230 | 1230 | | | | | | |
|
1231 | 1231 | +------------------------------------------------------+ |
|
1232 | 1232 | |
|
1233 | 1233 | Version 2 (headerlen=100): |
|
1234 | 1234 | |
|
1235 | 1235 | +------------------------------------------------------------------+ |
|
1236 | 1236 | | | | | | | |
|
1237 | 1237 | | node | p1 node | p2 node | base node | link node | |
|
1238 | 1238 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
1239 | 1239 | | | | | | | |
|
1240 | 1240 | +------------------------------------------------------------------+ |
|
1241 | 1241 | |
|
1242 | 1242 | Version 3 (headerlen=102): |
|
1243 | 1243 | |
|
1244 | 1244 | +------------------------------------------------------------------------------+ |
|
1245 | 1245 | | | | | | | | |
|
1246 | 1246 | | node | p1 node | p2 node | base node | link node | flags | |
|
1247 | 1247 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
|
1248 | 1248 | | | | | | | | |
|
1249 | 1249 | +------------------------------------------------------------------------------+ |
|
1250 | 1250 | |
|
1251 | 1251 | Version 4 (headerlen=103): |
|
1252 | 1252 | |
|
1253 | 1253 | +------------------------------------------------------------------------------+----------+ |
|
1254 | 1254 | | | | | | | | | |
|
1255 | 1255 | | node | p1 node | p2 node | base node | link node | flags | pflags | |
|
1256 | 1256 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) | |
|
1257 | 1257 | | | | | | | | | |
|
1258 | 1258 | +------------------------------------------------------------------------------+----------+ |
|
1259 | 1259 | |
|
1260 | 1260 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which |
|
1261 | 1261 | contain a series of *delta*s, densely packed (no separators). These deltas |
|
1262 | 1262 | describe a diff from an existing entry (either that the recipient already |
|
1263 | 1263 | has, or previously specified in the bundle/changegroup). The format is |
|
1264 | 1264 | described more fully in "hg help internals.bdiff", but briefly: |
|
1265 | 1265 | |
|
1266 | 1266 | +---------------------------------------------------------------+ |
|
1267 | 1267 | | | | | | |
|
1268 | 1268 | | start offset | end offset | new length | content | |
|
1269 | 1269 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | |
|
1270 | 1270 | | | | | | |
|
1271 | 1271 | +---------------------------------------------------------------+ |
|
1272 | 1272 | |
|
1273 | 1273 | Please note that the length field in the delta data does *not* include |
|
1274 | 1274 | itself. |
|
1275 | 1275 | |
|
1276 | 1276 | In version 1, the delta is always applied against the previous node from |
|
1277 | 1277 | the changegroup or the first parent if this is the first entry in the |
|
1278 | 1278 | changegroup. |
|
1279 | 1279 | |
|
1280 | 1280 | In version 2 and up, the delta base node is encoded in the entry in the |
|
1281 | 1281 | changegroup. This allows the delta to be expressed against any parent, |
|
1282 | 1282 | which can result in smaller deltas and more efficient encoding of data. |
|
1283 | 1283 | |
|
1284 | 1284 | The *flags* field holds bitwise flags affecting the processing of revision |
|
1285 | 1285 | data. The following flags are defined: |
|
1286 | 1286 | |
|
1287 | 1287 | 32768 |
|
1288 | 1288 | Censored revision. The revision's fulltext has been replaced by censor |
|
1289 | 1289 | metadata. May only occur on file revisions. |
|
1290 | 1290 | |
|
1291 | 1291 | 16384 |
|
1292 | 1292 | Ellipsis revision. Revision hash does not match data (likely due to |
|
1293 | 1293 | rewritten parents). |
|
1294 | 1294 | |
|
1295 | 1295 | 8192 |
|
1296 | 1296 | Externally stored. The revision fulltext contains "key:value" "\n" |
|
1297 | 1297 | delimited metadata defining an object stored elsewhere. Used by the LFS |
|
1298 | 1298 | extension. |
|
1299 | 1299 | |
|
1300 | 1300 | 4096 |
|
1301 | 1301 | Contains copy information. This revision changes files in a way that |
|
1302 | 1302 | could affect copy tracing. This does *not* affect changegroup handling, |
|
1303 | 1303 | but is relevant for other parts of Mercurial. |
|
1304 | 1304 | |
|
1305 | 1305 | For historical reasons, the integer values are identical to revlog version |
|
1306 | 1306 | 1 per-revision storage flags and correspond to bits being set in this |
|
1307 | 1307 | 2-byte field. Bits were allocated starting from the most-significant bit, |
|
1308 | 1308 | hence the reverse ordering and allocation of these flags. |
|
1309 | 1309 | |
|
1310 | 1310 | The *pflags* (protocol flags) field holds bitwise flags affecting the |
|
1311 | 1311 | protocol itself. They are first in the header since they may affect the |
|
1312 | 1312 | handling of the rest of the fields in a future version. They are defined |
|
1313 | 1313 | as such: |
|
1314 | 1314 | |
|
1315 | 1315 | 1 indicates whether to read a chunk of sidedata (of variable length) right |
|
1316 | 1316 | after the revision flags. |
|
1317 | 1317 | |
|
1318 | 1318 | Changeset Segment |
|
1319 | 1319 | ================= |
|
1320 | 1320 | |
|
1321 | 1321 | The *changeset segment* consists of a single *delta group* holding |
|
1322 | 1322 | changelog data. The *empty chunk* at the end of the *delta group* denotes |
|
1323 | 1323 | the boundary to the *manifest segment*. |
|
1324 | 1324 | |
|
1325 | 1325 | Manifest Segment |
|
1326 | 1326 | ================ |
|
1327 | 1327 | |
|
1328 | 1328 | The *manifest segment* consists of a single *delta group* holding manifest |
|
1329 | 1329 | data. If treemanifests are in use, it contains only the manifest for the |
|
1330 | 1330 | root directory of the repository. Otherwise, it contains the entire |
|
1331 | 1331 | manifest data. The *empty chunk* at the end of the *delta group* denotes |
|
1332 | 1332 | the boundary to the next segment (either the *treemanifests segment* or |
|
1333 | 1333 | the *filelogs segment*, depending on version and the request options). |
|
1334 | 1334 | |
|
1335 | 1335 | Treemanifests Segment |
|
1336 | 1336 | --------------------- |
|
1337 | 1337 | |
|
1338 | 1338 | The *treemanifests segment* only exists in changegroup version "3" and |
|
1339 | 1339 | "4", and only if the 'treemanifest' param is part of the bundle2 |
|
1340 | 1340 | changegroup part (it is not possible to use changegroup version 3 or 4 |
|
1341 | 1341 | outside of bundle2). Aside from the filenames in the *treemanifests |
|
1342 | 1342 | segment* containing a trailing "/" character, it behaves identically to |
|
1343 | 1343 | the *filelogs segment* (see below). The final sub-segment is followed by |
|
1344 | 1344 | an *empty chunk* (logically, a sub-segment with filename size 0). This |
|
1345 | 1345 | denotes the boundary to the *filelogs segment*. |
|
1346 | 1346 | |
|
1347 | 1347 | Filelogs Segment |
|
1348 | 1348 | ================ |
|
1349 | 1349 | |
|
1350 | 1350 | The *filelogs segment* consists of multiple sub-segments, each |
|
1351 | 1351 | corresponding to an individual file whose data is being described: |
|
1352 | 1352 | |
|
1353 | 1353 | +--------------------------------------------------+ |
|
1354 | 1354 | | | | | | | |
|
1355 | 1355 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | |
|
1356 | 1356 | | | | | | (4 bytes) | |
|
1357 | 1357 | | | | | | | |
|
1358 | 1358 | +--------------------------------------------------+ |
|
1359 | 1359 | |
|
1360 | 1360 | The final filelog sub-segment is followed by an *empty chunk* (logically, |
|
1361 | 1361 | a sub-segment with filename size 0). This denotes the end of the segment |
|
1362 | 1362 | and of the overall changegroup. |
|
1363 | 1363 | |
|
1364 | 1364 | Each filelog sub-segment consists of the following: |
|
1365 | 1365 | |
|
1366 | 1366 | +------------------------------------------------------+ |
|
1367 | 1367 | | | | | |
|
1368 | 1368 | | filename length | filename | delta group | |
|
1369 | 1369 | | (4 bytes) | (<length - 4> bytes) | (various) | |
|
1370 | 1370 | | | | | |
|
1371 | 1371 | +------------------------------------------------------+ |
|
1372 | 1372 | |
|
1373 | 1373 | That is, a *chunk* consisting of the filename (not terminated or padded) |
|
1374 | 1374 | followed by N chunks constituting the *delta group* for this file. The |
|
1375 | 1375 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
1376 | 1376 | next filelog sub-segment. |
|
1377 | 1377 | |
|
1378 | 1378 | non-existent subtopics print an error |
|
1379 | 1379 | |
|
1380 | 1380 | $ hg help internals.foo |
|
1381 | 1381 | abort: no such help topic: internals.foo |
|
1382 | 1382 | (try 'hg help --keyword foo') |
|
1383 | 1383 | [10] |
|
1384 | 1384 | |
|
1385 | 1385 | test advanced, deprecated and experimental options are hidden in command help |
|
1386 | 1386 | $ hg help debugoptADV |
|
1387 | 1387 | hg debugoptADV |
|
1388 | 1388 | |
|
1389 | 1389 | (no help text available) |
|
1390 | 1390 | |
|
1391 | 1391 | options: |
|
1392 | 1392 | |
|
1393 | 1393 | (some details hidden, use --verbose to show complete help) |
|
1394 | 1394 | $ hg help debugoptDEP |
|
1395 | 1395 | hg debugoptDEP |
|
1396 | 1396 | |
|
1397 | 1397 | (no help text available) |
|
1398 | 1398 | |
|
1399 | 1399 | options: |
|
1400 | 1400 | |
|
1401 | 1401 | (some details hidden, use --verbose to show complete help) |
|
1402 | 1402 | |
|
1403 | 1403 | $ hg help debugoptEXP |
|
1404 | 1404 | hg debugoptEXP |
|
1405 | 1405 | |
|
1406 | 1406 | (no help text available) |
|
1407 | 1407 | |
|
1408 | 1408 | options: |
|
1409 | 1409 | |
|
1410 | 1410 | (some details hidden, use --verbose to show complete help) |
|
1411 | 1411 | |
|
1412 | 1412 | test advanced, deprecated and experimental options are shown with -v |
|
1413 | 1413 | $ hg help -v debugoptADV | grep aopt |
|
1414 | 1414 | --aopt option is (ADVANCED) |
|
1415 | 1415 | $ hg help -v debugoptDEP | grep dopt |
|
1416 | 1416 | --dopt option is (DEPRECATED) |
|
1417 | 1417 | $ hg help -v debugoptEXP | grep eopt |
|
1418 | 1418 | --eopt option is (EXPERIMENTAL) |
|
1419 | 1419 | |
|
1420 | 1420 | #if gettext |
|
1421 | 1421 | test deprecated option is hidden with translation with untranslated description |
|
1422 | 1422 | (use many globy for not failing on changed transaction) |
|
1423 | 1423 | $ LANGUAGE=sv hg help debugoptDEP |
|
1424 | 1424 | hg debugoptDEP |
|
1425 | 1425 | |
|
1426 | 1426 | (*) (glob) |
|
1427 | 1427 | |
|
1428 | 1428 | options: |
|
1429 | 1429 | |
|
1430 | 1430 | (some details hidden, use --verbose to show complete help) |
|
1431 | 1431 | #endif |
|
1432 | 1432 | |
|
1433 | 1433 | Test commands that collide with topics (issue4240) |
|
1434 | 1434 | |
|
1435 | 1435 | $ hg config -hq |
|
1436 | 1436 | hg config [-u] [NAME]... |
|
1437 | 1437 | |
|
1438 | 1438 | show combined config settings from all hgrc files |
|
1439 | 1439 | $ hg showconfig -hq |
|
1440 | 1440 | hg config [-u] [NAME]... |
|
1441 | 1441 | |
|
1442 | 1442 | show combined config settings from all hgrc files |
|
1443 | 1443 | |
|
1444 | 1444 | Test a help topic |
|
1445 | 1445 | |
|
1446 | 1446 | $ hg help dates |
|
1447 | 1447 | Date Formats |
|
1448 | 1448 | """""""""""" |
|
1449 | 1449 | |
|
1450 | 1450 | Some commands allow the user to specify a date, e.g.: |
|
1451 | 1451 | |
|
1452 | 1452 | - backout, commit, import, tag: Specify the commit date. |
|
1453 | 1453 | - log, revert, update: Select revision(s) by date. |
|
1454 | 1454 | |
|
1455 | 1455 | Many date formats are valid. Here are some examples: |
|
1456 | 1456 | |
|
1457 | 1457 | - "Wed Dec 6 13:18:29 2006" (local timezone assumed) |
|
1458 | 1458 | - "Dec 6 13:18 -0600" (year assumed, time offset provided) |
|
1459 | 1459 | - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) |
|
1460 | 1460 | - "Dec 6" (midnight) |
|
1461 | 1461 | - "13:18" (today assumed) |
|
1462 | 1462 | - "3:39" (3:39AM assumed) |
|
1463 | 1463 | - "3:39pm" (15:39) |
|
1464 | 1464 | - "2006-12-06 13:18:29" (ISO 8601 format) |
|
1465 | 1465 | - "2006-12-6 13:18" |
|
1466 | 1466 | - "2006-12-6" |
|
1467 | 1467 | - "12-6" |
|
1468 | 1468 | - "12/6" |
|
1469 | 1469 | - "12/6/6" (Dec 6 2006) |
|
1470 | 1470 | - "today" (midnight) |
|
1471 | 1471 | - "yesterday" (midnight) |
|
1472 | 1472 | - "now" - right now |
|
1473 | 1473 | |
|
1474 | 1474 | Lastly, there is Mercurial's internal format: |
|
1475 | 1475 | |
|
1476 | 1476 | - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) |
|
1477 | 1477 | |
|
1478 | 1478 | This is the internal representation format for dates. The first number is |
|
1479 | 1479 | the number of seconds since the epoch (1970-01-01 00:00 UTC). The second |
|
1480 | 1480 | is the offset of the local timezone, in seconds west of UTC (negative if |
|
1481 | 1481 | the timezone is east of UTC). |
|
1482 | 1482 | |
|
1483 | 1483 | The log command also accepts date ranges: |
|
1484 | 1484 | |
|
1485 | 1485 | - "<DATE" - at or before a given date/time |
|
1486 | 1486 | - ">DATE" - on or after a given date/time |
|
1487 | 1487 | - "DATE to DATE" - a date range, inclusive |
|
1488 | 1488 | - "-DAYS" - within a given number of days from today |
|
1489 | 1489 | |
|
1490 | 1490 | Test repeated config section name |
|
1491 | 1491 | |
|
1492 | 1492 | $ hg help config.host |
|
1493 | 1493 | "http_proxy.host" |
|
1494 | 1494 | Host name and (optional) port of the proxy server, for example |
|
1495 | 1495 | "myproxy:8000". |
|
1496 | 1496 | |
|
1497 | 1497 | "smtp.host" |
|
1498 | 1498 | Host name of mail server, e.g. "mail.example.com". |
|
1499 | 1499 | |
|
1500 | 1500 | |
|
1501 | 1501 | Test section name with dot |
|
1502 | 1502 | |
|
1503 | 1503 | $ hg help config.ui.username |
|
1504 | 1504 | "ui.username" |
|
1505 | 1505 | The committer of a changeset created when running "commit". Typically |
|
1506 | 1506 | a person's name and email address, e.g. "Fred Widget |
|
1507 | 1507 | <fred@example.com>". Environment variables in the username are |
|
1508 | 1508 | expanded. |
|
1509 | 1509 | |
|
1510 | 1510 | (default: "$EMAIL" or "username@hostname". If the username in hgrc is |
|
1511 | 1511 | empty, e.g. if the system admin set "username =" in the system hgrc, |
|
1512 | 1512 | it has to be specified manually or in a different hgrc file) |
|
1513 | 1513 | |
|
1514 | 1514 | |
|
1515 | 1515 | $ hg help config.annotate.git |
|
1516 | 1516 | abort: help section not found: config.annotate.git |
|
1517 | 1517 | [10] |
|
1518 | 1518 | |
|
1519 | 1519 | $ hg help config.update.check |
|
1520 | 1520 | "commands.update.check" |
|
1521 | 1521 | Determines what level of checking 'hg update' will perform before |
|
1522 | 1522 | moving to a destination revision. Valid values are "abort", "none", |
|
1523 | 1523 | "linear", and "noconflict". |
|
1524 | 1524 | |
|
1525 | 1525 | - "abort" always fails if the working directory has uncommitted |
|
1526 | 1526 | changes. |
|
1527 | 1527 | - "none" performs no checking, and may result in a merge with |
|
1528 | 1528 | uncommitted changes. |
|
1529 | 1529 | - "linear" allows any update as long as it follows a straight line in |
|
1530 | 1530 | the revision history, and may trigger a merge with uncommitted |
|
1531 | 1531 | changes. |
|
1532 | 1532 | - "noconflict" will allow any update which would not trigger a merge |
|
1533 | 1533 | with uncommitted changes, if any are present. |
|
1534 | 1534 | |
|
1535 | 1535 | (default: "linear") |
|
1536 | 1536 | |
|
1537 | 1537 | |
|
1538 | 1538 | $ hg help config.commands.update.check |
|
1539 | 1539 | "commands.update.check" |
|
1540 | 1540 | Determines what level of checking 'hg update' will perform before |
|
1541 | 1541 | moving to a destination revision. Valid values are "abort", "none", |
|
1542 | 1542 | "linear", and "noconflict". |
|
1543 | 1543 | |
|
1544 | 1544 | - "abort" always fails if the working directory has uncommitted |
|
1545 | 1545 | changes. |
|
1546 | 1546 | - "none" performs no checking, and may result in a merge with |
|
1547 | 1547 | uncommitted changes. |
|
1548 | 1548 | - "linear" allows any update as long as it follows a straight line in |
|
1549 | 1549 | the revision history, and may trigger a merge with uncommitted |
|
1550 | 1550 | changes. |
|
1551 | 1551 | - "noconflict" will allow any update which would not trigger a merge |
|
1552 | 1552 | with uncommitted changes, if any are present. |
|
1553 | 1553 | |
|
1554 | 1554 | (default: "linear") |
|
1555 | 1555 | |
|
1556 | 1556 | |
|
1557 | 1557 | $ hg help config.ommands.update.check |
|
1558 | 1558 | abort: help section not found: config.ommands.update.check |
|
1559 | 1559 | [10] |
|
1560 | 1560 | |
|
1561 | 1561 | Unrelated trailing paragraphs shouldn't be included |
|
1562 | 1562 | |
|
1563 | 1563 | $ hg help config.extramsg | grep '^$' |
|
1564 | 1564 | |
|
1565 | 1565 | |
|
1566 | 1566 | Test capitalized section name |
|
1567 | 1567 | |
|
1568 | 1568 | $ hg help scripting.HGPLAIN > /dev/null |
|
1569 | 1569 | |
|
1570 | 1570 | Help subsection: |
|
1571 | 1571 | |
|
1572 | 1572 | $ hg help config.charsets |grep "Email example:" > /dev/null |
|
1573 | 1573 | [1] |
|
1574 | 1574 | |
|
1575 | 1575 | Show nested definitions |
|
1576 | 1576 | ("profiling.type"[break]"ls"[break]"stat"[break]) |
|
1577 | 1577 | |
|
1578 | 1578 | $ hg help config.type | egrep '^$'|wc -l |
|
1579 | 1579 | \s*3 (re) |
|
1580 | 1580 | |
|
1581 | 1581 | $ hg help config.profiling.type.ls |
|
1582 | 1582 | "profiling.type.ls" |
|
1583 | 1583 | Use Python's built-in instrumenting profiler. This profiler works on |
|
1584 | 1584 | all platforms, but each line number it reports is the first line of |
|
1585 | 1585 | a function. This restriction makes it difficult to identify the |
|
1586 | 1586 | expensive parts of a non-trivial function. |
|
1587 | 1587 | |
|
1588 | 1588 | |
|
1589 | 1589 | Separate sections from subsections |
|
1590 | 1590 | |
|
1591 | 1591 | $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq |
|
1592 | 1592 | "format" |
|
1593 | 1593 | -------- |
|
1594 | 1594 | |
|
1595 | 1595 | "usegeneraldelta" |
|
1596 | 1596 | |
|
1597 | 1597 | "dotencode" |
|
1598 | 1598 | |
|
1599 | 1599 | "usefncache" |
|
1600 | 1600 | |
|
1601 | 1601 | "use-dirstate-v2" |
|
1602 | 1602 | |
|
1603 | 1603 | "use-dirstate-tracked-hint" |
|
1604 | 1604 | |
|
1605 | "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories" | |
|
1606 | ||
|
1605 | 1607 | "use-persistent-nodemap" |
|
1606 | 1608 | |
|
1607 | 1609 | "use-share-safe" |
|
1608 | 1610 | |
|
1609 | 1611 | "use-share-safe.automatic-upgrade-of-mismatching-repositories" |
|
1610 | 1612 | |
|
1611 | 1613 | "usestore" |
|
1612 | 1614 | |
|
1613 | 1615 | "sparse-revlog" |
|
1614 | 1616 | |
|
1615 | 1617 | "revlog-compression" |
|
1616 | 1618 | |
|
1617 | 1619 | "bookmarks-in-store" |
|
1618 | 1620 | |
|
1619 | 1621 | "profiling" |
|
1620 | 1622 | ----------- |
|
1621 | 1623 | |
|
1622 | 1624 | "format" |
|
1623 | 1625 | |
|
1624 | 1626 | "progress" |
|
1625 | 1627 | ---------- |
|
1626 | 1628 | |
|
1627 | 1629 | "format" |
|
1628 | 1630 | |
|
1629 | 1631 | |
|
1630 | 1632 | Last item in help config.*: |
|
1631 | 1633 | |
|
1632 | 1634 | $ hg help config.`hg help config|grep '^ "'| \ |
|
1633 | 1635 | > tail -1|sed 's![ "]*!!g'`| \ |
|
1634 | 1636 | > grep 'hg help -c config' > /dev/null |
|
1635 | 1637 | [1] |
|
1636 | 1638 | |
|
1637 | 1639 | note to use help -c for general hg help config: |
|
1638 | 1640 | |
|
1639 | 1641 | $ hg help config |grep 'hg help -c config' > /dev/null |
|
1640 | 1642 | |
|
1641 | 1643 | Test templating help |
|
1642 | 1644 | |
|
1643 | 1645 | $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) ' |
|
1644 | 1646 | desc String. The text of the changeset description. |
|
1645 | 1647 | diffstat String. Statistics of changes with the following format: |
|
1646 | 1648 | firstline Any text. Returns the first line of text. |
|
1647 | 1649 | nonempty Any text. Returns '(none)' if the string is empty. |
|
1648 | 1650 | |
|
1649 | 1651 | Test deprecated items |
|
1650 | 1652 | |
|
1651 | 1653 | $ hg help -v templating | grep currentbookmark |
|
1652 | 1654 | currentbookmark |
|
1653 | 1655 | $ hg help templating | (grep currentbookmark || true) |
|
1654 | 1656 | |
|
1655 | 1657 | Test help hooks |
|
1656 | 1658 | |
|
1657 | 1659 | $ cat > helphook1.py <<EOF |
|
1658 | 1660 | > from mercurial import help |
|
1659 | 1661 | > |
|
1660 | 1662 | > def rewrite(ui, topic, doc): |
|
1661 | 1663 | > return doc + b'\nhelphook1\n' |
|
1662 | 1664 | > |
|
1663 | 1665 | > def extsetup(ui): |
|
1664 | 1666 | > help.addtopichook(b'revisions', rewrite) |
|
1665 | 1667 | > EOF |
|
1666 | 1668 | $ cat > helphook2.py <<EOF |
|
1667 | 1669 | > from mercurial import help |
|
1668 | 1670 | > |
|
1669 | 1671 | > def rewrite(ui, topic, doc): |
|
1670 | 1672 | > return doc + b'\nhelphook2\n' |
|
1671 | 1673 | > |
|
1672 | 1674 | > def extsetup(ui): |
|
1673 | 1675 | > help.addtopichook(b'revisions', rewrite) |
|
1674 | 1676 | > EOF |
|
1675 | 1677 | $ echo '[extensions]' >> $HGRCPATH |
|
1676 | 1678 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
|
1677 | 1679 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
|
1678 | 1680 | $ hg help revsets | grep helphook |
|
1679 | 1681 | helphook1 |
|
1680 | 1682 | helphook2 |
|
1681 | 1683 | |
|
1682 | 1684 | help -c should only show debug --debug |
|
1683 | 1685 | |
|
1684 | 1686 | $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$' |
|
1685 | 1687 | [1] |
|
1686 | 1688 | |
|
1687 | 1689 | help -c should only show deprecated for -v |
|
1688 | 1690 | |
|
1689 | 1691 | $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$' |
|
1690 | 1692 | [1] |
|
1691 | 1693 | |
|
1692 | 1694 | Test -s / --system |
|
1693 | 1695 | |
|
1694 | 1696 | $ hg help config.files -s windows |grep 'etc/mercurial' | \ |
|
1695 | 1697 | > wc -l | sed -e 's/ //g' |
|
1696 | 1698 | 0 |
|
1697 | 1699 | $ hg help config.files --system unix | grep 'USER' | \ |
|
1698 | 1700 | > wc -l | sed -e 's/ //g' |
|
1699 | 1701 | 0 |
|
1700 | 1702 | |
|
1701 | 1703 | Test -e / -c / -k combinations |
|
1702 | 1704 | |
|
1703 | 1705 | $ hg help -c|egrep '^[A-Z].*:|^ debug' |
|
1704 | 1706 | Commands: |
|
1705 | 1707 | $ hg help -e|egrep '^[A-Z].*:|^ debug' |
|
1706 | 1708 | Extensions: |
|
1707 | 1709 | $ hg help -k|egrep '^[A-Z].*:|^ debug' |
|
1708 | 1710 | Topics: |
|
1709 | 1711 | Commands: |
|
1710 | 1712 | Extensions: |
|
1711 | 1713 | Extension Commands: |
|
1712 | 1714 | $ hg help -c schemes |
|
1713 | 1715 | abort: no such help topic: schemes |
|
1714 | 1716 | (try 'hg help --keyword schemes') |
|
1715 | 1717 | [10] |
|
1716 | 1718 | $ hg help -e schemes |head -1 |
|
1717 | 1719 | schemes extension - extend schemes with shortcuts to repository swarms |
|
1718 | 1720 | $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' |
|
1719 | 1721 | Commands: |
|
1720 | 1722 | $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):' |
|
1721 | 1723 | Extensions: |
|
1722 | 1724 | $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):' |
|
1723 | 1725 | Extensions: |
|
1724 | 1726 | Commands: |
|
1725 | 1727 | $ hg help -c commit > /dev/null |
|
1726 | 1728 | $ hg help -e -c commit > /dev/null |
|
1727 | 1729 | $ hg help -e commit |
|
1728 | 1730 | abort: no such help topic: commit |
|
1729 | 1731 | (try 'hg help --keyword commit') |
|
1730 | 1732 | [10] |
|
1731 | 1733 | |
|
1732 | 1734 | Test keyword search help |
|
1733 | 1735 | |
|
1734 | 1736 | $ cat > prefixedname.py <<EOF |
|
1735 | 1737 | > '''matched against word "clone" |
|
1736 | 1738 | > ''' |
|
1737 | 1739 | > EOF |
|
1738 | 1740 | $ echo '[extensions]' >> $HGRCPATH |
|
1739 | 1741 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH |
|
1740 | 1742 | $ hg help -k clone |
|
1741 | 1743 | Topics: |
|
1742 | 1744 | |
|
1743 | 1745 | config Configuration Files |
|
1744 | 1746 | extensions Using Additional Features |
|
1745 | 1747 | glossary Glossary |
|
1746 | 1748 | phases Working with Phases |
|
1747 | 1749 | subrepos Subrepositories |
|
1748 | 1750 | urls URL Paths |
|
1749 | 1751 | |
|
1750 | 1752 | Commands: |
|
1751 | 1753 | |
|
1752 | 1754 | bookmarks create a new bookmark or list existing bookmarks |
|
1753 | 1755 | clone make a copy of an existing repository |
|
1754 | 1756 | paths show aliases for remote repositories |
|
1755 | 1757 | pull pull changes from the specified source |
|
1756 | 1758 | update update working directory (or switch revisions) |
|
1757 | 1759 | |
|
1758 | 1760 | Extensions: |
|
1759 | 1761 | |
|
1760 | 1762 | clonebundles advertise pre-generated bundles to seed clones |
|
1761 | 1763 | narrow create clones which fetch history data for subset of files |
|
1762 | 1764 | (EXPERIMENTAL) |
|
1763 | 1765 | prefixedname matched against word "clone" |
|
1764 | 1766 | relink recreates hardlinks between repository clones |
|
1765 | 1767 | |
|
1766 | 1768 | Extension Commands: |
|
1767 | 1769 | |
|
1768 | 1770 | qclone clone main and patch repository at same time |
|
1769 | 1771 | |
|
1770 | 1772 | Test unfound topic |
|
1771 | 1773 | |
|
1772 | 1774 | $ hg help nonexistingtopicthatwillneverexisteverever |
|
1773 | 1775 | abort: no such help topic: nonexistingtopicthatwillneverexisteverever |
|
1774 | 1776 | (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever') |
|
1775 | 1777 | [10] |
|
1776 | 1778 | |
|
1777 | 1779 | Test unfound keyword |
|
1778 | 1780 | |
|
1779 | 1781 | $ hg help --keyword nonexistingwordthatwillneverexisteverever |
|
1780 | 1782 | abort: no matches |
|
1781 | 1783 | (try 'hg help' for a list of topics) |
|
1782 | 1784 | [10] |
|
1783 | 1785 | |
|
1784 | 1786 | Test omit indicating for help |
|
1785 | 1787 | |
|
1786 | 1788 | $ cat > addverboseitems.py <<EOF |
|
1787 | 1789 | > r'''extension to test omit indicating. |
|
1788 | 1790 | > |
|
1789 | 1791 | > This paragraph is never omitted (for extension) |
|
1790 | 1792 | > |
|
1791 | 1793 | > .. container:: verbose |
|
1792 | 1794 | > |
|
1793 | 1795 | > This paragraph is omitted, |
|
1794 | 1796 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension) |
|
1795 | 1797 | > |
|
1796 | 1798 | > This paragraph is never omitted, too (for extension) |
|
1797 | 1799 | > ''' |
|
1798 | 1800 | > from mercurial import commands, help |
|
1799 | 1801 | > testtopic = br"""This paragraph is never omitted (for topic). |
|
1800 | 1802 | > |
|
1801 | 1803 | > .. container:: verbose |
|
1802 | 1804 | > |
|
1803 | 1805 | > This paragraph is omitted, |
|
1804 | 1806 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) |
|
1805 | 1807 | > |
|
1806 | 1808 | > This paragraph is never omitted, too (for topic) |
|
1807 | 1809 | > """ |
|
1808 | 1810 | > def extsetup(ui): |
|
1809 | 1811 | > help.helptable.append(([b"topic-containing-verbose"], |
|
1810 | 1812 | > b"This is the topic to test omit indicating.", |
|
1811 | 1813 | > lambda ui: testtopic)) |
|
1812 | 1814 | > EOF |
|
1813 | 1815 | $ echo '[extensions]' >> $HGRCPATH |
|
1814 | 1816 | $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
|
1815 | 1817 | $ hg help addverboseitems |
|
1816 | 1818 | addverboseitems extension - extension to test omit indicating. |
|
1817 | 1819 | |
|
1818 | 1820 | This paragraph is never omitted (for extension) |
|
1819 | 1821 | |
|
1820 | 1822 | This paragraph is never omitted, too (for extension) |
|
1821 | 1823 | |
|
1822 | 1824 | (some details hidden, use --verbose to show complete help) |
|
1823 | 1825 | |
|
1824 | 1826 | no commands defined |
|
1825 | 1827 | $ hg help -v addverboseitems |
|
1826 | 1828 | addverboseitems extension - extension to test omit indicating. |
|
1827 | 1829 | |
|
1828 | 1830 | This paragraph is never omitted (for extension) |
|
1829 | 1831 | |
|
1830 | 1832 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for |
|
1831 | 1833 | extension) |
|
1832 | 1834 | |
|
1833 | 1835 | This paragraph is never omitted, too (for extension) |
|
1834 | 1836 | |
|
1835 | 1837 | no commands defined |
|
1836 | 1838 | $ hg help topic-containing-verbose |
|
1837 | 1839 | This is the topic to test omit indicating. |
|
1838 | 1840 | """""""""""""""""""""""""""""""""""""""""" |
|
1839 | 1841 | |
|
1840 | 1842 | This paragraph is never omitted (for topic). |
|
1841 | 1843 | |
|
1842 | 1844 | This paragraph is never omitted, too (for topic) |
|
1843 | 1845 | |
|
1844 | 1846 | (some details hidden, use --verbose to show complete help) |
|
1845 | 1847 | $ hg help -v topic-containing-verbose |
|
1846 | 1848 | This is the topic to test omit indicating. |
|
1847 | 1849 | """""""""""""""""""""""""""""""""""""""""" |
|
1848 | 1850 | |
|
1849 | 1851 | This paragraph is never omitted (for topic). |
|
1850 | 1852 | |
|
1851 | 1853 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for |
|
1852 | 1854 | topic) |
|
1853 | 1855 | |
|
1854 | 1856 | This paragraph is never omitted, too (for topic) |
|
1855 | 1857 | |
|
1856 | 1858 | Test section lookup |
|
1857 | 1859 | |
|
1858 | 1860 | $ hg help revset.merge |
|
1859 | 1861 | "merge()" |
|
1860 | 1862 | Changeset is a merge changeset. |
|
1861 | 1863 | |
|
1862 | 1864 | $ hg help glossary.dag |
|
1863 | 1865 | DAG |
|
1864 | 1866 | The repository of changesets of a distributed version control system |
|
1865 | 1867 | (DVCS) can be described as a directed acyclic graph (DAG), consisting |
|
1866 | 1868 | of nodes and edges, where nodes correspond to changesets and edges |
|
1867 | 1869 | imply a parent -> child relation. This graph can be visualized by |
|
1868 | 1870 | graphical tools such as 'hg log --graph'. In Mercurial, the DAG is |
|
1869 | 1871 | limited by the requirement for children to have at most two parents. |
|
1870 | 1872 | |
|
1871 | 1873 | |
|
1872 | 1874 | $ hg help hgrc.paths |
|
1873 | 1875 | "paths" |
|
1874 | 1876 | ------- |
|
1875 | 1877 | |
|
1876 | 1878 | Assigns symbolic names and behavior to repositories. |
|
1877 | 1879 | |
|
1878 | 1880 | Options are symbolic names defining the URL or directory that is the |
|
1879 | 1881 | location of the repository. Example: |
|
1880 | 1882 | |
|
1881 | 1883 | [paths] |
|
1882 | 1884 | my_server = https://example.com/my_repo |
|
1883 | 1885 | local_path = /home/me/repo |
|
1884 | 1886 | |
|
1885 | 1887 | These symbolic names can be used from the command line. To pull from |
|
1886 | 1888 | "my_server": 'hg pull my_server'. To push to "local_path": 'hg push |
|
1887 | 1889 | local_path'. You can check 'hg help urls' for details about valid URLs. |
|
1888 | 1890 | |
|
1889 | 1891 | Options containing colons (":") denote sub-options that can influence |
|
1890 | 1892 | behavior for that specific path. Example: |
|
1891 | 1893 | |
|
1892 | 1894 | [paths] |
|
1893 | 1895 | my_server = https://example.com/my_path |
|
1894 | 1896 | my_server:pushurl = ssh://example.com/my_path |
|
1895 | 1897 | |
|
1896 | 1898 | Paths using the 'path://otherpath' scheme will inherit the sub-options |
|
1897 | 1899 | value from the path they point to. |
|
1898 | 1900 | |
|
1899 | 1901 | The following sub-options can be defined: |
|
1900 | 1902 | |
|
1901 | 1903 | "multi-urls" |
|
1902 | 1904 | A boolean option. When enabled the value of the '[paths]' entry will be |
|
1903 | 1905 | parsed as a list and the alias will resolve to multiple destination. If |
|
1904 | 1906 | some of the list entry use the 'path://' syntax, the suboption will be |
|
1905 | 1907 | inherited individually. |
|
1906 | 1908 | |
|
1907 | 1909 | "pushurl" |
|
1908 | 1910 | The URL to use for push operations. If not defined, the location |
|
1909 | 1911 | defined by the path's main entry is used. |
|
1910 | 1912 | |
|
1911 | 1913 | "pushrev" |
|
1912 | 1914 | A revset defining which revisions to push by default. |
|
1913 | 1915 | |
|
1914 | 1916 | When 'hg push' is executed without a "-r" argument, the revset defined |
|
1915 | 1917 | by this sub-option is evaluated to determine what to push. |
|
1916 | 1918 | |
|
1917 | 1919 | For example, a value of "." will push the working directory's revision |
|
1918 | 1920 | by default. |
|
1919 | 1921 | |
|
1920 | 1922 | Revsets specifying bookmarks will not result in the bookmark being |
|
1921 | 1923 | pushed. |
|
1922 | 1924 | |
|
1923 | 1925 | "bookmarks.mode" |
|
1924 | 1926 | How bookmark will be dealt during the exchange. It support the following |
|
1925 | 1927 | value |
|
1926 | 1928 | |
|
1927 | 1929 | - "default": the default behavior, local and remote bookmarks are |
|
1928 | 1930 | "merged" on push/pull. |
|
1929 | 1931 | - "mirror": when pulling, replace local bookmarks by remote bookmarks. |
|
1930 | 1932 | This is useful to replicate a repository, or as an optimization. |
|
1931 | 1933 | - "ignore": ignore bookmarks during exchange. (This currently only |
|
1932 | 1934 | affect pulling) |
|
1933 | 1935 | |
|
1934 | 1936 | The following special named paths exist: |
|
1935 | 1937 | |
|
1936 | 1938 | "default" |
|
1937 | 1939 | The URL or directory to use when no source or remote is specified. |
|
1938 | 1940 | |
|
1939 | 1941 | 'hg clone' will automatically define this path to the location the |
|
1940 | 1942 | repository was cloned from. |
|
1941 | 1943 | |
|
1942 | 1944 | "default-push" |
|
1943 | 1945 | (deprecated) The URL or directory for the default 'hg push' location. |
|
1944 | 1946 | "default:pushurl" should be used instead. |
|
1945 | 1947 | |
|
1946 | 1948 | $ hg help glossary.mcguffin |
|
1947 | 1949 | abort: help section not found: glossary.mcguffin |
|
1948 | 1950 | [10] |
|
1949 | 1951 | |
|
1950 | 1952 | $ hg help glossary.mc.guffin |
|
1951 | 1953 | abort: help section not found: glossary.mc.guffin |
|
1952 | 1954 | [10] |
|
1953 | 1955 | |
|
1954 | 1956 | $ hg help template.files |
|
1955 | 1957 | files List of strings. All files modified, added, or removed by |
|
1956 | 1958 | this changeset. |
|
1957 | 1959 | files(pattern) |
|
1958 | 1960 | All files of the current changeset matching the pattern. See |
|
1959 | 1961 | 'hg help patterns'. |
|
1960 | 1962 | |
|
1961 | 1963 | Test section lookup by translated message |
|
1962 | 1964 | |
|
1963 | 1965 | str.lower() instead of encoding.lower(str) on translated message might |
|
1964 | 1966 | make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z) |
|
1965 | 1967 | as the second or later byte of multi-byte character. |
|
1966 | 1968 | |
|
1967 | 1969 | For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932) |
|
1968 | 1970 | contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this |
|
1969 | 1971 | replacement makes message meaningless. |
|
1970 | 1972 | |
|
1971 | 1973 | This tests that section lookup by translated string isn't broken by |
|
1972 | 1974 | such str.lower(). |
|
1973 | 1975 | |
|
1974 | 1976 | $ "$PYTHON" <<EOF |
|
1975 | 1977 | > def escape(s): |
|
1976 | 1978 | > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932')) |
|
1977 | 1979 | > # translation of "record" in ja_JP.cp932 |
|
1978 | 1980 | > upper = b"\x8bL\x98^" |
|
1979 | 1981 | > # str.lower()-ed section name should be treated as different one |
|
1980 | 1982 | > lower = b"\x8bl\x98^" |
|
1981 | 1983 | > with open('ambiguous.py', 'wb') as fp: |
|
1982 | 1984 | > fp.write(b"""# ambiguous section names in ja_JP.cp932 |
|
1983 | 1985 | > u'''summary of extension |
|
1984 | 1986 | > |
|
1985 | 1987 | > %s |
|
1986 | 1988 | > ---- |
|
1987 | 1989 | > |
|
1988 | 1990 | > Upper name should show only this message |
|
1989 | 1991 | > |
|
1990 | 1992 | > %s |
|
1991 | 1993 | > ---- |
|
1992 | 1994 | > |
|
1993 | 1995 | > Lower name should show only this message |
|
1994 | 1996 | > |
|
1995 | 1997 | > subsequent section |
|
1996 | 1998 | > ------------------ |
|
1997 | 1999 | > |
|
1998 | 2000 | > This should be hidden at 'hg help ambiguous' with section name. |
|
1999 | 2001 | > ''' |
|
2000 | 2002 | > """ % (escape(upper), escape(lower))) |
|
2001 | 2003 | > EOF |
|
2002 | 2004 | |
|
2003 | 2005 | $ cat >> $HGRCPATH <<EOF |
|
2004 | 2006 | > [extensions] |
|
2005 | 2007 | > ambiguous = ./ambiguous.py |
|
2006 | 2008 | > EOF |
|
2007 | 2009 | |
|
2008 | 2010 | $ "$PYTHON" <<EOF | sh |
|
2009 | 2011 | > from mercurial.utils import procutil |
|
2010 | 2012 | > upper = b"\x8bL\x98^" |
|
2011 | 2013 | > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper) |
|
2012 | 2014 | > EOF |
|
2013 | 2015 | \x8bL\x98^ (esc) |
|
2014 | 2016 | ---- |
|
2015 | 2017 | |
|
2016 | 2018 | Upper name should show only this message |
|
2017 | 2019 | |
|
2018 | 2020 | |
|
2019 | 2021 | $ "$PYTHON" <<EOF | sh |
|
2020 | 2022 | > from mercurial.utils import procutil |
|
2021 | 2023 | > lower = b"\x8bl\x98^" |
|
2022 | 2024 | > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower) |
|
2023 | 2025 | > EOF |
|
2024 | 2026 | \x8bl\x98^ (esc) |
|
2025 | 2027 | ---- |
|
2026 | 2028 | |
|
2027 | 2029 | Lower name should show only this message |
|
2028 | 2030 | |
|
2029 | 2031 | |
|
2030 | 2032 | $ cat >> $HGRCPATH <<EOF |
|
2031 | 2033 | > [extensions] |
|
2032 | 2034 | > ambiguous = ! |
|
2033 | 2035 | > EOF |
|
2034 | 2036 | |
|
2035 | 2037 | Show help content of disabled extensions |
|
2036 | 2038 | |
|
2037 | 2039 | $ cat >> $HGRCPATH <<EOF |
|
2038 | 2040 | > [extensions] |
|
2039 | 2041 | > ambiguous = !./ambiguous.py |
|
2040 | 2042 | > EOF |
|
2041 | 2043 | $ hg help -e ambiguous |
|
2042 | 2044 | ambiguous extension - (no help text available) |
|
2043 | 2045 | |
|
2044 | 2046 | (use 'hg help extensions' for information on enabling extensions) |
|
2045 | 2047 | |
|
2046 | 2048 | Test dynamic list of merge tools only shows up once |
|
2047 | 2049 | $ hg help merge-tools |
|
2048 | 2050 | Merge Tools |
|
2049 | 2051 | """"""""""" |
|
2050 | 2052 | |
|
2051 | 2053 | To merge files Mercurial uses merge tools. |
|
2052 | 2054 | |
|
2053 | 2055 | A merge tool combines two different versions of a file into a merged file. |
|
2054 | 2056 | Merge tools are given the two files and the greatest common ancestor of |
|
2055 | 2057 | the two file versions, so they can determine the changes made on both |
|
2056 | 2058 | branches. |
|
2057 | 2059 | |
|
2058 | 2060 | Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg |
|
2059 | 2061 | backout' and in several extensions. |
|
2060 | 2062 | |
|
2061 | 2063 | Usually, the merge tool tries to automatically reconcile the files by |
|
2062 | 2064 | combining all non-overlapping changes that occurred separately in the two |
|
2063 | 2065 | different evolutions of the same initial base file. Furthermore, some |
|
2064 | 2066 | interactive merge programs make it easier to manually resolve conflicting |
|
2065 | 2067 | merges, either in a graphical way, or by inserting some conflict markers. |
|
2066 | 2068 | Mercurial does not include any interactive merge programs but relies on |
|
2067 | 2069 | external tools for that. |
|
2068 | 2070 | |
|
2069 | 2071 | Available merge tools |
|
2070 | 2072 | ===================== |
|
2071 | 2073 | |
|
2072 | 2074 | External merge tools and their properties are configured in the merge- |
|
2073 | 2075 | tools configuration section - see hgrc(5) - but they can often just be |
|
2074 | 2076 | named by their executable. |
|
2075 | 2077 | |
|
2076 | 2078 | A merge tool is generally usable if its executable can be found on the |
|
2077 | 2079 | system and if it can handle the merge. The executable is found if it is an |
|
2078 | 2080 | absolute or relative executable path or the name of an application in the |
|
2079 | 2081 | executable search path. The tool is assumed to be able to handle the merge |
|
2080 | 2082 | if it can handle symlinks if the file is a symlink, if it can handle |
|
2081 | 2083 | binary files if the file is binary, and if a GUI is available if the tool |
|
2082 | 2084 | requires a GUI. |
|
2083 | 2085 | |
|
2084 | 2086 | There are some internal merge tools which can be used. The internal merge |
|
2085 | 2087 | tools are: |
|
2086 | 2088 | |
|
2087 | 2089 | ":dump" |
|
2088 | 2090 | Creates three versions of the files to merge, containing the contents of |
|
2089 | 2091 | local, other and base. These files can then be used to perform a merge |
|
2090 | 2092 | manually. If the file to be merged is named "a.txt", these files will |
|
2091 | 2093 | accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and |
|
2092 | 2094 | they will be placed in the same directory as "a.txt". |
|
2093 | 2095 | |
|
2094 | 2096 | This implies premerge. Therefore, files aren't dumped, if premerge runs |
|
2095 | 2097 | successfully. Use :forcedump to forcibly write files out. |
|
2096 | 2098 | |
|
2097 | 2099 | (actual capabilities: binary, symlink) |
|
2098 | 2100 | |
|
2099 | 2101 | ":fail" |
|
2100 | 2102 | Rather than attempting to merge files that were modified on both |
|
2101 | 2103 | branches, it marks them as unresolved. The resolve command must be used |
|
2102 | 2104 | to resolve these conflicts. |
|
2103 | 2105 | |
|
2104 | 2106 | (actual capabilities: binary, symlink) |
|
2105 | 2107 | |
|
2106 | 2108 | ":forcedump" |
|
2107 | 2109 | Creates three versions of the files as same as :dump, but omits |
|
2108 | 2110 | premerge. |
|
2109 | 2111 | |
|
2110 | 2112 | (actual capabilities: binary, symlink) |
|
2111 | 2113 | |
|
2112 | 2114 | ":local" |
|
2113 | 2115 | Uses the local 'p1()' version of files as the merged version. |
|
2114 | 2116 | |
|
2115 | 2117 | (actual capabilities: binary, symlink) |
|
2116 | 2118 | |
|
2117 | 2119 | ":merge" |
|
2118 | 2120 | Uses the internal non-interactive simple merge algorithm for merging |
|
2119 | 2121 | files. It will fail if there are any conflicts and leave markers in the |
|
2120 | 2122 | partially merged file. Markers will have two sections, one for each side |
|
2121 | 2123 | of merge. |
|
2122 | 2124 | |
|
2123 | 2125 | ":merge-local" |
|
2124 | 2126 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
2125 | 2127 | local 'p1()' changes. |
|
2126 | 2128 | |
|
2127 | 2129 | ":merge-other" |
|
2128 | 2130 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
2129 | 2131 | other 'p2()' changes. |
|
2130 | 2132 | |
|
2131 | 2133 | ":merge3" |
|
2132 | 2134 | Uses the internal non-interactive simple merge algorithm for merging |
|
2133 | 2135 | files. It will fail if there are any conflicts and leave markers in the |
|
2134 | 2136 | partially merged file. Marker will have three sections, one from each |
|
2135 | 2137 | side of the merge and one for the base content. |
|
2136 | 2138 | |
|
2137 | 2139 | ":mergediff" |
|
2138 | 2140 | Uses the internal non-interactive simple merge algorithm for merging |
|
2139 | 2141 | files. It will fail if there are any conflicts and leave markers in the |
|
2140 | 2142 | partially merged file. The marker will have two sections, one with the |
|
2141 | 2143 | content from one side of the merge, and one with a diff from the base |
|
2142 | 2144 | content to the content on the other side. (experimental) |
|
2143 | 2145 | |
|
2144 | 2146 | ":other" |
|
2145 | 2147 | Uses the other 'p2()' version of files as the merged version. |
|
2146 | 2148 | |
|
2147 | 2149 | (actual capabilities: binary, symlink) |
|
2148 | 2150 | |
|
2149 | 2151 | ":prompt" |
|
2150 | 2152 | Asks the user which of the local 'p1()' or the other 'p2()' version to |
|
2151 | 2153 | keep as the merged version. |
|
2152 | 2154 | |
|
2153 | 2155 | (actual capabilities: binary, symlink) |
|
2154 | 2156 | |
|
2155 | 2157 | ":tagmerge" |
|
2156 | 2158 | Uses the internal tag merge algorithm (experimental). |
|
2157 | 2159 | |
|
2158 | 2160 | ":union" |
|
2159 | 2161 | Uses the internal non-interactive simple merge algorithm for merging |
|
2160 | 2162 | files. It will use both left and right sides for conflict regions. No |
|
2161 | 2163 | markers are inserted. |
|
2162 | 2164 | |
|
2163 | 2165 | Internal tools are always available and do not require a GUI but will by |
|
2164 | 2166 | default not handle symlinks or binary files. See next section for detail |
|
2165 | 2167 | about "actual capabilities" described above. |
|
2166 | 2168 | |
|
2167 | 2169 | Choosing a merge tool |
|
2168 | 2170 | ===================== |
|
2169 | 2171 | |
|
2170 | 2172 | Mercurial uses these rules when deciding which merge tool to use: |
|
2171 | 2173 | |
|
2172 | 2174 | 1. If a tool has been specified with the --tool option to merge or |
|
2173 | 2175 | resolve, it is used. If it is the name of a tool in the merge-tools |
|
2174 | 2176 | configuration, its configuration is used. Otherwise the specified tool |
|
2175 | 2177 | must be executable by the shell. |
|
2176 | 2178 | 2. If the "HGMERGE" environment variable is present, its value is used and |
|
2177 | 2179 | must be executable by the shell. |
|
2178 | 2180 | 3. If the filename of the file to be merged matches any of the patterns in |
|
2179 | 2181 | the merge-patterns configuration section, the first usable merge tool |
|
2180 | 2182 | corresponding to a matching pattern is used. |
|
2181 | 2183 | 4. If ui.merge is set it will be considered next. If the value is not the |
|
2182 | 2184 | name of a configured tool, the specified value is used and must be |
|
2183 | 2185 | executable by the shell. Otherwise the named tool is used if it is |
|
2184 | 2186 | usable. |
|
2185 | 2187 | 5. If any usable merge tools are present in the merge-tools configuration |
|
2186 | 2188 | section, the one with the highest priority is used. |
|
2187 | 2189 | 6. If a program named "hgmerge" can be found on the system, it is used - |
|
2188 | 2190 | but it will by default not be used for symlinks and binary files. |
|
2189 | 2191 | 7. If the file to be merged is not binary and is not a symlink, then |
|
2190 | 2192 | internal ":merge" is used. |
|
2191 | 2193 | 8. Otherwise, ":prompt" is used. |
|
2192 | 2194 | |
|
2193 | 2195 | For historical reason, Mercurial treats merge tools as below while |
|
2194 | 2196 | examining rules above. |
|
2195 | 2197 | |
|
2196 | 2198 | step specified via binary symlink |
|
2197 | 2199 | ---------------------------------- |
|
2198 | 2200 | 1. --tool o/o o/o |
|
2199 | 2201 | 2. HGMERGE o/o o/o |
|
2200 | 2202 | 3. merge-patterns o/o(*) x/?(*) |
|
2201 | 2203 | 4. ui.merge x/?(*) x/?(*) |
|
2202 | 2204 | |
|
2203 | 2205 | Each capability column indicates Mercurial behavior for internal/external |
|
2204 | 2206 | merge tools at examining each rule. |
|
2205 | 2207 | |
|
2206 | 2208 | - "o": "assume that a tool has capability" |
|
2207 | 2209 | - "x": "assume that a tool does not have capability" |
|
2208 | 2210 | - "?": "check actual capability of a tool" |
|
2209 | 2211 | |
|
2210 | 2212 | If "merge.strict-capability-check" configuration is true, Mercurial checks |
|
2211 | 2213 | capabilities of merge tools strictly in (*) cases above (= each capability |
|
2212 | 2214 | column becomes "?/?"). It is false by default for backward compatibility. |
|
2213 | 2215 | |
|
2214 | 2216 | Note: |
|
2215 | 2217 | After selecting a merge program, Mercurial will by default attempt to |
|
2216 | 2218 | merge the files using a simple merge algorithm first. Only if it |
|
2217 | 2219 | doesn't succeed because of conflicting changes will Mercurial actually |
|
2218 | 2220 | execute the merge program. Whether to use the simple merge algorithm |
|
2219 | 2221 | first can be controlled by the premerge setting of the merge tool. |
|
2220 | 2222 | Premerge is enabled by default unless the file is binary or a symlink. |
|
2221 | 2223 | |
|
2222 | 2224 | See the merge-tools and ui sections of hgrc(5) for details on the |
|
2223 | 2225 | configuration of merge tools. |
|
2224 | 2226 | |
|
2225 | 2227 | Compression engines listed in `hg help bundlespec` |
|
2226 | 2228 | |
|
2227 | 2229 | $ hg help bundlespec | grep gzip |
|
2228 | 2230 | "v1" bundles can only use the "gzip", "bzip2", and "none" compression |
|
2229 | 2231 | An algorithm that produces smaller bundles than "gzip". |
|
2230 | 2232 | This engine will likely produce smaller bundles than "gzip" but will be |
|
2231 | 2233 | "gzip" |
|
2232 | 2234 | better compression than "gzip". It also frequently yields better (?) |
|
2233 | 2235 | |
|
2234 | 2236 | Test usage of section marks in help documents |
|
2235 | 2237 | |
|
2236 | 2238 | $ cd "$TESTDIR"/../doc |
|
2237 | 2239 | $ "$PYTHON" check-seclevel.py |
|
2238 | 2240 | $ cd $TESTTMP |
|
2239 | 2241 | |
|
2240 | 2242 | #if serve |
|
2241 | 2243 | |
|
2242 | 2244 | Test the help pages in hgweb. |
|
2243 | 2245 | |
|
2244 | 2246 | Dish up an empty repo; serve it cold. |
|
2245 | 2247 | |
|
2246 | 2248 | $ hg init "$TESTTMP/test" |
|
2247 | 2249 | $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid |
|
2248 | 2250 | $ cat hg.pid >> $DAEMON_PIDS |
|
2249 | 2251 | |
|
2250 | 2252 | $ get-with-headers.py $LOCALIP:$HGPORT "help" |
|
2251 | 2253 | 200 Script output follows |
|
2252 | 2254 | |
|
2253 | 2255 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2254 | 2256 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2255 | 2257 | <head> |
|
2256 | 2258 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2257 | 2259 | <meta name="robots" content="index, nofollow" /> |
|
2258 | 2260 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2259 | 2261 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2260 | 2262 | |
|
2261 | 2263 | <title>Help: Index</title> |
|
2262 | 2264 | </head> |
|
2263 | 2265 | <body> |
|
2264 | 2266 | |
|
2265 | 2267 | <div class="container"> |
|
2266 | 2268 | <div class="menu"> |
|
2267 | 2269 | <div class="logo"> |
|
2268 | 2270 | <a href="https://mercurial-scm.org/"> |
|
2269 | 2271 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2270 | 2272 | </div> |
|
2271 | 2273 | <ul> |
|
2272 | 2274 | <li><a href="/shortlog">log</a></li> |
|
2273 | 2275 | <li><a href="/graph">graph</a></li> |
|
2274 | 2276 | <li><a href="/tags">tags</a></li> |
|
2275 | 2277 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2276 | 2278 | <li><a href="/branches">branches</a></li> |
|
2277 | 2279 | </ul> |
|
2278 | 2280 | <ul> |
|
2279 | 2281 | <li class="active">help</li> |
|
2280 | 2282 | </ul> |
|
2281 | 2283 | </div> |
|
2282 | 2284 | |
|
2283 | 2285 | <div class="main"> |
|
2284 | 2286 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2285 | 2287 | |
|
2286 | 2288 | <form class="search" action="/log"> |
|
2287 | 2289 | |
|
2288 | 2290 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2289 | 2291 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2290 | 2292 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2291 | 2293 | </form> |
|
2292 | 2294 | <table class="bigtable"> |
|
2293 | 2295 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> |
|
2294 | 2296 | |
|
2295 | 2297 | <tr><td> |
|
2296 | 2298 | <a href="/help/bundlespec"> |
|
2297 | 2299 | bundlespec |
|
2298 | 2300 | </a> |
|
2299 | 2301 | </td><td> |
|
2300 | 2302 | Bundle File Formats |
|
2301 | 2303 | </td></tr> |
|
2302 | 2304 | <tr><td> |
|
2303 | 2305 | <a href="/help/color"> |
|
2304 | 2306 | color |
|
2305 | 2307 | </a> |
|
2306 | 2308 | </td><td> |
|
2307 | 2309 | Colorizing Outputs |
|
2308 | 2310 | </td></tr> |
|
2309 | 2311 | <tr><td> |
|
2310 | 2312 | <a href="/help/config"> |
|
2311 | 2313 | config |
|
2312 | 2314 | </a> |
|
2313 | 2315 | </td><td> |
|
2314 | 2316 | Configuration Files |
|
2315 | 2317 | </td></tr> |
|
2316 | 2318 | <tr><td> |
|
2317 | 2319 | <a href="/help/dates"> |
|
2318 | 2320 | dates |
|
2319 | 2321 | </a> |
|
2320 | 2322 | </td><td> |
|
2321 | 2323 | Date Formats |
|
2322 | 2324 | </td></tr> |
|
2323 | 2325 | <tr><td> |
|
2324 | 2326 | <a href="/help/deprecated"> |
|
2325 | 2327 | deprecated |
|
2326 | 2328 | </a> |
|
2327 | 2329 | </td><td> |
|
2328 | 2330 | Deprecated Features |
|
2329 | 2331 | </td></tr> |
|
2330 | 2332 | <tr><td> |
|
2331 | 2333 | <a href="/help/diffs"> |
|
2332 | 2334 | diffs |
|
2333 | 2335 | </a> |
|
2334 | 2336 | </td><td> |
|
2335 | 2337 | Diff Formats |
|
2336 | 2338 | </td></tr> |
|
2337 | 2339 | <tr><td> |
|
2338 | 2340 | <a href="/help/environment"> |
|
2339 | 2341 | environment |
|
2340 | 2342 | </a> |
|
2341 | 2343 | </td><td> |
|
2342 | 2344 | Environment Variables |
|
2343 | 2345 | </td></tr> |
|
2344 | 2346 | <tr><td> |
|
2345 | 2347 | <a href="/help/evolution"> |
|
2346 | 2348 | evolution |
|
2347 | 2349 | </a> |
|
2348 | 2350 | </td><td> |
|
2349 | 2351 | Safely rewriting history (EXPERIMENTAL) |
|
2350 | 2352 | </td></tr> |
|
2351 | 2353 | <tr><td> |
|
2352 | 2354 | <a href="/help/extensions"> |
|
2353 | 2355 | extensions |
|
2354 | 2356 | </a> |
|
2355 | 2357 | </td><td> |
|
2356 | 2358 | Using Additional Features |
|
2357 | 2359 | </td></tr> |
|
2358 | 2360 | <tr><td> |
|
2359 | 2361 | <a href="/help/filesets"> |
|
2360 | 2362 | filesets |
|
2361 | 2363 | </a> |
|
2362 | 2364 | </td><td> |
|
2363 | 2365 | Specifying File Sets |
|
2364 | 2366 | </td></tr> |
|
2365 | 2367 | <tr><td> |
|
2366 | 2368 | <a href="/help/flags"> |
|
2367 | 2369 | flags |
|
2368 | 2370 | </a> |
|
2369 | 2371 | </td><td> |
|
2370 | 2372 | Command-line flags |
|
2371 | 2373 | </td></tr> |
|
2372 | 2374 | <tr><td> |
|
2373 | 2375 | <a href="/help/glossary"> |
|
2374 | 2376 | glossary |
|
2375 | 2377 | </a> |
|
2376 | 2378 | </td><td> |
|
2377 | 2379 | Glossary |
|
2378 | 2380 | </td></tr> |
|
2379 | 2381 | <tr><td> |
|
2380 | 2382 | <a href="/help/hgignore"> |
|
2381 | 2383 | hgignore |
|
2382 | 2384 | </a> |
|
2383 | 2385 | </td><td> |
|
2384 | 2386 | Syntax for Mercurial Ignore Files |
|
2385 | 2387 | </td></tr> |
|
2386 | 2388 | <tr><td> |
|
2387 | 2389 | <a href="/help/hgweb"> |
|
2388 | 2390 | hgweb |
|
2389 | 2391 | </a> |
|
2390 | 2392 | </td><td> |
|
2391 | 2393 | Configuring hgweb |
|
2392 | 2394 | </td></tr> |
|
2393 | 2395 | <tr><td> |
|
2394 | 2396 | <a href="/help/internals"> |
|
2395 | 2397 | internals |
|
2396 | 2398 | </a> |
|
2397 | 2399 | </td><td> |
|
2398 | 2400 | Technical implementation topics |
|
2399 | 2401 | </td></tr> |
|
2400 | 2402 | <tr><td> |
|
2401 | 2403 | <a href="/help/merge-tools"> |
|
2402 | 2404 | merge-tools |
|
2403 | 2405 | </a> |
|
2404 | 2406 | </td><td> |
|
2405 | 2407 | Merge Tools |
|
2406 | 2408 | </td></tr> |
|
2407 | 2409 | <tr><td> |
|
2408 | 2410 | <a href="/help/pager"> |
|
2409 | 2411 | pager |
|
2410 | 2412 | </a> |
|
2411 | 2413 | </td><td> |
|
2412 | 2414 | Pager Support |
|
2413 | 2415 | </td></tr> |
|
2414 | 2416 | <tr><td> |
|
2415 | 2417 | <a href="/help/patterns"> |
|
2416 | 2418 | patterns |
|
2417 | 2419 | </a> |
|
2418 | 2420 | </td><td> |
|
2419 | 2421 | File Name Patterns |
|
2420 | 2422 | </td></tr> |
|
2421 | 2423 | <tr><td> |
|
2422 | 2424 | <a href="/help/phases"> |
|
2423 | 2425 | phases |
|
2424 | 2426 | </a> |
|
2425 | 2427 | </td><td> |
|
2426 | 2428 | Working with Phases |
|
2427 | 2429 | </td></tr> |
|
2428 | 2430 | <tr><td> |
|
2429 | 2431 | <a href="/help/revisions"> |
|
2430 | 2432 | revisions |
|
2431 | 2433 | </a> |
|
2432 | 2434 | </td><td> |
|
2433 | 2435 | Specifying Revisions |
|
2434 | 2436 | </td></tr> |
|
2435 | 2437 | <tr><td> |
|
2436 | 2438 | <a href="/help/rust"> |
|
2437 | 2439 | rust |
|
2438 | 2440 | </a> |
|
2439 | 2441 | </td><td> |
|
2440 | 2442 | Rust in Mercurial |
|
2441 | 2443 | </td></tr> |
|
2442 | 2444 | <tr><td> |
|
2443 | 2445 | <a href="/help/scripting"> |
|
2444 | 2446 | scripting |
|
2445 | 2447 | </a> |
|
2446 | 2448 | </td><td> |
|
2447 | 2449 | Using Mercurial from scripts and automation |
|
2448 | 2450 | </td></tr> |
|
2449 | 2451 | <tr><td> |
|
2450 | 2452 | <a href="/help/subrepos"> |
|
2451 | 2453 | subrepos |
|
2452 | 2454 | </a> |
|
2453 | 2455 | </td><td> |
|
2454 | 2456 | Subrepositories |
|
2455 | 2457 | </td></tr> |
|
2456 | 2458 | <tr><td> |
|
2457 | 2459 | <a href="/help/templating"> |
|
2458 | 2460 | templating |
|
2459 | 2461 | </a> |
|
2460 | 2462 | </td><td> |
|
2461 | 2463 | Template Usage |
|
2462 | 2464 | </td></tr> |
|
2463 | 2465 | <tr><td> |
|
2464 | 2466 | <a href="/help/urls"> |
|
2465 | 2467 | urls |
|
2466 | 2468 | </a> |
|
2467 | 2469 | </td><td> |
|
2468 | 2470 | URL Paths |
|
2469 | 2471 | </td></tr> |
|
2470 | 2472 | <tr><td> |
|
2471 | 2473 | <a href="/help/topic-containing-verbose"> |
|
2472 | 2474 | topic-containing-verbose |
|
2473 | 2475 | </a> |
|
2474 | 2476 | </td><td> |
|
2475 | 2477 | This is the topic to test omit indicating. |
|
2476 | 2478 | </td></tr> |
|
2477 | 2479 | |
|
2478 | 2480 | |
|
2479 | 2481 | <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr> |
|
2480 | 2482 | |
|
2481 | 2483 | <tr><td> |
|
2482 | 2484 | <a href="/help/abort"> |
|
2483 | 2485 | abort |
|
2484 | 2486 | </a> |
|
2485 | 2487 | </td><td> |
|
2486 | 2488 | abort an unfinished operation (EXPERIMENTAL) |
|
2487 | 2489 | </td></tr> |
|
2488 | 2490 | <tr><td> |
|
2489 | 2491 | <a href="/help/add"> |
|
2490 | 2492 | add |
|
2491 | 2493 | </a> |
|
2492 | 2494 | </td><td> |
|
2493 | 2495 | add the specified files on the next commit |
|
2494 | 2496 | </td></tr> |
|
2495 | 2497 | <tr><td> |
|
2496 | 2498 | <a href="/help/annotate"> |
|
2497 | 2499 | annotate |
|
2498 | 2500 | </a> |
|
2499 | 2501 | </td><td> |
|
2500 | 2502 | show changeset information by line for each file |
|
2501 | 2503 | </td></tr> |
|
2502 | 2504 | <tr><td> |
|
2503 | 2505 | <a href="/help/clone"> |
|
2504 | 2506 | clone |
|
2505 | 2507 | </a> |
|
2506 | 2508 | </td><td> |
|
2507 | 2509 | make a copy of an existing repository |
|
2508 | 2510 | </td></tr> |
|
2509 | 2511 | <tr><td> |
|
2510 | 2512 | <a href="/help/commit"> |
|
2511 | 2513 | commit |
|
2512 | 2514 | </a> |
|
2513 | 2515 | </td><td> |
|
2514 | 2516 | commit the specified files or all outstanding changes |
|
2515 | 2517 | </td></tr> |
|
2516 | 2518 | <tr><td> |
|
2517 | 2519 | <a href="/help/continue"> |
|
2518 | 2520 | continue |
|
2519 | 2521 | </a> |
|
2520 | 2522 | </td><td> |
|
2521 | 2523 | resumes an interrupted operation (EXPERIMENTAL) |
|
2522 | 2524 | </td></tr> |
|
2523 | 2525 | <tr><td> |
|
2524 | 2526 | <a href="/help/diff"> |
|
2525 | 2527 | diff |
|
2526 | 2528 | </a> |
|
2527 | 2529 | </td><td> |
|
2528 | 2530 | diff repository (or selected files) |
|
2529 | 2531 | </td></tr> |
|
2530 | 2532 | <tr><td> |
|
2531 | 2533 | <a href="/help/export"> |
|
2532 | 2534 | export |
|
2533 | 2535 | </a> |
|
2534 | 2536 | </td><td> |
|
2535 | 2537 | dump the header and diffs for one or more changesets |
|
2536 | 2538 | </td></tr> |
|
2537 | 2539 | <tr><td> |
|
2538 | 2540 | <a href="/help/forget"> |
|
2539 | 2541 | forget |
|
2540 | 2542 | </a> |
|
2541 | 2543 | </td><td> |
|
2542 | 2544 | forget the specified files on the next commit |
|
2543 | 2545 | </td></tr> |
|
2544 | 2546 | <tr><td> |
|
2545 | 2547 | <a href="/help/init"> |
|
2546 | 2548 | init |
|
2547 | 2549 | </a> |
|
2548 | 2550 | </td><td> |
|
2549 | 2551 | create a new repository in the given directory |
|
2550 | 2552 | </td></tr> |
|
2551 | 2553 | <tr><td> |
|
2552 | 2554 | <a href="/help/log"> |
|
2553 | 2555 | log |
|
2554 | 2556 | </a> |
|
2555 | 2557 | </td><td> |
|
2556 | 2558 | show revision history of entire repository or files |
|
2557 | 2559 | </td></tr> |
|
2558 | 2560 | <tr><td> |
|
2559 | 2561 | <a href="/help/merge"> |
|
2560 | 2562 | merge |
|
2561 | 2563 | </a> |
|
2562 | 2564 | </td><td> |
|
2563 | 2565 | merge another revision into working directory |
|
2564 | 2566 | </td></tr> |
|
2565 | 2567 | <tr><td> |
|
2566 | 2568 | <a href="/help/pull"> |
|
2567 | 2569 | pull |
|
2568 | 2570 | </a> |
|
2569 | 2571 | </td><td> |
|
2570 | 2572 | pull changes from the specified source |
|
2571 | 2573 | </td></tr> |
|
2572 | 2574 | <tr><td> |
|
2573 | 2575 | <a href="/help/push"> |
|
2574 | 2576 | push |
|
2575 | 2577 | </a> |
|
2576 | 2578 | </td><td> |
|
2577 | 2579 | push changes to the specified destination |
|
2578 | 2580 | </td></tr> |
|
2579 | 2581 | <tr><td> |
|
2580 | 2582 | <a href="/help/remove"> |
|
2581 | 2583 | remove |
|
2582 | 2584 | </a> |
|
2583 | 2585 | </td><td> |
|
2584 | 2586 | remove the specified files on the next commit |
|
2585 | 2587 | </td></tr> |
|
2586 | 2588 | <tr><td> |
|
2587 | 2589 | <a href="/help/serve"> |
|
2588 | 2590 | serve |
|
2589 | 2591 | </a> |
|
2590 | 2592 | </td><td> |
|
2591 | 2593 | start stand-alone webserver |
|
2592 | 2594 | </td></tr> |
|
2593 | 2595 | <tr><td> |
|
2594 | 2596 | <a href="/help/status"> |
|
2595 | 2597 | status |
|
2596 | 2598 | </a> |
|
2597 | 2599 | </td><td> |
|
2598 | 2600 | show changed files in the working directory |
|
2599 | 2601 | </td></tr> |
|
2600 | 2602 | <tr><td> |
|
2601 | 2603 | <a href="/help/summary"> |
|
2602 | 2604 | summary |
|
2603 | 2605 | </a> |
|
2604 | 2606 | </td><td> |
|
2605 | 2607 | summarize working directory state |
|
2606 | 2608 | </td></tr> |
|
2607 | 2609 | <tr><td> |
|
2608 | 2610 | <a href="/help/update"> |
|
2609 | 2611 | update |
|
2610 | 2612 | </a> |
|
2611 | 2613 | </td><td> |
|
2612 | 2614 | update working directory (or switch revisions) |
|
2613 | 2615 | </td></tr> |
|
2614 | 2616 | |
|
2615 | 2617 | |
|
2616 | 2618 | |
|
2617 | 2619 | <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr> |
|
2618 | 2620 | |
|
2619 | 2621 | <tr><td> |
|
2620 | 2622 | <a href="/help/addremove"> |
|
2621 | 2623 | addremove |
|
2622 | 2624 | </a> |
|
2623 | 2625 | </td><td> |
|
2624 | 2626 | add all new files, delete all missing files |
|
2625 | 2627 | </td></tr> |
|
2626 | 2628 | <tr><td> |
|
2627 | 2629 | <a href="/help/archive"> |
|
2628 | 2630 | archive |
|
2629 | 2631 | </a> |
|
2630 | 2632 | </td><td> |
|
2631 | 2633 | create an unversioned archive of a repository revision |
|
2632 | 2634 | </td></tr> |
|
2633 | 2635 | <tr><td> |
|
2634 | 2636 | <a href="/help/backout"> |
|
2635 | 2637 | backout |
|
2636 | 2638 | </a> |
|
2637 | 2639 | </td><td> |
|
2638 | 2640 | reverse effect of earlier changeset |
|
2639 | 2641 | </td></tr> |
|
2640 | 2642 | <tr><td> |
|
2641 | 2643 | <a href="/help/bisect"> |
|
2642 | 2644 | bisect |
|
2643 | 2645 | </a> |
|
2644 | 2646 | </td><td> |
|
2645 | 2647 | subdivision search of changesets |
|
2646 | 2648 | </td></tr> |
|
2647 | 2649 | <tr><td> |
|
2648 | 2650 | <a href="/help/bookmarks"> |
|
2649 | 2651 | bookmarks |
|
2650 | 2652 | </a> |
|
2651 | 2653 | </td><td> |
|
2652 | 2654 | create a new bookmark or list existing bookmarks |
|
2653 | 2655 | </td></tr> |
|
2654 | 2656 | <tr><td> |
|
2655 | 2657 | <a href="/help/branch"> |
|
2656 | 2658 | branch |
|
2657 | 2659 | </a> |
|
2658 | 2660 | </td><td> |
|
2659 | 2661 | set or show the current branch name |
|
2660 | 2662 | </td></tr> |
|
2661 | 2663 | <tr><td> |
|
2662 | 2664 | <a href="/help/branches"> |
|
2663 | 2665 | branches |
|
2664 | 2666 | </a> |
|
2665 | 2667 | </td><td> |
|
2666 | 2668 | list repository named branches |
|
2667 | 2669 | </td></tr> |
|
2668 | 2670 | <tr><td> |
|
2669 | 2671 | <a href="/help/bundle"> |
|
2670 | 2672 | bundle |
|
2671 | 2673 | </a> |
|
2672 | 2674 | </td><td> |
|
2673 | 2675 | create a bundle file |
|
2674 | 2676 | </td></tr> |
|
2675 | 2677 | <tr><td> |
|
2676 | 2678 | <a href="/help/cat"> |
|
2677 | 2679 | cat |
|
2678 | 2680 | </a> |
|
2679 | 2681 | </td><td> |
|
2680 | 2682 | output the current or given revision of files |
|
2681 | 2683 | </td></tr> |
|
2682 | 2684 | <tr><td> |
|
2683 | 2685 | <a href="/help/config"> |
|
2684 | 2686 | config |
|
2685 | 2687 | </a> |
|
2686 | 2688 | </td><td> |
|
2687 | 2689 | show combined config settings from all hgrc files |
|
2688 | 2690 | </td></tr> |
|
2689 | 2691 | <tr><td> |
|
2690 | 2692 | <a href="/help/copy"> |
|
2691 | 2693 | copy |
|
2692 | 2694 | </a> |
|
2693 | 2695 | </td><td> |
|
2694 | 2696 | mark files as copied for the next commit |
|
2695 | 2697 | </td></tr> |
|
2696 | 2698 | <tr><td> |
|
2697 | 2699 | <a href="/help/files"> |
|
2698 | 2700 | files |
|
2699 | 2701 | </a> |
|
2700 | 2702 | </td><td> |
|
2701 | 2703 | list tracked files |
|
2702 | 2704 | </td></tr> |
|
2703 | 2705 | <tr><td> |
|
2704 | 2706 | <a href="/help/graft"> |
|
2705 | 2707 | graft |
|
2706 | 2708 | </a> |
|
2707 | 2709 | </td><td> |
|
2708 | 2710 | copy changes from other branches onto the current branch |
|
2709 | 2711 | </td></tr> |
|
2710 | 2712 | <tr><td> |
|
2711 | 2713 | <a href="/help/grep"> |
|
2712 | 2714 | grep |
|
2713 | 2715 | </a> |
|
2714 | 2716 | </td><td> |
|
2715 | 2717 | search for a pattern in specified files |
|
2716 | 2718 | </td></tr> |
|
2717 | 2719 | <tr><td> |
|
2718 | 2720 | <a href="/help/hashelp"> |
|
2719 | 2721 | hashelp |
|
2720 | 2722 | </a> |
|
2721 | 2723 | </td><td> |
|
2722 | 2724 | Extension command's help |
|
2723 | 2725 | </td></tr> |
|
2724 | 2726 | <tr><td> |
|
2725 | 2727 | <a href="/help/heads"> |
|
2726 | 2728 | heads |
|
2727 | 2729 | </a> |
|
2728 | 2730 | </td><td> |
|
2729 | 2731 | show branch heads |
|
2730 | 2732 | </td></tr> |
|
2731 | 2733 | <tr><td> |
|
2732 | 2734 | <a href="/help/help"> |
|
2733 | 2735 | help |
|
2734 | 2736 | </a> |
|
2735 | 2737 | </td><td> |
|
2736 | 2738 | show help for a given topic or a help overview |
|
2737 | 2739 | </td></tr> |
|
2738 | 2740 | <tr><td> |
|
2739 | 2741 | <a href="/help/hgalias"> |
|
2740 | 2742 | hgalias |
|
2741 | 2743 | </a> |
|
2742 | 2744 | </td><td> |
|
2743 | 2745 | My doc |
|
2744 | 2746 | </td></tr> |
|
2745 | 2747 | <tr><td> |
|
2746 | 2748 | <a href="/help/hgaliasnodoc"> |
|
2747 | 2749 | hgaliasnodoc |
|
2748 | 2750 | </a> |
|
2749 | 2751 | </td><td> |
|
2750 | 2752 | summarize working directory state |
|
2751 | 2753 | </td></tr> |
|
2752 | 2754 | <tr><td> |
|
2753 | 2755 | <a href="/help/identify"> |
|
2754 | 2756 | identify |
|
2755 | 2757 | </a> |
|
2756 | 2758 | </td><td> |
|
2757 | 2759 | identify the working directory or specified revision |
|
2758 | 2760 | </td></tr> |
|
2759 | 2761 | <tr><td> |
|
2760 | 2762 | <a href="/help/import"> |
|
2761 | 2763 | import |
|
2762 | 2764 | </a> |
|
2763 | 2765 | </td><td> |
|
2764 | 2766 | import an ordered set of patches |
|
2765 | 2767 | </td></tr> |
|
2766 | 2768 | <tr><td> |
|
2767 | 2769 | <a href="/help/incoming"> |
|
2768 | 2770 | incoming |
|
2769 | 2771 | </a> |
|
2770 | 2772 | </td><td> |
|
2771 | 2773 | show new changesets found in source |
|
2772 | 2774 | </td></tr> |
|
2773 | 2775 | <tr><td> |
|
2774 | 2776 | <a href="/help/manifest"> |
|
2775 | 2777 | manifest |
|
2776 | 2778 | </a> |
|
2777 | 2779 | </td><td> |
|
2778 | 2780 | output the current or given revision of the project manifest |
|
2779 | 2781 | </td></tr> |
|
2780 | 2782 | <tr><td> |
|
2781 | 2783 | <a href="/help/nohelp"> |
|
2782 | 2784 | nohelp |
|
2783 | 2785 | </a> |
|
2784 | 2786 | </td><td> |
|
2785 | 2787 | (no help text available) |
|
2786 | 2788 | </td></tr> |
|
2787 | 2789 | <tr><td> |
|
2788 | 2790 | <a href="/help/outgoing"> |
|
2789 | 2791 | outgoing |
|
2790 | 2792 | </a> |
|
2791 | 2793 | </td><td> |
|
2792 | 2794 | show changesets not found in the destination |
|
2793 | 2795 | </td></tr> |
|
2794 | 2796 | <tr><td> |
|
2795 | 2797 | <a href="/help/paths"> |
|
2796 | 2798 | paths |
|
2797 | 2799 | </a> |
|
2798 | 2800 | </td><td> |
|
2799 | 2801 | show aliases for remote repositories |
|
2800 | 2802 | </td></tr> |
|
2801 | 2803 | <tr><td> |
|
2802 | 2804 | <a href="/help/phase"> |
|
2803 | 2805 | phase |
|
2804 | 2806 | </a> |
|
2805 | 2807 | </td><td> |
|
2806 | 2808 | set or show the current phase name |
|
2807 | 2809 | </td></tr> |
|
2808 | 2810 | <tr><td> |
|
2809 | 2811 | <a href="/help/purge"> |
|
2810 | 2812 | purge |
|
2811 | 2813 | </a> |
|
2812 | 2814 | </td><td> |
|
2813 | 2815 | removes files not tracked by Mercurial |
|
2814 | 2816 | </td></tr> |
|
2815 | 2817 | <tr><td> |
|
2816 | 2818 | <a href="/help/recover"> |
|
2817 | 2819 | recover |
|
2818 | 2820 | </a> |
|
2819 | 2821 | </td><td> |
|
2820 | 2822 | roll back an interrupted transaction |
|
2821 | 2823 | </td></tr> |
|
2822 | 2824 | <tr><td> |
|
2823 | 2825 | <a href="/help/rename"> |
|
2824 | 2826 | rename |
|
2825 | 2827 | </a> |
|
2826 | 2828 | </td><td> |
|
2827 | 2829 | rename files; equivalent of copy + remove |
|
2828 | 2830 | </td></tr> |
|
2829 | 2831 | <tr><td> |
|
2830 | 2832 | <a href="/help/resolve"> |
|
2831 | 2833 | resolve |
|
2832 | 2834 | </a> |
|
2833 | 2835 | </td><td> |
|
2834 | 2836 | redo merges or set/view the merge status of files |
|
2835 | 2837 | </td></tr> |
|
2836 | 2838 | <tr><td> |
|
2837 | 2839 | <a href="/help/revert"> |
|
2838 | 2840 | revert |
|
2839 | 2841 | </a> |
|
2840 | 2842 | </td><td> |
|
2841 | 2843 | restore files to their checkout state |
|
2842 | 2844 | </td></tr> |
|
2843 | 2845 | <tr><td> |
|
2844 | 2846 | <a href="/help/root"> |
|
2845 | 2847 | root |
|
2846 | 2848 | </a> |
|
2847 | 2849 | </td><td> |
|
2848 | 2850 | print the root (top) of the current working directory |
|
2849 | 2851 | </td></tr> |
|
2850 | 2852 | <tr><td> |
|
2851 | 2853 | <a href="/help/shellalias"> |
|
2852 | 2854 | shellalias |
|
2853 | 2855 | </a> |
|
2854 | 2856 | </td><td> |
|
2855 | 2857 | (no help text available) |
|
2856 | 2858 | </td></tr> |
|
2857 | 2859 | <tr><td> |
|
2858 | 2860 | <a href="/help/shelve"> |
|
2859 | 2861 | shelve |
|
2860 | 2862 | </a> |
|
2861 | 2863 | </td><td> |
|
2862 | 2864 | save and set aside changes from the working directory |
|
2863 | 2865 | </td></tr> |
|
2864 | 2866 | <tr><td> |
|
2865 | 2867 | <a href="/help/tag"> |
|
2866 | 2868 | tag |
|
2867 | 2869 | </a> |
|
2868 | 2870 | </td><td> |
|
2869 | 2871 | add one or more tags for the current or given revision |
|
2870 | 2872 | </td></tr> |
|
2871 | 2873 | <tr><td> |
|
2872 | 2874 | <a href="/help/tags"> |
|
2873 | 2875 | tags |
|
2874 | 2876 | </a> |
|
2875 | 2877 | </td><td> |
|
2876 | 2878 | list repository tags |
|
2877 | 2879 | </td></tr> |
|
2878 | 2880 | <tr><td> |
|
2879 | 2881 | <a href="/help/unbundle"> |
|
2880 | 2882 | unbundle |
|
2881 | 2883 | </a> |
|
2882 | 2884 | </td><td> |
|
2883 | 2885 | apply one or more bundle files |
|
2884 | 2886 | </td></tr> |
|
2885 | 2887 | <tr><td> |
|
2886 | 2888 | <a href="/help/unshelve"> |
|
2887 | 2889 | unshelve |
|
2888 | 2890 | </a> |
|
2889 | 2891 | </td><td> |
|
2890 | 2892 | restore a shelved change to the working directory |
|
2891 | 2893 | </td></tr> |
|
2892 | 2894 | <tr><td> |
|
2893 | 2895 | <a href="/help/verify"> |
|
2894 | 2896 | verify |
|
2895 | 2897 | </a> |
|
2896 | 2898 | </td><td> |
|
2897 | 2899 | verify the integrity of the repository |
|
2898 | 2900 | </td></tr> |
|
2899 | 2901 | <tr><td> |
|
2900 | 2902 | <a href="/help/version"> |
|
2901 | 2903 | version |
|
2902 | 2904 | </a> |
|
2903 | 2905 | </td><td> |
|
2904 | 2906 | output version and copyright information |
|
2905 | 2907 | </td></tr> |
|
2906 | 2908 | |
|
2907 | 2909 | |
|
2908 | 2910 | </table> |
|
2909 | 2911 | </div> |
|
2910 | 2912 | </div> |
|
2911 | 2913 | |
|
2912 | 2914 | |
|
2913 | 2915 | |
|
2914 | 2916 | </body> |
|
2915 | 2917 | </html> |
|
2916 | 2918 | |
|
2917 | 2919 | |
|
2918 | 2920 | $ get-with-headers.py $LOCALIP:$HGPORT "help/add" |
|
2919 | 2921 | 200 Script output follows |
|
2920 | 2922 | |
|
2921 | 2923 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2922 | 2924 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2923 | 2925 | <head> |
|
2924 | 2926 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2925 | 2927 | <meta name="robots" content="index, nofollow" /> |
|
2926 | 2928 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2927 | 2929 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2928 | 2930 | |
|
2929 | 2931 | <title>Help: add</title> |
|
2930 | 2932 | </head> |
|
2931 | 2933 | <body> |
|
2932 | 2934 | |
|
2933 | 2935 | <div class="container"> |
|
2934 | 2936 | <div class="menu"> |
|
2935 | 2937 | <div class="logo"> |
|
2936 | 2938 | <a href="https://mercurial-scm.org/"> |
|
2937 | 2939 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2938 | 2940 | </div> |
|
2939 | 2941 | <ul> |
|
2940 | 2942 | <li><a href="/shortlog">log</a></li> |
|
2941 | 2943 | <li><a href="/graph">graph</a></li> |
|
2942 | 2944 | <li><a href="/tags">tags</a></li> |
|
2943 | 2945 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2944 | 2946 | <li><a href="/branches">branches</a></li> |
|
2945 | 2947 | </ul> |
|
2946 | 2948 | <ul> |
|
2947 | 2949 | <li class="active"><a href="/help">help</a></li> |
|
2948 | 2950 | </ul> |
|
2949 | 2951 | </div> |
|
2950 | 2952 | |
|
2951 | 2953 | <div class="main"> |
|
2952 | 2954 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2953 | 2955 | <h3>Help: add</h3> |
|
2954 | 2956 | |
|
2955 | 2957 | <form class="search" action="/log"> |
|
2956 | 2958 | |
|
2957 | 2959 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2958 | 2960 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2959 | 2961 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2960 | 2962 | </form> |
|
2961 | 2963 | <div id="doc"> |
|
2962 | 2964 | <p> |
|
2963 | 2965 | hg add [OPTION]... [FILE]... |
|
2964 | 2966 | </p> |
|
2965 | 2967 | <p> |
|
2966 | 2968 | add the specified files on the next commit |
|
2967 | 2969 | </p> |
|
2968 | 2970 | <p> |
|
2969 | 2971 | Schedule files to be version controlled and added to the |
|
2970 | 2972 | repository. |
|
2971 | 2973 | </p> |
|
2972 | 2974 | <p> |
|
2973 | 2975 | The files will be added to the repository at the next commit. To |
|
2974 | 2976 | undo an add before that, see 'hg forget'. |
|
2975 | 2977 | </p> |
|
2976 | 2978 | <p> |
|
2977 | 2979 | If no names are given, add all files to the repository (except |
|
2978 | 2980 | files matching ".hgignore"). |
|
2979 | 2981 | </p> |
|
2980 | 2982 | <p> |
|
2981 | 2983 | Examples: |
|
2982 | 2984 | </p> |
|
2983 | 2985 | <ul> |
|
2984 | 2986 | <li> New (unknown) files are added automatically by 'hg add': |
|
2985 | 2987 | <pre> |
|
2986 | 2988 | \$ ls (re) |
|
2987 | 2989 | foo.c |
|
2988 | 2990 | \$ hg status (re) |
|
2989 | 2991 | ? foo.c |
|
2990 | 2992 | \$ hg add (re) |
|
2991 | 2993 | adding foo.c |
|
2992 | 2994 | \$ hg status (re) |
|
2993 | 2995 | A foo.c |
|
2994 | 2996 | </pre> |
|
2995 | 2997 | <li> Specific files to be added can be specified: |
|
2996 | 2998 | <pre> |
|
2997 | 2999 | \$ ls (re) |
|
2998 | 3000 | bar.c foo.c |
|
2999 | 3001 | \$ hg status (re) |
|
3000 | 3002 | ? bar.c |
|
3001 | 3003 | ? foo.c |
|
3002 | 3004 | \$ hg add bar.c (re) |
|
3003 | 3005 | \$ hg status (re) |
|
3004 | 3006 | A bar.c |
|
3005 | 3007 | ? foo.c |
|
3006 | 3008 | </pre> |
|
3007 | 3009 | </ul> |
|
3008 | 3010 | <p> |
|
3009 | 3011 | Returns 0 if all files are successfully added. |
|
3010 | 3012 | </p> |
|
3011 | 3013 | <p> |
|
3012 | 3014 | options ([+] can be repeated): |
|
3013 | 3015 | </p> |
|
3014 | 3016 | <table> |
|
3015 | 3017 | <tr><td>-I</td> |
|
3016 | 3018 | <td>--include PATTERN [+]</td> |
|
3017 | 3019 | <td>include names matching the given patterns</td></tr> |
|
3018 | 3020 | <tr><td>-X</td> |
|
3019 | 3021 | <td>--exclude PATTERN [+]</td> |
|
3020 | 3022 | <td>exclude names matching the given patterns</td></tr> |
|
3021 | 3023 | <tr><td>-S</td> |
|
3022 | 3024 | <td>--subrepos</td> |
|
3023 | 3025 | <td>recurse into subrepositories</td></tr> |
|
3024 | 3026 | <tr><td>-n</td> |
|
3025 | 3027 | <td>--dry-run</td> |
|
3026 | 3028 | <td>do not perform actions, just print output</td></tr> |
|
3027 | 3029 | </table> |
|
3028 | 3030 | <p> |
|
3029 | 3031 | global options ([+] can be repeated): |
|
3030 | 3032 | </p> |
|
3031 | 3033 | <table> |
|
3032 | 3034 | <tr><td>-R</td> |
|
3033 | 3035 | <td>--repository REPO</td> |
|
3034 | 3036 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
3035 | 3037 | <tr><td></td> |
|
3036 | 3038 | <td>--cwd DIR</td> |
|
3037 | 3039 | <td>change working directory</td></tr> |
|
3038 | 3040 | <tr><td>-y</td> |
|
3039 | 3041 | <td>--noninteractive</td> |
|
3040 | 3042 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
3041 | 3043 | <tr><td>-q</td> |
|
3042 | 3044 | <td>--quiet</td> |
|
3043 | 3045 | <td>suppress output</td></tr> |
|
3044 | 3046 | <tr><td>-v</td> |
|
3045 | 3047 | <td>--verbose</td> |
|
3046 | 3048 | <td>enable additional output</td></tr> |
|
3047 | 3049 | <tr><td></td> |
|
3048 | 3050 | <td>--color TYPE</td> |
|
3049 | 3051 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> |
|
3050 | 3052 | <tr><td></td> |
|
3051 | 3053 | <td>--config CONFIG [+]</td> |
|
3052 | 3054 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
3053 | 3055 | <tr><td></td> |
|
3054 | 3056 | <td>--debug</td> |
|
3055 | 3057 | <td>enable debugging output</td></tr> |
|
3056 | 3058 | <tr><td></td> |
|
3057 | 3059 | <td>--debugger</td> |
|
3058 | 3060 | <td>start debugger</td></tr> |
|
3059 | 3061 | <tr><td></td> |
|
3060 | 3062 | <td>--encoding ENCODE</td> |
|
3061 | 3063 | <td>set the charset encoding (default: ascii)</td></tr> |
|
3062 | 3064 | <tr><td></td> |
|
3063 | 3065 | <td>--encodingmode MODE</td> |
|
3064 | 3066 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
3065 | 3067 | <tr><td></td> |
|
3066 | 3068 | <td>--traceback</td> |
|
3067 | 3069 | <td>always print a traceback on exception</td></tr> |
|
3068 | 3070 | <tr><td></td> |
|
3069 | 3071 | <td>--time</td> |
|
3070 | 3072 | <td>time how long the command takes</td></tr> |
|
3071 | 3073 | <tr><td></td> |
|
3072 | 3074 | <td>--profile</td> |
|
3073 | 3075 | <td>print command execution profile</td></tr> |
|
3074 | 3076 | <tr><td></td> |
|
3075 | 3077 | <td>--version</td> |
|
3076 | 3078 | <td>output version information and exit</td></tr> |
|
3077 | 3079 | <tr><td>-h</td> |
|
3078 | 3080 | <td>--help</td> |
|
3079 | 3081 | <td>display help and exit</td></tr> |
|
3080 | 3082 | <tr><td></td> |
|
3081 | 3083 | <td>--hidden</td> |
|
3082 | 3084 | <td>consider hidden changesets</td></tr> |
|
3083 | 3085 | <tr><td></td> |
|
3084 | 3086 | <td>--pager TYPE</td> |
|
3085 | 3087 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> |
|
3086 | 3088 | </table> |
|
3087 | 3089 | |
|
3088 | 3090 | </div> |
|
3089 | 3091 | </div> |
|
3090 | 3092 | </div> |
|
3091 | 3093 | |
|
3092 | 3094 | |
|
3093 | 3095 | |
|
3094 | 3096 | </body> |
|
3095 | 3097 | </html> |
|
3096 | 3098 | |
|
3097 | 3099 | |
|
3098 | 3100 | $ get-with-headers.py $LOCALIP:$HGPORT "help/remove" |
|
3099 | 3101 | 200 Script output follows |
|
3100 | 3102 | |
|
3101 | 3103 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3102 | 3104 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3103 | 3105 | <head> |
|
3104 | 3106 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3105 | 3107 | <meta name="robots" content="index, nofollow" /> |
|
3106 | 3108 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3107 | 3109 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3108 | 3110 | |
|
3109 | 3111 | <title>Help: remove</title> |
|
3110 | 3112 | </head> |
|
3111 | 3113 | <body> |
|
3112 | 3114 | |
|
3113 | 3115 | <div class="container"> |
|
3114 | 3116 | <div class="menu"> |
|
3115 | 3117 | <div class="logo"> |
|
3116 | 3118 | <a href="https://mercurial-scm.org/"> |
|
3117 | 3119 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3118 | 3120 | </div> |
|
3119 | 3121 | <ul> |
|
3120 | 3122 | <li><a href="/shortlog">log</a></li> |
|
3121 | 3123 | <li><a href="/graph">graph</a></li> |
|
3122 | 3124 | <li><a href="/tags">tags</a></li> |
|
3123 | 3125 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3124 | 3126 | <li><a href="/branches">branches</a></li> |
|
3125 | 3127 | </ul> |
|
3126 | 3128 | <ul> |
|
3127 | 3129 | <li class="active"><a href="/help">help</a></li> |
|
3128 | 3130 | </ul> |
|
3129 | 3131 | </div> |
|
3130 | 3132 | |
|
3131 | 3133 | <div class="main"> |
|
3132 | 3134 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3133 | 3135 | <h3>Help: remove</h3> |
|
3134 | 3136 | |
|
3135 | 3137 | <form class="search" action="/log"> |
|
3136 | 3138 | |
|
3137 | 3139 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3138 | 3140 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3139 | 3141 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3140 | 3142 | </form> |
|
3141 | 3143 | <div id="doc"> |
|
3142 | 3144 | <p> |
|
3143 | 3145 | hg remove [OPTION]... FILE... |
|
3144 | 3146 | </p> |
|
3145 | 3147 | <p> |
|
3146 | 3148 | aliases: rm |
|
3147 | 3149 | </p> |
|
3148 | 3150 | <p> |
|
3149 | 3151 | remove the specified files on the next commit |
|
3150 | 3152 | </p> |
|
3151 | 3153 | <p> |
|
3152 | 3154 | Schedule the indicated files for removal from the current branch. |
|
3153 | 3155 | </p> |
|
3154 | 3156 | <p> |
|
3155 | 3157 | This command schedules the files to be removed at the next commit. |
|
3156 | 3158 | To undo a remove before that, see 'hg revert'. To undo added |
|
3157 | 3159 | files, see 'hg forget'. |
|
3158 | 3160 | </p> |
|
3159 | 3161 | <p> |
|
3160 | 3162 | -A/--after can be used to remove only files that have already |
|
3161 | 3163 | been deleted, -f/--force can be used to force deletion, and -Af |
|
3162 | 3164 | can be used to remove files from the next revision without |
|
3163 | 3165 | deleting them from the working directory. |
|
3164 | 3166 | </p> |
|
3165 | 3167 | <p> |
|
3166 | 3168 | The following table details the behavior of remove for different |
|
3167 | 3169 | file states (columns) and option combinations (rows). The file |
|
3168 | 3170 | states are Added [A], Clean [C], Modified [M] and Missing [!] |
|
3169 | 3171 | (as reported by 'hg status'). The actions are Warn, Remove |
|
3170 | 3172 | (from branch) and Delete (from disk): |
|
3171 | 3173 | </p> |
|
3172 | 3174 | <table> |
|
3173 | 3175 | <tr><td>opt/state</td> |
|
3174 | 3176 | <td>A</td> |
|
3175 | 3177 | <td>C</td> |
|
3176 | 3178 | <td>M</td> |
|
3177 | 3179 | <td>!</td></tr> |
|
3178 | 3180 | <tr><td>none</td> |
|
3179 | 3181 | <td>W</td> |
|
3180 | 3182 | <td>RD</td> |
|
3181 | 3183 | <td>W</td> |
|
3182 | 3184 | <td>R</td></tr> |
|
3183 | 3185 | <tr><td>-f</td> |
|
3184 | 3186 | <td>R</td> |
|
3185 | 3187 | <td>RD</td> |
|
3186 | 3188 | <td>RD</td> |
|
3187 | 3189 | <td>R</td></tr> |
|
3188 | 3190 | <tr><td>-A</td> |
|
3189 | 3191 | <td>W</td> |
|
3190 | 3192 | <td>W</td> |
|
3191 | 3193 | <td>W</td> |
|
3192 | 3194 | <td>R</td></tr> |
|
3193 | 3195 | <tr><td>-Af</td> |
|
3194 | 3196 | <td>R</td> |
|
3195 | 3197 | <td>R</td> |
|
3196 | 3198 | <td>R</td> |
|
3197 | 3199 | <td>R</td></tr> |
|
3198 | 3200 | </table> |
|
3199 | 3201 | <p> |
|
3200 | 3202 | <b>Note:</b> |
|
3201 | 3203 | </p> |
|
3202 | 3204 | <p> |
|
3203 | 3205 | 'hg remove' never deletes files in Added [A] state from the |
|
3204 | 3206 | working directory, not even if "--force" is specified. |
|
3205 | 3207 | </p> |
|
3206 | 3208 | <p> |
|
3207 | 3209 | Returns 0 on success, 1 if any warnings encountered. |
|
3208 | 3210 | </p> |
|
3209 | 3211 | <p> |
|
3210 | 3212 | options ([+] can be repeated): |
|
3211 | 3213 | </p> |
|
3212 | 3214 | <table> |
|
3213 | 3215 | <tr><td>-A</td> |
|
3214 | 3216 | <td>--after</td> |
|
3215 | 3217 | <td>record delete for missing files</td></tr> |
|
3216 | 3218 | <tr><td>-f</td> |
|
3217 | 3219 | <td>--force</td> |
|
3218 | 3220 | <td>forget added files, delete modified files</td></tr> |
|
3219 | 3221 | <tr><td>-S</td> |
|
3220 | 3222 | <td>--subrepos</td> |
|
3221 | 3223 | <td>recurse into subrepositories</td></tr> |
|
3222 | 3224 | <tr><td>-I</td> |
|
3223 | 3225 | <td>--include PATTERN [+]</td> |
|
3224 | 3226 | <td>include names matching the given patterns</td></tr> |
|
3225 | 3227 | <tr><td>-X</td> |
|
3226 | 3228 | <td>--exclude PATTERN [+]</td> |
|
3227 | 3229 | <td>exclude names matching the given patterns</td></tr> |
|
3228 | 3230 | <tr><td>-n</td> |
|
3229 | 3231 | <td>--dry-run</td> |
|
3230 | 3232 | <td>do not perform actions, just print output</td></tr> |
|
3231 | 3233 | </table> |
|
3232 | 3234 | <p> |
|
3233 | 3235 | global options ([+] can be repeated): |
|
3234 | 3236 | </p> |
|
3235 | 3237 | <table> |
|
3236 | 3238 | <tr><td>-R</td> |
|
3237 | 3239 | <td>--repository REPO</td> |
|
3238 | 3240 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
3239 | 3241 | <tr><td></td> |
|
3240 | 3242 | <td>--cwd DIR</td> |
|
3241 | 3243 | <td>change working directory</td></tr> |
|
3242 | 3244 | <tr><td>-y</td> |
|
3243 | 3245 | <td>--noninteractive</td> |
|
3244 | 3246 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
3245 | 3247 | <tr><td>-q</td> |
|
3246 | 3248 | <td>--quiet</td> |
|
3247 | 3249 | <td>suppress output</td></tr> |
|
3248 | 3250 | <tr><td>-v</td> |
|
3249 | 3251 | <td>--verbose</td> |
|
3250 | 3252 | <td>enable additional output</td></tr> |
|
3251 | 3253 | <tr><td></td> |
|
3252 | 3254 | <td>--color TYPE</td> |
|
3253 | 3255 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> |
|
3254 | 3256 | <tr><td></td> |
|
3255 | 3257 | <td>--config CONFIG [+]</td> |
|
3256 | 3258 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
3257 | 3259 | <tr><td></td> |
|
3258 | 3260 | <td>--debug</td> |
|
3259 | 3261 | <td>enable debugging output</td></tr> |
|
3260 | 3262 | <tr><td></td> |
|
3261 | 3263 | <td>--debugger</td> |
|
3262 | 3264 | <td>start debugger</td></tr> |
|
3263 | 3265 | <tr><td></td> |
|
3264 | 3266 | <td>--encoding ENCODE</td> |
|
3265 | 3267 | <td>set the charset encoding (default: ascii)</td></tr> |
|
3266 | 3268 | <tr><td></td> |
|
3267 | 3269 | <td>--encodingmode MODE</td> |
|
3268 | 3270 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
3269 | 3271 | <tr><td></td> |
|
3270 | 3272 | <td>--traceback</td> |
|
3271 | 3273 | <td>always print a traceback on exception</td></tr> |
|
3272 | 3274 | <tr><td></td> |
|
3273 | 3275 | <td>--time</td> |
|
3274 | 3276 | <td>time how long the command takes</td></tr> |
|
3275 | 3277 | <tr><td></td> |
|
3276 | 3278 | <td>--profile</td> |
|
3277 | 3279 | <td>print command execution profile</td></tr> |
|
3278 | 3280 | <tr><td></td> |
|
3279 | 3281 | <td>--version</td> |
|
3280 | 3282 | <td>output version information and exit</td></tr> |
|
3281 | 3283 | <tr><td>-h</td> |
|
3282 | 3284 | <td>--help</td> |
|
3283 | 3285 | <td>display help and exit</td></tr> |
|
3284 | 3286 | <tr><td></td> |
|
3285 | 3287 | <td>--hidden</td> |
|
3286 | 3288 | <td>consider hidden changesets</td></tr> |
|
3287 | 3289 | <tr><td></td> |
|
3288 | 3290 | <td>--pager TYPE</td> |
|
3289 | 3291 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> |
|
3290 | 3292 | </table> |
|
3291 | 3293 | |
|
3292 | 3294 | </div> |
|
3293 | 3295 | </div> |
|
3294 | 3296 | </div> |
|
3295 | 3297 | |
|
3296 | 3298 | |
|
3297 | 3299 | |
|
3298 | 3300 | </body> |
|
3299 | 3301 | </html> |
|
3300 | 3302 | |
|
3301 | 3303 | |
|
3302 | 3304 | $ get-with-headers.py $LOCALIP:$HGPORT "help/dates" |
|
3303 | 3305 | 200 Script output follows |
|
3304 | 3306 | |
|
3305 | 3307 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3306 | 3308 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3307 | 3309 | <head> |
|
3308 | 3310 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3309 | 3311 | <meta name="robots" content="index, nofollow" /> |
|
3310 | 3312 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3311 | 3313 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3312 | 3314 | |
|
3313 | 3315 | <title>Help: dates</title> |
|
3314 | 3316 | </head> |
|
3315 | 3317 | <body> |
|
3316 | 3318 | |
|
3317 | 3319 | <div class="container"> |
|
3318 | 3320 | <div class="menu"> |
|
3319 | 3321 | <div class="logo"> |
|
3320 | 3322 | <a href="https://mercurial-scm.org/"> |
|
3321 | 3323 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3322 | 3324 | </div> |
|
3323 | 3325 | <ul> |
|
3324 | 3326 | <li><a href="/shortlog">log</a></li> |
|
3325 | 3327 | <li><a href="/graph">graph</a></li> |
|
3326 | 3328 | <li><a href="/tags">tags</a></li> |
|
3327 | 3329 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3328 | 3330 | <li><a href="/branches">branches</a></li> |
|
3329 | 3331 | </ul> |
|
3330 | 3332 | <ul> |
|
3331 | 3333 | <li class="active"><a href="/help">help</a></li> |
|
3332 | 3334 | </ul> |
|
3333 | 3335 | </div> |
|
3334 | 3336 | |
|
3335 | 3337 | <div class="main"> |
|
3336 | 3338 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3337 | 3339 | <h3>Help: dates</h3> |
|
3338 | 3340 | |
|
3339 | 3341 | <form class="search" action="/log"> |
|
3340 | 3342 | |
|
3341 | 3343 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3342 | 3344 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3343 | 3345 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3344 | 3346 | </form> |
|
3345 | 3347 | <div id="doc"> |
|
3346 | 3348 | <h1>Date Formats</h1> |
|
3347 | 3349 | <p> |
|
3348 | 3350 | Some commands allow the user to specify a date, e.g.: |
|
3349 | 3351 | </p> |
|
3350 | 3352 | <ul> |
|
3351 | 3353 | <li> backout, commit, import, tag: Specify the commit date. |
|
3352 | 3354 | <li> log, revert, update: Select revision(s) by date. |
|
3353 | 3355 | </ul> |
|
3354 | 3356 | <p> |
|
3355 | 3357 | Many date formats are valid. Here are some examples: |
|
3356 | 3358 | </p> |
|
3357 | 3359 | <ul> |
|
3358 | 3360 | <li> "Wed Dec 6 13:18:29 2006" (local timezone assumed) |
|
3359 | 3361 | <li> "Dec 6 13:18 -0600" (year assumed, time offset provided) |
|
3360 | 3362 | <li> "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) |
|
3361 | 3363 | <li> "Dec 6" (midnight) |
|
3362 | 3364 | <li> "13:18" (today assumed) |
|
3363 | 3365 | <li> "3:39" (3:39AM assumed) |
|
3364 | 3366 | <li> "3:39pm" (15:39) |
|
3365 | 3367 | <li> "2006-12-06 13:18:29" (ISO 8601 format) |
|
3366 | 3368 | <li> "2006-12-6 13:18" |
|
3367 | 3369 | <li> "2006-12-6" |
|
3368 | 3370 | <li> "12-6" |
|
3369 | 3371 | <li> "12/6" |
|
3370 | 3372 | <li> "12/6/6" (Dec 6 2006) |
|
3371 | 3373 | <li> "today" (midnight) |
|
3372 | 3374 | <li> "yesterday" (midnight) |
|
3373 | 3375 | <li> "now" - right now |
|
3374 | 3376 | </ul> |
|
3375 | 3377 | <p> |
|
3376 | 3378 | Lastly, there is Mercurial's internal format: |
|
3377 | 3379 | </p> |
|
3378 | 3380 | <ul> |
|
3379 | 3381 | <li> "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) |
|
3380 | 3382 | </ul> |
|
3381 | 3383 | <p> |
|
3382 | 3384 | This is the internal representation format for dates. The first number |
|
3383 | 3385 | is the number of seconds since the epoch (1970-01-01 00:00 UTC). The |
|
3384 | 3386 | second is the offset of the local timezone, in seconds west of UTC |
|
3385 | 3387 | (negative if the timezone is east of UTC). |
|
3386 | 3388 | </p> |
|
3387 | 3389 | <p> |
|
3388 | 3390 | The log command also accepts date ranges: |
|
3389 | 3391 | </p> |
|
3390 | 3392 | <ul> |
|
3391 | 3393 | <li> "<DATE" - at or before a given date/time |
|
3392 | 3394 | <li> ">DATE" - on or after a given date/time |
|
3393 | 3395 | <li> "DATE to DATE" - a date range, inclusive |
|
3394 | 3396 | <li> "-DAYS" - within a given number of days from today |
|
3395 | 3397 | </ul> |
|
3396 | 3398 | |
|
3397 | 3399 | </div> |
|
3398 | 3400 | </div> |
|
3399 | 3401 | </div> |
|
3400 | 3402 | |
|
3401 | 3403 | |
|
3402 | 3404 | |
|
3403 | 3405 | </body> |
|
3404 | 3406 | </html> |
|
3405 | 3407 | |
|
3406 | 3408 | |
|
3407 | 3409 | $ get-with-headers.py $LOCALIP:$HGPORT "help/pager" |
|
3408 | 3410 | 200 Script output follows |
|
3409 | 3411 | |
|
3410 | 3412 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3411 | 3413 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3412 | 3414 | <head> |
|
3413 | 3415 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3414 | 3416 | <meta name="robots" content="index, nofollow" /> |
|
3415 | 3417 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3416 | 3418 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3417 | 3419 | |
|
3418 | 3420 | <title>Help: pager</title> |
|
3419 | 3421 | </head> |
|
3420 | 3422 | <body> |
|
3421 | 3423 | |
|
3422 | 3424 | <div class="container"> |
|
3423 | 3425 | <div class="menu"> |
|
3424 | 3426 | <div class="logo"> |
|
3425 | 3427 | <a href="https://mercurial-scm.org/"> |
|
3426 | 3428 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3427 | 3429 | </div> |
|
3428 | 3430 | <ul> |
|
3429 | 3431 | <li><a href="/shortlog">log</a></li> |
|
3430 | 3432 | <li><a href="/graph">graph</a></li> |
|
3431 | 3433 | <li><a href="/tags">tags</a></li> |
|
3432 | 3434 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3433 | 3435 | <li><a href="/branches">branches</a></li> |
|
3434 | 3436 | </ul> |
|
3435 | 3437 | <ul> |
|
3436 | 3438 | <li class="active"><a href="/help">help</a></li> |
|
3437 | 3439 | </ul> |
|
3438 | 3440 | </div> |
|
3439 | 3441 | |
|
3440 | 3442 | <div class="main"> |
|
3441 | 3443 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3442 | 3444 | <h3>Help: pager</h3> |
|
3443 | 3445 | |
|
3444 | 3446 | <form class="search" action="/log"> |
|
3445 | 3447 | |
|
3446 | 3448 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3447 | 3449 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3448 | 3450 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3449 | 3451 | </form> |
|
3450 | 3452 | <div id="doc"> |
|
3451 | 3453 | <h1>Pager Support</h1> |
|
3452 | 3454 | <p> |
|
3453 | 3455 | Some Mercurial commands can produce a lot of output, and Mercurial will |
|
3454 | 3456 | attempt to use a pager to make those commands more pleasant. |
|
3455 | 3457 | </p> |
|
3456 | 3458 | <p> |
|
3457 | 3459 | To set the pager that should be used, set the application variable: |
|
3458 | 3460 | </p> |
|
3459 | 3461 | <pre> |
|
3460 | 3462 | [pager] |
|
3461 | 3463 | pager = less -FRX |
|
3462 | 3464 | </pre> |
|
3463 | 3465 | <p> |
|
3464 | 3466 | If no pager is set in the user or repository configuration, Mercurial uses the |
|
3465 | 3467 | environment variable $PAGER. If $PAGER is not set, pager.pager from the default |
|
3466 | 3468 | or system configuration is used. If none of these are set, a default pager will |
|
3467 | 3469 | be used, typically 'less' on Unix and 'more' on Windows. |
|
3468 | 3470 | </p> |
|
3469 | 3471 | <p> |
|
3470 | 3472 | You can disable the pager for certain commands by adding them to the |
|
3471 | 3473 | pager.ignore list: |
|
3472 | 3474 | </p> |
|
3473 | 3475 | <pre> |
|
3474 | 3476 | [pager] |
|
3475 | 3477 | ignore = version, help, update |
|
3476 | 3478 | </pre> |
|
3477 | 3479 | <p> |
|
3478 | 3480 | To ignore global commands like 'hg version' or 'hg help', you have |
|
3479 | 3481 | to specify them in your user configuration file. |
|
3480 | 3482 | </p> |
|
3481 | 3483 | <p> |
|
3482 | 3484 | To control whether the pager is used at all for an individual command, |
|
3483 | 3485 | you can use --pager=<value>: |
|
3484 | 3486 | </p> |
|
3485 | 3487 | <ul> |
|
3486 | 3488 | <li> use as needed: 'auto'. |
|
3487 | 3489 | <li> require the pager: 'yes' or 'on'. |
|
3488 | 3490 | <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work). |
|
3489 | 3491 | </ul> |
|
3490 | 3492 | <p> |
|
3491 | 3493 | To globally turn off all attempts to use a pager, set: |
|
3492 | 3494 | </p> |
|
3493 | 3495 | <pre> |
|
3494 | 3496 | [ui] |
|
3495 | 3497 | paginate = never |
|
3496 | 3498 | </pre> |
|
3497 | 3499 | <p> |
|
3498 | 3500 | which will prevent the pager from running. |
|
3499 | 3501 | </p> |
|
3500 | 3502 | |
|
3501 | 3503 | </div> |
|
3502 | 3504 | </div> |
|
3503 | 3505 | </div> |
|
3504 | 3506 | |
|
3505 | 3507 | |
|
3506 | 3508 | |
|
3507 | 3509 | </body> |
|
3508 | 3510 | </html> |
|
3509 | 3511 | |
|
3510 | 3512 | |
|
3511 | 3513 | Sub-topic indexes rendered properly |
|
3512 | 3514 | |
|
3513 | 3515 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals" |
|
3514 | 3516 | 200 Script output follows |
|
3515 | 3517 | |
|
3516 | 3518 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3517 | 3519 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3518 | 3520 | <head> |
|
3519 | 3521 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3520 | 3522 | <meta name="robots" content="index, nofollow" /> |
|
3521 | 3523 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3522 | 3524 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3523 | 3525 | |
|
3524 | 3526 | <title>Help: internals</title> |
|
3525 | 3527 | </head> |
|
3526 | 3528 | <body> |
|
3527 | 3529 | |
|
3528 | 3530 | <div class="container"> |
|
3529 | 3531 | <div class="menu"> |
|
3530 | 3532 | <div class="logo"> |
|
3531 | 3533 | <a href="https://mercurial-scm.org/"> |
|
3532 | 3534 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3533 | 3535 | </div> |
|
3534 | 3536 | <ul> |
|
3535 | 3537 | <li><a href="/shortlog">log</a></li> |
|
3536 | 3538 | <li><a href="/graph">graph</a></li> |
|
3537 | 3539 | <li><a href="/tags">tags</a></li> |
|
3538 | 3540 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3539 | 3541 | <li><a href="/branches">branches</a></li> |
|
3540 | 3542 | </ul> |
|
3541 | 3543 | <ul> |
|
3542 | 3544 | <li><a href="/help">help</a></li> |
|
3543 | 3545 | </ul> |
|
3544 | 3546 | </div> |
|
3545 | 3547 | |
|
3546 | 3548 | <div class="main"> |
|
3547 | 3549 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3548 | 3550 | |
|
3549 | 3551 | <form class="search" action="/log"> |
|
3550 | 3552 | |
|
3551 | 3553 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3552 | 3554 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3553 | 3555 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3554 | 3556 | </form> |
|
3555 | 3557 | <table class="bigtable"> |
|
3556 | 3558 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> |
|
3557 | 3559 | |
|
3558 | 3560 | <tr><td> |
|
3559 | 3561 | <a href="/help/internals.bid-merge"> |
|
3560 | 3562 | bid-merge |
|
3561 | 3563 | </a> |
|
3562 | 3564 | </td><td> |
|
3563 | 3565 | Bid Merge Algorithm |
|
3564 | 3566 | </td></tr> |
|
3565 | 3567 | <tr><td> |
|
3566 | 3568 | <a href="/help/internals.bundle2"> |
|
3567 | 3569 | bundle2 |
|
3568 | 3570 | </a> |
|
3569 | 3571 | </td><td> |
|
3570 | 3572 | Bundle2 |
|
3571 | 3573 | </td></tr> |
|
3572 | 3574 | <tr><td> |
|
3573 | 3575 | <a href="/help/internals.bundles"> |
|
3574 | 3576 | bundles |
|
3575 | 3577 | </a> |
|
3576 | 3578 | </td><td> |
|
3577 | 3579 | Bundles |
|
3578 | 3580 | </td></tr> |
|
3579 | 3581 | <tr><td> |
|
3580 | 3582 | <a href="/help/internals.cbor"> |
|
3581 | 3583 | cbor |
|
3582 | 3584 | </a> |
|
3583 | 3585 | </td><td> |
|
3584 | 3586 | CBOR |
|
3585 | 3587 | </td></tr> |
|
3586 | 3588 | <tr><td> |
|
3587 | 3589 | <a href="/help/internals.censor"> |
|
3588 | 3590 | censor |
|
3589 | 3591 | </a> |
|
3590 | 3592 | </td><td> |
|
3591 | 3593 | Censor |
|
3592 | 3594 | </td></tr> |
|
3593 | 3595 | <tr><td> |
|
3594 | 3596 | <a href="/help/internals.changegroups"> |
|
3595 | 3597 | changegroups |
|
3596 | 3598 | </a> |
|
3597 | 3599 | </td><td> |
|
3598 | 3600 | Changegroups |
|
3599 | 3601 | </td></tr> |
|
3600 | 3602 | <tr><td> |
|
3601 | 3603 | <a href="/help/internals.config"> |
|
3602 | 3604 | config |
|
3603 | 3605 | </a> |
|
3604 | 3606 | </td><td> |
|
3605 | 3607 | Config Registrar |
|
3606 | 3608 | </td></tr> |
|
3607 | 3609 | <tr><td> |
|
3608 | 3610 | <a href="/help/internals.dirstate-v2"> |
|
3609 | 3611 | dirstate-v2 |
|
3610 | 3612 | </a> |
|
3611 | 3613 | </td><td> |
|
3612 | 3614 | dirstate-v2 file format |
|
3613 | 3615 | </td></tr> |
|
3614 | 3616 | <tr><td> |
|
3615 | 3617 | <a href="/help/internals.extensions"> |
|
3616 | 3618 | extensions |
|
3617 | 3619 | </a> |
|
3618 | 3620 | </td><td> |
|
3619 | 3621 | Extension API |
|
3620 | 3622 | </td></tr> |
|
3621 | 3623 | <tr><td> |
|
3622 | 3624 | <a href="/help/internals.mergestate"> |
|
3623 | 3625 | mergestate |
|
3624 | 3626 | </a> |
|
3625 | 3627 | </td><td> |
|
3626 | 3628 | Mergestate |
|
3627 | 3629 | </td></tr> |
|
3628 | 3630 | <tr><td> |
|
3629 | 3631 | <a href="/help/internals.requirements"> |
|
3630 | 3632 | requirements |
|
3631 | 3633 | </a> |
|
3632 | 3634 | </td><td> |
|
3633 | 3635 | Repository Requirements |
|
3634 | 3636 | </td></tr> |
|
3635 | 3637 | <tr><td> |
|
3636 | 3638 | <a href="/help/internals.revlogs"> |
|
3637 | 3639 | revlogs |
|
3638 | 3640 | </a> |
|
3639 | 3641 | </td><td> |
|
3640 | 3642 | Revision Logs |
|
3641 | 3643 | </td></tr> |
|
3642 | 3644 | <tr><td> |
|
3643 | 3645 | <a href="/help/internals.wireprotocol"> |
|
3644 | 3646 | wireprotocol |
|
3645 | 3647 | </a> |
|
3646 | 3648 | </td><td> |
|
3647 | 3649 | Wire Protocol |
|
3648 | 3650 | </td></tr> |
|
3649 | 3651 | <tr><td> |
|
3650 | 3652 | <a href="/help/internals.wireprotocolrpc"> |
|
3651 | 3653 | wireprotocolrpc |
|
3652 | 3654 | </a> |
|
3653 | 3655 | </td><td> |
|
3654 | 3656 | Wire Protocol RPC |
|
3655 | 3657 | </td></tr> |
|
3656 | 3658 | <tr><td> |
|
3657 | 3659 | <a href="/help/internals.wireprotocolv2"> |
|
3658 | 3660 | wireprotocolv2 |
|
3659 | 3661 | </a> |
|
3660 | 3662 | </td><td> |
|
3661 | 3663 | Wire Protocol Version 2 |
|
3662 | 3664 | </td></tr> |
|
3663 | 3665 | |
|
3664 | 3666 | |
|
3665 | 3667 | |
|
3666 | 3668 | |
|
3667 | 3669 | |
|
3668 | 3670 | </table> |
|
3669 | 3671 | </div> |
|
3670 | 3672 | </div> |
|
3671 | 3673 | |
|
3672 | 3674 | |
|
3673 | 3675 | |
|
3674 | 3676 | </body> |
|
3675 | 3677 | </html> |
|
3676 | 3678 | |
|
3677 | 3679 | |
|
3678 | 3680 | Sub-topic topics rendered properly |
|
3679 | 3681 | |
|
3680 | 3682 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups" |
|
3681 | 3683 | 200 Script output follows |
|
3682 | 3684 | |
|
3683 | 3685 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3684 | 3686 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3685 | 3687 | <head> |
|
3686 | 3688 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3687 | 3689 | <meta name="robots" content="index, nofollow" /> |
|
3688 | 3690 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3689 | 3691 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3690 | 3692 | |
|
3691 | 3693 | <title>Help: internals.changegroups</title> |
|
3692 | 3694 | </head> |
|
3693 | 3695 | <body> |
|
3694 | 3696 | |
|
3695 | 3697 | <div class="container"> |
|
3696 | 3698 | <div class="menu"> |
|
3697 | 3699 | <div class="logo"> |
|
3698 | 3700 | <a href="https://mercurial-scm.org/"> |
|
3699 | 3701 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3700 | 3702 | </div> |
|
3701 | 3703 | <ul> |
|
3702 | 3704 | <li><a href="/shortlog">log</a></li> |
|
3703 | 3705 | <li><a href="/graph">graph</a></li> |
|
3704 | 3706 | <li><a href="/tags">tags</a></li> |
|
3705 | 3707 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3706 | 3708 | <li><a href="/branches">branches</a></li> |
|
3707 | 3709 | </ul> |
|
3708 | 3710 | <ul> |
|
3709 | 3711 | <li class="active"><a href="/help">help</a></li> |
|
3710 | 3712 | </ul> |
|
3711 | 3713 | </div> |
|
3712 | 3714 | |
|
3713 | 3715 | <div class="main"> |
|
3714 | 3716 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3715 | 3717 | <h3>Help: internals.changegroups</h3> |
|
3716 | 3718 | |
|
3717 | 3719 | <form class="search" action="/log"> |
|
3718 | 3720 | |
|
3719 | 3721 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3720 | 3722 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3721 | 3723 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3722 | 3724 | </form> |
|
3723 | 3725 | <div id="doc"> |
|
3724 | 3726 | <h1>Changegroups</h1> |
|
3725 | 3727 | <p> |
|
3726 | 3728 | Changegroups are representations of repository revlog data, specifically |
|
3727 | 3729 | the changelog data, root/flat manifest data, treemanifest data, and |
|
3728 | 3730 | filelogs. |
|
3729 | 3731 | </p> |
|
3730 | 3732 | <p> |
|
3731 | 3733 | There are 4 versions of changegroups: "1", "2", "3" and "4". From a |
|
3732 | 3734 | high-level, versions "1" and "2" are almost exactly the same, with the |
|
3733 | 3735 | only difference being an additional item in the *delta header*. Version |
|
3734 | 3736 | "3" adds support for storage flags in the *delta header* and optionally |
|
3735 | 3737 | exchanging treemanifests (enabled by setting an option on the |
|
3736 | 3738 | "changegroup" part in the bundle2). Version "4" adds support for exchanging |
|
3737 | 3739 | sidedata (additional revision metadata not part of the digest). |
|
3738 | 3740 | </p> |
|
3739 | 3741 | <p> |
|
3740 | 3742 | Changegroups when not exchanging treemanifests consist of 3 logical |
|
3741 | 3743 | segments: |
|
3742 | 3744 | </p> |
|
3743 | 3745 | <pre> |
|
3744 | 3746 | +---------------------------------+ |
|
3745 | 3747 | | | | | |
|
3746 | 3748 | | changeset | manifest | filelogs | |
|
3747 | 3749 | | | | | |
|
3748 | 3750 | | | | | |
|
3749 | 3751 | +---------------------------------+ |
|
3750 | 3752 | </pre> |
|
3751 | 3753 | <p> |
|
3752 | 3754 | When exchanging treemanifests, there are 4 logical segments: |
|
3753 | 3755 | </p> |
|
3754 | 3756 | <pre> |
|
3755 | 3757 | +-------------------------------------------------+ |
|
3756 | 3758 | | | | | | |
|
3757 | 3759 | | changeset | root | treemanifests | filelogs | |
|
3758 | 3760 | | | manifest | | | |
|
3759 | 3761 | | | | | | |
|
3760 | 3762 | +-------------------------------------------------+ |
|
3761 | 3763 | </pre> |
|
3762 | 3764 | <p> |
|
3763 | 3765 | The principle building block of each segment is a *chunk*. A *chunk* |
|
3764 | 3766 | is a framed piece of data: |
|
3765 | 3767 | </p> |
|
3766 | 3768 | <pre> |
|
3767 | 3769 | +---------------------------------------+ |
|
3768 | 3770 | | | | |
|
3769 | 3771 | | length | data | |
|
3770 | 3772 | | (4 bytes) | (<length - 4> bytes) | |
|
3771 | 3773 | | | | |
|
3772 | 3774 | +---------------------------------------+ |
|
3773 | 3775 | </pre> |
|
3774 | 3776 | <p> |
|
3775 | 3777 | All integers are big-endian signed integers. Each chunk starts with a 32-bit |
|
3776 | 3778 | integer indicating the length of the entire chunk (including the length field |
|
3777 | 3779 | itself). |
|
3778 | 3780 | </p> |
|
3779 | 3781 | <p> |
|
3780 | 3782 | There is a special case chunk that has a value of 0 for the length |
|
3781 | 3783 | ("0x00000000"). We call this an *empty chunk*. |
|
3782 | 3784 | </p> |
|
3783 | 3785 | <h2>Delta Groups</h2> |
|
3784 | 3786 | <p> |
|
3785 | 3787 | A *delta group* expresses the content of a revlog as a series of deltas, |
|
3786 | 3788 | or patches against previous revisions. |
|
3787 | 3789 | </p> |
|
3788 | 3790 | <p> |
|
3789 | 3791 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* |
|
3790 | 3792 | to signal the end of the delta group: |
|
3791 | 3793 | </p> |
|
3792 | 3794 | <pre> |
|
3793 | 3795 | +------------------------------------------------------------------------+ |
|
3794 | 3796 | | | | | | | |
|
3795 | 3797 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | |
|
3796 | 3798 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | |
|
3797 | 3799 | | | | | | | |
|
3798 | 3800 | +------------------------------------------------------------------------+ |
|
3799 | 3801 | </pre> |
|
3800 | 3802 | <p> |
|
3801 | 3803 | Each *chunk*'s data consists of the following: |
|
3802 | 3804 | </p> |
|
3803 | 3805 | <pre> |
|
3804 | 3806 | +---------------------------------------+ |
|
3805 | 3807 | | | | |
|
3806 | 3808 | | delta header | delta data | |
|
3807 | 3809 | | (various by version) | (various) | |
|
3808 | 3810 | | | | |
|
3809 | 3811 | +---------------------------------------+ |
|
3810 | 3812 | </pre> |
|
3811 | 3813 | <p> |
|
3812 | 3814 | The *delta data* is a series of *delta*s that describe a diff from an existing |
|
3813 | 3815 | entry (either that the recipient already has, or previously specified in the |
|
3814 | 3816 | bundle/changegroup). |
|
3815 | 3817 | </p> |
|
3816 | 3818 | <p> |
|
3817 | 3819 | The *delta header* is different between versions "1", "2", "3" and "4" |
|
3818 | 3820 | of the changegroup format. |
|
3819 | 3821 | </p> |
|
3820 | 3822 | <p> |
|
3821 | 3823 | Version 1 (headerlen=80): |
|
3822 | 3824 | </p> |
|
3823 | 3825 | <pre> |
|
3824 | 3826 | +------------------------------------------------------+ |
|
3825 | 3827 | | | | | | |
|
3826 | 3828 | | node | p1 node | p2 node | link node | |
|
3827 | 3829 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
3828 | 3830 | | | | | | |
|
3829 | 3831 | +------------------------------------------------------+ |
|
3830 | 3832 | </pre> |
|
3831 | 3833 | <p> |
|
3832 | 3834 | Version 2 (headerlen=100): |
|
3833 | 3835 | </p> |
|
3834 | 3836 | <pre> |
|
3835 | 3837 | +------------------------------------------------------------------+ |
|
3836 | 3838 | | | | | | | |
|
3837 | 3839 | | node | p1 node | p2 node | base node | link node | |
|
3838 | 3840 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
3839 | 3841 | | | | | | | |
|
3840 | 3842 | +------------------------------------------------------------------+ |
|
3841 | 3843 | </pre> |
|
3842 | 3844 | <p> |
|
3843 | 3845 | Version 3 (headerlen=102): |
|
3844 | 3846 | </p> |
|
3845 | 3847 | <pre> |
|
3846 | 3848 | +------------------------------------------------------------------------------+ |
|
3847 | 3849 | | | | | | | | |
|
3848 | 3850 | | node | p1 node | p2 node | base node | link node | flags | |
|
3849 | 3851 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
|
3850 | 3852 | | | | | | | | |
|
3851 | 3853 | +------------------------------------------------------------------------------+ |
|
3852 | 3854 | </pre> |
|
3853 | 3855 | <p> |
|
3854 | 3856 | Version 4 (headerlen=103): |
|
3855 | 3857 | </p> |
|
3856 | 3858 | <pre> |
|
3857 | 3859 | +------------------------------------------------------------------------------+----------+ |
|
3858 | 3860 | | | | | | | | | |
|
3859 | 3861 | | node | p1 node | p2 node | base node | link node | flags | pflags | |
|
3860 | 3862 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | (1 byte) | |
|
3861 | 3863 | | | | | | | | | |
|
3862 | 3864 | +------------------------------------------------------------------------------+----------+ |
|
3863 | 3865 | </pre> |
|
3864 | 3866 | <p> |
|
3865 | 3867 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which contain a |
|
3866 | 3868 | series of *delta*s, densely packed (no separators). These deltas describe a diff |
|
3867 | 3869 | from an existing entry (either that the recipient already has, or previously |
|
3868 | 3870 | specified in the bundle/changegroup). The format is described more fully in |
|
3869 | 3871 | "hg help internals.bdiff", but briefly: |
|
3870 | 3872 | </p> |
|
3871 | 3873 | <pre> |
|
3872 | 3874 | +---------------------------------------------------------------+ |
|
3873 | 3875 | | | | | | |
|
3874 | 3876 | | start offset | end offset | new length | content | |
|
3875 | 3877 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | |
|
3876 | 3878 | | | | | | |
|
3877 | 3879 | +---------------------------------------------------------------+ |
|
3878 | 3880 | </pre> |
|
3879 | 3881 | <p> |
|
3880 | 3882 | Please note that the length field in the delta data does *not* include itself. |
|
3881 | 3883 | </p> |
|
3882 | 3884 | <p> |
|
3883 | 3885 | In version 1, the delta is always applied against the previous node from |
|
3884 | 3886 | the changegroup or the first parent if this is the first entry in the |
|
3885 | 3887 | changegroup. |
|
3886 | 3888 | </p> |
|
3887 | 3889 | <p> |
|
3888 | 3890 | In version 2 and up, the delta base node is encoded in the entry in the |
|
3889 | 3891 | changegroup. This allows the delta to be expressed against any parent, |
|
3890 | 3892 | which can result in smaller deltas and more efficient encoding of data. |
|
3891 | 3893 | </p> |
|
3892 | 3894 | <p> |
|
3893 | 3895 | The *flags* field holds bitwise flags affecting the processing of revision |
|
3894 | 3896 | data. The following flags are defined: |
|
3895 | 3897 | </p> |
|
3896 | 3898 | <dl> |
|
3897 | 3899 | <dt>32768 |
|
3898 | 3900 | <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions. |
|
3899 | 3901 | <dt>16384 |
|
3900 | 3902 | <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents). |
|
3901 | 3903 | <dt>8192 |
|
3902 | 3904 | <dd>Externally stored. The revision fulltext contains "key:value" "\n" delimited metadata defining an object stored elsewhere. Used by the LFS extension. |
|
3903 | 3905 | <dt>4096 |
|
3904 | 3906 | <dd>Contains copy information. This revision changes files in a way that could affect copy tracing. This does *not* affect changegroup handling, but is relevant for other parts of Mercurial. |
|
3905 | 3907 | </dl> |
|
3906 | 3908 | <p> |
|
3907 | 3909 | For historical reasons, the integer values are identical to revlog version 1 |
|
3908 | 3910 | per-revision storage flags and correspond to bits being set in this 2-byte |
|
3909 | 3911 | field. Bits were allocated starting from the most-significant bit, hence the |
|
3910 | 3912 | reverse ordering and allocation of these flags. |
|
3911 | 3913 | </p> |
|
3912 | 3914 | <p> |
|
3913 | 3915 | The *pflags* (protocol flags) field holds bitwise flags affecting the protocol |
|
3914 | 3916 | itself. They are first in the header since they may affect the handling of the |
|
3915 | 3917 | rest of the fields in a future version. They are defined as such: |
|
3916 | 3918 | </p> |
|
3917 | 3919 | <dl> |
|
3918 | 3920 | <dt>1 indicates whether to read a chunk of sidedata (of variable length) right |
|
3919 | 3921 | <dd>after the revision flags. |
|
3920 | 3922 | </dl> |
|
3921 | 3923 | <h2>Changeset Segment</h2> |
|
3922 | 3924 | <p> |
|
3923 | 3925 | The *changeset segment* consists of a single *delta group* holding |
|
3924 | 3926 | changelog data. The *empty chunk* at the end of the *delta group* denotes |
|
3925 | 3927 | the boundary to the *manifest segment*. |
|
3926 | 3928 | </p> |
|
3927 | 3929 | <h2>Manifest Segment</h2> |
|
3928 | 3930 | <p> |
|
3929 | 3931 | The *manifest segment* consists of a single *delta group* holding manifest |
|
3930 | 3932 | data. If treemanifests are in use, it contains only the manifest for the |
|
3931 | 3933 | root directory of the repository. Otherwise, it contains the entire |
|
3932 | 3934 | manifest data. The *empty chunk* at the end of the *delta group* denotes |
|
3933 | 3935 | the boundary to the next segment (either the *treemanifests segment* or the |
|
3934 | 3936 | *filelogs segment*, depending on version and the request options). |
|
3935 | 3937 | </p> |
|
3936 | 3938 | <h3>Treemanifests Segment</h3> |
|
3937 | 3939 | <p> |
|
3938 | 3940 | The *treemanifests segment* only exists in changegroup version "3" and "4", |
|
3939 | 3941 | and only if the 'treemanifest' param is part of the bundle2 changegroup part |
|
3940 | 3942 | (it is not possible to use changegroup version 3 or 4 outside of bundle2). |
|
3941 | 3943 | Aside from the filenames in the *treemanifests segment* containing a |
|
3942 | 3944 | trailing "/" character, it behaves identically to the *filelogs segment* |
|
3943 | 3945 | (see below). The final sub-segment is followed by an *empty chunk* (logically, |
|
3944 | 3946 | a sub-segment with filename size 0). This denotes the boundary to the |
|
3945 | 3947 | *filelogs segment*. |
|
3946 | 3948 | </p> |
|
3947 | 3949 | <h2>Filelogs Segment</h2> |
|
3948 | 3950 | <p> |
|
3949 | 3951 | The *filelogs segment* consists of multiple sub-segments, each |
|
3950 | 3952 | corresponding to an individual file whose data is being described: |
|
3951 | 3953 | </p> |
|
3952 | 3954 | <pre> |
|
3953 | 3955 | +--------------------------------------------------+ |
|
3954 | 3956 | | | | | | | |
|
3955 | 3957 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | |
|
3956 | 3958 | | | | | | (4 bytes) | |
|
3957 | 3959 | | | | | | | |
|
3958 | 3960 | +--------------------------------------------------+ |
|
3959 | 3961 | </pre> |
|
3960 | 3962 | <p> |
|
3961 | 3963 | The final filelog sub-segment is followed by an *empty chunk* (logically, |
|
3962 | 3964 | a sub-segment with filename size 0). This denotes the end of the segment |
|
3963 | 3965 | and of the overall changegroup. |
|
3964 | 3966 | </p> |
|
3965 | 3967 | <p> |
|
3966 | 3968 | Each filelog sub-segment consists of the following: |
|
3967 | 3969 | </p> |
|
3968 | 3970 | <pre> |
|
3969 | 3971 | +------------------------------------------------------+ |
|
3970 | 3972 | | | | | |
|
3971 | 3973 | | filename length | filename | delta group | |
|
3972 | 3974 | | (4 bytes) | (<length - 4> bytes) | (various) | |
|
3973 | 3975 | | | | | |
|
3974 | 3976 | +------------------------------------------------------+ |
|
3975 | 3977 | </pre> |
|
3976 | 3978 | <p> |
|
3977 | 3979 | That is, a *chunk* consisting of the filename (not terminated or padded) |
|
3978 | 3980 | followed by N chunks constituting the *delta group* for this file. The |
|
3979 | 3981 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
3980 | 3982 | next filelog sub-segment. |
|
3981 | 3983 | </p> |
|
3982 | 3984 | |
|
3983 | 3985 | </div> |
|
3984 | 3986 | </div> |
|
3985 | 3987 | </div> |
|
3986 | 3988 | |
|
3987 | 3989 | |
|
3988 | 3990 | |
|
3989 | 3991 | </body> |
|
3990 | 3992 | </html> |
|
3991 | 3993 | |
|
3992 | 3994 | |
|
3993 | 3995 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic" |
|
3994 | 3996 | 404 Not Found |
|
3995 | 3997 | |
|
3996 | 3998 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3997 | 3999 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3998 | 4000 | <head> |
|
3999 | 4001 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
4000 | 4002 | <meta name="robots" content="index, nofollow" /> |
|
4001 | 4003 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
4002 | 4004 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
4003 | 4005 | |
|
4004 | 4006 | <title>test: error</title> |
|
4005 | 4007 | </head> |
|
4006 | 4008 | <body> |
|
4007 | 4009 | |
|
4008 | 4010 | <div class="container"> |
|
4009 | 4011 | <div class="menu"> |
|
4010 | 4012 | <div class="logo"> |
|
4011 | 4013 | <a href="https://mercurial-scm.org/"> |
|
4012 | 4014 | <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> |
|
4013 | 4015 | </div> |
|
4014 | 4016 | <ul> |
|
4015 | 4017 | <li><a href="/shortlog">log</a></li> |
|
4016 | 4018 | <li><a href="/graph">graph</a></li> |
|
4017 | 4019 | <li><a href="/tags">tags</a></li> |
|
4018 | 4020 | <li><a href="/bookmarks">bookmarks</a></li> |
|
4019 | 4021 | <li><a href="/branches">branches</a></li> |
|
4020 | 4022 | </ul> |
|
4021 | 4023 | <ul> |
|
4022 | 4024 | <li><a href="/help">help</a></li> |
|
4023 | 4025 | </ul> |
|
4024 | 4026 | </div> |
|
4025 | 4027 | |
|
4026 | 4028 | <div class="main"> |
|
4027 | 4029 | |
|
4028 | 4030 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
4029 | 4031 | <h3>error</h3> |
|
4030 | 4032 | |
|
4031 | 4033 | |
|
4032 | 4034 | <form class="search" action="/log"> |
|
4033 | 4035 | |
|
4034 | 4036 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
4035 | 4037 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
4036 | 4038 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
4037 | 4039 | </form> |
|
4038 | 4040 | |
|
4039 | 4041 | <div class="description"> |
|
4040 | 4042 | <p> |
|
4041 | 4043 | An error occurred while processing your request: |
|
4042 | 4044 | </p> |
|
4043 | 4045 | <p> |
|
4044 | 4046 | Not Found |
|
4045 | 4047 | </p> |
|
4046 | 4048 | </div> |
|
4047 | 4049 | </div> |
|
4048 | 4050 | </div> |
|
4049 | 4051 | |
|
4050 | 4052 | |
|
4051 | 4053 | |
|
4052 | 4054 | </body> |
|
4053 | 4055 | </html> |
|
4054 | 4056 | |
|
4055 | 4057 | [1] |
|
4056 | 4058 | |
|
4057 | 4059 | $ killdaemons.py |
|
4058 | 4060 | |
|
4059 | 4061 | #endif |
@@ -1,605 +1,638 | |||
|
1 | 1 | setup |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > share = |
|
6 | 6 | > [format] |
|
7 | 7 | > use-share-safe = True |
|
8 | 8 | > [storage] |
|
9 | 9 | > revlog.persistent-nodemap.slow-path=allow |
|
10 | 10 | > # enforce zlib to ensure we can upgrade to zstd later |
|
11 | 11 | > [format] |
|
12 | 12 | > revlog-compression=zlib |
|
13 | 13 | > # we want to be able to enable it later |
|
14 | 14 | > use-persistent-nodemap=no |
|
15 | 15 | > EOF |
|
16 | 16 | |
|
17 | 17 | prepare source repo |
|
18 | 18 | |
|
19 | 19 | $ hg init source |
|
20 | 20 | $ cd source |
|
21 | 21 | $ cat .hg/requires |
|
22 | 22 | dirstate-v2 (dirstate-v2 !) |
|
23 | 23 | share-safe |
|
24 | 24 | $ cat .hg/store/requires |
|
25 | 25 | dotencode |
|
26 | 26 | fncache |
|
27 | 27 | generaldelta |
|
28 | 28 | revlogv1 |
|
29 | 29 | sparserevlog |
|
30 | 30 | store |
|
31 | 31 | $ hg debugrequirements |
|
32 | 32 | dotencode |
|
33 | 33 | dirstate-v2 (dirstate-v2 !) |
|
34 | 34 | fncache |
|
35 | 35 | generaldelta |
|
36 | 36 | revlogv1 |
|
37 | 37 | share-safe |
|
38 | 38 | sparserevlog |
|
39 | 39 | store |
|
40 | 40 | |
|
41 | 41 | $ echo a > a |
|
42 | 42 | $ hg ci -Aqm "added a" |
|
43 | 43 | $ echo b > b |
|
44 | 44 | $ hg ci -Aqm "added b" |
|
45 | 45 | |
|
46 | 46 | $ HGEDITOR=cat hg config --shared |
|
47 | 47 | abort: repository is not shared; can't use --shared |
|
48 | 48 | [10] |
|
49 | 49 | $ cd .. |
|
50 | 50 | |
|
51 | 51 | Create a shared repo and check the requirements are shared and read correctly |
|
52 | 52 | $ hg share source shared1 |
|
53 | 53 | updating working directory |
|
54 | 54 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
55 | 55 | $ cd shared1 |
|
56 | 56 | $ cat .hg/requires |
|
57 | 57 | dirstate-v2 (dirstate-v2 !) |
|
58 | 58 | share-safe |
|
59 | 59 | shared |
|
60 | 60 | |
|
61 | 61 | $ hg debugrequirements -R ../source |
|
62 | 62 | dotencode |
|
63 | 63 | dirstate-v2 (dirstate-v2 !) |
|
64 | 64 | fncache |
|
65 | 65 | generaldelta |
|
66 | 66 | revlogv1 |
|
67 | 67 | share-safe |
|
68 | 68 | sparserevlog |
|
69 | 69 | store |
|
70 | 70 | |
|
71 | 71 | $ hg debugrequirements |
|
72 | 72 | dotencode |
|
73 | 73 | dirstate-v2 (dirstate-v2 !) |
|
74 | 74 | fncache |
|
75 | 75 | generaldelta |
|
76 | 76 | revlogv1 |
|
77 | 77 | share-safe |
|
78 | 78 | shared |
|
79 | 79 | sparserevlog |
|
80 | 80 | store |
|
81 | 81 | |
|
82 | 82 | $ echo c > c |
|
83 | 83 | $ hg ci -Aqm "added c" |
|
84 | 84 | |
|
85 | 85 | Check that config of the source repository is also loaded |
|
86 | 86 | |
|
87 | 87 | $ hg showconfig ui.curses |
|
88 | 88 | [1] |
|
89 | 89 | |
|
90 | 90 | $ echo "[ui]" >> ../source/.hg/hgrc |
|
91 | 91 | $ echo "curses=true" >> ../source/.hg/hgrc |
|
92 | 92 | |
|
93 | 93 | $ hg showconfig ui.curses |
|
94 | 94 | true |
|
95 | 95 | |
|
96 | 96 | Test that extensions of source repository are also loaded |
|
97 | 97 | |
|
98 | 98 | $ hg debugextensions |
|
99 | 99 | share |
|
100 | 100 | $ hg extdiff -p echo |
|
101 | 101 | hg: unknown command 'extdiff' |
|
102 | 102 | 'extdiff' is provided by the following extension: |
|
103 | 103 | |
|
104 | 104 | extdiff command to allow external programs to compare revisions |
|
105 | 105 | |
|
106 | 106 | (use 'hg help extensions' for information on enabling extensions) |
|
107 | 107 | [10] |
|
108 | 108 | |
|
109 | 109 | $ echo "[extensions]" >> ../source/.hg/hgrc |
|
110 | 110 | $ echo "extdiff=" >> ../source/.hg/hgrc |
|
111 | 111 | |
|
112 | 112 | $ hg debugextensions -R ../source |
|
113 | 113 | extdiff |
|
114 | 114 | share |
|
115 | 115 | $ hg extdiff -R ../source -p echo |
|
116 | 116 | |
|
117 | 117 | BROKEN: the command below will not work if config of shared source is not loaded |
|
118 | 118 | on dispatch but debugextensions says that extension |
|
119 | 119 | is loaded |
|
120 | 120 | $ hg debugextensions |
|
121 | 121 | extdiff |
|
122 | 122 | share |
|
123 | 123 | |
|
124 | 124 | $ hg extdiff -p echo |
|
125 | 125 | |
|
126 | 126 | However, local .hg/hgrc should override the config set by share source |
|
127 | 127 | |
|
128 | 128 | $ echo "[ui]" >> .hg/hgrc |
|
129 | 129 | $ echo "curses=false" >> .hg/hgrc |
|
130 | 130 | |
|
131 | 131 | $ hg showconfig ui.curses |
|
132 | 132 | false |
|
133 | 133 | |
|
134 | 134 | $ HGEDITOR=cat hg config --shared |
|
135 | 135 | [ui] |
|
136 | 136 | curses=true |
|
137 | 137 | [extensions] |
|
138 | 138 | extdiff= |
|
139 | 139 | |
|
140 | 140 | $ HGEDITOR=cat hg config --local |
|
141 | 141 | [ui] |
|
142 | 142 | curses=false |
|
143 | 143 | |
|
144 | 144 | Testing that hooks set in source repository also runs in shared repo |
|
145 | 145 | |
|
146 | 146 | $ cd ../source |
|
147 | 147 | $ cat <<EOF >> .hg/hgrc |
|
148 | 148 | > [extensions] |
|
149 | 149 | > hooklib= |
|
150 | 150 | > [hooks] |
|
151 | 151 | > pretxnchangegroup.reject_merge_commits = \ |
|
152 | 152 | > python:hgext.hooklib.reject_merge_commits.hook |
|
153 | 153 | > EOF |
|
154 | 154 | |
|
155 | 155 | $ cd .. |
|
156 | 156 | $ hg clone source cloned |
|
157 | 157 | updating to branch default |
|
158 | 158 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
159 | 159 | $ cd cloned |
|
160 | 160 | $ hg up 0 |
|
161 | 161 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
162 | 162 | $ echo bar > bar |
|
163 | 163 | $ hg ci -Aqm "added bar" |
|
164 | 164 | $ hg merge |
|
165 | 165 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
166 | 166 | (branch merge, don't forget to commit) |
|
167 | 167 | $ hg ci -m "merge commit" |
|
168 | 168 | |
|
169 | 169 | $ hg push ../source |
|
170 | 170 | pushing to ../source |
|
171 | 171 | searching for changes |
|
172 | 172 | adding changesets |
|
173 | 173 | adding manifests |
|
174 | 174 | adding file changes |
|
175 | 175 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
176 | 176 | transaction abort! |
|
177 | 177 | rollback completed |
|
178 | 178 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
179 | 179 | [255] |
|
180 | 180 | |
|
181 | 181 | $ hg push ../shared1 |
|
182 | 182 | pushing to ../shared1 |
|
183 | 183 | searching for changes |
|
184 | 184 | adding changesets |
|
185 | 185 | adding manifests |
|
186 | 186 | adding file changes |
|
187 | 187 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
188 | 188 | transaction abort! |
|
189 | 189 | rollback completed |
|
190 | 190 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
191 | 191 | [255] |
|
192 | 192 | |
|
193 | 193 | Test that if share source config is untrusted, we dont read it |
|
194 | 194 | |
|
195 | 195 | $ cd ../shared1 |
|
196 | 196 | |
|
197 | 197 | $ cat << EOF > $TESTTMP/untrusted.py |
|
198 | 198 | > from mercurial import scmutil, util |
|
199 | 199 | > def uisetup(ui): |
|
200 | 200 | > class untrustedui(ui.__class__): |
|
201 | 201 | > def _trusted(self, fp, f): |
|
202 | 202 | > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'): |
|
203 | 203 | > return False |
|
204 | 204 | > return super(untrustedui, self)._trusted(fp, f) |
|
205 | 205 | > ui.__class__ = untrustedui |
|
206 | 206 | > EOF |
|
207 | 207 | |
|
208 | 208 | $ hg showconfig hooks |
|
209 | 209 | hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook |
|
210 | 210 | |
|
211 | 211 | $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py |
|
212 | 212 | [1] |
|
213 | 213 | |
|
214 | 214 | Update the source repository format and check that shared repo works |
|
215 | 215 | |
|
216 | 216 | $ cd ../source |
|
217 | 217 | |
|
218 | 218 | Disable zstd related tests because its not present on pure version |
|
219 | 219 | #if zstd |
|
220 | 220 | $ echo "[format]" >> .hg/hgrc |
|
221 | 221 | $ echo "revlog-compression=zstd" >> .hg/hgrc |
|
222 | 222 | |
|
223 | 223 | $ hg debugupgraderepo --run -q |
|
224 | 224 | upgrade will perform the following actions: |
|
225 | 225 | |
|
226 | 226 | requirements |
|
227 | 227 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-dirstate-v2 !) |
|
228 | 228 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (dirstate-v2 !) |
|
229 | 229 | added: revlog-compression-zstd |
|
230 | 230 | |
|
231 | 231 | processed revlogs: |
|
232 | 232 | - all-filelogs |
|
233 | 233 | - changelog |
|
234 | 234 | - manifest |
|
235 | 235 | |
|
236 | 236 | $ hg log -r . |
|
237 | 237 | changeset: 1:5f6d8a4bf34a |
|
238 | 238 | user: test |
|
239 | 239 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
240 | 240 | summary: added b |
|
241 | 241 | |
|
242 | 242 | #endif |
|
243 | 243 | $ echo "[format]" >> .hg/hgrc |
|
244 | 244 | $ echo "use-persistent-nodemap=True" >> .hg/hgrc |
|
245 | 245 | |
|
246 | 246 | $ hg debugupgraderepo --run -q -R ../shared1 |
|
247 | 247 | abort: cannot use these actions on a share repository: persistent-nodemap |
|
248 | 248 | (upgrade the main repository directly) |
|
249 | 249 | [255] |
|
250 | 250 | |
|
251 | 251 | $ hg debugupgraderepo --run -q |
|
252 | 252 | upgrade will perform the following actions: |
|
253 | 253 | |
|
254 | 254 | requirements |
|
255 | 255 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) |
|
256 | 256 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) |
|
257 | 257 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd dirstate-v2 !) |
|
258 | 258 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) |
|
259 | 259 | added: persistent-nodemap |
|
260 | 260 | |
|
261 | 261 | processed revlogs: |
|
262 | 262 | - all-filelogs |
|
263 | 263 | - changelog |
|
264 | 264 | - manifest |
|
265 | 265 | |
|
266 | 266 | $ hg log -r . |
|
267 | 267 | changeset: 1:5f6d8a4bf34a |
|
268 | 268 | user: test |
|
269 | 269 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
270 | 270 | summary: added b |
|
271 | 271 | |
|
272 | 272 | |
|
273 | 273 | Shared one should work |
|
274 | 274 | $ cd ../shared1 |
|
275 | 275 | $ hg log -r . |
|
276 | 276 | changeset: 2:155349b645be |
|
277 | 277 | tag: tip |
|
278 | 278 | user: test |
|
279 | 279 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
280 | 280 | summary: added c |
|
281 | 281 | |
|
282 | 282 | |
|
283 | 283 | Testing that nonsharedrc is loaded for source and not shared |
|
284 | 284 | |
|
285 | 285 | $ cd ../source |
|
286 | 286 | $ touch .hg/hgrc-not-shared |
|
287 | 287 | $ echo "[ui]" >> .hg/hgrc-not-shared |
|
288 | 288 | $ echo "traceback=true" >> .hg/hgrc-not-shared |
|
289 | 289 | |
|
290 | 290 | $ hg showconfig ui.traceback |
|
291 | 291 | true |
|
292 | 292 | |
|
293 | 293 | $ HGEDITOR=cat hg config --non-shared |
|
294 | 294 | [ui] |
|
295 | 295 | traceback=true |
|
296 | 296 | |
|
297 | 297 | $ cd ../shared1 |
|
298 | 298 | $ hg showconfig ui.traceback |
|
299 | 299 | [1] |
|
300 | 300 | |
|
301 | 301 | Unsharing works |
|
302 | 302 | |
|
303 | 303 | $ hg unshare |
|
304 | 304 | |
|
305 | 305 | Test that source config is added to the shared one after unshare, and the config |
|
306 | 306 | of current repo is still respected over the config which came from source config |
|
307 | 307 | $ cd ../cloned |
|
308 | 308 | $ hg push ../shared1 |
|
309 | 309 | pushing to ../shared1 |
|
310 | 310 | searching for changes |
|
311 | 311 | adding changesets |
|
312 | 312 | adding manifests |
|
313 | 313 | adding file changes |
|
314 | 314 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
315 | 315 | transaction abort! |
|
316 | 316 | rollback completed |
|
317 | 317 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
318 | 318 | [255] |
|
319 | 319 | $ hg showconfig ui.curses -R ../shared1 |
|
320 | 320 | false |
|
321 | 321 | |
|
322 | 322 | $ cd ../ |
|
323 | 323 | |
|
324 | 324 | Test that upgrading using debugupgraderepo works |
|
325 | 325 | ================================================= |
|
326 | 326 | |
|
327 | 327 | $ hg init non-share-safe --config format.use-share-safe=false |
|
328 | 328 | $ cd non-share-safe |
|
329 | 329 | $ hg debugrequirements |
|
330 | 330 | dotencode |
|
331 | 331 | dirstate-v2 (dirstate-v2 !) |
|
332 | 332 | fncache |
|
333 | 333 | generaldelta |
|
334 | 334 | revlogv1 |
|
335 | 335 | sparserevlog |
|
336 | 336 | store |
|
337 | 337 | $ echo foo > foo |
|
338 | 338 | $ hg ci -Aqm 'added foo' |
|
339 | 339 | $ echo bar > bar |
|
340 | 340 | $ hg ci -Aqm 'added bar' |
|
341 | 341 | |
|
342 | 342 | Create a share before upgrading |
|
343 | 343 | |
|
344 | 344 | $ cd .. |
|
345 | 345 | $ hg share non-share-safe nss-share |
|
346 | 346 | updating working directory |
|
347 | 347 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
348 | 348 | $ hg debugrequirements -R nss-share |
|
349 | 349 | dotencode |
|
350 | 350 | dirstate-v2 (dirstate-v2 !) |
|
351 | 351 | fncache |
|
352 | 352 | generaldelta |
|
353 | 353 | revlogv1 |
|
354 | 354 | shared |
|
355 | 355 | sparserevlog |
|
356 | 356 | store |
|
357 | 357 | $ cd non-share-safe |
|
358 | 358 | |
|
359 | 359 | Upgrade |
|
360 | 360 | |
|
361 | 361 | $ hg debugupgraderepo -q |
|
362 | 362 | requirements |
|
363 | 363 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
364 | 364 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
365 | 365 | added: share-safe |
|
366 | 366 | |
|
367 | 367 | no revlogs to process |
|
368 | 368 | |
|
369 | 369 | $ hg debugupgraderepo --run |
|
370 | 370 | upgrade will perform the following actions: |
|
371 | 371 | |
|
372 | 372 | requirements |
|
373 | 373 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
374 | 374 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
375 | 375 | added: share-safe |
|
376 | 376 | |
|
377 | 377 | share-safe |
|
378 | 378 | Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs. |
|
379 | 379 | |
|
380 | 380 | no revlogs to process |
|
381 | 381 | |
|
382 | 382 | beginning upgrade... |
|
383 | 383 | repository locked and read-only |
|
384 | 384 | creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
385 | 385 | (it is safe to interrupt this process any time before data migration completes) |
|
386 | 386 | upgrading repository requirements |
|
387 | 387 | removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
388 | 388 | repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. |
|
389 | 389 | |
|
390 | 390 | $ hg debugrequirements |
|
391 | 391 | dotencode |
|
392 | 392 | dirstate-v2 (dirstate-v2 !) |
|
393 | 393 | fncache |
|
394 | 394 | generaldelta |
|
395 | 395 | revlogv1 |
|
396 | 396 | share-safe |
|
397 | 397 | sparserevlog |
|
398 | 398 | store |
|
399 | 399 | |
|
400 | 400 | $ cat .hg/requires |
|
401 | 401 | dirstate-v2 (dirstate-v2 !) |
|
402 | 402 | share-safe |
|
403 | 403 | |
|
404 | 404 | $ cat .hg/store/requires |
|
405 | 405 | dotencode |
|
406 | 406 | fncache |
|
407 | 407 | generaldelta |
|
408 | 408 | revlogv1 |
|
409 | 409 | sparserevlog |
|
410 | 410 | store |
|
411 | 411 | |
|
412 | 412 | $ hg log -GT "{node}: {desc}\n" |
|
413 | 413 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
414 | 414 | | |
|
415 | 415 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
416 | 416 | |
|
417 | 417 | |
|
418 | 418 | Make sure existing shares dont work with default config |
|
419 | 419 | |
|
420 | 420 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
421 | 421 | abort: version mismatch: source uses share-safe functionality while the current share does not |
|
422 | 422 | (see `hg help config.format.use-share-safe` for more information) |
|
423 | 423 | [255] |
|
424 | 424 | |
|
425 | 425 | |
|
426 | 426 | Create a safe share from upgrade one |
|
427 | 427 | |
|
428 | 428 | $ cd .. |
|
429 | 429 | $ hg share non-share-safe ss-share |
|
430 | 430 | updating working directory |
|
431 | 431 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
432 | 432 | $ cd ss-share |
|
433 | 433 | $ hg log -GT "{node}: {desc}\n" |
|
434 | 434 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
435 | 435 | | |
|
436 | 436 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
437 | 437 | |
|
438 | 438 | $ cd ../non-share-safe |
|
439 | 439 | |
|
440 | 440 | Test that downgrading works too |
|
441 | 441 | |
|
442 | 442 | $ cat >> $HGRCPATH <<EOF |
|
443 | 443 | > [extensions] |
|
444 | 444 | > share = |
|
445 | 445 | > [format] |
|
446 | 446 | > use-share-safe = False |
|
447 | 447 | > EOF |
|
448 | 448 | |
|
449 | 449 | $ hg debugupgraderepo -q |
|
450 | 450 | requirements |
|
451 | 451 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
452 | 452 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
453 | 453 | removed: share-safe |
|
454 | 454 | |
|
455 | 455 | no revlogs to process |
|
456 | 456 | |
|
457 | 457 | $ hg debugupgraderepo --run |
|
458 | 458 | upgrade will perform the following actions: |
|
459 | 459 | |
|
460 | 460 | requirements |
|
461 | 461 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
462 | 462 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
463 | 463 | removed: share-safe |
|
464 | 464 | |
|
465 | 465 | no revlogs to process |
|
466 | 466 | |
|
467 | 467 | beginning upgrade... |
|
468 | 468 | repository locked and read-only |
|
469 | 469 | creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
470 | 470 | (it is safe to interrupt this process any time before data migration completes) |
|
471 | 471 | upgrading repository requirements |
|
472 | 472 | removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
473 | 473 | repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared. |
|
474 | 474 | |
|
475 | 475 | $ hg debugrequirements |
|
476 | 476 | dotencode |
|
477 | 477 | dirstate-v2 (dirstate-v2 !) |
|
478 | 478 | fncache |
|
479 | 479 | generaldelta |
|
480 | 480 | revlogv1 |
|
481 | 481 | sparserevlog |
|
482 | 482 | store |
|
483 | 483 | |
|
484 | 484 | $ cat .hg/requires |
|
485 | 485 | dotencode |
|
486 | 486 | dirstate-v2 (dirstate-v2 !) |
|
487 | 487 | fncache |
|
488 | 488 | generaldelta |
|
489 | 489 | revlogv1 |
|
490 | 490 | sparserevlog |
|
491 | 491 | store |
|
492 | 492 | |
|
493 | 493 | $ test -f .hg/store/requires |
|
494 | 494 | [1] |
|
495 | 495 | |
|
496 | 496 | $ hg log -GT "{node}: {desc}\n" |
|
497 | 497 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
498 | 498 | | |
|
499 | 499 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
500 | 500 | |
|
501 | 501 | |
|
502 | 502 | Make sure existing shares still works |
|
503 | 503 | |
|
504 | 504 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
505 | 505 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
506 | 506 | | |
|
507 | 507 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
508 | 508 | |
|
509 | 509 | |
|
510 | 510 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share |
|
511 | 511 | abort: share source does not support share-safe requirement |
|
512 | 512 | (see `hg help config.format.use-share-safe` for more information) |
|
513 | 513 | [255] |
|
514 | 514 | |
|
515 | 515 | Testing automatic downgrade of shares when config is set |
|
516 | 516 | |
|
517 | 517 | $ touch ../ss-share/.hg/wlock |
|
518 | 518 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort |
|
519 | 519 | abort: failed to downgrade share, got error: Lock held |
|
520 | 520 | (see `hg help config.format.use-share-safe` for more information) |
|
521 | 521 | [255] |
|
522 | 522 | $ rm ../ss-share/.hg/wlock |
|
523 | 523 | |
|
524 | 524 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort |
|
525 | 525 | repository downgraded to not use share-safe mode |
|
526 | 526 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
527 | 527 | | |
|
528 | 528 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
529 | 529 | |
|
530 | 530 | |
|
531 | 531 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share |
|
532 | 532 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
533 | 533 | | |
|
534 | 534 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
535 | 535 | |
|
536 | 536 | |
|
537 | 537 | |
|
538 | 538 | Testing automatic upgrade of shares when config is set |
|
539 | 539 | |
|
540 | 540 | $ hg debugupgraderepo -q --run --config format.use-share-safe=True |
|
541 | 541 | upgrade will perform the following actions: |
|
542 | 542 | |
|
543 | 543 | requirements |
|
544 | 544 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
545 | 545 | preserved: dotencode, use-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
546 | 546 | added: share-safe |
|
547 | 547 | |
|
548 | 548 | no revlogs to process |
|
549 | 549 | |
|
550 | 550 | repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. |
|
551 | 551 | $ hg debugrequirements |
|
552 | 552 | dotencode |
|
553 | 553 | dirstate-v2 (dirstate-v2 !) |
|
554 | 554 | fncache |
|
555 | 555 | generaldelta |
|
556 | 556 | revlogv1 |
|
557 | 557 | share-safe |
|
558 | 558 | sparserevlog |
|
559 | 559 | store |
|
560 | 560 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
561 | 561 | abort: version mismatch: source uses share-safe functionality while the current share does not |
|
562 | 562 | (see `hg help config.format.use-share-safe` for more information) |
|
563 | 563 | [255] |
|
564 | 564 | |
|
565 | 565 | Check that if lock is taken, upgrade fails but read operation are successful |
|
566 | 566 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra |
|
567 | 567 | abort: share-safe mismatch with source. |
|
568 | 568 | Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set. |
|
569 | 569 | (see `hg help config.format.use-share-safe` for more information) |
|
570 | 570 | [255] |
|
571 | 571 | $ touch ../nss-share/.hg/wlock |
|
572 | 572 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow |
|
573 | 573 | failed to upgrade share, got error: Lock held |
|
574 | 574 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
575 | 575 | | |
|
576 | 576 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
577 | 577 | |
|
578 | 578 | |
|
579 | 579 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False |
|
580 | 580 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
581 | 581 | | |
|
582 | 582 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
583 | 583 | |
|
584 | 584 | |
|
585 | 585 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort |
|
586 | 586 | abort: failed to upgrade share, got error: Lock held |
|
587 | 587 | (see `hg help config.format.use-share-safe` for more information) |
|
588 | 588 | [255] |
|
589 | 589 | |
|
590 | 590 | $ rm ../nss-share/.hg/wlock |
|
591 | 591 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort |
|
592 | 592 | repository upgraded to use share-safe mode |
|
593 | 593 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
594 | 594 | | |
|
595 | 595 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
596 | 596 | |
|
597 | 597 | |
|
598 | 598 | Test that unshare works |
|
599 | 599 | |
|
600 | 600 | $ hg unshare -R ../nss-share |
|
601 | 601 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
602 | 602 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
603 | 603 | | |
|
604 | 604 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
605 | 605 | |
|
606 | ||
|
607 | Test automatique upgrade/downgrade of main-repository | |
|
608 | ------------------------------------------------------ | |
|
609 | ||
|
610 | create an initial repository | |
|
611 | ||
|
612 | $ hg init auto-upgrade \ | |
|
613 | > --config format.use-share-safe=no | |
|
614 | $ hg debugbuilddag -R auto-upgrade --new-file .+5 | |
|
615 | $ hg -R auto-upgrade update | |
|
616 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
617 | $ hg debugformat -R auto-upgrade | grep share-safe | |
|
618 | share-safe: no | |
|
619 | ||
|
620 | upgrade it to share-safe automatically | |
|
621 | ||
|
622 | $ hg status -R auto-upgrade \ | |
|
623 | > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \ | |
|
624 | > --config format.use-share-safe=yes | |
|
625 | automatically upgrading repository to the `share-safe` feature | |
|
626 | (see `hg help config.format.use-share-safe` for details) | |
|
627 | $ hg debugformat -R auto-upgrade | grep share-safe | |
|
628 | share-safe: yes | |
|
629 | ||
|
630 | downgrade it from share-safe automatically | |
|
631 | ||
|
632 | $ hg status -R auto-upgrade \ | |
|
633 | > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \ | |
|
634 | > --config format.use-share-safe=no | |
|
635 | automatically downgrading repository from the `share-safe` feature | |
|
636 | (see `hg help config.format.use-share-safe` for details) | |
|
637 | $ hg debugformat -R auto-upgrade | grep share-safe | |
|
638 | share-safe: no |
@@ -1,204 +1,238 | |||
|
1 | 1 | =============================== |
|
2 | 2 | Test the "tracked hint" feature |
|
3 | 3 | =============================== |
|
4 | 4 | |
|
5 | 5 | The tracked hint feature provide a file that get updated when the set of tracked |
|
6 | 6 | files get updated. |
|
7 | 7 | |
|
8 | 8 | basic setup |
|
9 | 9 | |
|
10 | 10 | $ cat << EOF >> $HGRCPATH |
|
11 | 11 | > [format] |
|
12 | 12 | > use-dirstate-tracked-hint=yes |
|
13 | 13 | > EOF |
|
14 | 14 | |
|
15 | 15 | $ hg init tracked-hint-test |
|
16 | 16 | $ cd tracked-hint-test |
|
17 | 17 | $ hg debugbuilddag '.+10' -n |
|
18 | 18 | $ hg log -G -T '{rev} {desc} {files}\n' |
|
19 | 19 | o 10 r10 nf10 |
|
20 | 20 | | |
|
21 | 21 | o 9 r9 nf9 |
|
22 | 22 | | |
|
23 | 23 | o 8 r8 nf8 |
|
24 | 24 | | |
|
25 | 25 | o 7 r7 nf7 |
|
26 | 26 | | |
|
27 | 27 | o 6 r6 nf6 |
|
28 | 28 | | |
|
29 | 29 | o 5 r5 nf5 |
|
30 | 30 | | |
|
31 | 31 | o 4 r4 nf4 |
|
32 | 32 | | |
|
33 | 33 | o 3 r3 nf3 |
|
34 | 34 | | |
|
35 | 35 | o 2 r2 nf2 |
|
36 | 36 | | |
|
37 | 37 | o 1 r1 nf1 |
|
38 | 38 | | |
|
39 | 39 | o 0 r0 nf0 |
|
40 | 40 | |
|
41 | 41 | $ hg up tip |
|
42 | 42 | 11 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
43 | 43 | $ hg files |
|
44 | 44 | nf0 |
|
45 | 45 | nf1 |
|
46 | 46 | nf10 |
|
47 | 47 | nf2 |
|
48 | 48 | nf3 |
|
49 | 49 | nf4 |
|
50 | 50 | nf5 |
|
51 | 51 | nf6 |
|
52 | 52 | nf7 |
|
53 | 53 | nf8 |
|
54 | 54 | nf9 |
|
55 | 55 | |
|
56 | 56 | key-file exists |
|
57 | 57 | ----------- |
|
58 | 58 | |
|
59 | 59 | The tracked hint file should exist |
|
60 | 60 | |
|
61 | 61 | $ ls -1 .hg/dirstate* |
|
62 | 62 | .hg/dirstate |
|
63 | 63 | .hg/dirstate-tracked-hint |
|
64 | 64 | |
|
65 | 65 | key-file stay the same if the tracked set is unchanged |
|
66 | 66 | ------------------------------------------------------ |
|
67 | 67 | |
|
68 | 68 | (copy its content for later comparison) |
|
69 | 69 | |
|
70 | 70 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
71 | 71 | $ echo foo >> nf0 |
|
72 | 72 | $ sleep 1 |
|
73 | 73 | $ hg status |
|
74 | 74 | M nf0 |
|
75 | 75 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
76 | 76 | $ hg revert -C nf0 |
|
77 | 77 | $ sleep 1 |
|
78 | 78 | $ hg status |
|
79 | 79 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
80 | 80 | |
|
81 | 81 | key-file change if the tracked set is changed manually |
|
82 | 82 | ------------------------------------------------------ |
|
83 | 83 | |
|
84 | 84 | adding a file to tracking |
|
85 | 85 | |
|
86 | 86 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
87 | 87 | $ echo x > x |
|
88 | 88 | $ hg add x |
|
89 | 89 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
90 | 90 | Files .hg/dirstate-tracked-hint and ../key-bck differ |
|
91 | 91 | [1] |
|
92 | 92 | |
|
93 | 93 | remove a file from tracking |
|
94 | 94 | (forget) |
|
95 | 95 | |
|
96 | 96 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
97 | 97 | $ hg forget x |
|
98 | 98 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
99 | 99 | Files .hg/dirstate-tracked-hint and ../key-bck differ |
|
100 | 100 | [1] |
|
101 | 101 | |
|
102 | 102 | (remove) |
|
103 | 103 | |
|
104 | 104 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
105 | 105 | $ hg remove nf1 |
|
106 | 106 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
107 | 107 | Files .hg/dirstate-tracked-hint and ../key-bck differ |
|
108 | 108 | [1] |
|
109 | 109 | |
|
110 | 110 | key-file changes on revert (when applicable) |
|
111 | 111 | -------------------------------------------- |
|
112 | 112 | |
|
113 | 113 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
114 | 114 | $ hg status |
|
115 | 115 | R nf1 |
|
116 | 116 | ? x |
|
117 | 117 | $ hg revert --all |
|
118 | 118 | undeleting nf1 |
|
119 | 119 | $ hg status |
|
120 | 120 | ? x |
|
121 | 121 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
122 | 122 | Files .hg/dirstate-tracked-hint and ../key-bck differ |
|
123 | 123 | [1] |
|
124 | 124 | |
|
125 | 125 | |
|
126 | 126 | `hg update` does affect the key-file (when needed) |
|
127 | 127 | -------------------------------------------------- |
|
128 | 128 | |
|
129 | 129 | update changing the tracked set |
|
130 | 130 | |
|
131 | 131 | (removing) |
|
132 | 132 | |
|
133 | 133 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
134 | 134 | $ hg status --rev . --rev '.#generations[-1]' |
|
135 | 135 | R nf10 |
|
136 | 136 | $ hg up '.#generations[-1]' |
|
137 | 137 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
138 | 138 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
139 | 139 | Files .hg/dirstate-tracked-hint and ../key-bck differ |
|
140 | 140 | [1] |
|
141 | 141 | |
|
142 | 142 | (adding) |
|
143 | 143 | |
|
144 | 144 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
145 | 145 | $ hg status --rev . --rev '.#generations[1]' |
|
146 | 146 | A nf10 |
|
147 | 147 | $ hg up '.#generations[1]' |
|
148 | 148 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
149 | 149 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
150 | 150 | Files .hg/dirstate-tracked-hint and ../key-bck differ |
|
151 | 151 | [1] |
|
152 | 152 | |
|
153 | 153 | update not affecting the tracked set |
|
154 | 154 | |
|
155 | 155 | $ echo foo >> nf0 |
|
156 | 156 | $ hg commit -m foo |
|
157 | 157 | |
|
158 | 158 | $ cp .hg/dirstate-tracked-hint ../key-bck |
|
159 | 159 | $ hg status --rev . --rev '.#generations[-1]' |
|
160 | 160 | M nf0 |
|
161 | 161 | $ hg up '.#generations[-1]' |
|
162 | 162 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
163 | 163 | $ diff --brief .hg/dirstate-tracked-hint ../key-bck |
|
164 | 164 | |
|
165 | 165 | Test upgrade and downgrade |
|
166 | 166 | ========================== |
|
167 | 167 | |
|
168 | 168 | $ ls .hg/dirstate-tracked-hint |
|
169 | 169 | .hg/dirstate-tracked-hint |
|
170 | 170 | $ hg debugrequires | grep 'tracked' |
|
171 | 171 | dirstate-tracked-key-v1 |
|
172 | 172 | |
|
173 | 173 | downgrade |
|
174 | 174 | |
|
175 | 175 | $ hg debugupgraderepo --config format.use-dirstate-tracked-hint=no --run --quiet |
|
176 | 176 | upgrade will perform the following actions: |
|
177 | 177 | |
|
178 | 178 | requirements |
|
179 | 179 | preserved: * (glob) |
|
180 | 180 | removed: dirstate-tracked-key-v1 |
|
181 | 181 | |
|
182 | 182 | no revlogs to process |
|
183 | 183 | |
|
184 | 184 | $ ls -1 .hg/dirstate-tracked-hint |
|
185 | 185 | ls: *.hg/dirstate-tracked-hint*: $ENOENT$ (glob) |
|
186 | 186 | [2] |
|
187 | 187 | $ hg debugrequires | grep 'tracked' |
|
188 | 188 | [1] |
|
189 | 189 | |
|
190 | 190 | upgrade |
|
191 | 191 | |
|
192 | 192 | $ hg debugupgraderepo --config format.use-dirstate-tracked-hint=yes --run --quiet |
|
193 | 193 | upgrade will perform the following actions: |
|
194 | 194 | |
|
195 | 195 | requirements |
|
196 | 196 | preserved: * (glob) |
|
197 | 197 | added: dirstate-tracked-key-v1 |
|
198 | 198 | |
|
199 | 199 | no revlogs to process |
|
200 | 200 | |
|
201 | 201 | $ ls -1 .hg/dirstate-tracked-hint |
|
202 | 202 | .hg/dirstate-tracked-hint |
|
203 | 203 | $ hg debugrequires | grep 'tracked' |
|
204 | 204 | dirstate-tracked-key-v1 |
|
205 | $ cd .. | |
|
206 | ||
|
207 | Test automatic upgrade and downgrade | |
|
208 | ------------------------------------ | |
|
209 | ||
|
210 | create an initial repository | |
|
211 | ||
|
212 | $ hg init auto-upgrade \ | |
|
213 | > --config format.use-dirstate-tracked-hint=no | |
|
214 | $ hg debugbuilddag -R auto-upgrade --new-file .+5 | |
|
215 | $ hg -R auto-upgrade update | |
|
216 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
217 | $ hg debugformat -R auto-upgrade | grep tracked | |
|
218 | tracked-hint: no | |
|
219 | ||
|
220 | upgrade it to dirstate-tracked-hint automatically | |
|
221 | ||
|
222 | $ hg status -R auto-upgrade \ | |
|
223 | > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \ | |
|
224 | > --config format.use-dirstate-tracked-hint=yes | |
|
225 | automatically upgrading repository to the `tracked-hint` feature | |
|
226 | (see `hg help config.format.use-dirstate-tracked-hint` for details) | |
|
227 | $ hg debugformat -R auto-upgrade | grep tracked | |
|
228 | tracked-hint: yes | |
|
229 | ||
|
230 | downgrade it from dirstate-tracked-hint automatically | |
|
231 | ||
|
232 | $ hg status -R auto-upgrade \ | |
|
233 | > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \ | |
|
234 | > --config format.use-dirstate-tracked-hint=no | |
|
235 | automatically downgrading repository from the `tracked-hint` feature | |
|
236 | (see `hg help config.format.use-dirstate-tracked-hint` for details) | |
|
237 | $ hg debugformat -R auto-upgrade | grep tracked | |
|
238 | tracked-hint: no |
General Comments 0
You need to be logged in to leave comments.
Login now