Show More
@@ -1,1395 +1,1398 | |||
|
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 | from __future__ import absolute_import |
|
9 | 9 | |
|
10 | 10 | import functools |
|
11 | 11 | import re |
|
12 | 12 | |
|
13 | 13 | from . import ( |
|
14 | 14 | encoding, |
|
15 | 15 | error, |
|
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 = "extension '%s' overwrite config item '%s.%s'" |
|
26 | 26 | msg %= (extname, section, key) |
|
27 | 27 | ui.develwarn(msg, config='warn-config') |
|
28 | 28 | |
|
29 | 29 | knownitems.update(items) |
|
30 | 30 | |
|
31 | 31 | class configitem(object): |
|
32 | 32 | """represent a known config item |
|
33 | 33 | |
|
34 | 34 | :section: the official config section where to find this item, |
|
35 | 35 | :name: the official name within the section, |
|
36 | 36 | :default: default value for this item, |
|
37 | 37 | :alias: optional list of tuples as alternatives, |
|
38 | 38 | :generic: this is a generic definition, match name using regular expression. |
|
39 | 39 | """ |
|
40 | 40 | |
|
41 | 41 | def __init__(self, section, name, default=None, alias=(), |
|
42 | 42 | generic=False, priority=0): |
|
43 | 43 | self.section = section |
|
44 | 44 | self.name = name |
|
45 | 45 | self.default = default |
|
46 | 46 | self.alias = list(alias) |
|
47 | 47 | self.generic = generic |
|
48 | 48 | self.priority = priority |
|
49 | 49 | self._re = None |
|
50 | 50 | if generic: |
|
51 | 51 | self._re = re.compile(self.name) |
|
52 | 52 | |
|
53 | 53 | class itemregister(dict): |
|
54 | 54 | """A specialized dictionary that can handle wild-card selection""" |
|
55 | 55 | |
|
56 | 56 | def __init__(self): |
|
57 | 57 | super(itemregister, self).__init__() |
|
58 | 58 | self._generics = set() |
|
59 | 59 | |
|
60 | 60 | def update(self, other): |
|
61 | 61 | super(itemregister, self).update(other) |
|
62 | 62 | self._generics.update(other._generics) |
|
63 | 63 | |
|
64 | 64 | def __setitem__(self, key, item): |
|
65 | 65 | super(itemregister, self).__setitem__(key, item) |
|
66 | 66 | if item.generic: |
|
67 | 67 | self._generics.add(item) |
|
68 | 68 | |
|
69 | 69 | def get(self, key): |
|
70 | 70 | baseitem = super(itemregister, self).get(key) |
|
71 | 71 | if baseitem is not None and not baseitem.generic: |
|
72 | 72 | return baseitem |
|
73 | 73 | |
|
74 | 74 | # search for a matching generic item |
|
75 | 75 | generics = sorted(self._generics, key=(lambda x: (x.priority, x.name))) |
|
76 | 76 | for item in generics: |
|
77 | 77 | # we use 'match' instead of 'search' to make the matching simpler |
|
78 | 78 | # for people unfamiliar with regular expression. Having the match |
|
79 | 79 | # rooted to the start of the string will produce less surprising |
|
80 | 80 | # result for user writing simple regex for sub-attribute. |
|
81 | 81 | # |
|
82 | 82 | # For example using "color\..*" match produces an unsurprising |
|
83 | 83 | # result, while using search could suddenly match apparently |
|
84 | 84 | # unrelated configuration that happens to contains "color." |
|
85 | 85 | # anywhere. This is a tradeoff where we favor requiring ".*" on |
|
86 | 86 | # some match to avoid the need to prefix most pattern with "^". |
|
87 | 87 | # The "^" seems more error prone. |
|
88 | 88 | if item._re.match(key): |
|
89 | 89 | return item |
|
90 | 90 | |
|
91 | 91 | return None |
|
92 | 92 | |
|
93 | 93 | coreitems = {} |
|
94 | 94 | |
|
95 | 95 | def _register(configtable, *args, **kwargs): |
|
96 | 96 | item = configitem(*args, **kwargs) |
|
97 | 97 | section = configtable.setdefault(item.section, itemregister()) |
|
98 | 98 | if item.name in section: |
|
99 | 99 | msg = "duplicated config item registration for '%s.%s'" |
|
100 | 100 | raise error.ProgrammingError(msg % (item.section, item.name)) |
|
101 | 101 | section[item.name] = item |
|
102 | 102 | |
|
103 | 103 | # special value for case where the default is derived from other values |
|
104 | 104 | dynamicdefault = object() |
|
105 | 105 | |
|
106 | 106 | # Registering actual config items |
|
107 | 107 | |
|
108 | 108 | def getitemregister(configtable): |
|
109 | 109 | f = functools.partial(_register, configtable) |
|
110 | 110 | # export pseudo enum as configitem.* |
|
111 | 111 | f.dynamicdefault = dynamicdefault |
|
112 | 112 | return f |
|
113 | 113 | |
|
114 | 114 | coreconfigitem = getitemregister(coreitems) |
|
115 | 115 | |
|
116 | 116 | coreconfigitem('alias', '.*', |
|
117 | 117 | default=dynamicdefault, |
|
118 | 118 | generic=True, |
|
119 | 119 | ) |
|
120 | 120 | coreconfigitem('annotate', 'nodates', |
|
121 | 121 | default=False, |
|
122 | 122 | ) |
|
123 | 123 | coreconfigitem('annotate', 'showfunc', |
|
124 | 124 | default=False, |
|
125 | 125 | ) |
|
126 | 126 | coreconfigitem('annotate', 'unified', |
|
127 | 127 | default=None, |
|
128 | 128 | ) |
|
129 | 129 | coreconfigitem('annotate', 'git', |
|
130 | 130 | default=False, |
|
131 | 131 | ) |
|
132 | 132 | coreconfigitem('annotate', 'ignorews', |
|
133 | 133 | default=False, |
|
134 | 134 | ) |
|
135 | 135 | coreconfigitem('annotate', 'ignorewsamount', |
|
136 | 136 | default=False, |
|
137 | 137 | ) |
|
138 | 138 | coreconfigitem('annotate', 'ignoreblanklines', |
|
139 | 139 | default=False, |
|
140 | 140 | ) |
|
141 | 141 | coreconfigitem('annotate', 'ignorewseol', |
|
142 | 142 | default=False, |
|
143 | 143 | ) |
|
144 | 144 | coreconfigitem('annotate', 'nobinary', |
|
145 | 145 | default=False, |
|
146 | 146 | ) |
|
147 | 147 | coreconfigitem('annotate', 'noprefix', |
|
148 | 148 | default=False, |
|
149 | 149 | ) |
|
150 | 150 | coreconfigitem('annotate', 'word-diff', |
|
151 | 151 | default=False, |
|
152 | 152 | ) |
|
153 | 153 | coreconfigitem('auth', 'cookiefile', |
|
154 | 154 | default=None, |
|
155 | 155 | ) |
|
156 | 156 | # bookmarks.pushing: internal hack for discovery |
|
157 | 157 | coreconfigitem('bookmarks', 'pushing', |
|
158 | 158 | default=list, |
|
159 | 159 | ) |
|
160 | 160 | # bundle.mainreporoot: internal hack for bundlerepo |
|
161 | 161 | coreconfigitem('bundle', 'mainreporoot', |
|
162 | 162 | default='', |
|
163 | 163 | ) |
|
164 | 164 | # bundle.reorder: experimental config |
|
165 | 165 | coreconfigitem('bundle', 'reorder', |
|
166 | 166 | default='auto', |
|
167 | 167 | ) |
|
168 | 168 | coreconfigitem('censor', 'policy', |
|
169 | 169 | default='abort', |
|
170 | 170 | ) |
|
171 | 171 | coreconfigitem('chgserver', 'idletimeout', |
|
172 | 172 | default=3600, |
|
173 | 173 | ) |
|
174 | 174 | coreconfigitem('chgserver', 'skiphash', |
|
175 | 175 | default=False, |
|
176 | 176 | ) |
|
177 | 177 | coreconfigitem('cmdserver', 'log', |
|
178 | 178 | default=None, |
|
179 | 179 | ) |
|
180 | 180 | coreconfigitem('color', '.*', |
|
181 | 181 | default=None, |
|
182 | 182 | generic=True, |
|
183 | 183 | ) |
|
184 | 184 | coreconfigitem('color', 'mode', |
|
185 | 185 | default='auto', |
|
186 | 186 | ) |
|
187 | 187 | coreconfigitem('color', 'pagermode', |
|
188 | 188 | default=dynamicdefault, |
|
189 | 189 | ) |
|
190 | 190 | coreconfigitem('commands', 'grep.all-files', |
|
191 | 191 | default=False, |
|
192 | 192 | ) |
|
193 | 193 | coreconfigitem('commands', 'resolve.confirm', |
|
194 | 194 | default=False, |
|
195 | 195 | ) |
|
196 | 196 | coreconfigitem('commands', 'resolve.mark-check', |
|
197 | 197 | default='none', |
|
198 | 198 | ) |
|
199 | 199 | coreconfigitem('commands', 'show.aliasprefix', |
|
200 | 200 | default=list, |
|
201 | 201 | ) |
|
202 | 202 | coreconfigitem('commands', 'status.relative', |
|
203 | 203 | default=False, |
|
204 | 204 | ) |
|
205 | 205 | coreconfigitem('commands', 'status.skipstates', |
|
206 | 206 | default=[], |
|
207 | 207 | ) |
|
208 | 208 | coreconfigitem('commands', 'status.terse', |
|
209 | 209 | default='', |
|
210 | 210 | ) |
|
211 | 211 | coreconfigitem('commands', 'status.verbose', |
|
212 | 212 | default=False, |
|
213 | 213 | ) |
|
214 | 214 | coreconfigitem('commands', 'update.check', |
|
215 | 215 | default=None, |
|
216 | 216 | ) |
|
217 | 217 | coreconfigitem('commands', 'update.requiredest', |
|
218 | 218 | default=False, |
|
219 | 219 | ) |
|
220 | 220 | coreconfigitem('committemplate', '.*', |
|
221 | 221 | default=None, |
|
222 | 222 | generic=True, |
|
223 | 223 | ) |
|
224 | 224 | coreconfigitem('convert', 'bzr.saverev', |
|
225 | 225 | default=True, |
|
226 | 226 | ) |
|
227 | 227 | coreconfigitem('convert', 'cvsps.cache', |
|
228 | 228 | default=True, |
|
229 | 229 | ) |
|
230 | 230 | coreconfigitem('convert', 'cvsps.fuzz', |
|
231 | 231 | default=60, |
|
232 | 232 | ) |
|
233 | 233 | coreconfigitem('convert', 'cvsps.logencoding', |
|
234 | 234 | default=None, |
|
235 | 235 | ) |
|
236 | 236 | coreconfigitem('convert', 'cvsps.mergefrom', |
|
237 | 237 | default=None, |
|
238 | 238 | ) |
|
239 | 239 | coreconfigitem('convert', 'cvsps.mergeto', |
|
240 | 240 | default=None, |
|
241 | 241 | ) |
|
242 | 242 | coreconfigitem('convert', 'git.committeractions', |
|
243 | 243 | default=lambda: ['messagedifferent'], |
|
244 | 244 | ) |
|
245 | 245 | coreconfigitem('convert', 'git.extrakeys', |
|
246 | 246 | default=list, |
|
247 | 247 | ) |
|
248 | 248 | coreconfigitem('convert', 'git.findcopiesharder', |
|
249 | 249 | default=False, |
|
250 | 250 | ) |
|
251 | 251 | coreconfigitem('convert', 'git.remoteprefix', |
|
252 | 252 | default='remote', |
|
253 | 253 | ) |
|
254 | 254 | coreconfigitem('convert', 'git.renamelimit', |
|
255 | 255 | default=400, |
|
256 | 256 | ) |
|
257 | 257 | coreconfigitem('convert', 'git.saverev', |
|
258 | 258 | default=True, |
|
259 | 259 | ) |
|
260 | 260 | coreconfigitem('convert', 'git.similarity', |
|
261 | 261 | default=50, |
|
262 | 262 | ) |
|
263 | 263 | coreconfigitem('convert', 'git.skipsubmodules', |
|
264 | 264 | default=False, |
|
265 | 265 | ) |
|
266 | 266 | coreconfigitem('convert', 'hg.clonebranches', |
|
267 | 267 | default=False, |
|
268 | 268 | ) |
|
269 | 269 | coreconfigitem('convert', 'hg.ignoreerrors', |
|
270 | 270 | default=False, |
|
271 | 271 | ) |
|
272 | 272 | coreconfigitem('convert', 'hg.revs', |
|
273 | 273 | default=None, |
|
274 | 274 | ) |
|
275 | 275 | coreconfigitem('convert', 'hg.saverev', |
|
276 | 276 | default=False, |
|
277 | 277 | ) |
|
278 | 278 | coreconfigitem('convert', 'hg.sourcename', |
|
279 | 279 | default=None, |
|
280 | 280 | ) |
|
281 | 281 | coreconfigitem('convert', 'hg.startrev', |
|
282 | 282 | default=None, |
|
283 | 283 | ) |
|
284 | 284 | coreconfigitem('convert', 'hg.tagsbranch', |
|
285 | 285 | default='default', |
|
286 | 286 | ) |
|
287 | 287 | coreconfigitem('convert', 'hg.usebranchnames', |
|
288 | 288 | default=True, |
|
289 | 289 | ) |
|
290 | 290 | coreconfigitem('convert', 'ignoreancestorcheck', |
|
291 | 291 | default=False, |
|
292 | 292 | ) |
|
293 | 293 | coreconfigitem('convert', 'localtimezone', |
|
294 | 294 | default=False, |
|
295 | 295 | ) |
|
296 | 296 | coreconfigitem('convert', 'p4.encoding', |
|
297 | 297 | default=dynamicdefault, |
|
298 | 298 | ) |
|
299 | 299 | coreconfigitem('convert', 'p4.startrev', |
|
300 | 300 | default=0, |
|
301 | 301 | ) |
|
302 | 302 | coreconfigitem('convert', 'skiptags', |
|
303 | 303 | default=False, |
|
304 | 304 | ) |
|
305 | 305 | coreconfigitem('convert', 'svn.debugsvnlog', |
|
306 | 306 | default=True, |
|
307 | 307 | ) |
|
308 | 308 | coreconfigitem('convert', 'svn.trunk', |
|
309 | 309 | default=None, |
|
310 | 310 | ) |
|
311 | 311 | coreconfigitem('convert', 'svn.tags', |
|
312 | 312 | default=None, |
|
313 | 313 | ) |
|
314 | 314 | coreconfigitem('convert', 'svn.branches', |
|
315 | 315 | default=None, |
|
316 | 316 | ) |
|
317 | 317 | coreconfigitem('convert', 'svn.startrev', |
|
318 | 318 | default=0, |
|
319 | 319 | ) |
|
320 | 320 | coreconfigitem('debug', 'dirstate.delaywrite', |
|
321 | 321 | default=0, |
|
322 | 322 | ) |
|
323 | 323 | coreconfigitem('defaults', '.*', |
|
324 | 324 | default=None, |
|
325 | 325 | generic=True, |
|
326 | 326 | ) |
|
327 | 327 | coreconfigitem('devel', 'all-warnings', |
|
328 | 328 | default=False, |
|
329 | 329 | ) |
|
330 | 330 | coreconfigitem('devel', 'bundle2.debug', |
|
331 | 331 | default=False, |
|
332 | 332 | ) |
|
333 | 333 | coreconfigitem('devel', 'cache-vfs', |
|
334 | 334 | default=None, |
|
335 | 335 | ) |
|
336 | 336 | coreconfigitem('devel', 'check-locks', |
|
337 | 337 | default=False, |
|
338 | 338 | ) |
|
339 | 339 | coreconfigitem('devel', 'check-relroot', |
|
340 | 340 | default=False, |
|
341 | 341 | ) |
|
342 | 342 | coreconfigitem('devel', 'default-date', |
|
343 | 343 | default=None, |
|
344 | 344 | ) |
|
345 | 345 | coreconfigitem('devel', 'deprec-warn', |
|
346 | 346 | default=False, |
|
347 | 347 | ) |
|
348 | 348 | coreconfigitem('devel', 'disableloaddefaultcerts', |
|
349 | 349 | default=False, |
|
350 | 350 | ) |
|
351 | 351 | coreconfigitem('devel', 'warn-empty-changegroup', |
|
352 | 352 | default=False, |
|
353 | 353 | ) |
|
354 | 354 | coreconfigitem('devel', 'legacy.exchange', |
|
355 | 355 | default=list, |
|
356 | 356 | ) |
|
357 | 357 | coreconfigitem('devel', 'servercafile', |
|
358 | 358 | default='', |
|
359 | 359 | ) |
|
360 | 360 | coreconfigitem('devel', 'serverexactprotocol', |
|
361 | 361 | default='', |
|
362 | 362 | ) |
|
363 | 363 | coreconfigitem('devel', 'serverrequirecert', |
|
364 | 364 | default=False, |
|
365 | 365 | ) |
|
366 | 366 | coreconfigitem('devel', 'strip-obsmarkers', |
|
367 | 367 | default=True, |
|
368 | 368 | ) |
|
369 | 369 | coreconfigitem('devel', 'warn-config', |
|
370 | 370 | default=None, |
|
371 | 371 | ) |
|
372 | 372 | coreconfigitem('devel', 'warn-config-default', |
|
373 | 373 | default=None, |
|
374 | 374 | ) |
|
375 | 375 | coreconfigitem('devel', 'user.obsmarker', |
|
376 | 376 | default=None, |
|
377 | 377 | ) |
|
378 | 378 | coreconfigitem('devel', 'warn-config-unknown', |
|
379 | 379 | default=None, |
|
380 | 380 | ) |
|
381 | 381 | coreconfigitem('devel', 'debug.extensions', |
|
382 | 382 | default=False, |
|
383 | 383 | ) |
|
384 | 384 | coreconfigitem('devel', 'debug.peer-request', |
|
385 | 385 | default=False, |
|
386 | 386 | ) |
|
387 | 387 | coreconfigitem('diff', 'nodates', |
|
388 | 388 | default=False, |
|
389 | 389 | ) |
|
390 | 390 | coreconfigitem('diff', 'showfunc', |
|
391 | 391 | default=False, |
|
392 | 392 | ) |
|
393 | 393 | coreconfigitem('diff', 'unified', |
|
394 | 394 | default=None, |
|
395 | 395 | ) |
|
396 | 396 | coreconfigitem('diff', 'git', |
|
397 | 397 | default=False, |
|
398 | 398 | ) |
|
399 | 399 | coreconfigitem('diff', 'ignorews', |
|
400 | 400 | default=False, |
|
401 | 401 | ) |
|
402 | 402 | coreconfigitem('diff', 'ignorewsamount', |
|
403 | 403 | default=False, |
|
404 | 404 | ) |
|
405 | 405 | coreconfigitem('diff', 'ignoreblanklines', |
|
406 | 406 | default=False, |
|
407 | 407 | ) |
|
408 | 408 | coreconfigitem('diff', 'ignorewseol', |
|
409 | 409 | default=False, |
|
410 | 410 | ) |
|
411 | 411 | coreconfigitem('diff', 'nobinary', |
|
412 | 412 | default=False, |
|
413 | 413 | ) |
|
414 | 414 | coreconfigitem('diff', 'noprefix', |
|
415 | 415 | default=False, |
|
416 | 416 | ) |
|
417 | 417 | coreconfigitem('diff', 'word-diff', |
|
418 | 418 | default=False, |
|
419 | 419 | ) |
|
420 | 420 | coreconfigitem('email', 'bcc', |
|
421 | 421 | default=None, |
|
422 | 422 | ) |
|
423 | 423 | coreconfigitem('email', 'cc', |
|
424 | 424 | default=None, |
|
425 | 425 | ) |
|
426 | 426 | coreconfigitem('email', 'charsets', |
|
427 | 427 | default=list, |
|
428 | 428 | ) |
|
429 | 429 | coreconfigitem('email', 'from', |
|
430 | 430 | default=None, |
|
431 | 431 | ) |
|
432 | 432 | coreconfigitem('email', 'method', |
|
433 | 433 | default='smtp', |
|
434 | 434 | ) |
|
435 | 435 | coreconfigitem('email', 'reply-to', |
|
436 | 436 | default=None, |
|
437 | 437 | ) |
|
438 | 438 | coreconfigitem('email', 'to', |
|
439 | 439 | default=None, |
|
440 | 440 | ) |
|
441 | 441 | coreconfigitem('experimental', 'archivemetatemplate', |
|
442 | 442 | default=dynamicdefault, |
|
443 | 443 | ) |
|
444 | 444 | coreconfigitem('experimental', 'bundle-phases', |
|
445 | 445 | default=False, |
|
446 | 446 | ) |
|
447 | 447 | coreconfigitem('experimental', 'bundle2-advertise', |
|
448 | 448 | default=True, |
|
449 | 449 | ) |
|
450 | 450 | coreconfigitem('experimental', 'bundle2-output-capture', |
|
451 | 451 | default=False, |
|
452 | 452 | ) |
|
453 | 453 | coreconfigitem('experimental', 'bundle2.pushback', |
|
454 | 454 | default=False, |
|
455 | 455 | ) |
|
456 | 456 | coreconfigitem('experimental', 'bundle2.stream', |
|
457 | 457 | default=False, |
|
458 | 458 | ) |
|
459 | 459 | coreconfigitem('experimental', 'bundle2lazylocking', |
|
460 | 460 | default=False, |
|
461 | 461 | ) |
|
462 | 462 | coreconfigitem('experimental', 'bundlecomplevel', |
|
463 | 463 | default=None, |
|
464 | 464 | ) |
|
465 | 465 | coreconfigitem('experimental', 'bundlecomplevel.bzip2', |
|
466 | 466 | default=None, |
|
467 | 467 | ) |
|
468 | 468 | coreconfigitem('experimental', 'bundlecomplevel.gzip', |
|
469 | 469 | default=None, |
|
470 | 470 | ) |
|
471 | 471 | coreconfigitem('experimental', 'bundlecomplevel.none', |
|
472 | 472 | default=None, |
|
473 | 473 | ) |
|
474 | 474 | coreconfigitem('experimental', 'bundlecomplevel.zstd', |
|
475 | 475 | default=None, |
|
476 | 476 | ) |
|
477 | 477 | coreconfigitem('experimental', 'changegroup3', |
|
478 | 478 | default=False, |
|
479 | 479 | ) |
|
480 | 480 | coreconfigitem('experimental', 'clientcompressionengines', |
|
481 | 481 | default=list, |
|
482 | 482 | ) |
|
483 | 483 | coreconfigitem('experimental', 'copytrace', |
|
484 | 484 | default='on', |
|
485 | 485 | ) |
|
486 | 486 | coreconfigitem('experimental', 'copytrace.movecandidateslimit', |
|
487 | 487 | default=100, |
|
488 | 488 | ) |
|
489 | 489 | coreconfigitem('experimental', 'copytrace.sourcecommitlimit', |
|
490 | 490 | default=100, |
|
491 | 491 | ) |
|
492 | 492 | coreconfigitem('experimental', 'crecordtest', |
|
493 | 493 | default=None, |
|
494 | 494 | ) |
|
495 | 495 | coreconfigitem('experimental', 'directaccess', |
|
496 | 496 | default=False, |
|
497 | 497 | ) |
|
498 | 498 | coreconfigitem('experimental', 'directaccess.revnums', |
|
499 | 499 | default=False, |
|
500 | 500 | ) |
|
501 | 501 | coreconfigitem('experimental', 'editortmpinhg', |
|
502 | 502 | default=False, |
|
503 | 503 | ) |
|
504 | 504 | coreconfigitem('experimental', 'evolution', |
|
505 | 505 | default=list, |
|
506 | 506 | ) |
|
507 | 507 | coreconfigitem('experimental', 'evolution.allowdivergence', |
|
508 | 508 | default=False, |
|
509 | 509 | alias=[('experimental', 'allowdivergence')] |
|
510 | 510 | ) |
|
511 | 511 | coreconfigitem('experimental', 'evolution.allowunstable', |
|
512 | 512 | default=None, |
|
513 | 513 | ) |
|
514 | 514 | coreconfigitem('experimental', 'evolution.createmarkers', |
|
515 | 515 | default=None, |
|
516 | 516 | ) |
|
517 | 517 | coreconfigitem('experimental', 'evolution.effect-flags', |
|
518 | 518 | default=True, |
|
519 | 519 | alias=[('experimental', 'effect-flags')] |
|
520 | 520 | ) |
|
521 | 521 | coreconfigitem('experimental', 'evolution.exchange', |
|
522 | 522 | default=None, |
|
523 | 523 | ) |
|
524 | 524 | coreconfigitem('experimental', 'evolution.bundle-obsmarker', |
|
525 | 525 | default=False, |
|
526 | 526 | ) |
|
527 | 527 | coreconfigitem('experimental', 'evolution.report-instabilities', |
|
528 | 528 | default=True, |
|
529 | 529 | ) |
|
530 | 530 | coreconfigitem('experimental', 'evolution.track-operation', |
|
531 | 531 | default=True, |
|
532 | 532 | ) |
|
533 | 533 | coreconfigitem('experimental', 'maxdeltachainspan', |
|
534 | 534 | default=-1, |
|
535 | 535 | ) |
|
536 | 536 | coreconfigitem('experimental', 'mergetempdirprefix', |
|
537 | 537 | default=None, |
|
538 | 538 | ) |
|
539 | 539 | coreconfigitem('experimental', 'mmapindexthreshold', |
|
540 | 540 | default=None, |
|
541 | 541 | ) |
|
542 | 542 | coreconfigitem('experimental', 'nonnormalparanoidcheck', |
|
543 | 543 | default=False, |
|
544 | 544 | ) |
|
545 | 545 | coreconfigitem('experimental', 'exportableenviron', |
|
546 | 546 | default=list, |
|
547 | 547 | ) |
|
548 | 548 | coreconfigitem('experimental', 'extendedheader.index', |
|
549 | 549 | default=None, |
|
550 | 550 | ) |
|
551 | 551 | coreconfigitem('experimental', 'extendedheader.similarity', |
|
552 | 552 | default=False, |
|
553 | 553 | ) |
|
554 | 554 | coreconfigitem('experimental', 'format.compression', |
|
555 | 555 | default='zlib', |
|
556 | 556 | ) |
|
557 | 557 | coreconfigitem('experimental', 'graphshorten', |
|
558 | 558 | default=False, |
|
559 | 559 | ) |
|
560 | 560 | coreconfigitem('experimental', 'graphstyle.parent', |
|
561 | 561 | default=dynamicdefault, |
|
562 | 562 | ) |
|
563 | 563 | coreconfigitem('experimental', 'graphstyle.missing', |
|
564 | 564 | default=dynamicdefault, |
|
565 | 565 | ) |
|
566 | 566 | coreconfigitem('experimental', 'graphstyle.grandparent', |
|
567 | 567 | default=dynamicdefault, |
|
568 | 568 | ) |
|
569 | 569 | coreconfigitem('experimental', 'hook-track-tags', |
|
570 | 570 | default=False, |
|
571 | 571 | ) |
|
572 | 572 | coreconfigitem('experimental', 'httppeer.advertise-v2', |
|
573 | 573 | default=False, |
|
574 | 574 | ) |
|
575 | 575 | coreconfigitem('experimental', 'httppostargs', |
|
576 | 576 | default=False, |
|
577 | 577 | ) |
|
578 | 578 | coreconfigitem('experimental', 'mergedriver', |
|
579 | 579 | default=None, |
|
580 | 580 | ) |
|
581 | 581 | coreconfigitem('experimental', 'nointerrupt', default=False) |
|
582 | 582 | coreconfigitem('experimental', 'nointerrupt-interactiveonly', default=True) |
|
583 | 583 | |
|
584 | 584 | coreconfigitem('experimental', 'obsmarkers-exchange-debug', |
|
585 | 585 | default=False, |
|
586 | 586 | ) |
|
587 | 587 | coreconfigitem('experimental', 'remotenames', |
|
588 | 588 | default=False, |
|
589 | 589 | ) |
|
590 | 590 | coreconfigitem('experimental', 'removeemptydirs', |
|
591 | 591 | default=True, |
|
592 | 592 | ) |
|
593 | 593 | coreconfigitem('experimental', 'revisions.prefixhexnode', |
|
594 | 594 | default=False, |
|
595 | 595 | ) |
|
596 | 596 | coreconfigitem('experimental', 'revlogv2', |
|
597 | 597 | default=None, |
|
598 | 598 | ) |
|
599 | 599 | coreconfigitem('experimental', 'revisions.disambiguatewithin', |
|
600 | 600 | default=None, |
|
601 | 601 | ) |
|
602 | 602 | coreconfigitem('experimental', 'single-head-per-branch', |
|
603 | 603 | default=False, |
|
604 | 604 | ) |
|
605 | 605 | coreconfigitem('experimental', 'sshserver.support-v2', |
|
606 | 606 | default=False, |
|
607 | 607 | ) |
|
608 | 608 | coreconfigitem('experimental', 'spacemovesdown', |
|
609 | 609 | default=False, |
|
610 | 610 | ) |
|
611 | 611 | coreconfigitem('experimental', 'sparse-read', |
|
612 | 612 | default=False, |
|
613 | 613 | ) |
|
614 | 614 | coreconfigitem('experimental', 'sparse-read.density-threshold', |
|
615 | 615 | default=0.50, |
|
616 | 616 | ) |
|
617 | 617 | coreconfigitem('experimental', 'sparse-read.min-gap-size', |
|
618 | 618 | default='65K', |
|
619 | 619 | ) |
|
620 | 620 | coreconfigitem('experimental', 'treemanifest', |
|
621 | 621 | default=False, |
|
622 | 622 | ) |
|
623 | 623 | coreconfigitem('experimental', 'update.atomic-file', |
|
624 | 624 | default=False, |
|
625 | 625 | ) |
|
626 | 626 | coreconfigitem('experimental', 'sshpeer.advertise-v2', |
|
627 | 627 | default=False, |
|
628 | 628 | ) |
|
629 | 629 | coreconfigitem('experimental', 'web.apiserver', |
|
630 | 630 | default=False, |
|
631 | 631 | ) |
|
632 | 632 | coreconfigitem('experimental', 'web.api.http-v2', |
|
633 | 633 | default=False, |
|
634 | 634 | ) |
|
635 | 635 | coreconfigitem('experimental', 'web.api.debugreflect', |
|
636 | 636 | default=False, |
|
637 | 637 | ) |
|
638 | 638 | coreconfigitem('experimental', 'worker.wdir-get-thread-safe', |
|
639 | 639 | default=False, |
|
640 | 640 | ) |
|
641 | 641 | coreconfigitem('experimental', 'xdiff', |
|
642 | 642 | default=False, |
|
643 | 643 | ) |
|
644 | 644 | coreconfigitem('extensions', '.*', |
|
645 | 645 | default=None, |
|
646 | 646 | generic=True, |
|
647 | 647 | ) |
|
648 | 648 | coreconfigitem('extdata', '.*', |
|
649 | 649 | default=None, |
|
650 | 650 | generic=True, |
|
651 | 651 | ) |
|
652 | 652 | coreconfigitem('format', 'chunkcachesize', |
|
653 | 653 | default=None, |
|
654 | 654 | ) |
|
655 | 655 | coreconfigitem('format', 'dotencode', |
|
656 | 656 | default=True, |
|
657 | 657 | ) |
|
658 | 658 | coreconfigitem('format', 'generaldelta', |
|
659 | 659 | default=False, |
|
660 | 660 | ) |
|
661 | 661 | coreconfigitem('format', 'manifestcachesize', |
|
662 | 662 | default=None, |
|
663 | 663 | ) |
|
664 | 664 | coreconfigitem('format', 'maxchainlen', |
|
665 | 665 | default=None, |
|
666 | 666 | ) |
|
667 | 667 | coreconfigitem('format', 'obsstore-version', |
|
668 | 668 | default=None, |
|
669 | 669 | ) |
|
670 | 670 | coreconfigitem('format', 'sparse-revlog', |
|
671 | 671 | default=False, |
|
672 | 672 | ) |
|
673 | 673 | coreconfigitem('format', 'usefncache', |
|
674 | 674 | default=True, |
|
675 | 675 | ) |
|
676 | 676 | coreconfigitem('format', 'usegeneraldelta', |
|
677 | 677 | default=True, |
|
678 | 678 | ) |
|
679 | 679 | coreconfigitem('format', 'usestore', |
|
680 | 680 | default=True, |
|
681 | 681 | ) |
|
682 | 682 | coreconfigitem('fsmonitor', 'warn_when_unused', |
|
683 | 683 | default=True, |
|
684 | 684 | ) |
|
685 | 685 | coreconfigitem('fsmonitor', 'warn_update_file_count', |
|
686 | 686 | default=50000, |
|
687 | 687 | ) |
|
688 | 688 | coreconfigitem('hooks', '.*', |
|
689 | 689 | default=dynamicdefault, |
|
690 | 690 | generic=True, |
|
691 | 691 | ) |
|
692 | 692 | coreconfigitem('hgweb-paths', '.*', |
|
693 | 693 | default=list, |
|
694 | 694 | generic=True, |
|
695 | 695 | ) |
|
696 | 696 | coreconfigitem('hostfingerprints', '.*', |
|
697 | 697 | default=list, |
|
698 | 698 | generic=True, |
|
699 | 699 | ) |
|
700 | 700 | coreconfigitem('hostsecurity', 'ciphers', |
|
701 | 701 | default=None, |
|
702 | 702 | ) |
|
703 | 703 | coreconfigitem('hostsecurity', 'disabletls10warning', |
|
704 | 704 | default=False, |
|
705 | 705 | ) |
|
706 | 706 | coreconfigitem('hostsecurity', 'minimumprotocol', |
|
707 | 707 | default=dynamicdefault, |
|
708 | 708 | ) |
|
709 | 709 | coreconfigitem('hostsecurity', '.*:minimumprotocol$', |
|
710 | 710 | default=dynamicdefault, |
|
711 | 711 | generic=True, |
|
712 | 712 | ) |
|
713 | 713 | coreconfigitem('hostsecurity', '.*:ciphers$', |
|
714 | 714 | default=dynamicdefault, |
|
715 | 715 | generic=True, |
|
716 | 716 | ) |
|
717 | 717 | coreconfigitem('hostsecurity', '.*:fingerprints$', |
|
718 | 718 | default=list, |
|
719 | 719 | generic=True, |
|
720 | 720 | ) |
|
721 | 721 | coreconfigitem('hostsecurity', '.*:verifycertsfile$', |
|
722 | 722 | default=None, |
|
723 | 723 | generic=True, |
|
724 | 724 | ) |
|
725 | 725 | |
|
726 | 726 | coreconfigitem('http_proxy', 'always', |
|
727 | 727 | default=False, |
|
728 | 728 | ) |
|
729 | 729 | coreconfigitem('http_proxy', 'host', |
|
730 | 730 | default=None, |
|
731 | 731 | ) |
|
732 | 732 | coreconfigitem('http_proxy', 'no', |
|
733 | 733 | default=list, |
|
734 | 734 | ) |
|
735 | 735 | coreconfigitem('http_proxy', 'passwd', |
|
736 | 736 | default=None, |
|
737 | 737 | ) |
|
738 | 738 | coreconfigitem('http_proxy', 'user', |
|
739 | 739 | default=None, |
|
740 | 740 | ) |
|
741 | 741 | coreconfigitem('logtoprocess', 'commandexception', |
|
742 | 742 | default=None, |
|
743 | 743 | ) |
|
744 | 744 | coreconfigitem('logtoprocess', 'commandfinish', |
|
745 | 745 | default=None, |
|
746 | 746 | ) |
|
747 | 747 | coreconfigitem('logtoprocess', 'command', |
|
748 | 748 | default=None, |
|
749 | 749 | ) |
|
750 | 750 | coreconfigitem('logtoprocess', 'develwarn', |
|
751 | 751 | default=None, |
|
752 | 752 | ) |
|
753 | 753 | coreconfigitem('logtoprocess', 'uiblocked', |
|
754 | 754 | default=None, |
|
755 | 755 | ) |
|
756 | 756 | coreconfigitem('merge', 'checkunknown', |
|
757 | 757 | default='abort', |
|
758 | 758 | ) |
|
759 | 759 | coreconfigitem('merge', 'checkignored', |
|
760 | 760 | default='abort', |
|
761 | 761 | ) |
|
762 | 762 | coreconfigitem('experimental', 'merge.checkpathconflicts', |
|
763 | 763 | default=False, |
|
764 | 764 | ) |
|
765 | 765 | coreconfigitem('merge', 'followcopies', |
|
766 | 766 | default=True, |
|
767 | 767 | ) |
|
768 | 768 | coreconfigitem('merge', 'on-failure', |
|
769 | 769 | default='continue', |
|
770 | 770 | ) |
|
771 | 771 | coreconfigitem('merge', 'preferancestor', |
|
772 | 772 | default=lambda: ['*'], |
|
773 | 773 | ) |
|
774 | coreconfigitem('merge', 'strict-capability-check', | |
|
775 | default=False, | |
|
776 | ) | |
|
774 | 777 | coreconfigitem('merge-tools', '.*', |
|
775 | 778 | default=None, |
|
776 | 779 | generic=True, |
|
777 | 780 | ) |
|
778 | 781 | coreconfigitem('merge-tools', br'.*\.args$', |
|
779 | 782 | default="$local $base $other", |
|
780 | 783 | generic=True, |
|
781 | 784 | priority=-1, |
|
782 | 785 | ) |
|
783 | 786 | coreconfigitem('merge-tools', br'.*\.binary$', |
|
784 | 787 | default=False, |
|
785 | 788 | generic=True, |
|
786 | 789 | priority=-1, |
|
787 | 790 | ) |
|
788 | 791 | coreconfigitem('merge-tools', br'.*\.check$', |
|
789 | 792 | default=list, |
|
790 | 793 | generic=True, |
|
791 | 794 | priority=-1, |
|
792 | 795 | ) |
|
793 | 796 | coreconfigitem('merge-tools', br'.*\.checkchanged$', |
|
794 | 797 | default=False, |
|
795 | 798 | generic=True, |
|
796 | 799 | priority=-1, |
|
797 | 800 | ) |
|
798 | 801 | coreconfigitem('merge-tools', br'.*\.executable$', |
|
799 | 802 | default=dynamicdefault, |
|
800 | 803 | generic=True, |
|
801 | 804 | priority=-1, |
|
802 | 805 | ) |
|
803 | 806 | coreconfigitem('merge-tools', br'.*\.fixeol$', |
|
804 | 807 | default=False, |
|
805 | 808 | generic=True, |
|
806 | 809 | priority=-1, |
|
807 | 810 | ) |
|
808 | 811 | coreconfigitem('merge-tools', br'.*\.gui$', |
|
809 | 812 | default=False, |
|
810 | 813 | generic=True, |
|
811 | 814 | priority=-1, |
|
812 | 815 | ) |
|
813 | 816 | coreconfigitem('merge-tools', br'.*\.mergemarkers$', |
|
814 | 817 | default='basic', |
|
815 | 818 | generic=True, |
|
816 | 819 | priority=-1, |
|
817 | 820 | ) |
|
818 | 821 | coreconfigitem('merge-tools', br'.*\.mergemarkertemplate$', |
|
819 | 822 | default=dynamicdefault, # take from ui.mergemarkertemplate |
|
820 | 823 | generic=True, |
|
821 | 824 | priority=-1, |
|
822 | 825 | ) |
|
823 | 826 | coreconfigitem('merge-tools', br'.*\.priority$', |
|
824 | 827 | default=0, |
|
825 | 828 | generic=True, |
|
826 | 829 | priority=-1, |
|
827 | 830 | ) |
|
828 | 831 | coreconfigitem('merge-tools', br'.*\.premerge$', |
|
829 | 832 | default=dynamicdefault, |
|
830 | 833 | generic=True, |
|
831 | 834 | priority=-1, |
|
832 | 835 | ) |
|
833 | 836 | coreconfigitem('merge-tools', br'.*\.symlink$', |
|
834 | 837 | default=False, |
|
835 | 838 | generic=True, |
|
836 | 839 | priority=-1, |
|
837 | 840 | ) |
|
838 | 841 | coreconfigitem('pager', 'attend-.*', |
|
839 | 842 | default=dynamicdefault, |
|
840 | 843 | generic=True, |
|
841 | 844 | ) |
|
842 | 845 | coreconfigitem('pager', 'ignore', |
|
843 | 846 | default=list, |
|
844 | 847 | ) |
|
845 | 848 | coreconfigitem('pager', 'pager', |
|
846 | 849 | default=dynamicdefault, |
|
847 | 850 | ) |
|
848 | 851 | coreconfigitem('patch', 'eol', |
|
849 | 852 | default='strict', |
|
850 | 853 | ) |
|
851 | 854 | coreconfigitem('patch', 'fuzz', |
|
852 | 855 | default=2, |
|
853 | 856 | ) |
|
854 | 857 | coreconfigitem('paths', 'default', |
|
855 | 858 | default=None, |
|
856 | 859 | ) |
|
857 | 860 | coreconfigitem('paths', 'default-push', |
|
858 | 861 | default=None, |
|
859 | 862 | ) |
|
860 | 863 | coreconfigitem('paths', '.*', |
|
861 | 864 | default=None, |
|
862 | 865 | generic=True, |
|
863 | 866 | ) |
|
864 | 867 | coreconfigitem('phases', 'checksubrepos', |
|
865 | 868 | default='follow', |
|
866 | 869 | ) |
|
867 | 870 | coreconfigitem('phases', 'new-commit', |
|
868 | 871 | default='draft', |
|
869 | 872 | ) |
|
870 | 873 | coreconfigitem('phases', 'publish', |
|
871 | 874 | default=True, |
|
872 | 875 | ) |
|
873 | 876 | coreconfigitem('profiling', 'enabled', |
|
874 | 877 | default=False, |
|
875 | 878 | ) |
|
876 | 879 | coreconfigitem('profiling', 'format', |
|
877 | 880 | default='text', |
|
878 | 881 | ) |
|
879 | 882 | coreconfigitem('profiling', 'freq', |
|
880 | 883 | default=1000, |
|
881 | 884 | ) |
|
882 | 885 | coreconfigitem('profiling', 'limit', |
|
883 | 886 | default=30, |
|
884 | 887 | ) |
|
885 | 888 | coreconfigitem('profiling', 'nested', |
|
886 | 889 | default=0, |
|
887 | 890 | ) |
|
888 | 891 | coreconfigitem('profiling', 'output', |
|
889 | 892 | default=None, |
|
890 | 893 | ) |
|
891 | 894 | coreconfigitem('profiling', 'showmax', |
|
892 | 895 | default=0.999, |
|
893 | 896 | ) |
|
894 | 897 | coreconfigitem('profiling', 'showmin', |
|
895 | 898 | default=dynamicdefault, |
|
896 | 899 | ) |
|
897 | 900 | coreconfigitem('profiling', 'sort', |
|
898 | 901 | default='inlinetime', |
|
899 | 902 | ) |
|
900 | 903 | coreconfigitem('profiling', 'statformat', |
|
901 | 904 | default='hotpath', |
|
902 | 905 | ) |
|
903 | 906 | coreconfigitem('profiling', 'time-track', |
|
904 | 907 | default='cpu', |
|
905 | 908 | ) |
|
906 | 909 | coreconfigitem('profiling', 'type', |
|
907 | 910 | default='stat', |
|
908 | 911 | ) |
|
909 | 912 | coreconfigitem('progress', 'assume-tty', |
|
910 | 913 | default=False, |
|
911 | 914 | ) |
|
912 | 915 | coreconfigitem('progress', 'changedelay', |
|
913 | 916 | default=1, |
|
914 | 917 | ) |
|
915 | 918 | coreconfigitem('progress', 'clear-complete', |
|
916 | 919 | default=True, |
|
917 | 920 | ) |
|
918 | 921 | coreconfigitem('progress', 'debug', |
|
919 | 922 | default=False, |
|
920 | 923 | ) |
|
921 | 924 | coreconfigitem('progress', 'delay', |
|
922 | 925 | default=3, |
|
923 | 926 | ) |
|
924 | 927 | coreconfigitem('progress', 'disable', |
|
925 | 928 | default=False, |
|
926 | 929 | ) |
|
927 | 930 | coreconfigitem('progress', 'estimateinterval', |
|
928 | 931 | default=60.0, |
|
929 | 932 | ) |
|
930 | 933 | coreconfigitem('progress', 'format', |
|
931 | 934 | default=lambda: ['topic', 'bar', 'number', 'estimate'], |
|
932 | 935 | ) |
|
933 | 936 | coreconfigitem('progress', 'refresh', |
|
934 | 937 | default=0.1, |
|
935 | 938 | ) |
|
936 | 939 | coreconfigitem('progress', 'width', |
|
937 | 940 | default=dynamicdefault, |
|
938 | 941 | ) |
|
939 | 942 | coreconfigitem('push', 'pushvars.server', |
|
940 | 943 | default=False, |
|
941 | 944 | ) |
|
942 | 945 | coreconfigitem('storage', 'revlog.optimize-delta-parent-choice', |
|
943 | 946 | default=True, |
|
944 | 947 | alias=[('format', 'aggressivemergedeltas')], |
|
945 | 948 | ) |
|
946 | 949 | coreconfigitem('server', 'bookmarks-pushkey-compat', |
|
947 | 950 | default=True, |
|
948 | 951 | ) |
|
949 | 952 | coreconfigitem('server', 'bundle1', |
|
950 | 953 | default=True, |
|
951 | 954 | ) |
|
952 | 955 | coreconfigitem('server', 'bundle1gd', |
|
953 | 956 | default=None, |
|
954 | 957 | ) |
|
955 | 958 | coreconfigitem('server', 'bundle1.pull', |
|
956 | 959 | default=None, |
|
957 | 960 | ) |
|
958 | 961 | coreconfigitem('server', 'bundle1gd.pull', |
|
959 | 962 | default=None, |
|
960 | 963 | ) |
|
961 | 964 | coreconfigitem('server', 'bundle1.push', |
|
962 | 965 | default=None, |
|
963 | 966 | ) |
|
964 | 967 | coreconfigitem('server', 'bundle1gd.push', |
|
965 | 968 | default=None, |
|
966 | 969 | ) |
|
967 | 970 | coreconfigitem('server', 'compressionengines', |
|
968 | 971 | default=list, |
|
969 | 972 | ) |
|
970 | 973 | coreconfigitem('server', 'concurrent-push-mode', |
|
971 | 974 | default='strict', |
|
972 | 975 | ) |
|
973 | 976 | coreconfigitem('server', 'disablefullbundle', |
|
974 | 977 | default=False, |
|
975 | 978 | ) |
|
976 | 979 | coreconfigitem('server', 'maxhttpheaderlen', |
|
977 | 980 | default=1024, |
|
978 | 981 | ) |
|
979 | 982 | coreconfigitem('server', 'pullbundle', |
|
980 | 983 | default=False, |
|
981 | 984 | ) |
|
982 | 985 | coreconfigitem('server', 'preferuncompressed', |
|
983 | 986 | default=False, |
|
984 | 987 | ) |
|
985 | 988 | coreconfigitem('server', 'streamunbundle', |
|
986 | 989 | default=False, |
|
987 | 990 | ) |
|
988 | 991 | coreconfigitem('server', 'uncompressed', |
|
989 | 992 | default=True, |
|
990 | 993 | ) |
|
991 | 994 | coreconfigitem('server', 'uncompressedallowsecret', |
|
992 | 995 | default=False, |
|
993 | 996 | ) |
|
994 | 997 | coreconfigitem('server', 'validate', |
|
995 | 998 | default=False, |
|
996 | 999 | ) |
|
997 | 1000 | coreconfigitem('server', 'zliblevel', |
|
998 | 1001 | default=-1, |
|
999 | 1002 | ) |
|
1000 | 1003 | coreconfigitem('server', 'zstdlevel', |
|
1001 | 1004 | default=3, |
|
1002 | 1005 | ) |
|
1003 | 1006 | coreconfigitem('share', 'pool', |
|
1004 | 1007 | default=None, |
|
1005 | 1008 | ) |
|
1006 | 1009 | coreconfigitem('share', 'poolnaming', |
|
1007 | 1010 | default='identity', |
|
1008 | 1011 | ) |
|
1009 | 1012 | coreconfigitem('smtp', 'host', |
|
1010 | 1013 | default=None, |
|
1011 | 1014 | ) |
|
1012 | 1015 | coreconfigitem('smtp', 'local_hostname', |
|
1013 | 1016 | default=None, |
|
1014 | 1017 | ) |
|
1015 | 1018 | coreconfigitem('smtp', 'password', |
|
1016 | 1019 | default=None, |
|
1017 | 1020 | ) |
|
1018 | 1021 | coreconfigitem('smtp', 'port', |
|
1019 | 1022 | default=dynamicdefault, |
|
1020 | 1023 | ) |
|
1021 | 1024 | coreconfigitem('smtp', 'tls', |
|
1022 | 1025 | default='none', |
|
1023 | 1026 | ) |
|
1024 | 1027 | coreconfigitem('smtp', 'username', |
|
1025 | 1028 | default=None, |
|
1026 | 1029 | ) |
|
1027 | 1030 | coreconfigitem('sparse', 'missingwarning', |
|
1028 | 1031 | default=True, |
|
1029 | 1032 | ) |
|
1030 | 1033 | coreconfigitem('subrepos', 'allowed', |
|
1031 | 1034 | default=dynamicdefault, # to make backporting simpler |
|
1032 | 1035 | ) |
|
1033 | 1036 | coreconfigitem('subrepos', 'hg:allowed', |
|
1034 | 1037 | default=dynamicdefault, |
|
1035 | 1038 | ) |
|
1036 | 1039 | coreconfigitem('subrepos', 'git:allowed', |
|
1037 | 1040 | default=dynamicdefault, |
|
1038 | 1041 | ) |
|
1039 | 1042 | coreconfigitem('subrepos', 'svn:allowed', |
|
1040 | 1043 | default=dynamicdefault, |
|
1041 | 1044 | ) |
|
1042 | 1045 | coreconfigitem('templates', '.*', |
|
1043 | 1046 | default=None, |
|
1044 | 1047 | generic=True, |
|
1045 | 1048 | ) |
|
1046 | 1049 | coreconfigitem('trusted', 'groups', |
|
1047 | 1050 | default=list, |
|
1048 | 1051 | ) |
|
1049 | 1052 | coreconfigitem('trusted', 'users', |
|
1050 | 1053 | default=list, |
|
1051 | 1054 | ) |
|
1052 | 1055 | coreconfigitem('ui', '_usedassubrepo', |
|
1053 | 1056 | default=False, |
|
1054 | 1057 | ) |
|
1055 | 1058 | coreconfigitem('ui', 'allowemptycommit', |
|
1056 | 1059 | default=False, |
|
1057 | 1060 | ) |
|
1058 | 1061 | coreconfigitem('ui', 'archivemeta', |
|
1059 | 1062 | default=True, |
|
1060 | 1063 | ) |
|
1061 | 1064 | coreconfigitem('ui', 'askusername', |
|
1062 | 1065 | default=False, |
|
1063 | 1066 | ) |
|
1064 | 1067 | coreconfigitem('ui', 'clonebundlefallback', |
|
1065 | 1068 | default=False, |
|
1066 | 1069 | ) |
|
1067 | 1070 | coreconfigitem('ui', 'clonebundleprefers', |
|
1068 | 1071 | default=list, |
|
1069 | 1072 | ) |
|
1070 | 1073 | coreconfigitem('ui', 'clonebundles', |
|
1071 | 1074 | default=True, |
|
1072 | 1075 | ) |
|
1073 | 1076 | coreconfigitem('ui', 'color', |
|
1074 | 1077 | default='auto', |
|
1075 | 1078 | ) |
|
1076 | 1079 | coreconfigitem('ui', 'commitsubrepos', |
|
1077 | 1080 | default=False, |
|
1078 | 1081 | ) |
|
1079 | 1082 | coreconfigitem('ui', 'debug', |
|
1080 | 1083 | default=False, |
|
1081 | 1084 | ) |
|
1082 | 1085 | coreconfigitem('ui', 'debugger', |
|
1083 | 1086 | default=None, |
|
1084 | 1087 | ) |
|
1085 | 1088 | coreconfigitem('ui', 'editor', |
|
1086 | 1089 | default=dynamicdefault, |
|
1087 | 1090 | ) |
|
1088 | 1091 | coreconfigitem('ui', 'fallbackencoding', |
|
1089 | 1092 | default=None, |
|
1090 | 1093 | ) |
|
1091 | 1094 | coreconfigitem('ui', 'forcecwd', |
|
1092 | 1095 | default=None, |
|
1093 | 1096 | ) |
|
1094 | 1097 | coreconfigitem('ui', 'forcemerge', |
|
1095 | 1098 | default=None, |
|
1096 | 1099 | ) |
|
1097 | 1100 | coreconfigitem('ui', 'formatdebug', |
|
1098 | 1101 | default=False, |
|
1099 | 1102 | ) |
|
1100 | 1103 | coreconfigitem('ui', 'formatjson', |
|
1101 | 1104 | default=False, |
|
1102 | 1105 | ) |
|
1103 | 1106 | coreconfigitem('ui', 'formatted', |
|
1104 | 1107 | default=None, |
|
1105 | 1108 | ) |
|
1106 | 1109 | coreconfigitem('ui', 'graphnodetemplate', |
|
1107 | 1110 | default=None, |
|
1108 | 1111 | ) |
|
1109 | 1112 | coreconfigitem('ui', 'history-editing-backup', |
|
1110 | 1113 | default=True, |
|
1111 | 1114 | ) |
|
1112 | 1115 | coreconfigitem('ui', 'interactive', |
|
1113 | 1116 | default=None, |
|
1114 | 1117 | ) |
|
1115 | 1118 | coreconfigitem('ui', 'interface', |
|
1116 | 1119 | default=None, |
|
1117 | 1120 | ) |
|
1118 | 1121 | coreconfigitem('ui', 'interface.chunkselector', |
|
1119 | 1122 | default=None, |
|
1120 | 1123 | ) |
|
1121 | 1124 | coreconfigitem('ui', 'large-file-limit', |
|
1122 | 1125 | default=10000000, |
|
1123 | 1126 | ) |
|
1124 | 1127 | coreconfigitem('ui', 'logblockedtimes', |
|
1125 | 1128 | default=False, |
|
1126 | 1129 | ) |
|
1127 | 1130 | coreconfigitem('ui', 'logtemplate', |
|
1128 | 1131 | default=None, |
|
1129 | 1132 | ) |
|
1130 | 1133 | coreconfigitem('ui', 'merge', |
|
1131 | 1134 | default=None, |
|
1132 | 1135 | ) |
|
1133 | 1136 | coreconfigitem('ui', 'mergemarkers', |
|
1134 | 1137 | default='basic', |
|
1135 | 1138 | ) |
|
1136 | 1139 | coreconfigitem('ui', 'mergemarkertemplate', |
|
1137 | 1140 | default=('{node|short} ' |
|
1138 | 1141 | '{ifeq(tags, "tip", "", ' |
|
1139 | 1142 | 'ifeq(tags, "", "", "{tags} "))}' |
|
1140 | 1143 | '{if(bookmarks, "{bookmarks} ")}' |
|
1141 | 1144 | '{ifeq(branch, "default", "", "{branch} ")}' |
|
1142 | 1145 | '- {author|user}: {desc|firstline}') |
|
1143 | 1146 | ) |
|
1144 | 1147 | coreconfigitem('ui', 'nontty', |
|
1145 | 1148 | default=False, |
|
1146 | 1149 | ) |
|
1147 | 1150 | coreconfigitem('ui', 'origbackuppath', |
|
1148 | 1151 | default=None, |
|
1149 | 1152 | ) |
|
1150 | 1153 | coreconfigitem('ui', 'paginate', |
|
1151 | 1154 | default=True, |
|
1152 | 1155 | ) |
|
1153 | 1156 | coreconfigitem('ui', 'patch', |
|
1154 | 1157 | default=None, |
|
1155 | 1158 | ) |
|
1156 | 1159 | coreconfigitem('ui', 'portablefilenames', |
|
1157 | 1160 | default='warn', |
|
1158 | 1161 | ) |
|
1159 | 1162 | coreconfigitem('ui', 'promptecho', |
|
1160 | 1163 | default=False, |
|
1161 | 1164 | ) |
|
1162 | 1165 | coreconfigitem('ui', 'quiet', |
|
1163 | 1166 | default=False, |
|
1164 | 1167 | ) |
|
1165 | 1168 | coreconfigitem('ui', 'quietbookmarkmove', |
|
1166 | 1169 | default=False, |
|
1167 | 1170 | ) |
|
1168 | 1171 | coreconfigitem('ui', 'remotecmd', |
|
1169 | 1172 | default='hg', |
|
1170 | 1173 | ) |
|
1171 | 1174 | coreconfigitem('ui', 'report_untrusted', |
|
1172 | 1175 | default=True, |
|
1173 | 1176 | ) |
|
1174 | 1177 | coreconfigitem('ui', 'rollback', |
|
1175 | 1178 | default=True, |
|
1176 | 1179 | ) |
|
1177 | 1180 | coreconfigitem('ui', 'signal-safe-lock', |
|
1178 | 1181 | default=True, |
|
1179 | 1182 | ) |
|
1180 | 1183 | coreconfigitem('ui', 'slash', |
|
1181 | 1184 | default=False, |
|
1182 | 1185 | ) |
|
1183 | 1186 | coreconfigitem('ui', 'ssh', |
|
1184 | 1187 | default='ssh', |
|
1185 | 1188 | ) |
|
1186 | 1189 | coreconfigitem('ui', 'ssherrorhint', |
|
1187 | 1190 | default=None, |
|
1188 | 1191 | ) |
|
1189 | 1192 | coreconfigitem('ui', 'statuscopies', |
|
1190 | 1193 | default=False, |
|
1191 | 1194 | ) |
|
1192 | 1195 | coreconfigitem('ui', 'strict', |
|
1193 | 1196 | default=False, |
|
1194 | 1197 | ) |
|
1195 | 1198 | coreconfigitem('ui', 'style', |
|
1196 | 1199 | default='', |
|
1197 | 1200 | ) |
|
1198 | 1201 | coreconfigitem('ui', 'supportcontact', |
|
1199 | 1202 | default=None, |
|
1200 | 1203 | ) |
|
1201 | 1204 | coreconfigitem('ui', 'textwidth', |
|
1202 | 1205 | default=78, |
|
1203 | 1206 | ) |
|
1204 | 1207 | coreconfigitem('ui', 'timeout', |
|
1205 | 1208 | default='600', |
|
1206 | 1209 | ) |
|
1207 | 1210 | coreconfigitem('ui', 'timeout.warn', |
|
1208 | 1211 | default=0, |
|
1209 | 1212 | ) |
|
1210 | 1213 | coreconfigitem('ui', 'traceback', |
|
1211 | 1214 | default=False, |
|
1212 | 1215 | ) |
|
1213 | 1216 | coreconfigitem('ui', 'tweakdefaults', |
|
1214 | 1217 | default=False, |
|
1215 | 1218 | ) |
|
1216 | 1219 | coreconfigitem('ui', 'username', |
|
1217 | 1220 | alias=[('ui', 'user')] |
|
1218 | 1221 | ) |
|
1219 | 1222 | coreconfigitem('ui', 'verbose', |
|
1220 | 1223 | default=False, |
|
1221 | 1224 | ) |
|
1222 | 1225 | coreconfigitem('verify', 'skipflags', |
|
1223 | 1226 | default=None, |
|
1224 | 1227 | ) |
|
1225 | 1228 | coreconfigitem('web', 'allowbz2', |
|
1226 | 1229 | default=False, |
|
1227 | 1230 | ) |
|
1228 | 1231 | coreconfigitem('web', 'allowgz', |
|
1229 | 1232 | default=False, |
|
1230 | 1233 | ) |
|
1231 | 1234 | coreconfigitem('web', 'allow-pull', |
|
1232 | 1235 | alias=[('web', 'allowpull')], |
|
1233 | 1236 | default=True, |
|
1234 | 1237 | ) |
|
1235 | 1238 | coreconfigitem('web', 'allow-push', |
|
1236 | 1239 | alias=[('web', 'allow_push')], |
|
1237 | 1240 | default=list, |
|
1238 | 1241 | ) |
|
1239 | 1242 | coreconfigitem('web', 'allowzip', |
|
1240 | 1243 | default=False, |
|
1241 | 1244 | ) |
|
1242 | 1245 | coreconfigitem('web', 'archivesubrepos', |
|
1243 | 1246 | default=False, |
|
1244 | 1247 | ) |
|
1245 | 1248 | coreconfigitem('web', 'cache', |
|
1246 | 1249 | default=True, |
|
1247 | 1250 | ) |
|
1248 | 1251 | coreconfigitem('web', 'contact', |
|
1249 | 1252 | default=None, |
|
1250 | 1253 | ) |
|
1251 | 1254 | coreconfigitem('web', 'deny_push', |
|
1252 | 1255 | default=list, |
|
1253 | 1256 | ) |
|
1254 | 1257 | coreconfigitem('web', 'guessmime', |
|
1255 | 1258 | default=False, |
|
1256 | 1259 | ) |
|
1257 | 1260 | coreconfigitem('web', 'hidden', |
|
1258 | 1261 | default=False, |
|
1259 | 1262 | ) |
|
1260 | 1263 | coreconfigitem('web', 'labels', |
|
1261 | 1264 | default=list, |
|
1262 | 1265 | ) |
|
1263 | 1266 | coreconfigitem('web', 'logoimg', |
|
1264 | 1267 | default='hglogo.png', |
|
1265 | 1268 | ) |
|
1266 | 1269 | coreconfigitem('web', 'logourl', |
|
1267 | 1270 | default='https://mercurial-scm.org/', |
|
1268 | 1271 | ) |
|
1269 | 1272 | coreconfigitem('web', 'accesslog', |
|
1270 | 1273 | default='-', |
|
1271 | 1274 | ) |
|
1272 | 1275 | coreconfigitem('web', 'address', |
|
1273 | 1276 | default='', |
|
1274 | 1277 | ) |
|
1275 | 1278 | coreconfigitem('web', 'allow-archive', |
|
1276 | 1279 | alias=[('web', 'allow_archive')], |
|
1277 | 1280 | default=list, |
|
1278 | 1281 | ) |
|
1279 | 1282 | coreconfigitem('web', 'allow_read', |
|
1280 | 1283 | default=list, |
|
1281 | 1284 | ) |
|
1282 | 1285 | coreconfigitem('web', 'baseurl', |
|
1283 | 1286 | default=None, |
|
1284 | 1287 | ) |
|
1285 | 1288 | coreconfigitem('web', 'cacerts', |
|
1286 | 1289 | default=None, |
|
1287 | 1290 | ) |
|
1288 | 1291 | coreconfigitem('web', 'certificate', |
|
1289 | 1292 | default=None, |
|
1290 | 1293 | ) |
|
1291 | 1294 | coreconfigitem('web', 'collapse', |
|
1292 | 1295 | default=False, |
|
1293 | 1296 | ) |
|
1294 | 1297 | coreconfigitem('web', 'csp', |
|
1295 | 1298 | default=None, |
|
1296 | 1299 | ) |
|
1297 | 1300 | coreconfigitem('web', 'deny_read', |
|
1298 | 1301 | default=list, |
|
1299 | 1302 | ) |
|
1300 | 1303 | coreconfigitem('web', 'descend', |
|
1301 | 1304 | default=True, |
|
1302 | 1305 | ) |
|
1303 | 1306 | coreconfigitem('web', 'description', |
|
1304 | 1307 | default="", |
|
1305 | 1308 | ) |
|
1306 | 1309 | coreconfigitem('web', 'encoding', |
|
1307 | 1310 | default=lambda: encoding.encoding, |
|
1308 | 1311 | ) |
|
1309 | 1312 | coreconfigitem('web', 'errorlog', |
|
1310 | 1313 | default='-', |
|
1311 | 1314 | ) |
|
1312 | 1315 | coreconfigitem('web', 'ipv6', |
|
1313 | 1316 | default=False, |
|
1314 | 1317 | ) |
|
1315 | 1318 | coreconfigitem('web', 'maxchanges', |
|
1316 | 1319 | default=10, |
|
1317 | 1320 | ) |
|
1318 | 1321 | coreconfigitem('web', 'maxfiles', |
|
1319 | 1322 | default=10, |
|
1320 | 1323 | ) |
|
1321 | 1324 | coreconfigitem('web', 'maxshortchanges', |
|
1322 | 1325 | default=60, |
|
1323 | 1326 | ) |
|
1324 | 1327 | coreconfigitem('web', 'motd', |
|
1325 | 1328 | default='', |
|
1326 | 1329 | ) |
|
1327 | 1330 | coreconfigitem('web', 'name', |
|
1328 | 1331 | default=dynamicdefault, |
|
1329 | 1332 | ) |
|
1330 | 1333 | coreconfigitem('web', 'port', |
|
1331 | 1334 | default=8000, |
|
1332 | 1335 | ) |
|
1333 | 1336 | coreconfigitem('web', 'prefix', |
|
1334 | 1337 | default='', |
|
1335 | 1338 | ) |
|
1336 | 1339 | coreconfigitem('web', 'push_ssl', |
|
1337 | 1340 | default=True, |
|
1338 | 1341 | ) |
|
1339 | 1342 | coreconfigitem('web', 'refreshinterval', |
|
1340 | 1343 | default=20, |
|
1341 | 1344 | ) |
|
1342 | 1345 | coreconfigitem('web', 'server-header', |
|
1343 | 1346 | default=None, |
|
1344 | 1347 | ) |
|
1345 | 1348 | coreconfigitem('web', 'staticurl', |
|
1346 | 1349 | default=None, |
|
1347 | 1350 | ) |
|
1348 | 1351 | coreconfigitem('web', 'stripes', |
|
1349 | 1352 | default=1, |
|
1350 | 1353 | ) |
|
1351 | 1354 | coreconfigitem('web', 'style', |
|
1352 | 1355 | default='paper', |
|
1353 | 1356 | ) |
|
1354 | 1357 | coreconfigitem('web', 'templates', |
|
1355 | 1358 | default=None, |
|
1356 | 1359 | ) |
|
1357 | 1360 | coreconfigitem('web', 'view', |
|
1358 | 1361 | default='served', |
|
1359 | 1362 | ) |
|
1360 | 1363 | coreconfigitem('worker', 'backgroundclose', |
|
1361 | 1364 | default=dynamicdefault, |
|
1362 | 1365 | ) |
|
1363 | 1366 | # Windows defaults to a limit of 512 open files. A buffer of 128 |
|
1364 | 1367 | # should give us enough headway. |
|
1365 | 1368 | coreconfigitem('worker', 'backgroundclosemaxqueue', |
|
1366 | 1369 | default=384, |
|
1367 | 1370 | ) |
|
1368 | 1371 | coreconfigitem('worker', 'backgroundcloseminfilecount', |
|
1369 | 1372 | default=2048, |
|
1370 | 1373 | ) |
|
1371 | 1374 | coreconfigitem('worker', 'backgroundclosethreadcount', |
|
1372 | 1375 | default=4, |
|
1373 | 1376 | ) |
|
1374 | 1377 | coreconfigitem('worker', 'enabled', |
|
1375 | 1378 | default=True, |
|
1376 | 1379 | ) |
|
1377 | 1380 | coreconfigitem('worker', 'numcpus', |
|
1378 | 1381 | default=None, |
|
1379 | 1382 | ) |
|
1380 | 1383 | |
|
1381 | 1384 | # Rebase related configuration moved to core because other extension are doing |
|
1382 | 1385 | # strange things. For example, shelve import the extensions to reuse some bit |
|
1383 | 1386 | # without formally loading it. |
|
1384 | 1387 | coreconfigitem('commands', 'rebase.requiredest', |
|
1385 | 1388 | default=False, |
|
1386 | 1389 | ) |
|
1387 | 1390 | coreconfigitem('experimental', 'rebaseskipobsolete', |
|
1388 | 1391 | default=True, |
|
1389 | 1392 | ) |
|
1390 | 1393 | coreconfigitem('rebase', 'singletransaction', |
|
1391 | 1394 | default=False, |
|
1392 | 1395 | ) |
|
1393 | 1396 | coreconfigitem('rebase', 'experimental.inmemory', |
|
1394 | 1397 | default=False, |
|
1395 | 1398 | ) |
@@ -1,990 +1,996 | |||
|
1 | 1 | # filemerge.py - file-level merge handling for Mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> |
|
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 | from __future__ import absolute_import |
|
9 | 9 | |
|
10 | 10 | import contextlib |
|
11 | 11 | import os |
|
12 | 12 | import re |
|
13 | 13 | import shutil |
|
14 | 14 | |
|
15 | 15 | from .i18n import _ |
|
16 | 16 | from .node import nullid, short |
|
17 | 17 | |
|
18 | 18 | from . import ( |
|
19 | 19 | encoding, |
|
20 | 20 | error, |
|
21 | 21 | formatter, |
|
22 | 22 | match, |
|
23 | 23 | pycompat, |
|
24 | 24 | registrar, |
|
25 | 25 | scmutil, |
|
26 | 26 | simplemerge, |
|
27 | 27 | tagmerge, |
|
28 | 28 | templatekw, |
|
29 | 29 | templater, |
|
30 | 30 | util, |
|
31 | 31 | ) |
|
32 | 32 | |
|
33 | 33 | from .utils import ( |
|
34 | 34 | procutil, |
|
35 | 35 | stringutil, |
|
36 | 36 | ) |
|
37 | 37 | |
|
38 | 38 | def _toolstr(ui, tool, part, *args): |
|
39 | 39 | return ui.config("merge-tools", tool + "." + part, *args) |
|
40 | 40 | |
|
41 | 41 | def _toolbool(ui, tool, part,*args): |
|
42 | 42 | return ui.configbool("merge-tools", tool + "." + part, *args) |
|
43 | 43 | |
|
44 | 44 | def _toollist(ui, tool, part): |
|
45 | 45 | return ui.configlist("merge-tools", tool + "." + part) |
|
46 | 46 | |
|
47 | 47 | internals = {} |
|
48 | 48 | # Merge tools to document. |
|
49 | 49 | internalsdoc = {} |
|
50 | 50 | |
|
51 | 51 | internaltool = registrar.internalmerge() |
|
52 | 52 | |
|
53 | 53 | # internal tool merge types |
|
54 | 54 | nomerge = internaltool.nomerge |
|
55 | 55 | mergeonly = internaltool.mergeonly # just the full merge, no premerge |
|
56 | 56 | fullmerge = internaltool.fullmerge # both premerge and merge |
|
57 | 57 | |
|
58 | 58 | _localchangedotherdeletedmsg = _( |
|
59 | 59 | "local%(l)s changed %(fd)s which other%(o)s deleted\n" |
|
60 | 60 | "use (c)hanged version, (d)elete, or leave (u)nresolved?" |
|
61 | 61 | "$$ &Changed $$ &Delete $$ &Unresolved") |
|
62 | 62 | |
|
63 | 63 | _otherchangedlocaldeletedmsg = _( |
|
64 | 64 | "other%(o)s changed %(fd)s which local%(l)s deleted\n" |
|
65 | 65 | "use (c)hanged version, leave (d)eleted, or " |
|
66 | 66 | "leave (u)nresolved?" |
|
67 | 67 | "$$ &Changed $$ &Deleted $$ &Unresolved") |
|
68 | 68 | |
|
69 | 69 | class absentfilectx(object): |
|
70 | 70 | """Represents a file that's ostensibly in a context but is actually not |
|
71 | 71 | present in it. |
|
72 | 72 | |
|
73 | 73 | This is here because it's very specific to the filemerge code for now -- |
|
74 | 74 | other code is likely going to break with the values this returns.""" |
|
75 | 75 | def __init__(self, ctx, f): |
|
76 | 76 | self._ctx = ctx |
|
77 | 77 | self._f = f |
|
78 | 78 | |
|
79 | 79 | def path(self): |
|
80 | 80 | return self._f |
|
81 | 81 | |
|
82 | 82 | def size(self): |
|
83 | 83 | return None |
|
84 | 84 | |
|
85 | 85 | def data(self): |
|
86 | 86 | return None |
|
87 | 87 | |
|
88 | 88 | def filenode(self): |
|
89 | 89 | return nullid |
|
90 | 90 | |
|
91 | 91 | _customcmp = True |
|
92 | 92 | def cmp(self, fctx): |
|
93 | 93 | """compare with other file context |
|
94 | 94 | |
|
95 | 95 | returns True if different from fctx. |
|
96 | 96 | """ |
|
97 | 97 | return not (fctx.isabsent() and |
|
98 | 98 | fctx.ctx() == self.ctx() and |
|
99 | 99 | fctx.path() == self.path()) |
|
100 | 100 | |
|
101 | 101 | def flags(self): |
|
102 | 102 | return '' |
|
103 | 103 | |
|
104 | 104 | def changectx(self): |
|
105 | 105 | return self._ctx |
|
106 | 106 | |
|
107 | 107 | def isbinary(self): |
|
108 | 108 | return False |
|
109 | 109 | |
|
110 | 110 | def isabsent(self): |
|
111 | 111 | return True |
|
112 | 112 | |
|
113 | 113 | def _findtool(ui, tool): |
|
114 | 114 | if tool in internals: |
|
115 | 115 | return tool |
|
116 | 116 | cmd = _toolstr(ui, tool, "executable", tool) |
|
117 | 117 | if cmd.startswith('python:'): |
|
118 | 118 | return cmd |
|
119 | 119 | return findexternaltool(ui, tool) |
|
120 | 120 | |
|
121 | 121 | def _quotetoolpath(cmd): |
|
122 | 122 | if cmd.startswith('python:'): |
|
123 | 123 | return cmd |
|
124 | 124 | return procutil.shellquote(cmd) |
|
125 | 125 | |
|
126 | 126 | def findexternaltool(ui, tool): |
|
127 | 127 | for kn in ("regkey", "regkeyalt"): |
|
128 | 128 | k = _toolstr(ui, tool, kn) |
|
129 | 129 | if not k: |
|
130 | 130 | continue |
|
131 | 131 | p = util.lookupreg(k, _toolstr(ui, tool, "regname")) |
|
132 | 132 | if p: |
|
133 | 133 | p = procutil.findexe(p + _toolstr(ui, tool, "regappend", "")) |
|
134 | 134 | if p: |
|
135 | 135 | return p |
|
136 | 136 | exe = _toolstr(ui, tool, "executable", tool) |
|
137 | 137 | return procutil.findexe(util.expandpath(exe)) |
|
138 | 138 | |
|
139 | 139 | def _picktool(repo, ui, path, binary, symlink, changedelete): |
|
140 | strictcheck = ui.configbool('merge', 'strict-capability-check') | |
|
141 | ||
|
140 | 142 | def hascapability(tool, capability, strict=False): |
|
141 | 143 | if strict and tool in internals: |
|
142 | 144 | if internals[tool].capabilities.get(capability): |
|
143 | 145 | return True |
|
144 | 146 | return _toolbool(ui, tool, capability) |
|
145 | 147 | |
|
146 | 148 | def supportscd(tool): |
|
147 | 149 | return tool in internals and internals[tool].mergetype == nomerge |
|
148 | 150 | |
|
149 | 151 | def check(tool, pat, symlink, binary, changedelete): |
|
150 | 152 | tmsg = tool |
|
151 | 153 | if pat: |
|
152 | 154 | tmsg = _("%s (for pattern %s)") % (tool, pat) |
|
153 | 155 | if not _findtool(ui, tool): |
|
154 | 156 | if pat: # explicitly requested tool deserves a warning |
|
155 | 157 | ui.warn(_("couldn't find merge tool %s\n") % tmsg) |
|
156 | 158 | else: # configured but non-existing tools are more silent |
|
157 | 159 | ui.note(_("couldn't find merge tool %s\n") % tmsg) |
|
158 | elif symlink and not hascapability(tool, "symlink"): | |
|
160 | elif symlink and not hascapability(tool, "symlink", strictcheck): | |
|
159 | 161 | ui.warn(_("tool %s can't handle symlinks\n") % tmsg) |
|
160 | elif binary and not hascapability(tool, "binary"): | |
|
162 | elif binary and not hascapability(tool, "binary", strictcheck): | |
|
161 | 163 | ui.warn(_("tool %s can't handle binary\n") % tmsg) |
|
162 | 164 | elif changedelete and not supportscd(tool): |
|
163 | 165 | # the nomerge tools are the only tools that support change/delete |
|
164 | 166 | # conflicts |
|
165 | 167 | pass |
|
166 | 168 | elif not procutil.gui() and _toolbool(ui, tool, "gui"): |
|
167 | 169 | ui.warn(_("tool %s requires a GUI\n") % tmsg) |
|
168 | 170 | else: |
|
169 | 171 | return True |
|
170 | 172 | return False |
|
171 | 173 | |
|
172 | 174 | # internal config: ui.forcemerge |
|
173 | 175 | # forcemerge comes from command line arguments, highest priority |
|
174 | 176 | force = ui.config('ui', 'forcemerge') |
|
175 | 177 | if force: |
|
176 | 178 | toolpath = _findtool(ui, force) |
|
177 | 179 | if changedelete and not supportscd(toolpath): |
|
178 | 180 | return ":prompt", None |
|
179 | 181 | else: |
|
180 | 182 | if toolpath: |
|
181 | 183 | return (force, _quotetoolpath(toolpath)) |
|
182 | 184 | else: |
|
183 | 185 | # mimic HGMERGE if given tool not found |
|
184 | 186 | return (force, force) |
|
185 | 187 | |
|
186 | 188 | # HGMERGE takes next precedence |
|
187 | 189 | hgmerge = encoding.environ.get("HGMERGE") |
|
188 | 190 | if hgmerge: |
|
189 | 191 | if changedelete and not supportscd(hgmerge): |
|
190 | 192 | return ":prompt", None |
|
191 | 193 | else: |
|
192 | 194 | return (hgmerge, hgmerge) |
|
193 | 195 | |
|
194 | 196 | # then patterns |
|
197 | ||
|
198 | # whether binary capability should be checked strictly | |
|
199 | binarycap = binary and strictcheck | |
|
200 | ||
|
195 | 201 | for pat, tool in ui.configitems("merge-patterns"): |
|
196 | 202 | mf = match.match(repo.root, '', [pat]) |
|
197 |
if mf(path) and check(tool, pat, symlink, |
|
|
203 | if mf(path) and check(tool, pat, symlink, binarycap, changedelete): | |
|
198 | 204 | if binary and not hascapability(tool, "binary", strict=True): |
|
199 | 205 | ui.warn(_("warning: check merge-patterns configurations," |
|
200 | 206 | " if %r for binary file %r is unintentional\n" |
|
201 | 207 | "(see 'hg help merge-tools'" |
|
202 | 208 | " for binary files capability)\n") |
|
203 | 209 | % (pycompat.bytestr(tool), pycompat.bytestr(path))) |
|
204 | 210 | toolpath = _findtool(ui, tool) |
|
205 | 211 | return (tool, _quotetoolpath(toolpath)) |
|
206 | 212 | |
|
207 | 213 | # then merge tools |
|
208 | 214 | tools = {} |
|
209 | 215 | disabled = set() |
|
210 | 216 | for k, v in ui.configitems("merge-tools"): |
|
211 | 217 | t = k.split('.')[0] |
|
212 | 218 | if t not in tools: |
|
213 | 219 | tools[t] = int(_toolstr(ui, t, "priority")) |
|
214 | 220 | if _toolbool(ui, t, "disabled"): |
|
215 | 221 | disabled.add(t) |
|
216 | 222 | names = tools.keys() |
|
217 | 223 | tools = sorted([(-p, tool) for tool, p in tools.items() |
|
218 | 224 | if tool not in disabled]) |
|
219 | 225 | uimerge = ui.config("ui", "merge") |
|
220 | 226 | if uimerge: |
|
221 | 227 | # external tools defined in uimerge won't be able to handle |
|
222 | 228 | # change/delete conflicts |
|
223 | 229 | if check(uimerge, path, symlink, binary, changedelete): |
|
224 | 230 | if uimerge not in names and not changedelete: |
|
225 | 231 | return (uimerge, uimerge) |
|
226 | 232 | tools.insert(0, (None, uimerge)) # highest priority |
|
227 | 233 | tools.append((None, "hgmerge")) # the old default, if found |
|
228 | 234 | for p, t in tools: |
|
229 | 235 | if check(t, None, symlink, binary, changedelete): |
|
230 | 236 | toolpath = _findtool(ui, t) |
|
231 | 237 | return (t, _quotetoolpath(toolpath)) |
|
232 | 238 | |
|
233 | 239 | # internal merge or prompt as last resort |
|
234 | 240 | if symlink or binary or changedelete: |
|
235 | 241 | if not changedelete and len(tools): |
|
236 | 242 | # any tool is rejected by capability for symlink or binary |
|
237 | 243 | ui.warn(_("no tool found to merge %s\n") % path) |
|
238 | 244 | return ":prompt", None |
|
239 | 245 | return ":merge", None |
|
240 | 246 | |
|
241 | 247 | def _eoltype(data): |
|
242 | 248 | "Guess the EOL type of a file" |
|
243 | 249 | if '\0' in data: # binary |
|
244 | 250 | return None |
|
245 | 251 | if '\r\n' in data: # Windows |
|
246 | 252 | return '\r\n' |
|
247 | 253 | if '\r' in data: # Old Mac |
|
248 | 254 | return '\r' |
|
249 | 255 | if '\n' in data: # UNIX |
|
250 | 256 | return '\n' |
|
251 | 257 | return None # unknown |
|
252 | 258 | |
|
253 | 259 | def _matcheol(file, back): |
|
254 | 260 | "Convert EOL markers in a file to match origfile" |
|
255 | 261 | tostyle = _eoltype(back.data()) # No repo.wread filters? |
|
256 | 262 | if tostyle: |
|
257 | 263 | data = util.readfile(file) |
|
258 | 264 | style = _eoltype(data) |
|
259 | 265 | if style: |
|
260 | 266 | newdata = data.replace(style, tostyle) |
|
261 | 267 | if newdata != data: |
|
262 | 268 | util.writefile(file, newdata) |
|
263 | 269 | |
|
264 | 270 | @internaltool('prompt', nomerge) |
|
265 | 271 | def _iprompt(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): |
|
266 | 272 | """Asks the user which of the local `p1()` or the other `p2()` version to |
|
267 | 273 | keep as the merged version.""" |
|
268 | 274 | ui = repo.ui |
|
269 | 275 | fd = fcd.path() |
|
270 | 276 | |
|
271 | 277 | # Avoid prompting during an in-memory merge since it doesn't support merge |
|
272 | 278 | # conflicts. |
|
273 | 279 | if fcd.changectx().isinmemory(): |
|
274 | 280 | raise error.InMemoryMergeConflictsError('in-memory merge does not ' |
|
275 | 281 | 'support file conflicts') |
|
276 | 282 | |
|
277 | 283 | prompts = partextras(labels) |
|
278 | 284 | prompts['fd'] = fd |
|
279 | 285 | try: |
|
280 | 286 | if fco.isabsent(): |
|
281 | 287 | index = ui.promptchoice( |
|
282 | 288 | _localchangedotherdeletedmsg % prompts, 2) |
|
283 | 289 | choice = ['local', 'other', 'unresolved'][index] |
|
284 | 290 | elif fcd.isabsent(): |
|
285 | 291 | index = ui.promptchoice( |
|
286 | 292 | _otherchangedlocaldeletedmsg % prompts, 2) |
|
287 | 293 | choice = ['other', 'local', 'unresolved'][index] |
|
288 | 294 | else: |
|
289 | 295 | index = ui.promptchoice( |
|
290 | 296 | _("keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved" |
|
291 | 297 | " for %(fd)s?" |
|
292 | 298 | "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2) |
|
293 | 299 | choice = ['local', 'other', 'unresolved'][index] |
|
294 | 300 | |
|
295 | 301 | if choice == 'other': |
|
296 | 302 | return _iother(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
297 | 303 | labels) |
|
298 | 304 | elif choice == 'local': |
|
299 | 305 | return _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
300 | 306 | labels) |
|
301 | 307 | elif choice == 'unresolved': |
|
302 | 308 | return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
303 | 309 | labels) |
|
304 | 310 | except error.ResponseExpected: |
|
305 | 311 | ui.write("\n") |
|
306 | 312 | return _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
307 | 313 | labels) |
|
308 | 314 | |
|
309 | 315 | @internaltool('local', nomerge) |
|
310 | 316 | def _ilocal(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): |
|
311 | 317 | """Uses the local `p1()` version of files as the merged version.""" |
|
312 | 318 | return 0, fcd.isabsent() |
|
313 | 319 | |
|
314 | 320 | @internaltool('other', nomerge) |
|
315 | 321 | def _iother(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): |
|
316 | 322 | """Uses the other `p2()` version of files as the merged version.""" |
|
317 | 323 | if fco.isabsent(): |
|
318 | 324 | # local changed, remote deleted -- 'deleted' picked |
|
319 | 325 | _underlyingfctxifabsent(fcd).remove() |
|
320 | 326 | deleted = True |
|
321 | 327 | else: |
|
322 | 328 | _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags()) |
|
323 | 329 | deleted = False |
|
324 | 330 | return 0, deleted |
|
325 | 331 | |
|
326 | 332 | @internaltool('fail', nomerge) |
|
327 | 333 | def _ifail(repo, mynode, orig, fcd, fco, fca, toolconf, labels=None): |
|
328 | 334 | """ |
|
329 | 335 | Rather than attempting to merge files that were modified on both |
|
330 | 336 | branches, it marks them as unresolved. The resolve command must be |
|
331 | 337 | used to resolve these conflicts.""" |
|
332 | 338 | # for change/delete conflicts write out the changed version, then fail |
|
333 | 339 | if fcd.isabsent(): |
|
334 | 340 | _underlyingfctxifabsent(fcd).write(fco.data(), fco.flags()) |
|
335 | 341 | return 1, False |
|
336 | 342 | |
|
337 | 343 | def _underlyingfctxifabsent(filectx): |
|
338 | 344 | """Sometimes when resolving, our fcd is actually an absentfilectx, but |
|
339 | 345 | we want to write to it (to do the resolve). This helper returns the |
|
340 | 346 | underyling workingfilectx in that case. |
|
341 | 347 | """ |
|
342 | 348 | if filectx.isabsent(): |
|
343 | 349 | return filectx.changectx()[filectx.path()] |
|
344 | 350 | else: |
|
345 | 351 | return filectx |
|
346 | 352 | |
|
347 | 353 | def _premerge(repo, fcd, fco, fca, toolconf, files, labels=None): |
|
348 | 354 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
349 | 355 | if symlink or fcd.isabsent() or fco.isabsent(): |
|
350 | 356 | return 1 |
|
351 | 357 | unused, unused, unused, back = files |
|
352 | 358 | |
|
353 | 359 | ui = repo.ui |
|
354 | 360 | |
|
355 | 361 | validkeep = ['keep', 'keep-merge3'] |
|
356 | 362 | |
|
357 | 363 | # do we attempt to simplemerge first? |
|
358 | 364 | try: |
|
359 | 365 | premerge = _toolbool(ui, tool, "premerge", not binary) |
|
360 | 366 | except error.ConfigError: |
|
361 | 367 | premerge = _toolstr(ui, tool, "premerge", "").lower() |
|
362 | 368 | if premerge not in validkeep: |
|
363 | 369 | _valid = ', '.join(["'" + v + "'" for v in validkeep]) |
|
364 | 370 | raise error.ConfigError(_("%s.premerge not valid " |
|
365 | 371 | "('%s' is neither boolean nor %s)") % |
|
366 | 372 | (tool, premerge, _valid)) |
|
367 | 373 | |
|
368 | 374 | if premerge: |
|
369 | 375 | if premerge == 'keep-merge3': |
|
370 | 376 | if not labels: |
|
371 | 377 | labels = _defaultconflictlabels |
|
372 | 378 | if len(labels) < 3: |
|
373 | 379 | labels.append('base') |
|
374 | 380 | r = simplemerge.simplemerge(ui, fcd, fca, fco, quiet=True, label=labels) |
|
375 | 381 | if not r: |
|
376 | 382 | ui.debug(" premerge successful\n") |
|
377 | 383 | return 0 |
|
378 | 384 | if premerge not in validkeep: |
|
379 | 385 | # restore from backup and try again |
|
380 | 386 | _restorebackup(fcd, back) |
|
381 | 387 | return 1 # continue merging |
|
382 | 388 | |
|
383 | 389 | def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf): |
|
384 | 390 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
385 | 391 | if symlink: |
|
386 | 392 | repo.ui.warn(_('warning: internal %s cannot merge symlinks ' |
|
387 | 393 | 'for %s\n') % (tool, fcd.path())) |
|
388 | 394 | return False |
|
389 | 395 | if fcd.isabsent() or fco.isabsent(): |
|
390 | 396 | repo.ui.warn(_('warning: internal %s cannot merge change/delete ' |
|
391 | 397 | 'conflict for %s\n') % (tool, fcd.path())) |
|
392 | 398 | return False |
|
393 | 399 | return True |
|
394 | 400 | |
|
395 | 401 | def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode): |
|
396 | 402 | """ |
|
397 | 403 | Uses the internal non-interactive simple merge algorithm for merging |
|
398 | 404 | files. It will fail if there are any conflicts and leave markers in |
|
399 | 405 | the partially merged file. Markers will have two sections, one for each side |
|
400 | 406 | of merge, unless mode equals 'union' which suppresses the markers.""" |
|
401 | 407 | ui = repo.ui |
|
402 | 408 | |
|
403 | 409 | r = simplemerge.simplemerge(ui, fcd, fca, fco, label=labels, mode=mode) |
|
404 | 410 | return True, r, False |
|
405 | 411 | |
|
406 | 412 | @internaltool('union', fullmerge, |
|
407 | 413 | _("warning: conflicts while merging %s! " |
|
408 | 414 | "(edit, then use 'hg resolve --mark')\n"), |
|
409 | 415 | precheck=_mergecheck) |
|
410 | 416 | def _iunion(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
411 | 417 | """ |
|
412 | 418 | Uses the internal non-interactive simple merge algorithm for merging |
|
413 | 419 | files. It will use both left and right sides for conflict regions. |
|
414 | 420 | No markers are inserted.""" |
|
415 | 421 | return _merge(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
416 | 422 | files, labels, 'union') |
|
417 | 423 | |
|
418 | 424 | @internaltool('merge', fullmerge, |
|
419 | 425 | _("warning: conflicts while merging %s! " |
|
420 | 426 | "(edit, then use 'hg resolve --mark')\n"), |
|
421 | 427 | precheck=_mergecheck) |
|
422 | 428 | def _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
423 | 429 | """ |
|
424 | 430 | Uses the internal non-interactive simple merge algorithm for merging |
|
425 | 431 | files. It will fail if there are any conflicts and leave markers in |
|
426 | 432 | the partially merged file. Markers will have two sections, one for each side |
|
427 | 433 | of merge.""" |
|
428 | 434 | return _merge(repo, mynode, orig, fcd, fco, fca, toolconf, |
|
429 | 435 | files, labels, 'merge') |
|
430 | 436 | |
|
431 | 437 | @internaltool('merge3', fullmerge, |
|
432 | 438 | _("warning: conflicts while merging %s! " |
|
433 | 439 | "(edit, then use 'hg resolve --mark')\n"), |
|
434 | 440 | precheck=_mergecheck) |
|
435 | 441 | def _imerge3(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
436 | 442 | """ |
|
437 | 443 | Uses the internal non-interactive simple merge algorithm for merging |
|
438 | 444 | files. It will fail if there are any conflicts and leave markers in |
|
439 | 445 | the partially merged file. Marker will have three sections, one from each |
|
440 | 446 | side of the merge and one for the base content.""" |
|
441 | 447 | if not labels: |
|
442 | 448 | labels = _defaultconflictlabels |
|
443 | 449 | if len(labels) < 3: |
|
444 | 450 | labels.append('base') |
|
445 | 451 | return _imerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels) |
|
446 | 452 | |
|
447 | 453 | def _imergeauto(repo, mynode, orig, fcd, fco, fca, toolconf, files, |
|
448 | 454 | labels=None, localorother=None): |
|
449 | 455 | """ |
|
450 | 456 | Generic driver for _imergelocal and _imergeother |
|
451 | 457 | """ |
|
452 | 458 | assert localorother is not None |
|
453 | 459 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
454 | 460 | r = simplemerge.simplemerge(repo.ui, fcd, fca, fco, label=labels, |
|
455 | 461 | localorother=localorother) |
|
456 | 462 | return True, r |
|
457 | 463 | |
|
458 | 464 | @internaltool('merge-local', mergeonly, precheck=_mergecheck) |
|
459 | 465 | def _imergelocal(*args, **kwargs): |
|
460 | 466 | """ |
|
461 | 467 | Like :merge, but resolve all conflicts non-interactively in favor |
|
462 | 468 | of the local `p1()` changes.""" |
|
463 | 469 | success, status = _imergeauto(localorother='local', *args, **kwargs) |
|
464 | 470 | return success, status, False |
|
465 | 471 | |
|
466 | 472 | @internaltool('merge-other', mergeonly, precheck=_mergecheck) |
|
467 | 473 | def _imergeother(*args, **kwargs): |
|
468 | 474 | """ |
|
469 | 475 | Like :merge, but resolve all conflicts non-interactively in favor |
|
470 | 476 | of the other `p2()` changes.""" |
|
471 | 477 | success, status = _imergeauto(localorother='other', *args, **kwargs) |
|
472 | 478 | return success, status, False |
|
473 | 479 | |
|
474 | 480 | @internaltool('tagmerge', mergeonly, |
|
475 | 481 | _("automatic tag merging of %s failed! " |
|
476 | 482 | "(use 'hg resolve --tool :merge' or another merge " |
|
477 | 483 | "tool of your choice)\n")) |
|
478 | 484 | def _itagmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
479 | 485 | """ |
|
480 | 486 | Uses the internal tag merge algorithm (experimental). |
|
481 | 487 | """ |
|
482 | 488 | success, status = tagmerge.merge(repo, fcd, fco, fca) |
|
483 | 489 | return success, status, False |
|
484 | 490 | |
|
485 | 491 | @internaltool('dump', fullmerge, binary=True, symlink=True) |
|
486 | 492 | def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
487 | 493 | """ |
|
488 | 494 | Creates three versions of the files to merge, containing the |
|
489 | 495 | contents of local, other and base. These files can then be used to |
|
490 | 496 | perform a merge manually. If the file to be merged is named |
|
491 | 497 | ``a.txt``, these files will accordingly be named ``a.txt.local``, |
|
492 | 498 | ``a.txt.other`` and ``a.txt.base`` and they will be placed in the |
|
493 | 499 | same directory as ``a.txt``. |
|
494 | 500 | |
|
495 | 501 | This implies premerge. Therefore, files aren't dumped, if premerge |
|
496 | 502 | runs successfully. Use :forcedump to forcibly write files out. |
|
497 | 503 | """ |
|
498 | 504 | a = _workingpath(repo, fcd) |
|
499 | 505 | fd = fcd.path() |
|
500 | 506 | |
|
501 | 507 | from . import context |
|
502 | 508 | if isinstance(fcd, context.overlayworkingfilectx): |
|
503 | 509 | raise error.InMemoryMergeConflictsError('in-memory merge does not ' |
|
504 | 510 | 'support the :dump tool.') |
|
505 | 511 | |
|
506 | 512 | util.writefile(a + ".local", fcd.decodeddata()) |
|
507 | 513 | repo.wwrite(fd + ".other", fco.data(), fco.flags()) |
|
508 | 514 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) |
|
509 | 515 | return False, 1, False |
|
510 | 516 | |
|
511 | 517 | @internaltool('forcedump', mergeonly, binary=True, symlink=True) |
|
512 | 518 | def _forcedump(repo, mynode, orig, fcd, fco, fca, toolconf, files, |
|
513 | 519 | labels=None): |
|
514 | 520 | """ |
|
515 | 521 | Creates three versions of the files as same as :dump, but omits premerge. |
|
516 | 522 | """ |
|
517 | 523 | return _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, |
|
518 | 524 | labels=labels) |
|
519 | 525 | |
|
520 | 526 | def _xmergeimm(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
521 | 527 | # In-memory merge simply raises an exception on all external merge tools, |
|
522 | 528 | # for now. |
|
523 | 529 | # |
|
524 | 530 | # It would be possible to run most tools with temporary files, but this |
|
525 | 531 | # raises the question of what to do if the user only partially resolves the |
|
526 | 532 | # file -- we can't leave a merge state. (Copy to somewhere in the .hg/ |
|
527 | 533 | # directory and tell the user how to get it is my best idea, but it's |
|
528 | 534 | # clunky.) |
|
529 | 535 | raise error.InMemoryMergeConflictsError('in-memory merge does not support ' |
|
530 | 536 | 'external merge tools') |
|
531 | 537 | |
|
532 | 538 | def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
533 | 539 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
534 | 540 | if fcd.isabsent() or fco.isabsent(): |
|
535 | 541 | repo.ui.warn(_('warning: %s cannot merge change/delete conflict ' |
|
536 | 542 | 'for %s\n') % (tool, fcd.path())) |
|
537 | 543 | return False, 1, None |
|
538 | 544 | unused, unused, unused, back = files |
|
539 | 545 | localpath = _workingpath(repo, fcd) |
|
540 | 546 | args = _toolstr(repo.ui, tool, "args") |
|
541 | 547 | |
|
542 | 548 | with _maketempfiles(repo, fco, fca, repo.wvfs.join(back.path()), |
|
543 | 549 | "$output" in args) as temppaths: |
|
544 | 550 | basepath, otherpath, localoutputpath = temppaths |
|
545 | 551 | outpath = "" |
|
546 | 552 | mylabel, otherlabel = labels[:2] |
|
547 | 553 | if len(labels) >= 3: |
|
548 | 554 | baselabel = labels[2] |
|
549 | 555 | else: |
|
550 | 556 | baselabel = 'base' |
|
551 | 557 | env = {'HG_FILE': fcd.path(), |
|
552 | 558 | 'HG_MY_NODE': short(mynode), |
|
553 | 559 | 'HG_OTHER_NODE': short(fco.changectx().node()), |
|
554 | 560 | 'HG_BASE_NODE': short(fca.changectx().node()), |
|
555 | 561 | 'HG_MY_ISLINK': 'l' in fcd.flags(), |
|
556 | 562 | 'HG_OTHER_ISLINK': 'l' in fco.flags(), |
|
557 | 563 | 'HG_BASE_ISLINK': 'l' in fca.flags(), |
|
558 | 564 | 'HG_MY_LABEL': mylabel, |
|
559 | 565 | 'HG_OTHER_LABEL': otherlabel, |
|
560 | 566 | 'HG_BASE_LABEL': baselabel, |
|
561 | 567 | } |
|
562 | 568 | ui = repo.ui |
|
563 | 569 | |
|
564 | 570 | if "$output" in args: |
|
565 | 571 | # read input from backup, write to original |
|
566 | 572 | outpath = localpath |
|
567 | 573 | localpath = localoutputpath |
|
568 | 574 | replace = {'local': localpath, 'base': basepath, 'other': otherpath, |
|
569 | 575 | 'output': outpath, 'labellocal': mylabel, |
|
570 | 576 | 'labelother': otherlabel, 'labelbase': baselabel} |
|
571 | 577 | args = util.interpolate( |
|
572 | 578 | br'\$', replace, args, |
|
573 | 579 | lambda s: procutil.shellquote(util.localpath(s))) |
|
574 | 580 | if _toolbool(ui, tool, "gui"): |
|
575 | 581 | repo.ui.status(_('running merge tool %s for file %s\n') % |
|
576 | 582 | (tool, fcd.path())) |
|
577 | 583 | if scriptfn is None: |
|
578 | 584 | cmd = toolpath + ' ' + args |
|
579 | 585 | repo.ui.debug('launching merge tool: %s\n' % cmd) |
|
580 | 586 | r = ui.system(cmd, cwd=repo.root, environ=env, |
|
581 | 587 | blockedtag='mergetool') |
|
582 | 588 | else: |
|
583 | 589 | repo.ui.debug('launching python merge script: %s:%s\n' % |
|
584 | 590 | (toolpath, scriptfn)) |
|
585 | 591 | r = 0 |
|
586 | 592 | try: |
|
587 | 593 | # avoid cycle cmdutil->merge->filemerge->extensions->cmdutil |
|
588 | 594 | from . import extensions |
|
589 | 595 | mod = extensions.loadpath(toolpath, 'hgmerge.%s' % tool) |
|
590 | 596 | except Exception: |
|
591 | 597 | raise error.Abort(_("loading python merge script failed: %s") % |
|
592 | 598 | toolpath) |
|
593 | 599 | mergefn = getattr(mod, scriptfn, None) |
|
594 | 600 | if mergefn is None: |
|
595 | 601 | raise error.Abort(_("%s does not have function: %s") % |
|
596 | 602 | (toolpath, scriptfn)) |
|
597 | 603 | argslist = procutil.shellsplit(args) |
|
598 | 604 | # avoid cycle cmdutil->merge->filemerge->hook->extensions->cmdutil |
|
599 | 605 | from . import hook |
|
600 | 606 | ret, raised = hook.pythonhook(ui, repo, "merge", toolpath, |
|
601 | 607 | mergefn, {'args': argslist}, True) |
|
602 | 608 | if raised: |
|
603 | 609 | r = 1 |
|
604 | 610 | repo.ui.debug('merge tool returned: %d\n' % r) |
|
605 | 611 | return True, r, False |
|
606 | 612 | |
|
607 | 613 | def _formatconflictmarker(ctx, template, label, pad): |
|
608 | 614 | """Applies the given template to the ctx, prefixed by the label. |
|
609 | 615 | |
|
610 | 616 | Pad is the minimum width of the label prefix, so that multiple markers |
|
611 | 617 | can have aligned templated parts. |
|
612 | 618 | """ |
|
613 | 619 | if ctx.node() is None: |
|
614 | 620 | ctx = ctx.p1() |
|
615 | 621 | |
|
616 | 622 | props = {'ctx': ctx} |
|
617 | 623 | templateresult = template.renderdefault(props) |
|
618 | 624 | |
|
619 | 625 | label = ('%s:' % label).ljust(pad + 1) |
|
620 | 626 | mark = '%s %s' % (label, templateresult) |
|
621 | 627 | |
|
622 | 628 | if mark: |
|
623 | 629 | mark = mark.splitlines()[0] # split for safety |
|
624 | 630 | |
|
625 | 631 | # 8 for the prefix of conflict marker lines (e.g. '<<<<<<< ') |
|
626 | 632 | return stringutil.ellipsis(mark, 80 - 8) |
|
627 | 633 | |
|
628 | 634 | _defaultconflictlabels = ['local', 'other'] |
|
629 | 635 | |
|
630 | 636 | def _formatlabels(repo, fcd, fco, fca, labels, tool=None): |
|
631 | 637 | """Formats the given labels using the conflict marker template. |
|
632 | 638 | |
|
633 | 639 | Returns a list of formatted labels. |
|
634 | 640 | """ |
|
635 | 641 | cd = fcd.changectx() |
|
636 | 642 | co = fco.changectx() |
|
637 | 643 | ca = fca.changectx() |
|
638 | 644 | |
|
639 | 645 | ui = repo.ui |
|
640 | 646 | template = ui.config('ui', 'mergemarkertemplate') |
|
641 | 647 | if tool is not None: |
|
642 | 648 | template = _toolstr(ui, tool, 'mergemarkertemplate', template) |
|
643 | 649 | template = templater.unquotestring(template) |
|
644 | 650 | tres = formatter.templateresources(ui, repo) |
|
645 | 651 | tmpl = formatter.maketemplater(ui, template, defaults=templatekw.keywords, |
|
646 | 652 | resources=tres) |
|
647 | 653 | |
|
648 | 654 | pad = max(len(l) for l in labels) |
|
649 | 655 | |
|
650 | 656 | newlabels = [_formatconflictmarker(cd, tmpl, labels[0], pad), |
|
651 | 657 | _formatconflictmarker(co, tmpl, labels[1], pad)] |
|
652 | 658 | if len(labels) > 2: |
|
653 | 659 | newlabels.append(_formatconflictmarker(ca, tmpl, labels[2], pad)) |
|
654 | 660 | return newlabels |
|
655 | 661 | |
|
656 | 662 | def partextras(labels): |
|
657 | 663 | """Return a dictionary of extra labels for use in prompts to the user |
|
658 | 664 | |
|
659 | 665 | Intended use is in strings of the form "(l)ocal%(l)s". |
|
660 | 666 | """ |
|
661 | 667 | if labels is None: |
|
662 | 668 | return { |
|
663 | 669 | "l": "", |
|
664 | 670 | "o": "", |
|
665 | 671 | } |
|
666 | 672 | |
|
667 | 673 | return { |
|
668 | 674 | "l": " [%s]" % labels[0], |
|
669 | 675 | "o": " [%s]" % labels[1], |
|
670 | 676 | } |
|
671 | 677 | |
|
672 | 678 | def _restorebackup(fcd, back): |
|
673 | 679 | # TODO: Add a workingfilectx.write(otherfilectx) path so we can use |
|
674 | 680 | # util.copy here instead. |
|
675 | 681 | fcd.write(back.data(), fcd.flags()) |
|
676 | 682 | |
|
677 | 683 | def _makebackup(repo, ui, wctx, fcd, premerge): |
|
678 | 684 | """Makes and returns a filectx-like object for ``fcd``'s backup file. |
|
679 | 685 | |
|
680 | 686 | In addition to preserving the user's pre-existing modifications to `fcd` |
|
681 | 687 | (if any), the backup is used to undo certain premerges, confirm whether a |
|
682 | 688 | merge changed anything, and determine what line endings the new file should |
|
683 | 689 | have. |
|
684 | 690 | |
|
685 | 691 | Backups only need to be written once (right before the premerge) since their |
|
686 | 692 | content doesn't change afterwards. |
|
687 | 693 | """ |
|
688 | 694 | if fcd.isabsent(): |
|
689 | 695 | return None |
|
690 | 696 | # TODO: Break this import cycle somehow. (filectx -> ctx -> fileset -> |
|
691 | 697 | # merge -> filemerge). (I suspect the fileset import is the weakest link) |
|
692 | 698 | from . import context |
|
693 | 699 | a = _workingpath(repo, fcd) |
|
694 | 700 | back = scmutil.origpath(ui, repo, a) |
|
695 | 701 | inworkingdir = (back.startswith(repo.wvfs.base) and not |
|
696 | 702 | back.startswith(repo.vfs.base)) |
|
697 | 703 | if isinstance(fcd, context.overlayworkingfilectx) and inworkingdir: |
|
698 | 704 | # If the backup file is to be in the working directory, and we're |
|
699 | 705 | # merging in-memory, we must redirect the backup to the memory context |
|
700 | 706 | # so we don't disturb the working directory. |
|
701 | 707 | relpath = back[len(repo.wvfs.base) + 1:] |
|
702 | 708 | if premerge: |
|
703 | 709 | wctx[relpath].write(fcd.data(), fcd.flags()) |
|
704 | 710 | return wctx[relpath] |
|
705 | 711 | else: |
|
706 | 712 | if premerge: |
|
707 | 713 | # Otherwise, write to wherever path the user specified the backups |
|
708 | 714 | # should go. We still need to switch based on whether the source is |
|
709 | 715 | # in-memory so we can use the fast path of ``util.copy`` if both are |
|
710 | 716 | # on disk. |
|
711 | 717 | if isinstance(fcd, context.overlayworkingfilectx): |
|
712 | 718 | util.writefile(back, fcd.data()) |
|
713 | 719 | else: |
|
714 | 720 | util.copyfile(a, back) |
|
715 | 721 | # A arbitraryfilectx is returned, so we can run the same functions on |
|
716 | 722 | # the backup context regardless of where it lives. |
|
717 | 723 | return context.arbitraryfilectx(back, repo=repo) |
|
718 | 724 | |
|
719 | 725 | @contextlib.contextmanager |
|
720 | 726 | def _maketempfiles(repo, fco, fca, localpath, uselocalpath): |
|
721 | 727 | """Writes out `fco` and `fca` as temporary files, and (if uselocalpath) |
|
722 | 728 | copies `localpath` to another temporary file, so an external merge tool may |
|
723 | 729 | use them. |
|
724 | 730 | """ |
|
725 | 731 | tmproot = None |
|
726 | 732 | tmprootprefix = repo.ui.config('experimental', 'mergetempdirprefix') |
|
727 | 733 | if tmprootprefix: |
|
728 | 734 | tmproot = pycompat.mkdtemp(prefix=tmprootprefix) |
|
729 | 735 | |
|
730 | 736 | def maketempfrompath(prefix, path): |
|
731 | 737 | fullbase, ext = os.path.splitext(path) |
|
732 | 738 | pre = "%s~%s" % (os.path.basename(fullbase), prefix) |
|
733 | 739 | if tmproot: |
|
734 | 740 | name = os.path.join(tmproot, pre) |
|
735 | 741 | if ext: |
|
736 | 742 | name += ext |
|
737 | 743 | f = open(name, r"wb") |
|
738 | 744 | else: |
|
739 | 745 | fd, name = pycompat.mkstemp(prefix=pre + '.', suffix=ext) |
|
740 | 746 | f = os.fdopen(fd, r"wb") |
|
741 | 747 | return f, name |
|
742 | 748 | |
|
743 | 749 | def tempfromcontext(prefix, ctx): |
|
744 | 750 | f, name = maketempfrompath(prefix, ctx.path()) |
|
745 | 751 | data = repo.wwritedata(ctx.path(), ctx.data()) |
|
746 | 752 | f.write(data) |
|
747 | 753 | f.close() |
|
748 | 754 | return name |
|
749 | 755 | |
|
750 | 756 | b = tempfromcontext("base", fca) |
|
751 | 757 | c = tempfromcontext("other", fco) |
|
752 | 758 | d = localpath |
|
753 | 759 | if uselocalpath: |
|
754 | 760 | # We start off with this being the backup filename, so remove the .orig |
|
755 | 761 | # to make syntax-highlighting more likely. |
|
756 | 762 | if d.endswith('.orig'): |
|
757 | 763 | d, _ = os.path.splitext(d) |
|
758 | 764 | f, d = maketempfrompath("local", d) |
|
759 | 765 | with open(localpath, 'rb') as src: |
|
760 | 766 | f.write(src.read()) |
|
761 | 767 | f.close() |
|
762 | 768 | |
|
763 | 769 | try: |
|
764 | 770 | yield b, c, d |
|
765 | 771 | finally: |
|
766 | 772 | if tmproot: |
|
767 | 773 | shutil.rmtree(tmproot) |
|
768 | 774 | else: |
|
769 | 775 | util.unlink(b) |
|
770 | 776 | util.unlink(c) |
|
771 | 777 | # if not uselocalpath, d is the 'orig'/backup file which we |
|
772 | 778 | # shouldn't delete. |
|
773 | 779 | if d and uselocalpath: |
|
774 | 780 | util.unlink(d) |
|
775 | 781 | |
|
776 | 782 | def _filemerge(premerge, repo, wctx, mynode, orig, fcd, fco, fca, labels=None): |
|
777 | 783 | """perform a 3-way merge in the working directory |
|
778 | 784 | |
|
779 | 785 | premerge = whether this is a premerge |
|
780 | 786 | mynode = parent node before merge |
|
781 | 787 | orig = original local filename before merge |
|
782 | 788 | fco = other file context |
|
783 | 789 | fca = ancestor file context |
|
784 | 790 | fcd = local file context for current/destination file |
|
785 | 791 | |
|
786 | 792 | Returns whether the merge is complete, the return value of the merge, and |
|
787 | 793 | a boolean indicating whether the file was deleted from disk.""" |
|
788 | 794 | |
|
789 | 795 | if not fco.cmp(fcd): # files identical? |
|
790 | 796 | return True, None, False |
|
791 | 797 | |
|
792 | 798 | ui = repo.ui |
|
793 | 799 | fd = fcd.path() |
|
794 | 800 | binary = fcd.isbinary() or fco.isbinary() or fca.isbinary() |
|
795 | 801 | symlink = 'l' in fcd.flags() + fco.flags() |
|
796 | 802 | changedelete = fcd.isabsent() or fco.isabsent() |
|
797 | 803 | tool, toolpath = _picktool(repo, ui, fd, binary, symlink, changedelete) |
|
798 | 804 | scriptfn = None |
|
799 | 805 | if tool in internals and tool.startswith('internal:'): |
|
800 | 806 | # normalize to new-style names (':merge' etc) |
|
801 | 807 | tool = tool[len('internal'):] |
|
802 | 808 | if toolpath and toolpath.startswith('python:'): |
|
803 | 809 | invalidsyntax = False |
|
804 | 810 | if toolpath.count(':') >= 2: |
|
805 | 811 | script, scriptfn = toolpath[7:].rsplit(':', 1) |
|
806 | 812 | if not scriptfn: |
|
807 | 813 | invalidsyntax = True |
|
808 | 814 | # missing :callable can lead to spliting on windows drive letter |
|
809 | 815 | if '\\' in scriptfn or '/' in scriptfn: |
|
810 | 816 | invalidsyntax = True |
|
811 | 817 | else: |
|
812 | 818 | invalidsyntax = True |
|
813 | 819 | if invalidsyntax: |
|
814 | 820 | raise error.Abort(_("invalid 'python:' syntax: %s") % toolpath) |
|
815 | 821 | toolpath = script |
|
816 | 822 | ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n" |
|
817 | 823 | % (tool, fd, pycompat.bytestr(binary), pycompat.bytestr(symlink), |
|
818 | 824 | pycompat.bytestr(changedelete))) |
|
819 | 825 | |
|
820 | 826 | if tool in internals: |
|
821 | 827 | func = internals[tool] |
|
822 | 828 | mergetype = func.mergetype |
|
823 | 829 | onfailure = func.onfailure |
|
824 | 830 | precheck = func.precheck |
|
825 | 831 | isexternal = False |
|
826 | 832 | else: |
|
827 | 833 | if wctx.isinmemory(): |
|
828 | 834 | func = _xmergeimm |
|
829 | 835 | else: |
|
830 | 836 | func = _xmerge |
|
831 | 837 | mergetype = fullmerge |
|
832 | 838 | onfailure = _("merging %s failed!\n") |
|
833 | 839 | precheck = None |
|
834 | 840 | isexternal = True |
|
835 | 841 | |
|
836 | 842 | toolconf = tool, toolpath, binary, symlink, scriptfn |
|
837 | 843 | |
|
838 | 844 | if mergetype == nomerge: |
|
839 | 845 | r, deleted = func(repo, mynode, orig, fcd, fco, fca, toolconf, labels) |
|
840 | 846 | return True, r, deleted |
|
841 | 847 | |
|
842 | 848 | if premerge: |
|
843 | 849 | if orig != fco.path(): |
|
844 | 850 | ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd)) |
|
845 | 851 | else: |
|
846 | 852 | ui.status(_("merging %s\n") % fd) |
|
847 | 853 | |
|
848 | 854 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) |
|
849 | 855 | |
|
850 | 856 | if precheck and not precheck(repo, mynode, orig, fcd, fco, fca, |
|
851 | 857 | toolconf): |
|
852 | 858 | if onfailure: |
|
853 | 859 | if wctx.isinmemory(): |
|
854 | 860 | raise error.InMemoryMergeConflictsError('in-memory merge does ' |
|
855 | 861 | 'not support merge ' |
|
856 | 862 | 'conflicts') |
|
857 | 863 | ui.warn(onfailure % fd) |
|
858 | 864 | return True, 1, False |
|
859 | 865 | |
|
860 | 866 | back = _makebackup(repo, ui, wctx, fcd, premerge) |
|
861 | 867 | files = (None, None, None, back) |
|
862 | 868 | r = 1 |
|
863 | 869 | try: |
|
864 | 870 | internalmarkerstyle = ui.config('ui', 'mergemarkers') |
|
865 | 871 | if isexternal: |
|
866 | 872 | markerstyle = _toolstr(ui, tool, 'mergemarkers') |
|
867 | 873 | else: |
|
868 | 874 | markerstyle = internalmarkerstyle |
|
869 | 875 | |
|
870 | 876 | if not labels: |
|
871 | 877 | labels = _defaultconflictlabels |
|
872 | 878 | formattedlabels = labels |
|
873 | 879 | if markerstyle != 'basic': |
|
874 | 880 | formattedlabels = _formatlabels(repo, fcd, fco, fca, labels, |
|
875 | 881 | tool=tool) |
|
876 | 882 | |
|
877 | 883 | if premerge and mergetype == fullmerge: |
|
878 | 884 | # conflict markers generated by premerge will use 'detailed' |
|
879 | 885 | # settings if either ui.mergemarkers or the tool's mergemarkers |
|
880 | 886 | # setting is 'detailed'. This way tools can have basic labels in |
|
881 | 887 | # space-constrained areas of the UI, but still get full information |
|
882 | 888 | # in conflict markers if premerge is 'keep' or 'keep-merge3'. |
|
883 | 889 | premergelabels = labels |
|
884 | 890 | labeltool = None |
|
885 | 891 | if markerstyle != 'basic': |
|
886 | 892 | # respect 'tool's mergemarkertemplate (which defaults to |
|
887 | 893 | # ui.mergemarkertemplate) |
|
888 | 894 | labeltool = tool |
|
889 | 895 | if internalmarkerstyle != 'basic' or markerstyle != 'basic': |
|
890 | 896 | premergelabels = _formatlabels(repo, fcd, fco, fca, |
|
891 | 897 | premergelabels, tool=labeltool) |
|
892 | 898 | |
|
893 | 899 | r = _premerge(repo, fcd, fco, fca, toolconf, files, |
|
894 | 900 | labels=premergelabels) |
|
895 | 901 | # complete if premerge successful (r is 0) |
|
896 | 902 | return not r, r, False |
|
897 | 903 | |
|
898 | 904 | needcheck, r, deleted = func(repo, mynode, orig, fcd, fco, fca, |
|
899 | 905 | toolconf, files, labels=formattedlabels) |
|
900 | 906 | |
|
901 | 907 | if needcheck: |
|
902 | 908 | r = _check(repo, r, ui, tool, fcd, files) |
|
903 | 909 | |
|
904 | 910 | if r: |
|
905 | 911 | if onfailure: |
|
906 | 912 | if wctx.isinmemory(): |
|
907 | 913 | raise error.InMemoryMergeConflictsError('in-memory merge ' |
|
908 | 914 | 'does not support ' |
|
909 | 915 | 'merge conflicts') |
|
910 | 916 | ui.warn(onfailure % fd) |
|
911 | 917 | _onfilemergefailure(ui) |
|
912 | 918 | |
|
913 | 919 | return True, r, deleted |
|
914 | 920 | finally: |
|
915 | 921 | if not r and back is not None: |
|
916 | 922 | back.remove() |
|
917 | 923 | |
|
918 | 924 | def _haltmerge(): |
|
919 | 925 | msg = _('merge halted after failed merge (see hg resolve)') |
|
920 | 926 | raise error.InterventionRequired(msg) |
|
921 | 927 | |
|
922 | 928 | def _onfilemergefailure(ui): |
|
923 | 929 | action = ui.config('merge', 'on-failure') |
|
924 | 930 | if action == 'prompt': |
|
925 | 931 | msg = _('continue merge operation (yn)?' '$$ &Yes $$ &No') |
|
926 | 932 | if ui.promptchoice(msg, 0) == 1: |
|
927 | 933 | _haltmerge() |
|
928 | 934 | if action == 'halt': |
|
929 | 935 | _haltmerge() |
|
930 | 936 | # default action is 'continue', in which case we neither prompt nor halt |
|
931 | 937 | |
|
932 | 938 | def hasconflictmarkers(data): |
|
933 | 939 | return bool(re.search("^(<<<<<<< .*|=======|>>>>>>> .*)$", data, |
|
934 | 940 | re.MULTILINE)) |
|
935 | 941 | |
|
936 | 942 | def _check(repo, r, ui, tool, fcd, files): |
|
937 | 943 | fd = fcd.path() |
|
938 | 944 | unused, unused, unused, back = files |
|
939 | 945 | |
|
940 | 946 | if not r and (_toolbool(ui, tool, "checkconflicts") or |
|
941 | 947 | 'conflicts' in _toollist(ui, tool, "check")): |
|
942 | 948 | if hasconflictmarkers(fcd.data()): |
|
943 | 949 | r = 1 |
|
944 | 950 | |
|
945 | 951 | checked = False |
|
946 | 952 | if 'prompt' in _toollist(ui, tool, "check"): |
|
947 | 953 | checked = True |
|
948 | 954 | if ui.promptchoice(_("was merge of '%s' successful (yn)?" |
|
949 | 955 | "$$ &Yes $$ &No") % fd, 1): |
|
950 | 956 | r = 1 |
|
951 | 957 | |
|
952 | 958 | if not r and not checked and (_toolbool(ui, tool, "checkchanged") or |
|
953 | 959 | 'changed' in |
|
954 | 960 | _toollist(ui, tool, "check")): |
|
955 | 961 | if back is not None and not fcd.cmp(back): |
|
956 | 962 | if ui.promptchoice(_(" output file %s appears unchanged\n" |
|
957 | 963 | "was merge successful (yn)?" |
|
958 | 964 | "$$ &Yes $$ &No") % fd, 1): |
|
959 | 965 | r = 1 |
|
960 | 966 | |
|
961 | 967 | if back is not None and _toolbool(ui, tool, "fixeol"): |
|
962 | 968 | _matcheol(_workingpath(repo, fcd), back) |
|
963 | 969 | |
|
964 | 970 | return r |
|
965 | 971 | |
|
966 | 972 | def _workingpath(repo, ctx): |
|
967 | 973 | return repo.wjoin(ctx.path()) |
|
968 | 974 | |
|
969 | 975 | def premerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None): |
|
970 | 976 | return _filemerge(True, repo, wctx, mynode, orig, fcd, fco, fca, |
|
971 | 977 | labels=labels) |
|
972 | 978 | |
|
973 | 979 | def filemerge(repo, wctx, mynode, orig, fcd, fco, fca, labels=None): |
|
974 | 980 | return _filemerge(False, repo, wctx, mynode, orig, fcd, fco, fca, |
|
975 | 981 | labels=labels) |
|
976 | 982 | |
|
977 | 983 | def loadinternalmerge(ui, extname, registrarobj): |
|
978 | 984 | """Load internal merge tool from specified registrarobj |
|
979 | 985 | """ |
|
980 | 986 | for name, func in registrarobj._table.iteritems(): |
|
981 | 987 | fullname = ':' + name |
|
982 | 988 | internals[fullname] = func |
|
983 | 989 | internals['internal:' + name] = func |
|
984 | 990 | internalsdoc[fullname] = func |
|
985 | 991 | |
|
986 | 992 | # load built-in merge tools explicitly to setup internalsdoc |
|
987 | 993 | loadinternalmerge(None, None, internaltool) |
|
988 | 994 | |
|
989 | 995 | # tell hggettext to extract docstrings from these functions: |
|
990 | 996 | i18nfunctions = internals.values() |
@@ -1,2705 +1,2710 | |||
|
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 --debug` 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`` (per-repository) |
|
58 | 58 | - ``$HOME/.hgrc`` (per-user) |
|
59 | 59 | - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user) |
|
60 | 60 | - ``<install-root>/etc/mercurial/hgrc`` (per-installation) |
|
61 | 61 | - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation) |
|
62 | 62 | - ``/etc/mercurial/hgrc`` (per-system) |
|
63 | 63 | - ``/etc/mercurial/hgrc.d/*.rc`` (per-system) |
|
64 | 64 | - ``<internal>/default.d/*.rc`` (defaults) |
|
65 | 65 | |
|
66 | 66 | .. container:: verbose.windows |
|
67 | 67 | |
|
68 | 68 | On Windows, the following files are consulted: |
|
69 | 69 | |
|
70 | 70 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
71 | 71 | - ``%USERPROFILE%\.hgrc`` (per-user) |
|
72 | 72 | - ``%USERPROFILE%\Mercurial.ini`` (per-user) |
|
73 | 73 | - ``%HOME%\.hgrc`` (per-user) |
|
74 | 74 | - ``%HOME%\Mercurial.ini`` (per-user) |
|
75 | 75 | - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation) |
|
76 | 76 | - ``<install-dir>\hgrc.d\*.rc`` (per-installation) |
|
77 | 77 | - ``<install-dir>\Mercurial.ini`` (per-installation) |
|
78 | 78 | - ``<internal>/default.d/*.rc`` (defaults) |
|
79 | 79 | |
|
80 | 80 | .. note:: |
|
81 | 81 | |
|
82 | 82 | The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial`` |
|
83 | 83 | is used when running 32-bit Python on 64-bit Windows. |
|
84 | 84 | |
|
85 | 85 | .. container:: windows |
|
86 | 86 | |
|
87 | 87 | On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``. |
|
88 | 88 | |
|
89 | 89 | .. container:: verbose.plan9 |
|
90 | 90 | |
|
91 | 91 | On Plan9, the following files are consulted: |
|
92 | 92 | |
|
93 | 93 | - ``<repo>/.hg/hgrc`` (per-repository) |
|
94 | 94 | - ``$home/lib/hgrc`` (per-user) |
|
95 | 95 | - ``<install-root>/lib/mercurial/hgrc`` (per-installation) |
|
96 | 96 | - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation) |
|
97 | 97 | - ``/lib/mercurial/hgrc`` (per-system) |
|
98 | 98 | - ``/lib/mercurial/hgrc.d/*.rc`` (per-system) |
|
99 | 99 | - ``<internal>/default.d/*.rc`` (defaults) |
|
100 | 100 | |
|
101 | 101 | Per-repository configuration options only apply in a |
|
102 | 102 | particular repository. This file is not version-controlled, and |
|
103 | 103 | will not get transferred during a "clone" operation. Options in |
|
104 | 104 | this file override options in all other configuration files. |
|
105 | 105 | |
|
106 | 106 | .. container:: unix.plan9 |
|
107 | 107 | |
|
108 | 108 | On Plan 9 and Unix, most of this file will be ignored if it doesn't |
|
109 | 109 | belong to a trusted user or to a trusted group. See |
|
110 | 110 | :hg:`help config.trusted` for more details. |
|
111 | 111 | |
|
112 | 112 | Per-user configuration file(s) are for the user running Mercurial. Options |
|
113 | 113 | in these files apply to all Mercurial commands executed by this user in any |
|
114 | 114 | directory. Options in these files override per-system and per-installation |
|
115 | 115 | options. |
|
116 | 116 | |
|
117 | 117 | Per-installation configuration files are searched for in the |
|
118 | 118 | directory where Mercurial is installed. ``<install-root>`` is the |
|
119 | 119 | parent directory of the **hg** executable (or symlink) being run. |
|
120 | 120 | |
|
121 | 121 | .. container:: unix.plan9 |
|
122 | 122 | |
|
123 | 123 | For example, if installed in ``/shared/tools/bin/hg``, Mercurial |
|
124 | 124 | will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these |
|
125 | 125 | files apply to all Mercurial commands executed by any user in any |
|
126 | 126 | directory. |
|
127 | 127 | |
|
128 | 128 | Per-installation configuration files are for the system on |
|
129 | 129 | which Mercurial is running. Options in these files apply to all |
|
130 | 130 | Mercurial commands executed by any user in any directory. Registry |
|
131 | 131 | keys contain PATH-like strings, every part of which must reference |
|
132 | 132 | a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will |
|
133 | 133 | be read. Mercurial checks each of these locations in the specified |
|
134 | 134 | order until one or more configuration files are detected. |
|
135 | 135 | |
|
136 | 136 | Per-system configuration files are for the system on which Mercurial |
|
137 | 137 | is running. Options in these files apply to all Mercurial commands |
|
138 | 138 | executed by any user in any directory. Options in these files |
|
139 | 139 | override per-installation options. |
|
140 | 140 | |
|
141 | 141 | Mercurial comes with some default configuration. The default configuration |
|
142 | 142 | files are installed with Mercurial and will be overwritten on upgrades. Default |
|
143 | 143 | configuration files should never be edited by users or administrators but can |
|
144 | 144 | be overridden in other configuration files. So far the directory only contains |
|
145 | 145 | merge tool configuration but packagers can also put other default configuration |
|
146 | 146 | there. |
|
147 | 147 | |
|
148 | 148 | Syntax |
|
149 | 149 | ====== |
|
150 | 150 | |
|
151 | 151 | A configuration file consists of sections, led by a ``[section]`` header |
|
152 | 152 | and followed by ``name = value`` entries (sometimes called |
|
153 | 153 | ``configuration keys``):: |
|
154 | 154 | |
|
155 | 155 | [spam] |
|
156 | 156 | eggs=ham |
|
157 | 157 | green= |
|
158 | 158 | eggs |
|
159 | 159 | |
|
160 | 160 | Each line contains one entry. If the lines that follow are indented, |
|
161 | 161 | they are treated as continuations of that entry. Leading whitespace is |
|
162 | 162 | removed from values. Empty lines are skipped. Lines beginning with |
|
163 | 163 | ``#`` or ``;`` are ignored and may be used to provide comments. |
|
164 | 164 | |
|
165 | 165 | Configuration keys can be set multiple times, in which case Mercurial |
|
166 | 166 | will use the value that was configured last. As an example:: |
|
167 | 167 | |
|
168 | 168 | [spam] |
|
169 | 169 | eggs=large |
|
170 | 170 | ham=serrano |
|
171 | 171 | eggs=small |
|
172 | 172 | |
|
173 | 173 | This would set the configuration key named ``eggs`` to ``small``. |
|
174 | 174 | |
|
175 | 175 | It is also possible to define a section multiple times. A section can |
|
176 | 176 | be redefined on the same and/or on different configuration files. For |
|
177 | 177 | example:: |
|
178 | 178 | |
|
179 | 179 | [foo] |
|
180 | 180 | eggs=large |
|
181 | 181 | ham=serrano |
|
182 | 182 | eggs=small |
|
183 | 183 | |
|
184 | 184 | [bar] |
|
185 | 185 | eggs=ham |
|
186 | 186 | green= |
|
187 | 187 | eggs |
|
188 | 188 | |
|
189 | 189 | [foo] |
|
190 | 190 | ham=prosciutto |
|
191 | 191 | eggs=medium |
|
192 | 192 | bread=toasted |
|
193 | 193 | |
|
194 | 194 | This would set the ``eggs``, ``ham``, and ``bread`` configuration keys |
|
195 | 195 | of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``, |
|
196 | 196 | respectively. As you can see there only thing that matters is the last |
|
197 | 197 | value that was set for each of the configuration keys. |
|
198 | 198 | |
|
199 | 199 | If a configuration key is set multiple times in different |
|
200 | 200 | configuration files the final value will depend on the order in which |
|
201 | 201 | the different configuration files are read, with settings from earlier |
|
202 | 202 | paths overriding later ones as described on the ``Files`` section |
|
203 | 203 | above. |
|
204 | 204 | |
|
205 | 205 | A line of the form ``%include file`` will include ``file`` into the |
|
206 | 206 | current configuration file. The inclusion is recursive, which means |
|
207 | 207 | that included files can include other files. Filenames are relative to |
|
208 | 208 | the configuration file in which the ``%include`` directive is found. |
|
209 | 209 | Environment variables and ``~user`` constructs are expanded in |
|
210 | 210 | ``file``. This lets you do something like:: |
|
211 | 211 | |
|
212 | 212 | %include ~/.hgrc.d/$HOST.rc |
|
213 | 213 | |
|
214 | 214 | to include a different configuration file on each computer you use. |
|
215 | 215 | |
|
216 | 216 | A line with ``%unset name`` will remove ``name`` from the current |
|
217 | 217 | section, if it has been set previously. |
|
218 | 218 | |
|
219 | 219 | The values are either free-form text strings, lists of text strings, |
|
220 | 220 | or Boolean values. Boolean values can be set to true using any of "1", |
|
221 | 221 | "yes", "true", or "on" and to false using "0", "no", "false", or "off" |
|
222 | 222 | (all case insensitive). |
|
223 | 223 | |
|
224 | 224 | List values are separated by whitespace or comma, except when values are |
|
225 | 225 | placed in double quotation marks:: |
|
226 | 226 | |
|
227 | 227 | allow_read = "John Doe, PhD", brian, betty |
|
228 | 228 | |
|
229 | 229 | Quotation marks can be escaped by prefixing them with a backslash. Only |
|
230 | 230 | quotation marks at the beginning of a word is counted as a quotation |
|
231 | 231 | (e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``). |
|
232 | 232 | |
|
233 | 233 | Sections |
|
234 | 234 | ======== |
|
235 | 235 | |
|
236 | 236 | This section describes the different sections that may appear in a |
|
237 | 237 | Mercurial configuration file, the purpose of each section, its possible |
|
238 | 238 | keys, and their possible values. |
|
239 | 239 | |
|
240 | 240 | ``alias`` |
|
241 | 241 | --------- |
|
242 | 242 | |
|
243 | 243 | Defines command aliases. |
|
244 | 244 | |
|
245 | 245 | Aliases allow you to define your own commands in terms of other |
|
246 | 246 | commands (or aliases), optionally including arguments. Positional |
|
247 | 247 | arguments in the form of ``$1``, ``$2``, etc. in the alias definition |
|
248 | 248 | are expanded by Mercurial before execution. Positional arguments not |
|
249 | 249 | already used by ``$N`` in the definition are put at the end of the |
|
250 | 250 | command to be executed. |
|
251 | 251 | |
|
252 | 252 | Alias definitions consist of lines of the form:: |
|
253 | 253 | |
|
254 | 254 | <alias> = <command> [<argument>]... |
|
255 | 255 | |
|
256 | 256 | For example, this definition:: |
|
257 | 257 | |
|
258 | 258 | latest = log --limit 5 |
|
259 | 259 | |
|
260 | 260 | creates a new command ``latest`` that shows only the five most recent |
|
261 | 261 | changesets. You can define subsequent aliases using earlier ones:: |
|
262 | 262 | |
|
263 | 263 | stable5 = latest -b stable |
|
264 | 264 | |
|
265 | 265 | .. note:: |
|
266 | 266 | |
|
267 | 267 | It is possible to create aliases with the same names as |
|
268 | 268 | existing commands, which will then override the original |
|
269 | 269 | definitions. This is almost always a bad idea! |
|
270 | 270 | |
|
271 | 271 | An alias can start with an exclamation point (``!``) to make it a |
|
272 | 272 | shell alias. A shell alias is executed with the shell and will let you |
|
273 | 273 | run arbitrary commands. As an example, :: |
|
274 | 274 | |
|
275 | 275 | echo = !echo $@ |
|
276 | 276 | |
|
277 | 277 | will let you do ``hg echo foo`` to have ``foo`` printed in your |
|
278 | 278 | terminal. A better example might be:: |
|
279 | 279 | |
|
280 | 280 | purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f |
|
281 | 281 | |
|
282 | 282 | which will make ``hg purge`` delete all unknown files in the |
|
283 | 283 | repository in the same manner as the purge extension. |
|
284 | 284 | |
|
285 | 285 | Positional arguments like ``$1``, ``$2``, etc. in the alias definition |
|
286 | 286 | expand to the command arguments. Unmatched arguments are |
|
287 | 287 | removed. ``$0`` expands to the alias name and ``$@`` expands to all |
|
288 | 288 | arguments separated by a space. ``"$@"`` (with quotes) expands to all |
|
289 | 289 | arguments quoted individually and separated by a space. These expansions |
|
290 | 290 | happen before the command is passed to the shell. |
|
291 | 291 | |
|
292 | 292 | Shell aliases are executed in an environment where ``$HG`` expands to |
|
293 | 293 | the path of the Mercurial that was used to execute the alias. This is |
|
294 | 294 | useful when you want to call further Mercurial commands in a shell |
|
295 | 295 | alias, as was done above for the purge alias. In addition, |
|
296 | 296 | ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg |
|
297 | 297 | echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``. |
|
298 | 298 | |
|
299 | 299 | .. note:: |
|
300 | 300 | |
|
301 | 301 | Some global configuration options such as ``-R`` are |
|
302 | 302 | processed before shell aliases and will thus not be passed to |
|
303 | 303 | aliases. |
|
304 | 304 | |
|
305 | 305 | |
|
306 | 306 | ``annotate`` |
|
307 | 307 | ------------ |
|
308 | 308 | |
|
309 | 309 | Settings used when displaying file annotations. All values are |
|
310 | 310 | Booleans and default to False. See :hg:`help config.diff` for |
|
311 | 311 | related options for the diff command. |
|
312 | 312 | |
|
313 | 313 | ``ignorews`` |
|
314 | 314 | Ignore white space when comparing lines. |
|
315 | 315 | |
|
316 | 316 | ``ignorewseol`` |
|
317 | 317 | Ignore white space at the end of a line when comparing lines. |
|
318 | 318 | |
|
319 | 319 | ``ignorewsamount`` |
|
320 | 320 | Ignore changes in the amount of white space. |
|
321 | 321 | |
|
322 | 322 | ``ignoreblanklines`` |
|
323 | 323 | Ignore changes whose lines are all blank. |
|
324 | 324 | |
|
325 | 325 | |
|
326 | 326 | ``auth`` |
|
327 | 327 | -------- |
|
328 | 328 | |
|
329 | 329 | Authentication credentials and other authentication-like configuration |
|
330 | 330 | for HTTP connections. This section allows you to store usernames and |
|
331 | 331 | passwords for use when logging *into* HTTP servers. See |
|
332 | 332 | :hg:`help config.web` if you want to configure *who* can login to |
|
333 | 333 | your HTTP server. |
|
334 | 334 | |
|
335 | 335 | The following options apply to all hosts. |
|
336 | 336 | |
|
337 | 337 | ``cookiefile`` |
|
338 | 338 | Path to a file containing HTTP cookie lines. Cookies matching a |
|
339 | 339 | host will be sent automatically. |
|
340 | 340 | |
|
341 | 341 | The file format uses the Mozilla cookies.txt format, which defines cookies |
|
342 | 342 | on their own lines. Each line contains 7 fields delimited by the tab |
|
343 | 343 | character (domain, is_domain_cookie, path, is_secure, expires, name, |
|
344 | 344 | value). For more info, do an Internet search for "Netscape cookies.txt |
|
345 | 345 | format." |
|
346 | 346 | |
|
347 | 347 | Note: the cookies parser does not handle port numbers on domains. You |
|
348 | 348 | will need to remove ports from the domain for the cookie to be recognized. |
|
349 | 349 | This could result in a cookie being disclosed to an unwanted server. |
|
350 | 350 | |
|
351 | 351 | The cookies file is read-only. |
|
352 | 352 | |
|
353 | 353 | Other options in this section are grouped by name and have the following |
|
354 | 354 | format:: |
|
355 | 355 | |
|
356 | 356 | <name>.<argument> = <value> |
|
357 | 357 | |
|
358 | 358 | where ``<name>`` is used to group arguments into authentication |
|
359 | 359 | entries. Example:: |
|
360 | 360 | |
|
361 | 361 | foo.prefix = hg.intevation.de/mercurial |
|
362 | 362 | foo.username = foo |
|
363 | 363 | foo.password = bar |
|
364 | 364 | foo.schemes = http https |
|
365 | 365 | |
|
366 | 366 | bar.prefix = secure.example.org |
|
367 | 367 | bar.key = path/to/file.key |
|
368 | 368 | bar.cert = path/to/file.cert |
|
369 | 369 | bar.schemes = https |
|
370 | 370 | |
|
371 | 371 | Supported arguments: |
|
372 | 372 | |
|
373 | 373 | ``prefix`` |
|
374 | 374 | Either ``*`` or a URI prefix with or without the scheme part. |
|
375 | 375 | The authentication entry with the longest matching prefix is used |
|
376 | 376 | (where ``*`` matches everything and counts as a match of length |
|
377 | 377 | 1). If the prefix doesn't include a scheme, the match is performed |
|
378 | 378 | against the URI with its scheme stripped as well, and the schemes |
|
379 | 379 | argument, q.v., is then subsequently consulted. |
|
380 | 380 | |
|
381 | 381 | ``username`` |
|
382 | 382 | Optional. Username to authenticate with. If not given, and the |
|
383 | 383 | remote site requires basic or digest authentication, the user will |
|
384 | 384 | be prompted for it. Environment variables are expanded in the |
|
385 | 385 | username letting you do ``foo.username = $USER``. If the URI |
|
386 | 386 | includes a username, only ``[auth]`` entries with a matching |
|
387 | 387 | username or without a username will be considered. |
|
388 | 388 | |
|
389 | 389 | ``password`` |
|
390 | 390 | Optional. Password to authenticate with. If not given, and the |
|
391 | 391 | remote site requires basic or digest authentication, the user |
|
392 | 392 | will be prompted for it. |
|
393 | 393 | |
|
394 | 394 | ``key`` |
|
395 | 395 | Optional. PEM encoded client certificate key file. Environment |
|
396 | 396 | variables are expanded in the filename. |
|
397 | 397 | |
|
398 | 398 | ``cert`` |
|
399 | 399 | Optional. PEM encoded client certificate chain file. Environment |
|
400 | 400 | variables are expanded in the filename. |
|
401 | 401 | |
|
402 | 402 | ``schemes`` |
|
403 | 403 | Optional. Space separated list of URI schemes to use this |
|
404 | 404 | authentication entry with. Only used if the prefix doesn't include |
|
405 | 405 | a scheme. Supported schemes are http and https. They will match |
|
406 | 406 | static-http and static-https respectively, as well. |
|
407 | 407 | (default: https) |
|
408 | 408 | |
|
409 | 409 | If no suitable authentication entry is found, the user is prompted |
|
410 | 410 | for credentials as usual if required by the remote. |
|
411 | 411 | |
|
412 | 412 | ``color`` |
|
413 | 413 | --------- |
|
414 | 414 | |
|
415 | 415 | Configure the Mercurial color mode. For details about how to define your custom |
|
416 | 416 | effect and style see :hg:`help color`. |
|
417 | 417 | |
|
418 | 418 | ``mode`` |
|
419 | 419 | String: control the method used to output color. One of ``auto``, ``ansi``, |
|
420 | 420 | ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will |
|
421 | 421 | use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a |
|
422 | 422 | terminal. Any invalid value will disable color. |
|
423 | 423 | |
|
424 | 424 | ``pagermode`` |
|
425 | 425 | String: optional override of ``color.mode`` used with pager. |
|
426 | 426 | |
|
427 | 427 | On some systems, terminfo mode may cause problems when using |
|
428 | 428 | color with ``less -R`` as a pager program. less with the -R option |
|
429 | 429 | will only display ECMA-48 color codes, and terminfo mode may sometimes |
|
430 | 430 | emit codes that less doesn't understand. You can work around this by |
|
431 | 431 | either using ansi mode (or auto mode), or by using less -r (which will |
|
432 | 432 | pass through all terminal control codes, not just color control |
|
433 | 433 | codes). |
|
434 | 434 | |
|
435 | 435 | On some systems (such as MSYS in Windows), the terminal may support |
|
436 | 436 | a different color mode than the pager program. |
|
437 | 437 | |
|
438 | 438 | ``commands`` |
|
439 | 439 | ------------ |
|
440 | 440 | |
|
441 | 441 | ``resolve.confirm`` |
|
442 | 442 | Confirm before performing action if no filename is passed. |
|
443 | 443 | (default: False) |
|
444 | 444 | |
|
445 | 445 | ``resolve.mark-check`` |
|
446 | 446 | Determines what level of checking :hg:`resolve --mark` will perform before |
|
447 | 447 | marking files as resolved. Valid values are ``none`, ``warn``, and |
|
448 | 448 | ``abort``. ``warn`` will output a warning listing the file(s) that still |
|
449 | 449 | have conflict markers in them, but will still mark everything resolved. |
|
450 | 450 | ``abort`` will output the same warning but will not mark things as resolved. |
|
451 | 451 | If --all is passed and this is set to ``abort``, only a warning will be |
|
452 | 452 | shown (an error will not be raised). |
|
453 | 453 | (default: ``none``) |
|
454 | 454 | |
|
455 | 455 | ``status.relative`` |
|
456 | 456 | Make paths in :hg:`status` output relative to the current directory. |
|
457 | 457 | (default: False) |
|
458 | 458 | |
|
459 | 459 | ``status.terse`` |
|
460 | 460 | Default value for the --terse flag, which condenes status output. |
|
461 | 461 | (default: empty) |
|
462 | 462 | |
|
463 | 463 | ``update.check`` |
|
464 | 464 | Determines what level of checking :hg:`update` will perform before moving |
|
465 | 465 | to a destination revision. Valid values are ``abort``, ``none``, |
|
466 | 466 | ``linear``, and ``noconflict``. ``abort`` always fails if the working |
|
467 | 467 | directory has uncommitted changes. ``none`` performs no checking, and may |
|
468 | 468 | result in a merge with uncommitted changes. ``linear`` allows any update |
|
469 | 469 | as long as it follows a straight line in the revision history, and may |
|
470 | 470 | trigger a merge with uncommitted changes. ``noconflict`` will allow any |
|
471 | 471 | update which would not trigger a merge with uncommitted changes, if any |
|
472 | 472 | are present. |
|
473 | 473 | (default: ``linear``) |
|
474 | 474 | |
|
475 | 475 | ``update.requiredest`` |
|
476 | 476 | Require that the user pass a destination when running :hg:`update`. |
|
477 | 477 | For example, :hg:`update .::` will be allowed, but a plain :hg:`update` |
|
478 | 478 | will be disallowed. |
|
479 | 479 | (default: False) |
|
480 | 480 | |
|
481 | 481 | ``committemplate`` |
|
482 | 482 | ------------------ |
|
483 | 483 | |
|
484 | 484 | ``changeset`` |
|
485 | 485 | String: configuration in this section is used as the template to |
|
486 | 486 | customize the text shown in the editor when committing. |
|
487 | 487 | |
|
488 | 488 | In addition to pre-defined template keywords, commit log specific one |
|
489 | 489 | below can be used for customization: |
|
490 | 490 | |
|
491 | 491 | ``extramsg`` |
|
492 | 492 | String: Extra message (typically 'Leave message empty to abort |
|
493 | 493 | commit.'). This may be changed by some commands or extensions. |
|
494 | 494 | |
|
495 | 495 | For example, the template configuration below shows as same text as |
|
496 | 496 | one shown by default:: |
|
497 | 497 | |
|
498 | 498 | [committemplate] |
|
499 | 499 | changeset = {desc}\n\n |
|
500 | 500 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
501 | 501 | HG: {extramsg} |
|
502 | 502 | HG: -- |
|
503 | 503 | HG: user: {author}\n{ifeq(p2rev, "-1", "", |
|
504 | 504 | "HG: branch merge\n") |
|
505 | 505 | }HG: branch '{branch}'\n{if(activebookmark, |
|
506 | 506 | "HG: bookmark '{activebookmark}'\n") }{subrepos % |
|
507 | 507 | "HG: subrepo {subrepo}\n" }{file_adds % |
|
508 | 508 | "HG: added {file}\n" }{file_mods % |
|
509 | 509 | "HG: changed {file}\n" }{file_dels % |
|
510 | 510 | "HG: removed {file}\n" }{if(files, "", |
|
511 | 511 | "HG: no files changed\n")} |
|
512 | 512 | |
|
513 | 513 | ``diff()`` |
|
514 | 514 | String: show the diff (see :hg:`help templates` for detail) |
|
515 | 515 | |
|
516 | 516 | Sometimes it is helpful to show the diff of the changeset in the editor without |
|
517 | 517 | having to prefix 'HG: ' to each line so that highlighting works correctly. For |
|
518 | 518 | this, Mercurial provides a special string which will ignore everything below |
|
519 | 519 | it:: |
|
520 | 520 | |
|
521 | 521 | HG: ------------------------ >8 ------------------------ |
|
522 | 522 | |
|
523 | 523 | For example, the template configuration below will show the diff below the |
|
524 | 524 | extra message:: |
|
525 | 525 | |
|
526 | 526 | [committemplate] |
|
527 | 527 | changeset = {desc}\n\n |
|
528 | 528 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
529 | 529 | HG: {extramsg} |
|
530 | 530 | HG: ------------------------ >8 ------------------------ |
|
531 | 531 | HG: Do not touch the line above. |
|
532 | 532 | HG: Everything below will be removed. |
|
533 | 533 | {diff()} |
|
534 | 534 | |
|
535 | 535 | .. note:: |
|
536 | 536 | |
|
537 | 537 | For some problematic encodings (see :hg:`help win32mbcs` for |
|
538 | 538 | detail), this customization should be configured carefully, to |
|
539 | 539 | avoid showing broken characters. |
|
540 | 540 | |
|
541 | 541 | For example, if a multibyte character ending with backslash (0x5c) is |
|
542 | 542 | followed by the ASCII character 'n' in the customized template, |
|
543 | 543 | the sequence of backslash and 'n' is treated as line-feed unexpectedly |
|
544 | 544 | (and the multibyte character is broken, too). |
|
545 | 545 | |
|
546 | 546 | Customized template is used for commands below (``--edit`` may be |
|
547 | 547 | required): |
|
548 | 548 | |
|
549 | 549 | - :hg:`backout` |
|
550 | 550 | - :hg:`commit` |
|
551 | 551 | - :hg:`fetch` (for merge commit only) |
|
552 | 552 | - :hg:`graft` |
|
553 | 553 | - :hg:`histedit` |
|
554 | 554 | - :hg:`import` |
|
555 | 555 | - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh` |
|
556 | 556 | - :hg:`rebase` |
|
557 | 557 | - :hg:`shelve` |
|
558 | 558 | - :hg:`sign` |
|
559 | 559 | - :hg:`tag` |
|
560 | 560 | - :hg:`transplant` |
|
561 | 561 | |
|
562 | 562 | Configuring items below instead of ``changeset`` allows showing |
|
563 | 563 | customized message only for specific actions, or showing different |
|
564 | 564 | messages for each action. |
|
565 | 565 | |
|
566 | 566 | - ``changeset.backout`` for :hg:`backout` |
|
567 | 567 | - ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges |
|
568 | 568 | - ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other |
|
569 | 569 | - ``changeset.commit.normal.merge`` for :hg:`commit` on merges |
|
570 | 570 | - ``changeset.commit.normal.normal`` for :hg:`commit` on other |
|
571 | 571 | - ``changeset.fetch`` for :hg:`fetch` (impling merge commit) |
|
572 | 572 | - ``changeset.gpg.sign`` for :hg:`sign` |
|
573 | 573 | - ``changeset.graft`` for :hg:`graft` |
|
574 | 574 | - ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit` |
|
575 | 575 | - ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit` |
|
576 | 576 | - ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit` |
|
577 | 577 | - ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit` |
|
578 | 578 | - ``changeset.import.bypass`` for :hg:`import --bypass` |
|
579 | 579 | - ``changeset.import.normal.merge`` for :hg:`import` on merges |
|
580 | 580 | - ``changeset.import.normal.normal`` for :hg:`import` on other |
|
581 | 581 | - ``changeset.mq.qnew`` for :hg:`qnew` |
|
582 | 582 | - ``changeset.mq.qfold`` for :hg:`qfold` |
|
583 | 583 | - ``changeset.mq.qrefresh`` for :hg:`qrefresh` |
|
584 | 584 | - ``changeset.rebase.collapse`` for :hg:`rebase --collapse` |
|
585 | 585 | - ``changeset.rebase.merge`` for :hg:`rebase` on merges |
|
586 | 586 | - ``changeset.rebase.normal`` for :hg:`rebase` on other |
|
587 | 587 | - ``changeset.shelve.shelve`` for :hg:`shelve` |
|
588 | 588 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` |
|
589 | 589 | - ``changeset.tag.remove`` for :hg:`tag --remove` |
|
590 | 590 | - ``changeset.transplant.merge`` for :hg:`transplant` on merges |
|
591 | 591 | - ``changeset.transplant.normal`` for :hg:`transplant` on other |
|
592 | 592 | |
|
593 | 593 | These dot-separated lists of names are treated as hierarchical ones. |
|
594 | 594 | For example, ``changeset.tag.remove`` customizes the commit message |
|
595 | 595 | only for :hg:`tag --remove`, but ``changeset.tag`` customizes the |
|
596 | 596 | commit message for :hg:`tag` regardless of ``--remove`` option. |
|
597 | 597 | |
|
598 | 598 | When the external editor is invoked for a commit, the corresponding |
|
599 | 599 | dot-separated list of names without the ``changeset.`` prefix |
|
600 | 600 | (e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment |
|
601 | 601 | variable. |
|
602 | 602 | |
|
603 | 603 | In this section, items other than ``changeset`` can be referred from |
|
604 | 604 | others. For example, the configuration to list committed files up |
|
605 | 605 | below can be referred as ``{listupfiles}``:: |
|
606 | 606 | |
|
607 | 607 | [committemplate] |
|
608 | 608 | listupfiles = {file_adds % |
|
609 | 609 | "HG: added {file}\n" }{file_mods % |
|
610 | 610 | "HG: changed {file}\n" }{file_dels % |
|
611 | 611 | "HG: removed {file}\n" }{if(files, "", |
|
612 | 612 | "HG: no files changed\n")} |
|
613 | 613 | |
|
614 | 614 | ``decode/encode`` |
|
615 | 615 | ----------------- |
|
616 | 616 | |
|
617 | 617 | Filters for transforming files on checkout/checkin. This would |
|
618 | 618 | typically be used for newline processing or other |
|
619 | 619 | localization/canonicalization of files. |
|
620 | 620 | |
|
621 | 621 | Filters consist of a filter pattern followed by a filter command. |
|
622 | 622 | Filter patterns are globs by default, rooted at the repository root. |
|
623 | 623 | For example, to match any file ending in ``.txt`` in the root |
|
624 | 624 | directory only, use the pattern ``*.txt``. To match any file ending |
|
625 | 625 | in ``.c`` anywhere in the repository, use the pattern ``**.c``. |
|
626 | 626 | For each file only the first matching filter applies. |
|
627 | 627 | |
|
628 | 628 | The filter command can start with a specifier, either ``pipe:`` or |
|
629 | 629 | ``tempfile:``. If no specifier is given, ``pipe:`` is used by default. |
|
630 | 630 | |
|
631 | 631 | A ``pipe:`` command must accept data on stdin and return the transformed |
|
632 | 632 | data on stdout. |
|
633 | 633 | |
|
634 | 634 | Pipe example:: |
|
635 | 635 | |
|
636 | 636 | [encode] |
|
637 | 637 | # uncompress gzip files on checkin to improve delta compression |
|
638 | 638 | # note: not necessarily a good idea, just an example |
|
639 | 639 | *.gz = pipe: gunzip |
|
640 | 640 | |
|
641 | 641 | [decode] |
|
642 | 642 | # recompress gzip files when writing them to the working dir (we |
|
643 | 643 | # can safely omit "pipe:", because it's the default) |
|
644 | 644 | *.gz = gzip |
|
645 | 645 | |
|
646 | 646 | A ``tempfile:`` command is a template. The string ``INFILE`` is replaced |
|
647 | 647 | with the name of a temporary file that contains the data to be |
|
648 | 648 | filtered by the command. The string ``OUTFILE`` is replaced with the name |
|
649 | 649 | of an empty temporary file, where the filtered data must be written by |
|
650 | 650 | the command. |
|
651 | 651 | |
|
652 | 652 | .. container:: windows |
|
653 | 653 | |
|
654 | 654 | .. note:: |
|
655 | 655 | |
|
656 | 656 | The tempfile mechanism is recommended for Windows systems, |
|
657 | 657 | where the standard shell I/O redirection operators often have |
|
658 | 658 | strange effects and may corrupt the contents of your files. |
|
659 | 659 | |
|
660 | 660 | This filter mechanism is used internally by the ``eol`` extension to |
|
661 | 661 | translate line ending characters between Windows (CRLF) and Unix (LF) |
|
662 | 662 | format. We suggest you use the ``eol`` extension for convenience. |
|
663 | 663 | |
|
664 | 664 | |
|
665 | 665 | ``defaults`` |
|
666 | 666 | ------------ |
|
667 | 667 | |
|
668 | 668 | (defaults are deprecated. Don't use them. Use aliases instead.) |
|
669 | 669 | |
|
670 | 670 | Use the ``[defaults]`` section to define command defaults, i.e. the |
|
671 | 671 | default options/arguments to pass to the specified commands. |
|
672 | 672 | |
|
673 | 673 | The following example makes :hg:`log` run in verbose mode, and |
|
674 | 674 | :hg:`status` show only the modified files, by default:: |
|
675 | 675 | |
|
676 | 676 | [defaults] |
|
677 | 677 | log = -v |
|
678 | 678 | status = -m |
|
679 | 679 | |
|
680 | 680 | The actual commands, instead of their aliases, must be used when |
|
681 | 681 | defining command defaults. The command defaults will also be applied |
|
682 | 682 | to the aliases of the commands defined. |
|
683 | 683 | |
|
684 | 684 | |
|
685 | 685 | ``diff`` |
|
686 | 686 | -------- |
|
687 | 687 | |
|
688 | 688 | Settings used when displaying diffs. Everything except for ``unified`` |
|
689 | 689 | is a Boolean and defaults to False. See :hg:`help config.annotate` |
|
690 | 690 | for related options for the annotate command. |
|
691 | 691 | |
|
692 | 692 | ``git`` |
|
693 | 693 | Use git extended diff format. |
|
694 | 694 | |
|
695 | 695 | ``nobinary`` |
|
696 | 696 | Omit git binary patches. |
|
697 | 697 | |
|
698 | 698 | ``nodates`` |
|
699 | 699 | Don't include dates in diff headers. |
|
700 | 700 | |
|
701 | 701 | ``noprefix`` |
|
702 | 702 | Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode. |
|
703 | 703 | |
|
704 | 704 | ``showfunc`` |
|
705 | 705 | Show which function each change is in. |
|
706 | 706 | |
|
707 | 707 | ``ignorews`` |
|
708 | 708 | Ignore white space when comparing lines. |
|
709 | 709 | |
|
710 | 710 | ``ignorewsamount`` |
|
711 | 711 | Ignore changes in the amount of white space. |
|
712 | 712 | |
|
713 | 713 | ``ignoreblanklines`` |
|
714 | 714 | Ignore changes whose lines are all blank. |
|
715 | 715 | |
|
716 | 716 | ``unified`` |
|
717 | 717 | Number of lines of context to show. |
|
718 | 718 | |
|
719 | 719 | ``word-diff`` |
|
720 | 720 | Highlight changed words. |
|
721 | 721 | |
|
722 | 722 | ``email`` |
|
723 | 723 | --------- |
|
724 | 724 | |
|
725 | 725 | Settings for extensions that send email messages. |
|
726 | 726 | |
|
727 | 727 | ``from`` |
|
728 | 728 | Optional. Email address to use in "From" header and SMTP envelope |
|
729 | 729 | of outgoing messages. |
|
730 | 730 | |
|
731 | 731 | ``to`` |
|
732 | 732 | Optional. Comma-separated list of recipients' email addresses. |
|
733 | 733 | |
|
734 | 734 | ``cc`` |
|
735 | 735 | Optional. Comma-separated list of carbon copy recipients' |
|
736 | 736 | email addresses. |
|
737 | 737 | |
|
738 | 738 | ``bcc`` |
|
739 | 739 | Optional. Comma-separated list of blind carbon copy recipients' |
|
740 | 740 | email addresses. |
|
741 | 741 | |
|
742 | 742 | ``method`` |
|
743 | 743 | Optional. Method to use to send email messages. If value is ``smtp`` |
|
744 | 744 | (default), use SMTP (see the ``[smtp]`` section for configuration). |
|
745 | 745 | Otherwise, use as name of program to run that acts like sendmail |
|
746 | 746 | (takes ``-f`` option for sender, list of recipients on command line, |
|
747 | 747 | message on stdin). Normally, setting this to ``sendmail`` or |
|
748 | 748 | ``/usr/sbin/sendmail`` is enough to use sendmail to send messages. |
|
749 | 749 | |
|
750 | 750 | ``charsets`` |
|
751 | 751 | Optional. Comma-separated list of character sets considered |
|
752 | 752 | convenient for recipients. Addresses, headers, and parts not |
|
753 | 753 | containing patches of outgoing messages will be encoded in the |
|
754 | 754 | first character set to which conversion from local encoding |
|
755 | 755 | (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct |
|
756 | 756 | conversion fails, the text in question is sent as is. |
|
757 | 757 | (default: '') |
|
758 | 758 | |
|
759 | 759 | Order of outgoing email character sets: |
|
760 | 760 | |
|
761 | 761 | 1. ``us-ascii``: always first, regardless of settings |
|
762 | 762 | 2. ``email.charsets``: in order given by user |
|
763 | 763 | 3. ``ui.fallbackencoding``: if not in email.charsets |
|
764 | 764 | 4. ``$HGENCODING``: if not in email.charsets |
|
765 | 765 | 5. ``utf-8``: always last, regardless of settings |
|
766 | 766 | |
|
767 | 767 | Email example:: |
|
768 | 768 | |
|
769 | 769 | [email] |
|
770 | 770 | from = Joseph User <joe.user@example.com> |
|
771 | 771 | method = /usr/sbin/sendmail |
|
772 | 772 | # charsets for western Europeans |
|
773 | 773 | # us-ascii, utf-8 omitted, as they are tried first and last |
|
774 | 774 | charsets = iso-8859-1, iso-8859-15, windows-1252 |
|
775 | 775 | |
|
776 | 776 | |
|
777 | 777 | ``extensions`` |
|
778 | 778 | -------------- |
|
779 | 779 | |
|
780 | 780 | Mercurial has an extension mechanism for adding new features. To |
|
781 | 781 | enable an extension, create an entry for it in this section. |
|
782 | 782 | |
|
783 | 783 | If you know that the extension is already in Python's search path, |
|
784 | 784 | you can give the name of the module, followed by ``=``, with nothing |
|
785 | 785 | after the ``=``. |
|
786 | 786 | |
|
787 | 787 | Otherwise, give a name that you choose, followed by ``=``, followed by |
|
788 | 788 | the path to the ``.py`` file (including the file name extension) that |
|
789 | 789 | defines the extension. |
|
790 | 790 | |
|
791 | 791 | To explicitly disable an extension that is enabled in an hgrc of |
|
792 | 792 | broader scope, prepend its path with ``!``, as in ``foo = !/ext/path`` |
|
793 | 793 | or ``foo = !`` when path is not supplied. |
|
794 | 794 | |
|
795 | 795 | Example for ``~/.hgrc``:: |
|
796 | 796 | |
|
797 | 797 | [extensions] |
|
798 | 798 | # (the churn extension will get loaded from Mercurial's path) |
|
799 | 799 | churn = |
|
800 | 800 | # (this extension will get loaded from the file specified) |
|
801 | 801 | myfeature = ~/.hgext/myfeature.py |
|
802 | 802 | |
|
803 | 803 | |
|
804 | 804 | ``format`` |
|
805 | 805 | ---------- |
|
806 | 806 | |
|
807 | 807 | Configuration that controls the repository format. Newer format options are more |
|
808 | 808 | powerful but incompatible with some older versions of Mercurial. Format options |
|
809 | 809 | are considered at repository initialization only. You need to make a new clone |
|
810 | 810 | for config change to be taken into account. |
|
811 | 811 | |
|
812 | 812 | For more details about repository format and version compatibility, see |
|
813 | 813 | https://www.mercurial-scm.org/wiki/MissingRequirement |
|
814 | 814 | |
|
815 | 815 | ``usegeneraldelta`` |
|
816 | 816 | Enable or disable the "generaldelta" repository format which improves |
|
817 | 817 | repository compression by allowing "revlog" to store delta against arbitrary |
|
818 | 818 | revision instead of the previous stored one. This provides significant |
|
819 | 819 | improvement for repositories with branches. |
|
820 | 820 | |
|
821 | 821 | Repositories with this on-disk format require Mercurial version 1.9. |
|
822 | 822 | |
|
823 | 823 | Enabled by default. |
|
824 | 824 | |
|
825 | 825 | ``dotencode`` |
|
826 | 826 | Enable or disable the "dotencode" repository format which enhances |
|
827 | 827 | the "fncache" repository format (which has to be enabled to use |
|
828 | 828 | dotencode) to avoid issues with filenames starting with ._ on |
|
829 | 829 | Mac OS X and spaces on Windows. |
|
830 | 830 | |
|
831 | 831 | Repositories with this on-disk format require Mercurial version 1.7. |
|
832 | 832 | |
|
833 | 833 | Enabled by default. |
|
834 | 834 | |
|
835 | 835 | ``usefncache`` |
|
836 | 836 | Enable or disable the "fncache" repository format which enhances |
|
837 | 837 | the "store" repository format (which has to be enabled to use |
|
838 | 838 | fncache) to allow longer filenames and avoids using Windows |
|
839 | 839 | reserved names, e.g. "nul". |
|
840 | 840 | |
|
841 | 841 | Repositories with this on-disk format require Mercurial version 1.1. |
|
842 | 842 | |
|
843 | 843 | Enabled by default. |
|
844 | 844 | |
|
845 | 845 | ``usestore`` |
|
846 | 846 | Enable or disable the "store" repository format which improves |
|
847 | 847 | compatibility with systems that fold case or otherwise mangle |
|
848 | 848 | filenames. Disabling this option will allow you to store longer filenames |
|
849 | 849 | in some situations at the expense of compatibility. |
|
850 | 850 | |
|
851 | 851 | Repositories with this on-disk format require Mercurial version 0.9.4. |
|
852 | 852 | |
|
853 | 853 | Enabled by default. |
|
854 | 854 | |
|
855 | 855 | ``graph`` |
|
856 | 856 | --------- |
|
857 | 857 | |
|
858 | 858 | Web graph view configuration. This section let you change graph |
|
859 | 859 | elements display properties by branches, for instance to make the |
|
860 | 860 | ``default`` branch stand out. |
|
861 | 861 | |
|
862 | 862 | Each line has the following format:: |
|
863 | 863 | |
|
864 | 864 | <branch>.<argument> = <value> |
|
865 | 865 | |
|
866 | 866 | where ``<branch>`` is the name of the branch being |
|
867 | 867 | customized. Example:: |
|
868 | 868 | |
|
869 | 869 | [graph] |
|
870 | 870 | # 2px width |
|
871 | 871 | default.width = 2 |
|
872 | 872 | # red color |
|
873 | 873 | default.color = FF0000 |
|
874 | 874 | |
|
875 | 875 | Supported arguments: |
|
876 | 876 | |
|
877 | 877 | ``width`` |
|
878 | 878 | Set branch edges width in pixels. |
|
879 | 879 | |
|
880 | 880 | ``color`` |
|
881 | 881 | Set branch edges color in hexadecimal RGB notation. |
|
882 | 882 | |
|
883 | 883 | ``hooks`` |
|
884 | 884 | --------- |
|
885 | 885 | |
|
886 | 886 | Commands or Python functions that get automatically executed by |
|
887 | 887 | various actions such as starting or finishing a commit. Multiple |
|
888 | 888 | hooks can be run for the same action by appending a suffix to the |
|
889 | 889 | action. Overriding a site-wide hook can be done by changing its |
|
890 | 890 | value or setting it to an empty string. Hooks can be prioritized |
|
891 | 891 | by adding a prefix of ``priority.`` to the hook name on a new line |
|
892 | 892 | and setting the priority. The default priority is 0. |
|
893 | 893 | |
|
894 | 894 | Example ``.hg/hgrc``:: |
|
895 | 895 | |
|
896 | 896 | [hooks] |
|
897 | 897 | # update working directory after adding changesets |
|
898 | 898 | changegroup.update = hg update |
|
899 | 899 | # do not use the site-wide hook |
|
900 | 900 | incoming = |
|
901 | 901 | incoming.email = /my/email/hook |
|
902 | 902 | incoming.autobuild = /my/build/hook |
|
903 | 903 | # force autobuild hook to run before other incoming hooks |
|
904 | 904 | priority.incoming.autobuild = 1 |
|
905 | 905 | |
|
906 | 906 | Most hooks are run with environment variables set that give useful |
|
907 | 907 | additional information. For each hook below, the environment variables |
|
908 | 908 | it is passed are listed with names in the form ``$HG_foo``. The |
|
909 | 909 | ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks. |
|
910 | 910 | They contain the type of hook which triggered the run and the full name |
|
911 | 911 | of the hook in the config, respectively. In the example above, this will |
|
912 | 912 | be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``. |
|
913 | 913 | |
|
914 | 914 | .. container:: windows |
|
915 | 915 | |
|
916 | 916 | Some basic Unix syntax can be enabled for portability, including ``$VAR`` |
|
917 | 917 | and ``${VAR}`` style variables. A ``~`` followed by ``\`` or ``/`` will |
|
918 | 918 | be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion |
|
919 | 919 | on Unix. To use a literal ``$`` or ``~``, it must be escaped with a back |
|
920 | 920 | slash or inside of a strong quote. Strong quotes will be replaced by |
|
921 | 921 | double quotes after processing. |
|
922 | 922 | |
|
923 | 923 | This feature is enabled by adding a prefix of ``tonative.`` to the hook |
|
924 | 924 | name on a new line, and setting it to ``True``. For example:: |
|
925 | 925 | |
|
926 | 926 | [hooks] |
|
927 | 927 | incoming.autobuild = /my/build/hook |
|
928 | 928 | # enable translation to cmd.exe syntax for autobuild hook |
|
929 | 929 | tonative.incoming.autobuild = True |
|
930 | 930 | |
|
931 | 931 | ``changegroup`` |
|
932 | 932 | Run after a changegroup has been added via push, pull or unbundle. The ID of |
|
933 | 933 | the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``. |
|
934 | 934 | The URL from which changes came is in ``$HG_URL``. |
|
935 | 935 | |
|
936 | 936 | ``commit`` |
|
937 | 937 | Run after a changeset has been created in the local repository. The ID |
|
938 | 938 | of the newly created changeset is in ``$HG_NODE``. Parent changeset |
|
939 | 939 | IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
940 | 940 | |
|
941 | 941 | ``incoming`` |
|
942 | 942 | Run after a changeset has been pulled, pushed, or unbundled into |
|
943 | 943 | the local repository. The ID of the newly arrived changeset is in |
|
944 | 944 | ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``. |
|
945 | 945 | |
|
946 | 946 | ``outgoing`` |
|
947 | 947 | Run after sending changes from the local repository to another. The ID of |
|
948 | 948 | first changeset sent is in ``$HG_NODE``. The source of operation is in |
|
949 | 949 | ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`. |
|
950 | 950 | |
|
951 | 951 | ``post-<command>`` |
|
952 | 952 | Run after successful invocations of the associated command. The |
|
953 | 953 | contents of the command line are passed as ``$HG_ARGS`` and the result |
|
954 | 954 | code in ``$HG_RESULT``. Parsed command line arguments are passed as |
|
955 | 955 | ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of |
|
956 | 956 | the python data internally passed to <command>. ``$HG_OPTS`` is a |
|
957 | 957 | dictionary of options (with unspecified options set to their defaults). |
|
958 | 958 | ``$HG_PATS`` is a list of arguments. Hook failure is ignored. |
|
959 | 959 | |
|
960 | 960 | ``fail-<command>`` |
|
961 | 961 | Run after a failed invocation of an associated command. The contents |
|
962 | 962 | of the command line are passed as ``$HG_ARGS``. Parsed command line |
|
963 | 963 | arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain |
|
964 | 964 | string representations of the python data internally passed to |
|
965 | 965 | <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified |
|
966 | 966 | options set to their defaults). ``$HG_PATS`` is a list of arguments. |
|
967 | 967 | Hook failure is ignored. |
|
968 | 968 | |
|
969 | 969 | ``pre-<command>`` |
|
970 | 970 | Run before executing the associated command. The contents of the |
|
971 | 971 | command line are passed as ``$HG_ARGS``. Parsed command line arguments |
|
972 | 972 | are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string |
|
973 | 973 | representations of the data internally passed to <command>. ``$HG_OPTS`` |
|
974 | 974 | is a dictionary of options (with unspecified options set to their |
|
975 | 975 | defaults). ``$HG_PATS`` is a list of arguments. If the hook returns |
|
976 | 976 | failure, the command doesn't execute and Mercurial returns the failure |
|
977 | 977 | code. |
|
978 | 978 | |
|
979 | 979 | ``prechangegroup`` |
|
980 | 980 | Run before a changegroup is added via push, pull or unbundle. Exit |
|
981 | 981 | status 0 allows the changegroup to proceed. A non-zero status will |
|
982 | 982 | cause the push, pull or unbundle to fail. The URL from which changes |
|
983 | 983 | will come is in ``$HG_URL``. |
|
984 | 984 | |
|
985 | 985 | ``precommit`` |
|
986 | 986 | Run before starting a local commit. Exit status 0 allows the |
|
987 | 987 | commit to proceed. A non-zero status will cause the commit to fail. |
|
988 | 988 | Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
989 | 989 | |
|
990 | 990 | ``prelistkeys`` |
|
991 | 991 | Run before listing pushkeys (like bookmarks) in the |
|
992 | 992 | repository. A non-zero status will cause failure. The key namespace is |
|
993 | 993 | in ``$HG_NAMESPACE``. |
|
994 | 994 | |
|
995 | 995 | ``preoutgoing`` |
|
996 | 996 | Run before collecting changes to send from the local repository to |
|
997 | 997 | another. A non-zero status will cause failure. This lets you prevent |
|
998 | 998 | pull over HTTP or SSH. It can also prevent propagating commits (via |
|
999 | 999 | local pull, push (outbound) or bundle commands), but not completely, |
|
1000 | 1000 | since you can just copy files instead. The source of operation is in |
|
1001 | 1001 | ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote |
|
1002 | 1002 | SSH or HTTP repository. If "push", "pull" or "bundle", the operation |
|
1003 | 1003 | is happening on behalf of a repository on same system. |
|
1004 | 1004 | |
|
1005 | 1005 | ``prepushkey`` |
|
1006 | 1006 | Run before a pushkey (like a bookmark) is added to the |
|
1007 | 1007 | repository. A non-zero status will cause the key to be rejected. The |
|
1008 | 1008 | key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``, |
|
1009 | 1009 | the old value (if any) is in ``$HG_OLD``, and the new value is in |
|
1010 | 1010 | ``$HG_NEW``. |
|
1011 | 1011 | |
|
1012 | 1012 | ``pretag`` |
|
1013 | 1013 | Run before creating a tag. Exit status 0 allows the tag to be |
|
1014 | 1014 | created. A non-zero status will cause the tag to fail. The ID of the |
|
1015 | 1015 | changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The |
|
1016 | 1016 | tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``. |
|
1017 | 1017 | |
|
1018 | 1018 | ``pretxnopen`` |
|
1019 | 1019 | Run before any new repository transaction is open. The reason for the |
|
1020 | 1020 | transaction will be in ``$HG_TXNNAME``, and a unique identifier for the |
|
1021 | 1021 | transaction will be in ``HG_TXNID``. A non-zero status will prevent the |
|
1022 | 1022 | transaction from being opened. |
|
1023 | 1023 | |
|
1024 | 1024 | ``pretxnclose`` |
|
1025 | 1025 | Run right before the transaction is actually finalized. Any repository change |
|
1026 | 1026 | will be visible to the hook program. This lets you validate the transaction |
|
1027 | 1027 | content or change it. Exit status 0 allows the commit to proceed. A non-zero |
|
1028 | 1028 | status will cause the transaction to be rolled back. The reason for the |
|
1029 | 1029 | transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for |
|
1030 | 1030 | the transaction will be in ``HG_TXNID``. The rest of the available data will |
|
1031 | 1031 | vary according the transaction type. New changesets will add ``$HG_NODE`` |
|
1032 | 1032 | (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last |
|
1033 | 1033 | added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and |
|
1034 | 1034 | phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1`` |
|
1035 | 1035 | respectively, etc. |
|
1036 | 1036 | |
|
1037 | 1037 | ``pretxnclose-bookmark`` |
|
1038 | 1038 | Run right before a bookmark change is actually finalized. Any repository |
|
1039 | 1039 | change will be visible to the hook program. This lets you validate the |
|
1040 | 1040 | transaction content or change it. Exit status 0 allows the commit to |
|
1041 | 1041 | proceed. A non-zero status will cause the transaction to be rolled back. |
|
1042 | 1042 | The name of the bookmark will be available in ``$HG_BOOKMARK``, the new |
|
1043 | 1043 | bookmark location will be available in ``$HG_NODE`` while the previous |
|
1044 | 1044 | location will be available in ``$HG_OLDNODE``. In case of a bookmark |
|
1045 | 1045 | creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE`` |
|
1046 | 1046 | will be empty. |
|
1047 | 1047 | In addition, the reason for the transaction opening will be in |
|
1048 | 1048 | ``$HG_TXNNAME``, and a unique identifier for the transaction will be in |
|
1049 | 1049 | ``HG_TXNID``. |
|
1050 | 1050 | |
|
1051 | 1051 | ``pretxnclose-phase`` |
|
1052 | 1052 | Run right before a phase change is actually finalized. Any repository change |
|
1053 | 1053 | will be visible to the hook program. This lets you validate the transaction |
|
1054 | 1054 | content or change it. Exit status 0 allows the commit to proceed. A non-zero |
|
1055 | 1055 | status will cause the transaction to be rolled back. The hook is called |
|
1056 | 1056 | multiple times, once for each revision affected by a phase change. |
|
1057 | 1057 | The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE`` |
|
1058 | 1058 | while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE`` |
|
1059 | 1059 | will be empty. In addition, the reason for the transaction opening will be in |
|
1060 | 1060 | ``$HG_TXNNAME``, and a unique identifier for the transaction will be in |
|
1061 | 1061 | ``HG_TXNID``. The hook is also run for newly added revisions. In this case |
|
1062 | 1062 | the ``$HG_OLDPHASE`` entry will be empty. |
|
1063 | 1063 | |
|
1064 | 1064 | ``txnclose`` |
|
1065 | 1065 | Run after any repository transaction has been committed. At this |
|
1066 | 1066 | point, the transaction can no longer be rolled back. The hook will run |
|
1067 | 1067 | after the lock is released. See :hg:`help config.hooks.pretxnclose` for |
|
1068 | 1068 | details about available variables. |
|
1069 | 1069 | |
|
1070 | 1070 | ``txnclose-bookmark`` |
|
1071 | 1071 | Run after any bookmark change has been committed. At this point, the |
|
1072 | 1072 | transaction can no longer be rolled back. The hook will run after the lock |
|
1073 | 1073 | is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details |
|
1074 | 1074 | about available variables. |
|
1075 | 1075 | |
|
1076 | 1076 | ``txnclose-phase`` |
|
1077 | 1077 | Run after any phase change has been committed. At this point, the |
|
1078 | 1078 | transaction can no longer be rolled back. The hook will run after the lock |
|
1079 | 1079 | is released. See :hg:`help config.hooks.pretxnclose-phase` for details about |
|
1080 | 1080 | available variables. |
|
1081 | 1081 | |
|
1082 | 1082 | ``txnabort`` |
|
1083 | 1083 | Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose` |
|
1084 | 1084 | for details about available variables. |
|
1085 | 1085 | |
|
1086 | 1086 | ``pretxnchangegroup`` |
|
1087 | 1087 | Run after a changegroup has been added via push, pull or unbundle, but before |
|
1088 | 1088 | the transaction has been committed. The changegroup is visible to the hook |
|
1089 | 1089 | program. This allows validation of incoming changes before accepting them. |
|
1090 | 1090 | The ID of the first new changeset is in ``$HG_NODE`` and last is in |
|
1091 | 1091 | ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero |
|
1092 | 1092 | status will cause the transaction to be rolled back, and the push, pull or |
|
1093 | 1093 | unbundle will fail. The URL that was the source of changes is in ``$HG_URL``. |
|
1094 | 1094 | |
|
1095 | 1095 | ``pretxncommit`` |
|
1096 | 1096 | Run after a changeset has been created, but before the transaction is |
|
1097 | 1097 | committed. The changeset is visible to the hook program. This allows |
|
1098 | 1098 | validation of the commit message and changes. Exit status 0 allows the |
|
1099 | 1099 | commit to proceed. A non-zero status will cause the transaction to |
|
1100 | 1100 | be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent |
|
1101 | 1101 | changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``. |
|
1102 | 1102 | |
|
1103 | 1103 | ``preupdate`` |
|
1104 | 1104 | Run before updating the working directory. Exit status 0 allows |
|
1105 | 1105 | the update to proceed. A non-zero status will prevent the update. |
|
1106 | 1106 | The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a |
|
1107 | 1107 | merge, the ID of second new parent is in ``$HG_PARENT2``. |
|
1108 | 1108 | |
|
1109 | 1109 | ``listkeys`` |
|
1110 | 1110 | Run after listing pushkeys (like bookmarks) in the repository. The |
|
1111 | 1111 | key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a |
|
1112 | 1112 | dictionary containing the keys and values. |
|
1113 | 1113 | |
|
1114 | 1114 | ``pushkey`` |
|
1115 | 1115 | Run after a pushkey (like a bookmark) is added to the |
|
1116 | 1116 | repository. The key namespace is in ``$HG_NAMESPACE``, the key is in |
|
1117 | 1117 | ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new |
|
1118 | 1118 | value is in ``$HG_NEW``. |
|
1119 | 1119 | |
|
1120 | 1120 | ``tag`` |
|
1121 | 1121 | Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``. |
|
1122 | 1122 | The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in |
|
1123 | 1123 | the repository if ``$HG_LOCAL=0``. |
|
1124 | 1124 | |
|
1125 | 1125 | ``update`` |
|
1126 | 1126 | Run after updating the working directory. The changeset ID of first |
|
1127 | 1127 | new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new |
|
1128 | 1128 | parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the |
|
1129 | 1129 | update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``. |
|
1130 | 1130 | |
|
1131 | 1131 | .. note:: |
|
1132 | 1132 | |
|
1133 | 1133 | It is generally better to use standard hooks rather than the |
|
1134 | 1134 | generic pre- and post- command hooks, as they are guaranteed to be |
|
1135 | 1135 | called in the appropriate contexts for influencing transactions. |
|
1136 | 1136 | Also, hooks like "commit" will be called in all contexts that |
|
1137 | 1137 | generate a commit (e.g. tag) and not just the commit command. |
|
1138 | 1138 | |
|
1139 | 1139 | .. note:: |
|
1140 | 1140 | |
|
1141 | 1141 | Environment variables with empty values may not be passed to |
|
1142 | 1142 | hooks on platforms such as Windows. As an example, ``$HG_PARENT2`` |
|
1143 | 1143 | will have an empty value under Unix-like platforms for non-merge |
|
1144 | 1144 | changesets, while it will not be available at all under Windows. |
|
1145 | 1145 | |
|
1146 | 1146 | The syntax for Python hooks is as follows:: |
|
1147 | 1147 | |
|
1148 | 1148 | hookname = python:modulename.submodule.callable |
|
1149 | 1149 | hookname = python:/path/to/python/module.py:callable |
|
1150 | 1150 | |
|
1151 | 1151 | Python hooks are run within the Mercurial process. Each hook is |
|
1152 | 1152 | called with at least three keyword arguments: a ui object (keyword |
|
1153 | 1153 | ``ui``), a repository object (keyword ``repo``), and a ``hooktype`` |
|
1154 | 1154 | keyword that tells what kind of hook is used. Arguments listed as |
|
1155 | 1155 | environment variables above are passed as keyword arguments, with no |
|
1156 | 1156 | ``HG_`` prefix, and names in lower case. |
|
1157 | 1157 | |
|
1158 | 1158 | If a Python hook returns a "true" value or raises an exception, this |
|
1159 | 1159 | is treated as a failure. |
|
1160 | 1160 | |
|
1161 | 1161 | |
|
1162 | 1162 | ``hostfingerprints`` |
|
1163 | 1163 | -------------------- |
|
1164 | 1164 | |
|
1165 | 1165 | (Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.) |
|
1166 | 1166 | |
|
1167 | 1167 | Fingerprints of the certificates of known HTTPS servers. |
|
1168 | 1168 | |
|
1169 | 1169 | A HTTPS connection to a server with a fingerprint configured here will |
|
1170 | 1170 | only succeed if the servers certificate matches the fingerprint. |
|
1171 | 1171 | This is very similar to how ssh known hosts works. |
|
1172 | 1172 | |
|
1173 | 1173 | The fingerprint is the SHA-1 hash value of the DER encoded certificate. |
|
1174 | 1174 | Multiple values can be specified (separated by spaces or commas). This can |
|
1175 | 1175 | be used to define both old and new fingerprints while a host transitions |
|
1176 | 1176 | to a new certificate. |
|
1177 | 1177 | |
|
1178 | 1178 | The CA chain and web.cacerts is not used for servers with a fingerprint. |
|
1179 | 1179 | |
|
1180 | 1180 | For example:: |
|
1181 | 1181 | |
|
1182 | 1182 | [hostfingerprints] |
|
1183 | 1183 | hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1184 | 1184 | hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 |
|
1185 | 1185 | |
|
1186 | 1186 | ``hostsecurity`` |
|
1187 | 1187 | ---------------- |
|
1188 | 1188 | |
|
1189 | 1189 | Used to specify global and per-host security settings for connecting to |
|
1190 | 1190 | other machines. |
|
1191 | 1191 | |
|
1192 | 1192 | The following options control default behavior for all hosts. |
|
1193 | 1193 | |
|
1194 | 1194 | ``ciphers`` |
|
1195 | 1195 | Defines the cryptographic ciphers to use for connections. |
|
1196 | 1196 | |
|
1197 | 1197 | Value must be a valid OpenSSL Cipher List Format as documented at |
|
1198 | 1198 | https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT. |
|
1199 | 1199 | |
|
1200 | 1200 | This setting is for advanced users only. Setting to incorrect values |
|
1201 | 1201 | can significantly lower connection security or decrease performance. |
|
1202 | 1202 | You have been warned. |
|
1203 | 1203 | |
|
1204 | 1204 | This option requires Python 2.7. |
|
1205 | 1205 | |
|
1206 | 1206 | ``minimumprotocol`` |
|
1207 | 1207 | Defines the minimum channel encryption protocol to use. |
|
1208 | 1208 | |
|
1209 | 1209 | By default, the highest version of TLS supported by both client and server |
|
1210 | 1210 | is used. |
|
1211 | 1211 | |
|
1212 | 1212 | Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``. |
|
1213 | 1213 | |
|
1214 | 1214 | When running on an old Python version, only ``tls1.0`` is allowed since |
|
1215 | 1215 | old versions of Python only support up to TLS 1.0. |
|
1216 | 1216 | |
|
1217 | 1217 | When running a Python that supports modern TLS versions, the default is |
|
1218 | 1218 | ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this |
|
1219 | 1219 | weakens security and should only be used as a feature of last resort if |
|
1220 | 1220 | a server does not support TLS 1.1+. |
|
1221 | 1221 | |
|
1222 | 1222 | Options in the ``[hostsecurity]`` section can have the form |
|
1223 | 1223 | ``hostname``:``setting``. This allows multiple settings to be defined on a |
|
1224 | 1224 | per-host basis. |
|
1225 | 1225 | |
|
1226 | 1226 | The following per-host settings can be defined. |
|
1227 | 1227 | |
|
1228 | 1228 | ``ciphers`` |
|
1229 | 1229 | This behaves like ``ciphers`` as described above except it only applies |
|
1230 | 1230 | to the host on which it is defined. |
|
1231 | 1231 | |
|
1232 | 1232 | ``fingerprints`` |
|
1233 | 1233 | A list of hashes of the DER encoded peer/remote certificate. Values have |
|
1234 | 1234 | the form ``algorithm``:``fingerprint``. e.g. |
|
1235 | 1235 | ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``. |
|
1236 | 1236 | In addition, colons (``:``) can appear in the fingerprint part. |
|
1237 | 1237 | |
|
1238 | 1238 | The following algorithms/prefixes are supported: ``sha1``, ``sha256``, |
|
1239 | 1239 | ``sha512``. |
|
1240 | 1240 | |
|
1241 | 1241 | Use of ``sha256`` or ``sha512`` is preferred. |
|
1242 | 1242 | |
|
1243 | 1243 | If a fingerprint is specified, the CA chain is not validated for this |
|
1244 | 1244 | host and Mercurial will require the remote certificate to match one |
|
1245 | 1245 | of the fingerprints specified. This means if the server updates its |
|
1246 | 1246 | certificate, Mercurial will abort until a new fingerprint is defined. |
|
1247 | 1247 | This can provide stronger security than traditional CA-based validation |
|
1248 | 1248 | at the expense of convenience. |
|
1249 | 1249 | |
|
1250 | 1250 | This option takes precedence over ``verifycertsfile``. |
|
1251 | 1251 | |
|
1252 | 1252 | ``minimumprotocol`` |
|
1253 | 1253 | This behaves like ``minimumprotocol`` as described above except it |
|
1254 | 1254 | only applies to the host on which it is defined. |
|
1255 | 1255 | |
|
1256 | 1256 | ``verifycertsfile`` |
|
1257 | 1257 | Path to file a containing a list of PEM encoded certificates used to |
|
1258 | 1258 | verify the server certificate. Environment variables and ``~user`` |
|
1259 | 1259 | constructs are expanded in the filename. |
|
1260 | 1260 | |
|
1261 | 1261 | The server certificate or the certificate's certificate authority (CA) |
|
1262 | 1262 | must match a certificate from this file or certificate verification |
|
1263 | 1263 | will fail and connections to the server will be refused. |
|
1264 | 1264 | |
|
1265 | 1265 | If defined, only certificates provided by this file will be used: |
|
1266 | 1266 | ``web.cacerts`` and any system/default certificates will not be |
|
1267 | 1267 | used. |
|
1268 | 1268 | |
|
1269 | 1269 | This option has no effect if the per-host ``fingerprints`` option |
|
1270 | 1270 | is set. |
|
1271 | 1271 | |
|
1272 | 1272 | The format of the file is as follows:: |
|
1273 | 1273 | |
|
1274 | 1274 | -----BEGIN CERTIFICATE----- |
|
1275 | 1275 | ... (certificate in base64 PEM encoding) ... |
|
1276 | 1276 | -----END CERTIFICATE----- |
|
1277 | 1277 | -----BEGIN CERTIFICATE----- |
|
1278 | 1278 | ... (certificate in base64 PEM encoding) ... |
|
1279 | 1279 | -----END CERTIFICATE----- |
|
1280 | 1280 | |
|
1281 | 1281 | For example:: |
|
1282 | 1282 | |
|
1283 | 1283 | [hostsecurity] |
|
1284 | 1284 | hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 |
|
1285 | 1285 | 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 |
|
1286 | 1286 | 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 |
|
1287 | 1287 | foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem |
|
1288 | 1288 | |
|
1289 | 1289 | To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1 |
|
1290 | 1290 | when connecting to ``hg.example.com``:: |
|
1291 | 1291 | |
|
1292 | 1292 | [hostsecurity] |
|
1293 | 1293 | minimumprotocol = tls1.2 |
|
1294 | 1294 | hg.example.com:minimumprotocol = tls1.1 |
|
1295 | 1295 | |
|
1296 | 1296 | ``http_proxy`` |
|
1297 | 1297 | -------------- |
|
1298 | 1298 | |
|
1299 | 1299 | Used to access web-based Mercurial repositories through a HTTP |
|
1300 | 1300 | proxy. |
|
1301 | 1301 | |
|
1302 | 1302 | ``host`` |
|
1303 | 1303 | Host name and (optional) port of the proxy server, for example |
|
1304 | 1304 | "myproxy:8000". |
|
1305 | 1305 | |
|
1306 | 1306 | ``no`` |
|
1307 | 1307 | Optional. Comma-separated list of host names that should bypass |
|
1308 | 1308 | the proxy. |
|
1309 | 1309 | |
|
1310 | 1310 | ``passwd`` |
|
1311 | 1311 | Optional. Password to authenticate with at the proxy server. |
|
1312 | 1312 | |
|
1313 | 1313 | ``user`` |
|
1314 | 1314 | Optional. User name to authenticate with at the proxy server. |
|
1315 | 1315 | |
|
1316 | 1316 | ``always`` |
|
1317 | 1317 | Optional. Always use the proxy, even for localhost and any entries |
|
1318 | 1318 | in ``http_proxy.no``. (default: False) |
|
1319 | 1319 | |
|
1320 | 1320 | ``merge`` |
|
1321 | 1321 | --------- |
|
1322 | 1322 | |
|
1323 | 1323 | This section specifies behavior during merges and updates. |
|
1324 | 1324 | |
|
1325 | 1325 | ``checkignored`` |
|
1326 | 1326 | Controls behavior when an ignored file on disk has the same name as a tracked |
|
1327 | 1327 | file in the changeset being merged or updated to, and has different |
|
1328 | 1328 | contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``, |
|
1329 | 1329 | abort on such files. With ``warn``, warn on such files and back them up as |
|
1330 | 1330 | ``.orig``. With ``ignore``, don't print a warning and back them up as |
|
1331 | 1331 | ``.orig``. (default: ``abort``) |
|
1332 | 1332 | |
|
1333 | 1333 | ``checkunknown`` |
|
1334 | 1334 | Controls behavior when an unknown file that isn't ignored has the same name |
|
1335 | 1335 | as a tracked file in the changeset being merged or updated to, and has |
|
1336 | 1336 | different contents. Similar to ``merge.checkignored``, except for files that |
|
1337 | 1337 | are not ignored. (default: ``abort``) |
|
1338 | 1338 | |
|
1339 | 1339 | ``on-failure`` |
|
1340 | 1340 | When set to ``continue`` (the default), the merge process attempts to |
|
1341 | 1341 | merge all unresolved files using the merge chosen tool, regardless of |
|
1342 | 1342 | whether previous file merge attempts during the process succeeded or not. |
|
1343 | 1343 | Setting this to ``prompt`` will prompt after any merge failure continue |
|
1344 | 1344 | or halt the merge process. Setting this to ``halt`` will automatically |
|
1345 | 1345 | halt the merge process on any merge tool failure. The merge process |
|
1346 | 1346 | can be restarted by using the ``resolve`` command. When a merge is |
|
1347 | 1347 | halted, the repository is left in a normal ``unresolved`` merge state. |
|
1348 | 1348 | (default: ``continue``) |
|
1349 | 1349 | |
|
1350 | ``strict-capability-check`` | |
|
1351 | Whether capabilities of internal merge tools are checked strictly | |
|
1352 | or not, while examining rules to decide merge tool to be used. | |
|
1353 | (default: False) | |
|
1354 | ||
|
1350 | 1355 | ``merge-patterns`` |
|
1351 | 1356 | ------------------ |
|
1352 | 1357 | |
|
1353 | 1358 | This section specifies merge tools to associate with particular file |
|
1354 | 1359 | patterns. Tools matched here will take precedence over the default |
|
1355 | 1360 | merge tool. Patterns are globs by default, rooted at the repository |
|
1356 | 1361 | root. |
|
1357 | 1362 | |
|
1358 | 1363 | Example:: |
|
1359 | 1364 | |
|
1360 | 1365 | [merge-patterns] |
|
1361 | 1366 | **.c = kdiff3 |
|
1362 | 1367 | **.jpg = myimgmerge |
|
1363 | 1368 | |
|
1364 | 1369 | ``merge-tools`` |
|
1365 | 1370 | --------------- |
|
1366 | 1371 | |
|
1367 | 1372 | This section configures external merge tools to use for file-level |
|
1368 | 1373 | merges. This section has likely been preconfigured at install time. |
|
1369 | 1374 | Use :hg:`config merge-tools` to check the existing configuration. |
|
1370 | 1375 | Also see :hg:`help merge-tools` for more details. |
|
1371 | 1376 | |
|
1372 | 1377 | Example ``~/.hgrc``:: |
|
1373 | 1378 | |
|
1374 | 1379 | [merge-tools] |
|
1375 | 1380 | # Override stock tool location |
|
1376 | 1381 | kdiff3.executable = ~/bin/kdiff3 |
|
1377 | 1382 | # Specify command line |
|
1378 | 1383 | kdiff3.args = $base $local $other -o $output |
|
1379 | 1384 | # Give higher priority |
|
1380 | 1385 | kdiff3.priority = 1 |
|
1381 | 1386 | |
|
1382 | 1387 | # Changing the priority of preconfigured tool |
|
1383 | 1388 | meld.priority = 0 |
|
1384 | 1389 | |
|
1385 | 1390 | # Disable a preconfigured tool |
|
1386 | 1391 | vimdiff.disabled = yes |
|
1387 | 1392 | |
|
1388 | 1393 | # Define new tool |
|
1389 | 1394 | myHtmlTool.args = -m $local $other $base $output |
|
1390 | 1395 | myHtmlTool.regkey = Software\FooSoftware\HtmlMerge |
|
1391 | 1396 | myHtmlTool.priority = 1 |
|
1392 | 1397 | |
|
1393 | 1398 | Supported arguments: |
|
1394 | 1399 | |
|
1395 | 1400 | ``priority`` |
|
1396 | 1401 | The priority in which to evaluate this tool. |
|
1397 | 1402 | (default: 0) |
|
1398 | 1403 | |
|
1399 | 1404 | ``executable`` |
|
1400 | 1405 | Either just the name of the executable or its pathname. |
|
1401 | 1406 | |
|
1402 | 1407 | .. container:: windows |
|
1403 | 1408 | |
|
1404 | 1409 | On Windows, the path can use environment variables with ${ProgramFiles} |
|
1405 | 1410 | syntax. |
|
1406 | 1411 | |
|
1407 | 1412 | (default: the tool name) |
|
1408 | 1413 | |
|
1409 | 1414 | ``args`` |
|
1410 | 1415 | The arguments to pass to the tool executable. You can refer to the |
|
1411 | 1416 | files being merged as well as the output file through these |
|
1412 | 1417 | variables: ``$base``, ``$local``, ``$other``, ``$output``. |
|
1413 | 1418 | |
|
1414 | 1419 | The meaning of ``$local`` and ``$other`` can vary depending on which action is |
|
1415 | 1420 | being performed. During an update or merge, ``$local`` represents the original |
|
1416 | 1421 | state of the file, while ``$other`` represents the commit you are updating to or |
|
1417 | 1422 | the commit you are merging with. During a rebase, ``$local`` represents the |
|
1418 | 1423 | destination of the rebase, and ``$other`` represents the commit being rebased. |
|
1419 | 1424 | |
|
1420 | 1425 | Some operations define custom labels to assist with identifying the revisions, |
|
1421 | 1426 | accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom |
|
1422 | 1427 | labels are not available, these will be ``local``, ``other``, and ``base``, |
|
1423 | 1428 | respectively. |
|
1424 | 1429 | (default: ``$local $base $other``) |
|
1425 | 1430 | |
|
1426 | 1431 | ``premerge`` |
|
1427 | 1432 | Attempt to run internal non-interactive 3-way merge tool before |
|
1428 | 1433 | launching external tool. Options are ``true``, ``false``, ``keep`` or |
|
1429 | 1434 | ``keep-merge3``. The ``keep`` option will leave markers in the file if the |
|
1430 | 1435 | premerge fails. The ``keep-merge3`` will do the same but include information |
|
1431 | 1436 | about the base of the merge in the marker (see internal :merge3 in |
|
1432 | 1437 | :hg:`help merge-tools`). |
|
1433 | 1438 | (default: True) |
|
1434 | 1439 | |
|
1435 | 1440 | ``binary`` |
|
1436 | 1441 | This tool can merge binary files. (default: False, unless tool |
|
1437 | 1442 | was selected by file pattern match) |
|
1438 | 1443 | |
|
1439 | 1444 | ``symlink`` |
|
1440 | 1445 | This tool can merge symlinks. (default: False) |
|
1441 | 1446 | |
|
1442 | 1447 | ``check`` |
|
1443 | 1448 | A list of merge success-checking options: |
|
1444 | 1449 | |
|
1445 | 1450 | ``changed`` |
|
1446 | 1451 | Ask whether merge was successful when the merged file shows no changes. |
|
1447 | 1452 | ``conflicts`` |
|
1448 | 1453 | Check whether there are conflicts even though the tool reported success. |
|
1449 | 1454 | ``prompt`` |
|
1450 | 1455 | Always prompt for merge success, regardless of success reported by tool. |
|
1451 | 1456 | |
|
1452 | 1457 | ``fixeol`` |
|
1453 | 1458 | Attempt to fix up EOL changes caused by the merge tool. |
|
1454 | 1459 | (default: False) |
|
1455 | 1460 | |
|
1456 | 1461 | ``gui`` |
|
1457 | 1462 | This tool requires a graphical interface to run. (default: False) |
|
1458 | 1463 | |
|
1459 | 1464 | ``mergemarkers`` |
|
1460 | 1465 | Controls whether the labels passed via ``$labellocal``, ``$labelother``, and |
|
1461 | 1466 | ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or |
|
1462 | 1467 | ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict |
|
1463 | 1468 | markers generated during premerge will be ``detailed`` if either this option or |
|
1464 | 1469 | the corresponding option in the ``[ui]`` section is ``detailed``. |
|
1465 | 1470 | (default: ``basic``) |
|
1466 | 1471 | |
|
1467 | 1472 | ``mergemarkertemplate`` |
|
1468 | 1473 | This setting can be used to override ``mergemarkertemplate`` from the ``[ui]`` |
|
1469 | 1474 | section on a per-tool basis; this applies to the ``$label``-prefixed variables |
|
1470 | 1475 | and to the conflict markers that are generated if ``premerge`` is ``keep` or |
|
1471 | 1476 | ``keep-merge3``. See the corresponding variable in ``[ui]`` for more |
|
1472 | 1477 | information. |
|
1473 | 1478 | |
|
1474 | 1479 | .. container:: windows |
|
1475 | 1480 | |
|
1476 | 1481 | ``regkey`` |
|
1477 | 1482 | Windows registry key which describes install location of this |
|
1478 | 1483 | tool. Mercurial will search for this key first under |
|
1479 | 1484 | ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``. |
|
1480 | 1485 | (default: None) |
|
1481 | 1486 | |
|
1482 | 1487 | ``regkeyalt`` |
|
1483 | 1488 | An alternate Windows registry key to try if the first key is not |
|
1484 | 1489 | found. The alternate key uses the same ``regname`` and ``regappend`` |
|
1485 | 1490 | semantics of the primary key. The most common use for this key |
|
1486 | 1491 | is to search for 32bit applications on 64bit operating systems. |
|
1487 | 1492 | (default: None) |
|
1488 | 1493 | |
|
1489 | 1494 | ``regname`` |
|
1490 | 1495 | Name of value to read from specified registry key. |
|
1491 | 1496 | (default: the unnamed (default) value) |
|
1492 | 1497 | |
|
1493 | 1498 | ``regappend`` |
|
1494 | 1499 | String to append to the value read from the registry, typically |
|
1495 | 1500 | the executable name of the tool. |
|
1496 | 1501 | (default: None) |
|
1497 | 1502 | |
|
1498 | 1503 | ``pager`` |
|
1499 | 1504 | --------- |
|
1500 | 1505 | |
|
1501 | 1506 | Setting used to control when to paginate and with what external tool. See |
|
1502 | 1507 | :hg:`help pager` for details. |
|
1503 | 1508 | |
|
1504 | 1509 | ``pager`` |
|
1505 | 1510 | Define the external tool used as pager. |
|
1506 | 1511 | |
|
1507 | 1512 | If no pager is set, Mercurial uses the environment variable $PAGER. |
|
1508 | 1513 | If neither pager.pager, nor $PAGER is set, a default pager will be |
|
1509 | 1514 | used, typically `less` on Unix and `more` on Windows. Example:: |
|
1510 | 1515 | |
|
1511 | 1516 | [pager] |
|
1512 | 1517 | pager = less -FRX |
|
1513 | 1518 | |
|
1514 | 1519 | ``ignore`` |
|
1515 | 1520 | List of commands to disable the pager for. Example:: |
|
1516 | 1521 | |
|
1517 | 1522 | [pager] |
|
1518 | 1523 | ignore = version, help, update |
|
1519 | 1524 | |
|
1520 | 1525 | ``patch`` |
|
1521 | 1526 | --------- |
|
1522 | 1527 | |
|
1523 | 1528 | Settings used when applying patches, for instance through the 'import' |
|
1524 | 1529 | command or with Mercurial Queues extension. |
|
1525 | 1530 | |
|
1526 | 1531 | ``eol`` |
|
1527 | 1532 | When set to 'strict' patch content and patched files end of lines |
|
1528 | 1533 | are preserved. When set to ``lf`` or ``crlf``, both files end of |
|
1529 | 1534 | lines are ignored when patching and the result line endings are |
|
1530 | 1535 | normalized to either LF (Unix) or CRLF (Windows). When set to |
|
1531 | 1536 | ``auto``, end of lines are again ignored while patching but line |
|
1532 | 1537 | endings in patched files are normalized to their original setting |
|
1533 | 1538 | on a per-file basis. If target file does not exist or has no end |
|
1534 | 1539 | of line, patch line endings are preserved. |
|
1535 | 1540 | (default: strict) |
|
1536 | 1541 | |
|
1537 | 1542 | ``fuzz`` |
|
1538 | 1543 | The number of lines of 'fuzz' to allow when applying patches. This |
|
1539 | 1544 | controls how much context the patcher is allowed to ignore when |
|
1540 | 1545 | trying to apply a patch. |
|
1541 | 1546 | (default: 2) |
|
1542 | 1547 | |
|
1543 | 1548 | ``paths`` |
|
1544 | 1549 | --------- |
|
1545 | 1550 | |
|
1546 | 1551 | Assigns symbolic names and behavior to repositories. |
|
1547 | 1552 | |
|
1548 | 1553 | Options are symbolic names defining the URL or directory that is the |
|
1549 | 1554 | location of the repository. Example:: |
|
1550 | 1555 | |
|
1551 | 1556 | [paths] |
|
1552 | 1557 | my_server = https://example.com/my_repo |
|
1553 | 1558 | local_path = /home/me/repo |
|
1554 | 1559 | |
|
1555 | 1560 | These symbolic names can be used from the command line. To pull |
|
1556 | 1561 | from ``my_server``: :hg:`pull my_server`. To push to ``local_path``: |
|
1557 | 1562 | :hg:`push local_path`. |
|
1558 | 1563 | |
|
1559 | 1564 | Options containing colons (``:``) denote sub-options that can influence |
|
1560 | 1565 | behavior for that specific path. Example:: |
|
1561 | 1566 | |
|
1562 | 1567 | [paths] |
|
1563 | 1568 | my_server = https://example.com/my_path |
|
1564 | 1569 | my_server:pushurl = ssh://example.com/my_path |
|
1565 | 1570 | |
|
1566 | 1571 | The following sub-options can be defined: |
|
1567 | 1572 | |
|
1568 | 1573 | ``pushurl`` |
|
1569 | 1574 | The URL to use for push operations. If not defined, the location |
|
1570 | 1575 | defined by the path's main entry is used. |
|
1571 | 1576 | |
|
1572 | 1577 | ``pushrev`` |
|
1573 | 1578 | A revset defining which revisions to push by default. |
|
1574 | 1579 | |
|
1575 | 1580 | When :hg:`push` is executed without a ``-r`` argument, the revset |
|
1576 | 1581 | defined by this sub-option is evaluated to determine what to push. |
|
1577 | 1582 | |
|
1578 | 1583 | For example, a value of ``.`` will push the working directory's |
|
1579 | 1584 | revision by default. |
|
1580 | 1585 | |
|
1581 | 1586 | Revsets specifying bookmarks will not result in the bookmark being |
|
1582 | 1587 | pushed. |
|
1583 | 1588 | |
|
1584 | 1589 | The following special named paths exist: |
|
1585 | 1590 | |
|
1586 | 1591 | ``default`` |
|
1587 | 1592 | The URL or directory to use when no source or remote is specified. |
|
1588 | 1593 | |
|
1589 | 1594 | :hg:`clone` will automatically define this path to the location the |
|
1590 | 1595 | repository was cloned from. |
|
1591 | 1596 | |
|
1592 | 1597 | ``default-push`` |
|
1593 | 1598 | (deprecated) The URL or directory for the default :hg:`push` location. |
|
1594 | 1599 | ``default:pushurl`` should be used instead. |
|
1595 | 1600 | |
|
1596 | 1601 | ``phases`` |
|
1597 | 1602 | ---------- |
|
1598 | 1603 | |
|
1599 | 1604 | Specifies default handling of phases. See :hg:`help phases` for more |
|
1600 | 1605 | information about working with phases. |
|
1601 | 1606 | |
|
1602 | 1607 | ``publish`` |
|
1603 | 1608 | Controls draft phase behavior when working as a server. When true, |
|
1604 | 1609 | pushed changesets are set to public in both client and server and |
|
1605 | 1610 | pulled or cloned changesets are set to public in the client. |
|
1606 | 1611 | (default: True) |
|
1607 | 1612 | |
|
1608 | 1613 | ``new-commit`` |
|
1609 | 1614 | Phase of newly-created commits. |
|
1610 | 1615 | (default: draft) |
|
1611 | 1616 | |
|
1612 | 1617 | ``checksubrepos`` |
|
1613 | 1618 | Check the phase of the current revision of each subrepository. Allowed |
|
1614 | 1619 | values are "ignore", "follow" and "abort". For settings other than |
|
1615 | 1620 | "ignore", the phase of the current revision of each subrepository is |
|
1616 | 1621 | checked before committing the parent repository. If any of those phases is |
|
1617 | 1622 | greater than the phase of the parent repository (e.g. if a subrepo is in a |
|
1618 | 1623 | "secret" phase while the parent repo is in "draft" phase), the commit is |
|
1619 | 1624 | either aborted (if checksubrepos is set to "abort") or the higher phase is |
|
1620 | 1625 | used for the parent repository commit (if set to "follow"). |
|
1621 | 1626 | (default: follow) |
|
1622 | 1627 | |
|
1623 | 1628 | |
|
1624 | 1629 | ``profiling`` |
|
1625 | 1630 | ------------- |
|
1626 | 1631 | |
|
1627 | 1632 | Specifies profiling type, format, and file output. Two profilers are |
|
1628 | 1633 | supported: an instrumenting profiler (named ``ls``), and a sampling |
|
1629 | 1634 | profiler (named ``stat``). |
|
1630 | 1635 | |
|
1631 | 1636 | In this section description, 'profiling data' stands for the raw data |
|
1632 | 1637 | collected during profiling, while 'profiling report' stands for a |
|
1633 | 1638 | statistical text report generated from the profiling data. |
|
1634 | 1639 | |
|
1635 | 1640 | ``enabled`` |
|
1636 | 1641 | Enable the profiler. |
|
1637 | 1642 | (default: false) |
|
1638 | 1643 | |
|
1639 | 1644 | This is equivalent to passing ``--profile`` on the command line. |
|
1640 | 1645 | |
|
1641 | 1646 | ``type`` |
|
1642 | 1647 | The type of profiler to use. |
|
1643 | 1648 | (default: stat) |
|
1644 | 1649 | |
|
1645 | 1650 | ``ls`` |
|
1646 | 1651 | Use Python's built-in instrumenting profiler. This profiler |
|
1647 | 1652 | works on all platforms, but each line number it reports is the |
|
1648 | 1653 | first line of a function. This restriction makes it difficult to |
|
1649 | 1654 | identify the expensive parts of a non-trivial function. |
|
1650 | 1655 | ``stat`` |
|
1651 | 1656 | Use a statistical profiler, statprof. This profiler is most |
|
1652 | 1657 | useful for profiling commands that run for longer than about 0.1 |
|
1653 | 1658 | seconds. |
|
1654 | 1659 | |
|
1655 | 1660 | ``format`` |
|
1656 | 1661 | Profiling format. Specific to the ``ls`` instrumenting profiler. |
|
1657 | 1662 | (default: text) |
|
1658 | 1663 | |
|
1659 | 1664 | ``text`` |
|
1660 | 1665 | Generate a profiling report. When saving to a file, it should be |
|
1661 | 1666 | noted that only the report is saved, and the profiling data is |
|
1662 | 1667 | not kept. |
|
1663 | 1668 | ``kcachegrind`` |
|
1664 | 1669 | Format profiling data for kcachegrind use: when saving to a |
|
1665 | 1670 | file, the generated file can directly be loaded into |
|
1666 | 1671 | kcachegrind. |
|
1667 | 1672 | |
|
1668 | 1673 | ``statformat`` |
|
1669 | 1674 | Profiling format for the ``stat`` profiler. |
|
1670 | 1675 | (default: hotpath) |
|
1671 | 1676 | |
|
1672 | 1677 | ``hotpath`` |
|
1673 | 1678 | Show a tree-based display containing the hot path of execution (where |
|
1674 | 1679 | most time was spent). |
|
1675 | 1680 | ``bymethod`` |
|
1676 | 1681 | Show a table of methods ordered by how frequently they are active. |
|
1677 | 1682 | ``byline`` |
|
1678 | 1683 | Show a table of lines in files ordered by how frequently they are active. |
|
1679 | 1684 | ``json`` |
|
1680 | 1685 | Render profiling data as JSON. |
|
1681 | 1686 | |
|
1682 | 1687 | ``frequency`` |
|
1683 | 1688 | Sampling frequency. Specific to the ``stat`` sampling profiler. |
|
1684 | 1689 | (default: 1000) |
|
1685 | 1690 | |
|
1686 | 1691 | ``output`` |
|
1687 | 1692 | File path where profiling data or report should be saved. If the |
|
1688 | 1693 | file exists, it is replaced. (default: None, data is printed on |
|
1689 | 1694 | stderr) |
|
1690 | 1695 | |
|
1691 | 1696 | ``sort`` |
|
1692 | 1697 | Sort field. Specific to the ``ls`` instrumenting profiler. |
|
1693 | 1698 | One of ``callcount``, ``reccallcount``, ``totaltime`` and |
|
1694 | 1699 | ``inlinetime``. |
|
1695 | 1700 | (default: inlinetime) |
|
1696 | 1701 | |
|
1697 | 1702 | ``time-track`` |
|
1698 | 1703 | Control if the stat profiler track ``cpu`` or ``real`` time. |
|
1699 | 1704 | (default: ``cpu``) |
|
1700 | 1705 | |
|
1701 | 1706 | ``limit`` |
|
1702 | 1707 | Number of lines to show. Specific to the ``ls`` instrumenting profiler. |
|
1703 | 1708 | (default: 30) |
|
1704 | 1709 | |
|
1705 | 1710 | ``nested`` |
|
1706 | 1711 | Show at most this number of lines of drill-down info after each main entry. |
|
1707 | 1712 | This can help explain the difference between Total and Inline. |
|
1708 | 1713 | Specific to the ``ls`` instrumenting profiler. |
|
1709 | 1714 | (default: 0) |
|
1710 | 1715 | |
|
1711 | 1716 | ``showmin`` |
|
1712 | 1717 | Minimum fraction of samples an entry must have for it to be displayed. |
|
1713 | 1718 | Can be specified as a float between ``0.0`` and ``1.0`` or can have a |
|
1714 | 1719 | ``%`` afterwards to allow values up to ``100``. e.g. ``5%``. |
|
1715 | 1720 | |
|
1716 | 1721 | Only used by the ``stat`` profiler. |
|
1717 | 1722 | |
|
1718 | 1723 | For the ``hotpath`` format, default is ``0.05``. |
|
1719 | 1724 | For the ``chrome`` format, default is ``0.005``. |
|
1720 | 1725 | |
|
1721 | 1726 | The option is unused on other formats. |
|
1722 | 1727 | |
|
1723 | 1728 | ``showmax`` |
|
1724 | 1729 | Maximum fraction of samples an entry can have before it is ignored in |
|
1725 | 1730 | display. Values format is the same as ``showmin``. |
|
1726 | 1731 | |
|
1727 | 1732 | Only used by the ``stat`` profiler. |
|
1728 | 1733 | |
|
1729 | 1734 | For the ``chrome`` format, default is ``0.999``. |
|
1730 | 1735 | |
|
1731 | 1736 | The option is unused on other formats. |
|
1732 | 1737 | |
|
1733 | 1738 | ``progress`` |
|
1734 | 1739 | ------------ |
|
1735 | 1740 | |
|
1736 | 1741 | Mercurial commands can draw progress bars that are as informative as |
|
1737 | 1742 | possible. Some progress bars only offer indeterminate information, while others |
|
1738 | 1743 | have a definite end point. |
|
1739 | 1744 | |
|
1740 | 1745 | ``delay`` |
|
1741 | 1746 | Number of seconds (float) before showing the progress bar. (default: 3) |
|
1742 | 1747 | |
|
1743 | 1748 | ``changedelay`` |
|
1744 | 1749 | Minimum delay before showing a new topic. When set to less than 3 * refresh, |
|
1745 | 1750 | that value will be used instead. (default: 1) |
|
1746 | 1751 | |
|
1747 | 1752 | ``estimateinterval`` |
|
1748 | 1753 | Maximum sampling interval in seconds for speed and estimated time |
|
1749 | 1754 | calculation. (default: 60) |
|
1750 | 1755 | |
|
1751 | 1756 | ``refresh`` |
|
1752 | 1757 | Time in seconds between refreshes of the progress bar. (default: 0.1) |
|
1753 | 1758 | |
|
1754 | 1759 | ``format`` |
|
1755 | 1760 | Format of the progress bar. |
|
1756 | 1761 | |
|
1757 | 1762 | Valid entries for the format field are ``topic``, ``bar``, ``number``, |
|
1758 | 1763 | ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the |
|
1759 | 1764 | last 20 characters of the item, but this can be changed by adding either |
|
1760 | 1765 | ``-<num>`` which would take the last num characters, or ``+<num>`` for the |
|
1761 | 1766 | first num characters. |
|
1762 | 1767 | |
|
1763 | 1768 | (default: topic bar number estimate) |
|
1764 | 1769 | |
|
1765 | 1770 | ``width`` |
|
1766 | 1771 | If set, the maximum width of the progress information (that is, min(width, |
|
1767 | 1772 | term width) will be used). |
|
1768 | 1773 | |
|
1769 | 1774 | ``clear-complete`` |
|
1770 | 1775 | Clear the progress bar after it's done. (default: True) |
|
1771 | 1776 | |
|
1772 | 1777 | ``disable`` |
|
1773 | 1778 | If true, don't show a progress bar. |
|
1774 | 1779 | |
|
1775 | 1780 | ``assume-tty`` |
|
1776 | 1781 | If true, ALWAYS show a progress bar, unless disable is given. |
|
1777 | 1782 | |
|
1778 | 1783 | ``rebase`` |
|
1779 | 1784 | ---------- |
|
1780 | 1785 | |
|
1781 | 1786 | ``evolution.allowdivergence`` |
|
1782 | 1787 | Default to False, when True allow creating divergence when performing |
|
1783 | 1788 | rebase of obsolete changesets. |
|
1784 | 1789 | |
|
1785 | 1790 | ``revsetalias`` |
|
1786 | 1791 | --------------- |
|
1787 | 1792 | |
|
1788 | 1793 | Alias definitions for revsets. See :hg:`help revsets` for details. |
|
1789 | 1794 | |
|
1790 | 1795 | ``storage`` |
|
1791 | 1796 | ----------- |
|
1792 | 1797 | |
|
1793 | 1798 | Control the strategy Mercurial uses internally to store history. Options in this |
|
1794 | 1799 | category impact performance and repository size. |
|
1795 | 1800 | |
|
1796 | 1801 | ``revlog.optimize-delta-parent-choice`` |
|
1797 | 1802 | When storing a merge revision, both parents will be equally considered as |
|
1798 | 1803 | a possible delta base. This results in better delta selection and improved |
|
1799 | 1804 | revlog compression. This option is enabled by default. |
|
1800 | 1805 | |
|
1801 | 1806 | Turning this option off can result in large increase of repository size for |
|
1802 | 1807 | repository with many merges. |
|
1803 | 1808 | |
|
1804 | 1809 | ``server`` |
|
1805 | 1810 | ---------- |
|
1806 | 1811 | |
|
1807 | 1812 | Controls generic server settings. |
|
1808 | 1813 | |
|
1809 | 1814 | ``bookmarks-pushkey-compat`` |
|
1810 | 1815 | Trigger pushkey hook when being pushed bookmark updates. This config exist |
|
1811 | 1816 | for compatibility purpose (default to True) |
|
1812 | 1817 | |
|
1813 | 1818 | If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark |
|
1814 | 1819 | movement we recommend you migrate them to ``txnclose-bookmark`` and |
|
1815 | 1820 | ``pretxnclose-bookmark``. |
|
1816 | 1821 | |
|
1817 | 1822 | ``compressionengines`` |
|
1818 | 1823 | List of compression engines and their relative priority to advertise |
|
1819 | 1824 | to clients. |
|
1820 | 1825 | |
|
1821 | 1826 | The order of compression engines determines their priority, the first |
|
1822 | 1827 | having the highest priority. If a compression engine is not listed |
|
1823 | 1828 | here, it won't be advertised to clients. |
|
1824 | 1829 | |
|
1825 | 1830 | If not set (the default), built-in defaults are used. Run |
|
1826 | 1831 | :hg:`debuginstall` to list available compression engines and their |
|
1827 | 1832 | default wire protocol priority. |
|
1828 | 1833 | |
|
1829 | 1834 | Older Mercurial clients only support zlib compression and this setting |
|
1830 | 1835 | has no effect for legacy clients. |
|
1831 | 1836 | |
|
1832 | 1837 | ``uncompressed`` |
|
1833 | 1838 | Whether to allow clients to clone a repository using the |
|
1834 | 1839 | uncompressed streaming protocol. This transfers about 40% more |
|
1835 | 1840 | data than a regular clone, but uses less memory and CPU on both |
|
1836 | 1841 | server and client. Over a LAN (100 Mbps or better) or a very fast |
|
1837 | 1842 | WAN, an uncompressed streaming clone is a lot faster (~10x) than a |
|
1838 | 1843 | regular clone. Over most WAN connections (anything slower than |
|
1839 | 1844 | about 6 Mbps), uncompressed streaming is slower, because of the |
|
1840 | 1845 | extra data transfer overhead. This mode will also temporarily hold |
|
1841 | 1846 | the write lock while determining what data to transfer. |
|
1842 | 1847 | (default: True) |
|
1843 | 1848 | |
|
1844 | 1849 | ``uncompressedallowsecret`` |
|
1845 | 1850 | Whether to allow stream clones when the repository contains secret |
|
1846 | 1851 | changesets. (default: False) |
|
1847 | 1852 | |
|
1848 | 1853 | ``preferuncompressed`` |
|
1849 | 1854 | When set, clients will try to use the uncompressed streaming |
|
1850 | 1855 | protocol. (default: False) |
|
1851 | 1856 | |
|
1852 | 1857 | ``disablefullbundle`` |
|
1853 | 1858 | When set, servers will refuse attempts to do pull-based clones. |
|
1854 | 1859 | If this option is set, ``preferuncompressed`` and/or clone bundles |
|
1855 | 1860 | are highly recommended. Partial clones will still be allowed. |
|
1856 | 1861 | (default: False) |
|
1857 | 1862 | |
|
1858 | 1863 | ``streamunbundle`` |
|
1859 | 1864 | When set, servers will apply data sent from the client directly, |
|
1860 | 1865 | otherwise it will be written to a temporary file first. This option |
|
1861 | 1866 | effectively prevents concurrent pushes. |
|
1862 | 1867 | |
|
1863 | 1868 | ``pullbundle`` |
|
1864 | 1869 | When set, the server will check pullbundle.manifest for bundles |
|
1865 | 1870 | covering the requested heads and common nodes. The first matching |
|
1866 | 1871 | entry will be streamed to the client. |
|
1867 | 1872 | |
|
1868 | 1873 | For HTTP transport, the stream will still use zlib compression |
|
1869 | 1874 | for older clients. |
|
1870 | 1875 | |
|
1871 | 1876 | ``concurrent-push-mode`` |
|
1872 | 1877 | Level of allowed race condition between two pushing clients. |
|
1873 | 1878 | |
|
1874 | 1879 | - 'strict': push is abort if another client touched the repository |
|
1875 | 1880 | while the push was preparing. (default) |
|
1876 | 1881 | - 'check-related': push is only aborted if it affects head that got also |
|
1877 | 1882 | affected while the push was preparing. |
|
1878 | 1883 | |
|
1879 | 1884 | This requires compatible client (version 4.3 and later). Old client will |
|
1880 | 1885 | use 'strict'. |
|
1881 | 1886 | |
|
1882 | 1887 | ``validate`` |
|
1883 | 1888 | Whether to validate the completeness of pushed changesets by |
|
1884 | 1889 | checking that all new file revisions specified in manifests are |
|
1885 | 1890 | present. (default: False) |
|
1886 | 1891 | |
|
1887 | 1892 | ``maxhttpheaderlen`` |
|
1888 | 1893 | Instruct HTTP clients not to send request headers longer than this |
|
1889 | 1894 | many bytes. (default: 1024) |
|
1890 | 1895 | |
|
1891 | 1896 | ``bundle1`` |
|
1892 | 1897 | Whether to allow clients to push and pull using the legacy bundle1 |
|
1893 | 1898 | exchange format. (default: True) |
|
1894 | 1899 | |
|
1895 | 1900 | ``bundle1gd`` |
|
1896 | 1901 | Like ``bundle1`` but only used if the repository is using the |
|
1897 | 1902 | *generaldelta* storage format. (default: True) |
|
1898 | 1903 | |
|
1899 | 1904 | ``bundle1.push`` |
|
1900 | 1905 | Whether to allow clients to push using the legacy bundle1 exchange |
|
1901 | 1906 | format. (default: True) |
|
1902 | 1907 | |
|
1903 | 1908 | ``bundle1gd.push`` |
|
1904 | 1909 | Like ``bundle1.push`` but only used if the repository is using the |
|
1905 | 1910 | *generaldelta* storage format. (default: True) |
|
1906 | 1911 | |
|
1907 | 1912 | ``bundle1.pull`` |
|
1908 | 1913 | Whether to allow clients to pull using the legacy bundle1 exchange |
|
1909 | 1914 | format. (default: True) |
|
1910 | 1915 | |
|
1911 | 1916 | ``bundle1gd.pull`` |
|
1912 | 1917 | Like ``bundle1.pull`` but only used if the repository is using the |
|
1913 | 1918 | *generaldelta* storage format. (default: True) |
|
1914 | 1919 | |
|
1915 | 1920 | Large repositories using the *generaldelta* storage format should |
|
1916 | 1921 | consider setting this option because converting *generaldelta* |
|
1917 | 1922 | repositories to the exchange format required by the bundle1 data |
|
1918 | 1923 | format can consume a lot of CPU. |
|
1919 | 1924 | |
|
1920 | 1925 | ``zliblevel`` |
|
1921 | 1926 | Integer between ``-1`` and ``9`` that controls the zlib compression level |
|
1922 | 1927 | for wire protocol commands that send zlib compressed output (notably the |
|
1923 | 1928 | commands that send repository history data). |
|
1924 | 1929 | |
|
1925 | 1930 | The default (``-1``) uses the default zlib compression level, which is |
|
1926 | 1931 | likely equivalent to ``6``. ``0`` means no compression. ``9`` means |
|
1927 | 1932 | maximum compression. |
|
1928 | 1933 | |
|
1929 | 1934 | Setting this option allows server operators to make trade-offs between |
|
1930 | 1935 | bandwidth and CPU used. Lowering the compression lowers CPU utilization |
|
1931 | 1936 | but sends more bytes to clients. |
|
1932 | 1937 | |
|
1933 | 1938 | This option only impacts the HTTP server. |
|
1934 | 1939 | |
|
1935 | 1940 | ``zstdlevel`` |
|
1936 | 1941 | Integer between ``1`` and ``22`` that controls the zstd compression level |
|
1937 | 1942 | for wire protocol commands. ``1`` is the minimal amount of compression and |
|
1938 | 1943 | ``22`` is the highest amount of compression. |
|
1939 | 1944 | |
|
1940 | 1945 | The default (``3``) should be significantly faster than zlib while likely |
|
1941 | 1946 | delivering better compression ratios. |
|
1942 | 1947 | |
|
1943 | 1948 | This option only impacts the HTTP server. |
|
1944 | 1949 | |
|
1945 | 1950 | See also ``server.zliblevel``. |
|
1946 | 1951 | |
|
1947 | 1952 | ``smtp`` |
|
1948 | 1953 | -------- |
|
1949 | 1954 | |
|
1950 | 1955 | Configuration for extensions that need to send email messages. |
|
1951 | 1956 | |
|
1952 | 1957 | ``host`` |
|
1953 | 1958 | Host name of mail server, e.g. "mail.example.com". |
|
1954 | 1959 | |
|
1955 | 1960 | ``port`` |
|
1956 | 1961 | Optional. Port to connect to on mail server. (default: 465 if |
|
1957 | 1962 | ``tls`` is smtps; 25 otherwise) |
|
1958 | 1963 | |
|
1959 | 1964 | ``tls`` |
|
1960 | 1965 | Optional. Method to enable TLS when connecting to mail server: starttls, |
|
1961 | 1966 | smtps or none. (default: none) |
|
1962 | 1967 | |
|
1963 | 1968 | ``username`` |
|
1964 | 1969 | Optional. User name for authenticating with the SMTP server. |
|
1965 | 1970 | (default: None) |
|
1966 | 1971 | |
|
1967 | 1972 | ``password`` |
|
1968 | 1973 | Optional. Password for authenticating with the SMTP server. If not |
|
1969 | 1974 | specified, interactive sessions will prompt the user for a |
|
1970 | 1975 | password; non-interactive sessions will fail. (default: None) |
|
1971 | 1976 | |
|
1972 | 1977 | ``local_hostname`` |
|
1973 | 1978 | Optional. The hostname that the sender can use to identify |
|
1974 | 1979 | itself to the MTA. |
|
1975 | 1980 | |
|
1976 | 1981 | |
|
1977 | 1982 | ``subpaths`` |
|
1978 | 1983 | ------------ |
|
1979 | 1984 | |
|
1980 | 1985 | Subrepository source URLs can go stale if a remote server changes name |
|
1981 | 1986 | or becomes temporarily unavailable. This section lets you define |
|
1982 | 1987 | rewrite rules of the form:: |
|
1983 | 1988 | |
|
1984 | 1989 | <pattern> = <replacement> |
|
1985 | 1990 | |
|
1986 | 1991 | where ``pattern`` is a regular expression matching a subrepository |
|
1987 | 1992 | source URL and ``replacement`` is the replacement string used to |
|
1988 | 1993 | rewrite it. Groups can be matched in ``pattern`` and referenced in |
|
1989 | 1994 | ``replacements``. For instance:: |
|
1990 | 1995 | |
|
1991 | 1996 | http://server/(.*)-hg/ = http://hg.server/\1/ |
|
1992 | 1997 | |
|
1993 | 1998 | rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``. |
|
1994 | 1999 | |
|
1995 | 2000 | Relative subrepository paths are first made absolute, and the |
|
1996 | 2001 | rewrite rules are then applied on the full (absolute) path. If ``pattern`` |
|
1997 | 2002 | doesn't match the full path, an attempt is made to apply it on the |
|
1998 | 2003 | relative path alone. The rules are applied in definition order. |
|
1999 | 2004 | |
|
2000 | 2005 | ``subrepos`` |
|
2001 | 2006 | ------------ |
|
2002 | 2007 | |
|
2003 | 2008 | This section contains options that control the behavior of the |
|
2004 | 2009 | subrepositories feature. See also :hg:`help subrepos`. |
|
2005 | 2010 | |
|
2006 | 2011 | Security note: auditing in Mercurial is known to be insufficient to |
|
2007 | 2012 | prevent clone-time code execution with carefully constructed Git |
|
2008 | 2013 | subrepos. It is unknown if a similar detect is present in Subversion |
|
2009 | 2014 | subrepos. Both Git and Subversion subrepos are disabled by default |
|
2010 | 2015 | out of security concerns. These subrepo types can be enabled using |
|
2011 | 2016 | the respective options below. |
|
2012 | 2017 | |
|
2013 | 2018 | ``allowed`` |
|
2014 | 2019 | Whether subrepositories are allowed in the working directory. |
|
2015 | 2020 | |
|
2016 | 2021 | When false, commands involving subrepositories (like :hg:`update`) |
|
2017 | 2022 | will fail for all subrepository types. |
|
2018 | 2023 | (default: true) |
|
2019 | 2024 | |
|
2020 | 2025 | ``hg:allowed`` |
|
2021 | 2026 | Whether Mercurial subrepositories are allowed in the working |
|
2022 | 2027 | directory. This option only has an effect if ``subrepos.allowed`` |
|
2023 | 2028 | is true. |
|
2024 | 2029 | (default: true) |
|
2025 | 2030 | |
|
2026 | 2031 | ``git:allowed`` |
|
2027 | 2032 | Whether Git subrepositories are allowed in the working directory. |
|
2028 | 2033 | This option only has an effect if ``subrepos.allowed`` is true. |
|
2029 | 2034 | |
|
2030 | 2035 | See the security note above before enabling Git subrepos. |
|
2031 | 2036 | (default: false) |
|
2032 | 2037 | |
|
2033 | 2038 | ``svn:allowed`` |
|
2034 | 2039 | Whether Subversion subrepositories are allowed in the working |
|
2035 | 2040 | directory. This option only has an effect if ``subrepos.allowed`` |
|
2036 | 2041 | is true. |
|
2037 | 2042 | |
|
2038 | 2043 | See the security note above before enabling Subversion subrepos. |
|
2039 | 2044 | (default: false) |
|
2040 | 2045 | |
|
2041 | 2046 | ``templatealias`` |
|
2042 | 2047 | ----------------- |
|
2043 | 2048 | |
|
2044 | 2049 | Alias definitions for templates. See :hg:`help templates` for details. |
|
2045 | 2050 | |
|
2046 | 2051 | ``templates`` |
|
2047 | 2052 | ------------- |
|
2048 | 2053 | |
|
2049 | 2054 | Use the ``[templates]`` section to define template strings. |
|
2050 | 2055 | See :hg:`help templates` for details. |
|
2051 | 2056 | |
|
2052 | 2057 | ``trusted`` |
|
2053 | 2058 | ----------- |
|
2054 | 2059 | |
|
2055 | 2060 | Mercurial will not use the settings in the |
|
2056 | 2061 | ``.hg/hgrc`` file from a repository if it doesn't belong to a trusted |
|
2057 | 2062 | user or to a trusted group, as various hgrc features allow arbitrary |
|
2058 | 2063 | commands to be run. This issue is often encountered when configuring |
|
2059 | 2064 | hooks or extensions for shared repositories or servers. However, |
|
2060 | 2065 | the web interface will use some safe settings from the ``[web]`` |
|
2061 | 2066 | section. |
|
2062 | 2067 | |
|
2063 | 2068 | This section specifies what users and groups are trusted. The |
|
2064 | 2069 | current user is always trusted. To trust everybody, list a user or a |
|
2065 | 2070 | group with name ``*``. These settings must be placed in an |
|
2066 | 2071 | *already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the |
|
2067 | 2072 | user or service running Mercurial. |
|
2068 | 2073 | |
|
2069 | 2074 | ``users`` |
|
2070 | 2075 | Comma-separated list of trusted users. |
|
2071 | 2076 | |
|
2072 | 2077 | ``groups`` |
|
2073 | 2078 | Comma-separated list of trusted groups. |
|
2074 | 2079 | |
|
2075 | 2080 | |
|
2076 | 2081 | ``ui`` |
|
2077 | 2082 | ------ |
|
2078 | 2083 | |
|
2079 | 2084 | User interface controls. |
|
2080 | 2085 | |
|
2081 | 2086 | ``archivemeta`` |
|
2082 | 2087 | Whether to include the .hg_archival.txt file containing meta data |
|
2083 | 2088 | (hashes for the repository base and for tip) in archives created |
|
2084 | 2089 | by the :hg:`archive` command or downloaded via hgweb. |
|
2085 | 2090 | (default: True) |
|
2086 | 2091 | |
|
2087 | 2092 | ``askusername`` |
|
2088 | 2093 | Whether to prompt for a username when committing. If True, and |
|
2089 | 2094 | neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will |
|
2090 | 2095 | be prompted to enter a username. If no username is entered, the |
|
2091 | 2096 | default ``USER@HOST`` is used instead. |
|
2092 | 2097 | (default: False) |
|
2093 | 2098 | |
|
2094 | 2099 | ``clonebundles`` |
|
2095 | 2100 | Whether the "clone bundles" feature is enabled. |
|
2096 | 2101 | |
|
2097 | 2102 | When enabled, :hg:`clone` may download and apply a server-advertised |
|
2098 | 2103 | bundle file from a URL instead of using the normal exchange mechanism. |
|
2099 | 2104 | |
|
2100 | 2105 | This can likely result in faster and more reliable clones. |
|
2101 | 2106 | |
|
2102 | 2107 | (default: True) |
|
2103 | 2108 | |
|
2104 | 2109 | ``clonebundlefallback`` |
|
2105 | 2110 | Whether failure to apply an advertised "clone bundle" from a server |
|
2106 | 2111 | should result in fallback to a regular clone. |
|
2107 | 2112 | |
|
2108 | 2113 | This is disabled by default because servers advertising "clone |
|
2109 | 2114 | bundles" often do so to reduce server load. If advertised bundles |
|
2110 | 2115 | start mass failing and clients automatically fall back to a regular |
|
2111 | 2116 | clone, this would add significant and unexpected load to the server |
|
2112 | 2117 | since the server is expecting clone operations to be offloaded to |
|
2113 | 2118 | pre-generated bundles. Failing fast (the default behavior) ensures |
|
2114 | 2119 | clients don't overwhelm the server when "clone bundle" application |
|
2115 | 2120 | fails. |
|
2116 | 2121 | |
|
2117 | 2122 | (default: False) |
|
2118 | 2123 | |
|
2119 | 2124 | ``clonebundleprefers`` |
|
2120 | 2125 | Defines preferences for which "clone bundles" to use. |
|
2121 | 2126 | |
|
2122 | 2127 | Servers advertising "clone bundles" may advertise multiple available |
|
2123 | 2128 | bundles. Each bundle may have different attributes, such as the bundle |
|
2124 | 2129 | type and compression format. This option is used to prefer a particular |
|
2125 | 2130 | bundle over another. |
|
2126 | 2131 | |
|
2127 | 2132 | The following keys are defined by Mercurial: |
|
2128 | 2133 | |
|
2129 | 2134 | BUNDLESPEC |
|
2130 | 2135 | A bundle type specifier. These are strings passed to :hg:`bundle -t`. |
|
2131 | 2136 | e.g. ``gzip-v2`` or ``bzip2-v1``. |
|
2132 | 2137 | |
|
2133 | 2138 | COMPRESSION |
|
2134 | 2139 | The compression format of the bundle. e.g. ``gzip`` and ``bzip2``. |
|
2135 | 2140 | |
|
2136 | 2141 | Server operators may define custom keys. |
|
2137 | 2142 | |
|
2138 | 2143 | Example values: ``COMPRESSION=bzip2``, |
|
2139 | 2144 | ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``. |
|
2140 | 2145 | |
|
2141 | 2146 | By default, the first bundle advertised by the server is used. |
|
2142 | 2147 | |
|
2143 | 2148 | ``color`` |
|
2144 | 2149 | When to colorize output. Possible value are Boolean ("yes" or "no"), or |
|
2145 | 2150 | "debug", or "always". (default: "yes"). "yes" will use color whenever it |
|
2146 | 2151 | seems possible. See :hg:`help color` for details. |
|
2147 | 2152 | |
|
2148 | 2153 | ``commitsubrepos`` |
|
2149 | 2154 | Whether to commit modified subrepositories when committing the |
|
2150 | 2155 | parent repository. If False and one subrepository has uncommitted |
|
2151 | 2156 | changes, abort the commit. |
|
2152 | 2157 | (default: False) |
|
2153 | 2158 | |
|
2154 | 2159 | ``debug`` |
|
2155 | 2160 | Print debugging information. (default: False) |
|
2156 | 2161 | |
|
2157 | 2162 | ``editor`` |
|
2158 | 2163 | The editor to use during a commit. (default: ``$EDITOR`` or ``vi``) |
|
2159 | 2164 | |
|
2160 | 2165 | ``fallbackencoding`` |
|
2161 | 2166 | Encoding to try if it's not possible to decode the changelog using |
|
2162 | 2167 | UTF-8. (default: ISO-8859-1) |
|
2163 | 2168 | |
|
2164 | 2169 | ``graphnodetemplate`` |
|
2165 | 2170 | The template used to print changeset nodes in an ASCII revision graph. |
|
2166 | 2171 | (default: ``{graphnode}``) |
|
2167 | 2172 | |
|
2168 | 2173 | ``ignore`` |
|
2169 | 2174 | A file to read per-user ignore patterns from. This file should be |
|
2170 | 2175 | in the same format as a repository-wide .hgignore file. Filenames |
|
2171 | 2176 | are relative to the repository root. This option supports hook syntax, |
|
2172 | 2177 | so if you want to specify multiple ignore files, you can do so by |
|
2173 | 2178 | setting something like ``ignore.other = ~/.hgignore2``. For details |
|
2174 | 2179 | of the ignore file format, see the ``hgignore(5)`` man page. |
|
2175 | 2180 | |
|
2176 | 2181 | ``interactive`` |
|
2177 | 2182 | Allow to prompt the user. (default: True) |
|
2178 | 2183 | |
|
2179 | 2184 | ``interface`` |
|
2180 | 2185 | Select the default interface for interactive features (default: text). |
|
2181 | 2186 | Possible values are 'text' and 'curses'. |
|
2182 | 2187 | |
|
2183 | 2188 | ``interface.chunkselector`` |
|
2184 | 2189 | Select the interface for change recording (e.g. :hg:`commit -i`). |
|
2185 | 2190 | Possible values are 'text' and 'curses'. |
|
2186 | 2191 | This config overrides the interface specified by ui.interface. |
|
2187 | 2192 | |
|
2188 | 2193 | ``large-file-limit`` |
|
2189 | 2194 | Largest file size that gives no memory use warning. |
|
2190 | 2195 | Possible values are integers or 0 to disable the check. |
|
2191 | 2196 | (default: 10000000) |
|
2192 | 2197 | |
|
2193 | 2198 | ``logtemplate`` |
|
2194 | 2199 | Template string for commands that print changesets. |
|
2195 | 2200 | |
|
2196 | 2201 | ``merge`` |
|
2197 | 2202 | The conflict resolution program to use during a manual merge. |
|
2198 | 2203 | For more information on merge tools see :hg:`help merge-tools`. |
|
2199 | 2204 | For configuring merge tools see the ``[merge-tools]`` section. |
|
2200 | 2205 | |
|
2201 | 2206 | ``mergemarkers`` |
|
2202 | 2207 | Sets the merge conflict marker label styling. The ``detailed`` |
|
2203 | 2208 | style uses the ``mergemarkertemplate`` setting to style the labels. |
|
2204 | 2209 | The ``basic`` style just uses 'local' and 'other' as the marker label. |
|
2205 | 2210 | One of ``basic`` or ``detailed``. |
|
2206 | 2211 | (default: ``basic``) |
|
2207 | 2212 | |
|
2208 | 2213 | ``mergemarkertemplate`` |
|
2209 | 2214 | The template used to print the commit description next to each conflict |
|
2210 | 2215 | marker during merge conflicts. See :hg:`help templates` for the template |
|
2211 | 2216 | format. |
|
2212 | 2217 | |
|
2213 | 2218 | Defaults to showing the hash, tags, branches, bookmarks, author, and |
|
2214 | 2219 | the first line of the commit description. |
|
2215 | 2220 | |
|
2216 | 2221 | If you use non-ASCII characters in names for tags, branches, bookmarks, |
|
2217 | 2222 | authors, and/or commit descriptions, you must pay attention to encodings of |
|
2218 | 2223 | managed files. At template expansion, non-ASCII characters use the encoding |
|
2219 | 2224 | specified by the ``--encoding`` global option, ``HGENCODING`` or other |
|
2220 | 2225 | environment variables that govern your locale. If the encoding of the merge |
|
2221 | 2226 | markers is different from the encoding of the merged files, |
|
2222 | 2227 | serious problems may occur. |
|
2223 | 2228 | |
|
2224 | 2229 | Can be overridden per-merge-tool, see the ``[merge-tools]`` section. |
|
2225 | 2230 | |
|
2226 | 2231 | ``origbackuppath`` |
|
2227 | 2232 | The path to a directory used to store generated .orig files. If the path is |
|
2228 | 2233 | not a directory, one will be created. If set, files stored in this |
|
2229 | 2234 | directory have the same name as the original file and do not have a .orig |
|
2230 | 2235 | suffix. |
|
2231 | 2236 | |
|
2232 | 2237 | ``paginate`` |
|
2233 | 2238 | Control the pagination of command output (default: True). See :hg:`help pager` |
|
2234 | 2239 | for details. |
|
2235 | 2240 | |
|
2236 | 2241 | ``patch`` |
|
2237 | 2242 | An optional external tool that ``hg import`` and some extensions |
|
2238 | 2243 | will use for applying patches. By default Mercurial uses an |
|
2239 | 2244 | internal patch utility. The external tool must work as the common |
|
2240 | 2245 | Unix ``patch`` program. In particular, it must accept a ``-p`` |
|
2241 | 2246 | argument to strip patch headers, a ``-d`` argument to specify the |
|
2242 | 2247 | current directory, a file name to patch, and a patch file to take |
|
2243 | 2248 | from stdin. |
|
2244 | 2249 | |
|
2245 | 2250 | It is possible to specify a patch tool together with extra |
|
2246 | 2251 | arguments. For example, setting this option to ``patch --merge`` |
|
2247 | 2252 | will use the ``patch`` program with its 2-way merge option. |
|
2248 | 2253 | |
|
2249 | 2254 | ``portablefilenames`` |
|
2250 | 2255 | Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``. |
|
2251 | 2256 | (default: ``warn``) |
|
2252 | 2257 | |
|
2253 | 2258 | ``warn`` |
|
2254 | 2259 | Print a warning message on POSIX platforms, if a file with a non-portable |
|
2255 | 2260 | filename is added (e.g. a file with a name that can't be created on |
|
2256 | 2261 | Windows because it contains reserved parts like ``AUX``, reserved |
|
2257 | 2262 | characters like ``:``, or would cause a case collision with an existing |
|
2258 | 2263 | file). |
|
2259 | 2264 | |
|
2260 | 2265 | ``ignore`` |
|
2261 | 2266 | Don't print a warning. |
|
2262 | 2267 | |
|
2263 | 2268 | ``abort`` |
|
2264 | 2269 | The command is aborted. |
|
2265 | 2270 | |
|
2266 | 2271 | ``true`` |
|
2267 | 2272 | Alias for ``warn``. |
|
2268 | 2273 | |
|
2269 | 2274 | ``false`` |
|
2270 | 2275 | Alias for ``ignore``. |
|
2271 | 2276 | |
|
2272 | 2277 | .. container:: windows |
|
2273 | 2278 | |
|
2274 | 2279 | On Windows, this configuration option is ignored and the command aborted. |
|
2275 | 2280 | |
|
2276 | 2281 | ``quiet`` |
|
2277 | 2282 | Reduce the amount of output printed. |
|
2278 | 2283 | (default: False) |
|
2279 | 2284 | |
|
2280 | 2285 | ``remotecmd`` |
|
2281 | 2286 | Remote command to use for clone/push/pull operations. |
|
2282 | 2287 | (default: ``hg``) |
|
2283 | 2288 | |
|
2284 | 2289 | ``report_untrusted`` |
|
2285 | 2290 | Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a |
|
2286 | 2291 | trusted user or group. |
|
2287 | 2292 | (default: True) |
|
2288 | 2293 | |
|
2289 | 2294 | ``slash`` |
|
2290 | 2295 | (Deprecated. Use ``slashpath`` template filter instead.) |
|
2291 | 2296 | |
|
2292 | 2297 | Display paths using a slash (``/``) as the path separator. This |
|
2293 | 2298 | only makes a difference on systems where the default path |
|
2294 | 2299 | separator is not the slash character (e.g. Windows uses the |
|
2295 | 2300 | backslash character (``\``)). |
|
2296 | 2301 | (default: False) |
|
2297 | 2302 | |
|
2298 | 2303 | ``statuscopies`` |
|
2299 | 2304 | Display copies in the status command. |
|
2300 | 2305 | |
|
2301 | 2306 | ``ssh`` |
|
2302 | 2307 | Command to use for SSH connections. (default: ``ssh``) |
|
2303 | 2308 | |
|
2304 | 2309 | ``ssherrorhint`` |
|
2305 | 2310 | A hint shown to the user in the case of SSH error (e.g. |
|
2306 | 2311 | ``Please see http://company/internalwiki/ssh.html``) |
|
2307 | 2312 | |
|
2308 | 2313 | ``strict`` |
|
2309 | 2314 | Require exact command names, instead of allowing unambiguous |
|
2310 | 2315 | abbreviations. (default: False) |
|
2311 | 2316 | |
|
2312 | 2317 | ``style`` |
|
2313 | 2318 | Name of style to use for command output. |
|
2314 | 2319 | |
|
2315 | 2320 | ``supportcontact`` |
|
2316 | 2321 | A URL where users should report a Mercurial traceback. Use this if you are a |
|
2317 | 2322 | large organisation with its own Mercurial deployment process and crash |
|
2318 | 2323 | reports should be addressed to your internal support. |
|
2319 | 2324 | |
|
2320 | 2325 | ``textwidth`` |
|
2321 | 2326 | Maximum width of help text. A longer line generated by ``hg help`` or |
|
2322 | 2327 | ``hg subcommand --help`` will be broken after white space to get this |
|
2323 | 2328 | width or the terminal width, whichever comes first. |
|
2324 | 2329 | A non-positive value will disable this and the terminal width will be |
|
2325 | 2330 | used. (default: 78) |
|
2326 | 2331 | |
|
2327 | 2332 | ``timeout`` |
|
2328 | 2333 | The timeout used when a lock is held (in seconds), a negative value |
|
2329 | 2334 | means no timeout. (default: 600) |
|
2330 | 2335 | |
|
2331 | 2336 | ``timeout.warn`` |
|
2332 | 2337 | Time (in seconds) before a warning is printed about held lock. A negative |
|
2333 | 2338 | value means no warning. (default: 0) |
|
2334 | 2339 | |
|
2335 | 2340 | ``traceback`` |
|
2336 | 2341 | Mercurial always prints a traceback when an unknown exception |
|
2337 | 2342 | occurs. Setting this to True will make Mercurial print a traceback |
|
2338 | 2343 | on all exceptions, even those recognized by Mercurial (such as |
|
2339 | 2344 | IOError or MemoryError). (default: False) |
|
2340 | 2345 | |
|
2341 | 2346 | ``tweakdefaults`` |
|
2342 | 2347 | |
|
2343 | 2348 | By default Mercurial's behavior changes very little from release |
|
2344 | 2349 | to release, but over time the recommended config settings |
|
2345 | 2350 | shift. Enable this config to opt in to get automatic tweaks to |
|
2346 | 2351 | Mercurial's behavior over time. This config setting will have no |
|
2347 | 2352 | effet if ``HGPLAIN` is set or ``HGPLAINEXCEPT`` is set and does |
|
2348 | 2353 | not include ``tweakdefaults``. (default: False) |
|
2349 | 2354 | |
|
2350 | 2355 | ``username`` |
|
2351 | 2356 | The committer of a changeset created when running "commit". |
|
2352 | 2357 | Typically a person's name and email address, e.g. ``Fred Widget |
|
2353 | 2358 | <fred@example.com>``. Environment variables in the |
|
2354 | 2359 | username are expanded. |
|
2355 | 2360 | |
|
2356 | 2361 | (default: ``$EMAIL`` or ``username@hostname``. If the username in |
|
2357 | 2362 | hgrc is empty, e.g. if the system admin set ``username =`` in the |
|
2358 | 2363 | system hgrc, it has to be specified manually or in a different |
|
2359 | 2364 | hgrc file) |
|
2360 | 2365 | |
|
2361 | 2366 | ``verbose`` |
|
2362 | 2367 | Increase the amount of output printed. (default: False) |
|
2363 | 2368 | |
|
2364 | 2369 | |
|
2365 | 2370 | ``web`` |
|
2366 | 2371 | ------- |
|
2367 | 2372 | |
|
2368 | 2373 | Web interface configuration. The settings in this section apply to |
|
2369 | 2374 | both the builtin webserver (started by :hg:`serve`) and the script you |
|
2370 | 2375 | run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI |
|
2371 | 2376 | and WSGI). |
|
2372 | 2377 | |
|
2373 | 2378 | The Mercurial webserver does no authentication (it does not prompt for |
|
2374 | 2379 | usernames and passwords to validate *who* users are), but it does do |
|
2375 | 2380 | authorization (it grants or denies access for *authenticated users* |
|
2376 | 2381 | based on settings in this section). You must either configure your |
|
2377 | 2382 | webserver to do authentication for you, or disable the authorization |
|
2378 | 2383 | checks. |
|
2379 | 2384 | |
|
2380 | 2385 | For a quick setup in a trusted environment, e.g., a private LAN, where |
|
2381 | 2386 | you want it to accept pushes from anybody, you can use the following |
|
2382 | 2387 | command line:: |
|
2383 | 2388 | |
|
2384 | 2389 | $ hg --config web.allow-push=* --config web.push_ssl=False serve |
|
2385 | 2390 | |
|
2386 | 2391 | Note that this will allow anybody to push anything to the server and |
|
2387 | 2392 | that this should not be used for public servers. |
|
2388 | 2393 | |
|
2389 | 2394 | The full set of options is: |
|
2390 | 2395 | |
|
2391 | 2396 | ``accesslog`` |
|
2392 | 2397 | Where to output the access log. (default: stdout) |
|
2393 | 2398 | |
|
2394 | 2399 | ``address`` |
|
2395 | 2400 | Interface address to bind to. (default: all) |
|
2396 | 2401 | |
|
2397 | 2402 | ``allow-archive`` |
|
2398 | 2403 | List of archive format (bz2, gz, zip) allowed for downloading. |
|
2399 | 2404 | (default: empty) |
|
2400 | 2405 | |
|
2401 | 2406 | ``allowbz2`` |
|
2402 | 2407 | (DEPRECATED) Whether to allow .tar.bz2 downloading of repository |
|
2403 | 2408 | revisions. |
|
2404 | 2409 | (default: False) |
|
2405 | 2410 | |
|
2406 | 2411 | ``allowgz`` |
|
2407 | 2412 | (DEPRECATED) Whether to allow .tar.gz downloading of repository |
|
2408 | 2413 | revisions. |
|
2409 | 2414 | (default: False) |
|
2410 | 2415 | |
|
2411 | 2416 | ``allow-pull`` |
|
2412 | 2417 | Whether to allow pulling from the repository. (default: True) |
|
2413 | 2418 | |
|
2414 | 2419 | ``allow-push`` |
|
2415 | 2420 | Whether to allow pushing to the repository. If empty or not set, |
|
2416 | 2421 | pushing is not allowed. If the special value ``*``, any remote |
|
2417 | 2422 | user can push, including unauthenticated users. Otherwise, the |
|
2418 | 2423 | remote user must have been authenticated, and the authenticated |
|
2419 | 2424 | user name must be present in this list. The contents of the |
|
2420 | 2425 | allow-push list are examined after the deny_push list. |
|
2421 | 2426 | |
|
2422 | 2427 | ``allow_read`` |
|
2423 | 2428 | If the user has not already been denied repository access due to |
|
2424 | 2429 | the contents of deny_read, this list determines whether to grant |
|
2425 | 2430 | repository access to the user. If this list is not empty, and the |
|
2426 | 2431 | user is unauthenticated or not present in the list, then access is |
|
2427 | 2432 | denied for the user. If the list is empty or not set, then access |
|
2428 | 2433 | is permitted to all users by default. Setting allow_read to the |
|
2429 | 2434 | special value ``*`` is equivalent to it not being set (i.e. access |
|
2430 | 2435 | is permitted to all users). The contents of the allow_read list are |
|
2431 | 2436 | examined after the deny_read list. |
|
2432 | 2437 | |
|
2433 | 2438 | ``allowzip`` |
|
2434 | 2439 | (DEPRECATED) Whether to allow .zip downloading of repository |
|
2435 | 2440 | revisions. This feature creates temporary files. |
|
2436 | 2441 | (default: False) |
|
2437 | 2442 | |
|
2438 | 2443 | ``archivesubrepos`` |
|
2439 | 2444 | Whether to recurse into subrepositories when archiving. |
|
2440 | 2445 | (default: False) |
|
2441 | 2446 | |
|
2442 | 2447 | ``baseurl`` |
|
2443 | 2448 | Base URL to use when publishing URLs in other locations, so |
|
2444 | 2449 | third-party tools like email notification hooks can construct |
|
2445 | 2450 | URLs. Example: ``http://hgserver/repos/``. |
|
2446 | 2451 | |
|
2447 | 2452 | ``cacerts`` |
|
2448 | 2453 | Path to file containing a list of PEM encoded certificate |
|
2449 | 2454 | authority certificates. Environment variables and ``~user`` |
|
2450 | 2455 | constructs are expanded in the filename. If specified on the |
|
2451 | 2456 | client, then it will verify the identity of remote HTTPS servers |
|
2452 | 2457 | with these certificates. |
|
2453 | 2458 | |
|
2454 | 2459 | To disable SSL verification temporarily, specify ``--insecure`` from |
|
2455 | 2460 | command line. |
|
2456 | 2461 | |
|
2457 | 2462 | You can use OpenSSL's CA certificate file if your platform has |
|
2458 | 2463 | one. On most Linux systems this will be |
|
2459 | 2464 | ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to |
|
2460 | 2465 | generate this file manually. The form must be as follows:: |
|
2461 | 2466 | |
|
2462 | 2467 | -----BEGIN CERTIFICATE----- |
|
2463 | 2468 | ... (certificate in base64 PEM encoding) ... |
|
2464 | 2469 | -----END CERTIFICATE----- |
|
2465 | 2470 | -----BEGIN CERTIFICATE----- |
|
2466 | 2471 | ... (certificate in base64 PEM encoding) ... |
|
2467 | 2472 | -----END CERTIFICATE----- |
|
2468 | 2473 | |
|
2469 | 2474 | ``cache`` |
|
2470 | 2475 | Whether to support caching in hgweb. (default: True) |
|
2471 | 2476 | |
|
2472 | 2477 | ``certificate`` |
|
2473 | 2478 | Certificate to use when running :hg:`serve`. |
|
2474 | 2479 | |
|
2475 | 2480 | ``collapse`` |
|
2476 | 2481 | With ``descend`` enabled, repositories in subdirectories are shown at |
|
2477 | 2482 | a single level alongside repositories in the current path. With |
|
2478 | 2483 | ``collapse`` also enabled, repositories residing at a deeper level than |
|
2479 | 2484 | the current path are grouped behind navigable directory entries that |
|
2480 | 2485 | lead to the locations of these repositories. In effect, this setting |
|
2481 | 2486 | collapses each collection of repositories found within a subdirectory |
|
2482 | 2487 | into a single entry for that subdirectory. (default: False) |
|
2483 | 2488 | |
|
2484 | 2489 | ``comparisoncontext`` |
|
2485 | 2490 | Number of lines of context to show in side-by-side file comparison. If |
|
2486 | 2491 | negative or the value ``full``, whole files are shown. (default: 5) |
|
2487 | 2492 | |
|
2488 | 2493 | This setting can be overridden by a ``context`` request parameter to the |
|
2489 | 2494 | ``comparison`` command, taking the same values. |
|
2490 | 2495 | |
|
2491 | 2496 | ``contact`` |
|
2492 | 2497 | Name or email address of the person in charge of the repository. |
|
2493 | 2498 | (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty) |
|
2494 | 2499 | |
|
2495 | 2500 | ``csp`` |
|
2496 | 2501 | Send a ``Content-Security-Policy`` HTTP header with this value. |
|
2497 | 2502 | |
|
2498 | 2503 | The value may contain a special string ``%nonce%``, which will be replaced |
|
2499 | 2504 | by a randomly-generated one-time use value. If the value contains |
|
2500 | 2505 | ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the |
|
2501 | 2506 | one-time property of the nonce. This nonce will also be inserted into |
|
2502 | 2507 | ``<script>`` elements containing inline JavaScript. |
|
2503 | 2508 | |
|
2504 | 2509 | Note: lots of HTML content sent by the server is derived from repository |
|
2505 | 2510 | data. Please consider the potential for malicious repository data to |
|
2506 | 2511 | "inject" itself into generated HTML content as part of your security |
|
2507 | 2512 | threat model. |
|
2508 | 2513 | |
|
2509 | 2514 | ``deny_push`` |
|
2510 | 2515 | Whether to deny pushing to the repository. If empty or not set, |
|
2511 | 2516 | push is not denied. If the special value ``*``, all remote users are |
|
2512 | 2517 | denied push. Otherwise, unauthenticated users are all denied, and |
|
2513 | 2518 | any authenticated user name present in this list is also denied. The |
|
2514 | 2519 | contents of the deny_push list are examined before the allow-push list. |
|
2515 | 2520 | |
|
2516 | 2521 | ``deny_read`` |
|
2517 | 2522 | Whether to deny reading/viewing of the repository. If this list is |
|
2518 | 2523 | not empty, unauthenticated users are all denied, and any |
|
2519 | 2524 | authenticated user name present in this list is also denied access to |
|
2520 | 2525 | the repository. If set to the special value ``*``, all remote users |
|
2521 | 2526 | are denied access (rarely needed ;). If deny_read is empty or not set, |
|
2522 | 2527 | the determination of repository access depends on the presence and |
|
2523 | 2528 | content of the allow_read list (see description). If both |
|
2524 | 2529 | deny_read and allow_read are empty or not set, then access is |
|
2525 | 2530 | permitted to all users by default. If the repository is being |
|
2526 | 2531 | served via hgwebdir, denied users will not be able to see it in |
|
2527 | 2532 | the list of repositories. The contents of the deny_read list have |
|
2528 | 2533 | priority over (are examined before) the contents of the allow_read |
|
2529 | 2534 | list. |
|
2530 | 2535 | |
|
2531 | 2536 | ``descend`` |
|
2532 | 2537 | hgwebdir indexes will not descend into subdirectories. Only repositories |
|
2533 | 2538 | directly in the current path will be shown (other repositories are still |
|
2534 | 2539 | available from the index corresponding to their containing path). |
|
2535 | 2540 | |
|
2536 | 2541 | ``description`` |
|
2537 | 2542 | Textual description of the repository's purpose or contents. |
|
2538 | 2543 | (default: "unknown") |
|
2539 | 2544 | |
|
2540 | 2545 | ``encoding`` |
|
2541 | 2546 | Character encoding name. (default: the current locale charset) |
|
2542 | 2547 | Example: "UTF-8". |
|
2543 | 2548 | |
|
2544 | 2549 | ``errorlog`` |
|
2545 | 2550 | Where to output the error log. (default: stderr) |
|
2546 | 2551 | |
|
2547 | 2552 | ``guessmime`` |
|
2548 | 2553 | Control MIME types for raw download of file content. |
|
2549 | 2554 | Set to True to let hgweb guess the content type from the file |
|
2550 | 2555 | extension. This will serve HTML files as ``text/html`` and might |
|
2551 | 2556 | allow cross-site scripting attacks when serving untrusted |
|
2552 | 2557 | repositories. (default: False) |
|
2553 | 2558 | |
|
2554 | 2559 | ``hidden`` |
|
2555 | 2560 | Whether to hide the repository in the hgwebdir index. |
|
2556 | 2561 | (default: False) |
|
2557 | 2562 | |
|
2558 | 2563 | ``ipv6`` |
|
2559 | 2564 | Whether to use IPv6. (default: False) |
|
2560 | 2565 | |
|
2561 | 2566 | ``labels`` |
|
2562 | 2567 | List of string *labels* associated with the repository. |
|
2563 | 2568 | |
|
2564 | 2569 | Labels are exposed as a template keyword and can be used to customize |
|
2565 | 2570 | output. e.g. the ``index`` template can group or filter repositories |
|
2566 | 2571 | by labels and the ``summary`` template can display additional content |
|
2567 | 2572 | if a specific label is present. |
|
2568 | 2573 | |
|
2569 | 2574 | ``logoimg`` |
|
2570 | 2575 | File name of the logo image that some templates display on each page. |
|
2571 | 2576 | The file name is relative to ``staticurl``. That is, the full path to |
|
2572 | 2577 | the logo image is "staticurl/logoimg". |
|
2573 | 2578 | If unset, ``hglogo.png`` will be used. |
|
2574 | 2579 | |
|
2575 | 2580 | ``logourl`` |
|
2576 | 2581 | Base URL to use for logos. If unset, ``https://mercurial-scm.org/`` |
|
2577 | 2582 | will be used. |
|
2578 | 2583 | |
|
2579 | 2584 | ``maxchanges`` |
|
2580 | 2585 | Maximum number of changes to list on the changelog. (default: 10) |
|
2581 | 2586 | |
|
2582 | 2587 | ``maxfiles`` |
|
2583 | 2588 | Maximum number of files to list per changeset. (default: 10) |
|
2584 | 2589 | |
|
2585 | 2590 | ``maxshortchanges`` |
|
2586 | 2591 | Maximum number of changes to list on the shortlog, graph or filelog |
|
2587 | 2592 | pages. (default: 60) |
|
2588 | 2593 | |
|
2589 | 2594 | ``name`` |
|
2590 | 2595 | Repository name to use in the web interface. |
|
2591 | 2596 | (default: current working directory) |
|
2592 | 2597 | |
|
2593 | 2598 | ``port`` |
|
2594 | 2599 | Port to listen on. (default: 8000) |
|
2595 | 2600 | |
|
2596 | 2601 | ``prefix`` |
|
2597 | 2602 | Prefix path to serve from. (default: '' (server root)) |
|
2598 | 2603 | |
|
2599 | 2604 | ``push_ssl`` |
|
2600 | 2605 | Whether to require that inbound pushes be transported over SSL to |
|
2601 | 2606 | prevent password sniffing. (default: True) |
|
2602 | 2607 | |
|
2603 | 2608 | ``refreshinterval`` |
|
2604 | 2609 | How frequently directory listings re-scan the filesystem for new |
|
2605 | 2610 | repositories, in seconds. This is relevant when wildcards are used |
|
2606 | 2611 | to define paths. Depending on how much filesystem traversal is |
|
2607 | 2612 | required, refreshing may negatively impact performance. |
|
2608 | 2613 | |
|
2609 | 2614 | Values less than or equal to 0 always refresh. |
|
2610 | 2615 | (default: 20) |
|
2611 | 2616 | |
|
2612 | 2617 | ``server-header`` |
|
2613 | 2618 | Value for HTTP ``Server`` response header. |
|
2614 | 2619 | |
|
2615 | 2620 | ``staticurl`` |
|
2616 | 2621 | Base URL to use for static files. If unset, static files (e.g. the |
|
2617 | 2622 | hgicon.png favicon) will be served by the CGI script itself. Use |
|
2618 | 2623 | this setting to serve them directly with the HTTP server. |
|
2619 | 2624 | Example: ``http://hgserver/static/``. |
|
2620 | 2625 | |
|
2621 | 2626 | ``stripes`` |
|
2622 | 2627 | How many lines a "zebra stripe" should span in multi-line output. |
|
2623 | 2628 | Set to 0 to disable. (default: 1) |
|
2624 | 2629 | |
|
2625 | 2630 | ``style`` |
|
2626 | 2631 | Which template map style to use. The available options are the names of |
|
2627 | 2632 | subdirectories in the HTML templates path. (default: ``paper``) |
|
2628 | 2633 | Example: ``monoblue``. |
|
2629 | 2634 | |
|
2630 | 2635 | ``templates`` |
|
2631 | 2636 | Where to find the HTML templates. The default path to the HTML templates |
|
2632 | 2637 | can be obtained from ``hg debuginstall``. |
|
2633 | 2638 | |
|
2634 | 2639 | ``websub`` |
|
2635 | 2640 | ---------- |
|
2636 | 2641 | |
|
2637 | 2642 | Web substitution filter definition. You can use this section to |
|
2638 | 2643 | define a set of regular expression substitution patterns which |
|
2639 | 2644 | let you automatically modify the hgweb server output. |
|
2640 | 2645 | |
|
2641 | 2646 | The default hgweb templates only apply these substitution patterns |
|
2642 | 2647 | on the revision description fields. You can apply them anywhere |
|
2643 | 2648 | you want when you create your own templates by adding calls to the |
|
2644 | 2649 | "websub" filter (usually after calling the "escape" filter). |
|
2645 | 2650 | |
|
2646 | 2651 | This can be used, for example, to convert issue references to links |
|
2647 | 2652 | to your issue tracker, or to convert "markdown-like" syntax into |
|
2648 | 2653 | HTML (see the examples below). |
|
2649 | 2654 | |
|
2650 | 2655 | Each entry in this section names a substitution filter. |
|
2651 | 2656 | The value of each entry defines the substitution expression itself. |
|
2652 | 2657 | The websub expressions follow the old interhg extension syntax, |
|
2653 | 2658 | which in turn imitates the Unix sed replacement syntax:: |
|
2654 | 2659 | |
|
2655 | 2660 | patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i] |
|
2656 | 2661 | |
|
2657 | 2662 | You can use any separator other than "/". The final "i" is optional |
|
2658 | 2663 | and indicates that the search must be case insensitive. |
|
2659 | 2664 | |
|
2660 | 2665 | Examples:: |
|
2661 | 2666 | |
|
2662 | 2667 | [websub] |
|
2663 | 2668 | issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i |
|
2664 | 2669 | italic = s/\b_(\S+)_\b/<i>\1<\/i>/ |
|
2665 | 2670 | bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/ |
|
2666 | 2671 | |
|
2667 | 2672 | ``worker`` |
|
2668 | 2673 | ---------- |
|
2669 | 2674 | |
|
2670 | 2675 | Parallel master/worker configuration. We currently perform working |
|
2671 | 2676 | directory updates in parallel on Unix-like systems, which greatly |
|
2672 | 2677 | helps performance. |
|
2673 | 2678 | |
|
2674 | 2679 | ``enabled`` |
|
2675 | 2680 | Whether to enable workers code to be used. |
|
2676 | 2681 | (default: true) |
|
2677 | 2682 | |
|
2678 | 2683 | ``numcpus`` |
|
2679 | 2684 | Number of CPUs to use for parallel operations. A zero or |
|
2680 | 2685 | negative value is treated as ``use the default``. |
|
2681 | 2686 | (default: 4 or the number of CPUs on the system, whichever is larger) |
|
2682 | 2687 | |
|
2683 | 2688 | ``backgroundclose`` |
|
2684 | 2689 | Whether to enable closing file handles on background threads during certain |
|
2685 | 2690 | operations. Some platforms aren't very efficient at closing file |
|
2686 | 2691 | handles that have been written or appended to. By performing file closing |
|
2687 | 2692 | on background threads, file write rate can increase substantially. |
|
2688 | 2693 | (default: true on Windows, false elsewhere) |
|
2689 | 2694 | |
|
2690 | 2695 | ``backgroundcloseminfilecount`` |
|
2691 | 2696 | Minimum number of files required to trigger background file closing. |
|
2692 | 2697 | Operations not writing this many files won't start background close |
|
2693 | 2698 | threads. |
|
2694 | 2699 | (default: 2048) |
|
2695 | 2700 | |
|
2696 | 2701 | ``backgroundclosemaxqueue`` |
|
2697 | 2702 | The maximum number of opened file handles waiting to be closed in the |
|
2698 | 2703 | background. This option only has an effect if ``backgroundclose`` is |
|
2699 | 2704 | enabled. |
|
2700 | 2705 | (default: 384) |
|
2701 | 2706 | |
|
2702 | 2707 | ``backgroundclosethreadcount`` |
|
2703 | 2708 | Number of threads to process background file closes. Only relevant if |
|
2704 | 2709 | ``backgroundclose`` is enabled. |
|
2705 | 2710 | (default: 4) |
@@ -1,97 +1,101 | |||
|
1 | 1 | To merge files Mercurial uses merge tools. |
|
2 | 2 | |
|
3 | 3 | A merge tool combines two different versions of a file into a merged |
|
4 | 4 | file. Merge tools are given the two files and the greatest common |
|
5 | 5 | ancestor of the two file versions, so they can determine the changes |
|
6 | 6 | made on both branches. |
|
7 | 7 | |
|
8 | 8 | Merge tools are used both for :hg:`resolve`, :hg:`merge`, :hg:`update`, |
|
9 | 9 | :hg:`backout` and in several extensions. |
|
10 | 10 | |
|
11 | 11 | Usually, the merge tool tries to automatically reconcile the files by |
|
12 | 12 | combining all non-overlapping changes that occurred separately in |
|
13 | 13 | the two different evolutions of the same initial base file. Furthermore, some |
|
14 | 14 | interactive merge programs make it easier to manually resolve |
|
15 | 15 | conflicting merges, either in a graphical way, or by inserting some |
|
16 | 16 | conflict markers. Mercurial does not include any interactive merge |
|
17 | 17 | programs but relies on external tools for that. |
|
18 | 18 | |
|
19 | 19 | Available merge tools |
|
20 | 20 | ===================== |
|
21 | 21 | |
|
22 | 22 | External merge tools and their properties are configured in the |
|
23 | 23 | merge-tools configuration section - see hgrc(5) - but they can often just |
|
24 | 24 | be named by their executable. |
|
25 | 25 | |
|
26 | 26 | A merge tool is generally usable if its executable can be found on the |
|
27 | 27 | system and if it can handle the merge. The executable is found if it |
|
28 | 28 | is an absolute or relative executable path or the name of an |
|
29 | 29 | application in the executable search path. The tool is assumed to be |
|
30 | 30 | able to handle the merge if it can handle symlinks if the file is a |
|
31 | 31 | symlink, if it can handle binary files if the file is binary, and if a |
|
32 | 32 | GUI is available if the tool requires a GUI. |
|
33 | 33 | |
|
34 | 34 | There are some internal merge tools which can be used. The internal |
|
35 | 35 | merge tools are: |
|
36 | 36 | |
|
37 | 37 | .. internaltoolsmarker |
|
38 | 38 | |
|
39 | 39 | Internal tools are always available and do not require a GUI but will by default |
|
40 | 40 | not handle symlinks or binary files. |
|
41 | 41 | |
|
42 | 42 | Choosing a merge tool |
|
43 | 43 | ===================== |
|
44 | 44 | |
|
45 | 45 | Mercurial uses these rules when deciding which merge tool to use: |
|
46 | 46 | |
|
47 | 47 | 1. If a tool has been specified with the --tool option to merge or resolve, it |
|
48 | 48 | is used. If it is the name of a tool in the merge-tools configuration, its |
|
49 | 49 | configuration is used. Otherwise the specified tool must be executable by |
|
50 | 50 | the shell. |
|
51 | 51 | |
|
52 | 52 | 2. If the ``HGMERGE`` environment variable is present, its value is used and |
|
53 | 53 | must be executable by the shell. |
|
54 | 54 | |
|
55 | 55 | 3. If the filename of the file to be merged matches any of the patterns in the |
|
56 | 56 | merge-patterns configuration section, the first usable merge tool |
|
57 | 57 | corresponding to a matching pattern is used. |
|
58 | 58 | |
|
59 | 59 | 4. If ui.merge is set it will be considered next. If the value is not the name |
|
60 | 60 | of a configured tool, the specified value is used and must be executable by |
|
61 | 61 | the shell. Otherwise the named tool is used if it is usable. |
|
62 | 62 | |
|
63 | 63 | 5. If any usable merge tools are present in the merge-tools configuration |
|
64 | 64 | section, the one with the highest priority is used. |
|
65 | 65 | |
|
66 | 66 | 6. If a program named ``hgmerge`` can be found on the system, it is used - but |
|
67 | 67 | it will by default not be used for symlinks and binary files. |
|
68 | 68 | |
|
69 | 69 | 7. If the file to be merged is not binary and is not a symlink, then |
|
70 | 70 | internal ``:merge`` is used. |
|
71 | 71 | |
|
72 | 72 | 8. Otherwise, ``:prompt`` is used. |
|
73 | 73 | |
|
74 | 74 | For historical reason, Mercurial assumes capabilities of internal |
|
75 | 75 | merge tools as below while examining rules above, regardless of actual |
|
76 | 76 | capabilities of them. |
|
77 | 77 | |
|
78 | 78 | ==== =============== ====== ======= |
|
79 | 79 | step specified via binary symlink |
|
80 | 80 | ==== =============== ====== ======= |
|
81 | 81 | 1. --tool o o |
|
82 | 82 | 2. HGMERGE o o |
|
83 |
3. merge-patterns o |
|
|
84 |
4. ui.merge x |
|
|
83 | 3. merge-patterns o (*) x (*) | |
|
84 | 4. ui.merge x (*) x (*) | |
|
85 | 85 | ==== =============== ====== ======= |
|
86 | 86 | |
|
87 | If ``merge.strict-capability-check`` configuration is true, Mercurial | |
|
88 | checks capabilities of internal merge tools strictly in (*) cases | |
|
89 | above. It is false by default for backward compatibility. | |
|
90 | ||
|
87 | 91 | .. note:: |
|
88 | 92 | |
|
89 | 93 | After selecting a merge program, Mercurial will by default attempt |
|
90 | 94 | to merge the files using a simple merge algorithm first. Only if it doesn't |
|
91 | 95 | succeed because of conflicting changes will Mercurial actually execute the |
|
92 | 96 | merge program. Whether to use the simple merge algorithm first can be |
|
93 | 97 | controlled by the premerge setting of the merge tool. Premerge is enabled by |
|
94 | 98 | default unless the file is binary or a symlink. |
|
95 | 99 | |
|
96 | 100 | See the merge-tools and ui sections of hgrc(5) for details on the |
|
97 | 101 | configuration of merge tools. |
@@ -1,3611 +1,3615 | |||
|
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 | add add the specified files on the next commit |
|
57 | 57 | addremove add all new files, delete all missing files |
|
58 | 58 | annotate show changeset information by line for each file |
|
59 | 59 | archive create an unversioned archive of a repository revision |
|
60 | 60 | backout reverse effect of earlier changeset |
|
61 | 61 | bisect subdivision search of changesets |
|
62 | 62 | bookmarks create a new bookmark or list existing bookmarks |
|
63 | 63 | branch set or show the current branch name |
|
64 | 64 | branches list repository named branches |
|
65 | 65 | bundle create a bundle file |
|
66 | 66 | cat output the current or given revision of files |
|
67 | 67 | clone make a copy of an existing repository |
|
68 | 68 | commit commit the specified files or all outstanding changes |
|
69 | 69 | config show combined config settings from all hgrc files |
|
70 | 70 | copy mark files as copied for the next commit |
|
71 | 71 | diff diff repository (or selected files) |
|
72 | 72 | export dump the header and diffs for one or more changesets |
|
73 | 73 | files list tracked files |
|
74 | 74 | forget forget the specified files on the next commit |
|
75 | 75 | graft copy changes from other branches onto the current branch |
|
76 | 76 | grep search revision history for a pattern in specified files |
|
77 | 77 | heads show branch heads |
|
78 | 78 | help show help for a given topic or a help overview |
|
79 | 79 | identify identify the working directory or specified revision |
|
80 | 80 | import import an ordered set of patches |
|
81 | 81 | incoming show new changesets found in source |
|
82 | 82 | init create a new repository in the given directory |
|
83 | 83 | log show revision history of entire repository or files |
|
84 | 84 | manifest output the current or given revision of the project manifest |
|
85 | 85 | merge merge another revision into working directory |
|
86 | 86 | outgoing show changesets not found in the destination |
|
87 | 87 | paths show aliases for remote repositories |
|
88 | 88 | phase set or show the current phase name |
|
89 | 89 | pull pull changes from the specified source |
|
90 | 90 | push push changes to the specified destination |
|
91 | 91 | recover roll back an interrupted transaction |
|
92 | 92 | remove remove the specified files on the next commit |
|
93 | 93 | rename rename files; equivalent of copy + remove |
|
94 | 94 | resolve redo merges or set/view the merge status of files |
|
95 | 95 | revert restore files to their checkout state |
|
96 | 96 | root print the root (top) of the current working directory |
|
97 | 97 | serve start stand-alone webserver |
|
98 | 98 | status show changed files in the working directory |
|
99 | 99 | summary summarize working directory state |
|
100 | 100 | tag add one or more tags for the current or given revision |
|
101 | 101 | tags list repository tags |
|
102 | 102 | unbundle apply one or more bundle files |
|
103 | 103 | update update working directory (or switch revisions) |
|
104 | 104 | verify verify the integrity of the repository |
|
105 | 105 | version output version and copyright information |
|
106 | 106 | |
|
107 | 107 | additional help topics: |
|
108 | 108 | |
|
109 | 109 | bundlespec Bundle File Formats |
|
110 | 110 | color Colorizing Outputs |
|
111 | 111 | config Configuration Files |
|
112 | 112 | dates Date Formats |
|
113 | 113 | deprecated Deprecated Features |
|
114 | 114 | diffs Diff Formats |
|
115 | 115 | environment Environment Variables |
|
116 | 116 | extensions Using Additional Features |
|
117 | 117 | filesets Specifying File Sets |
|
118 | 118 | flags Command-line flags |
|
119 | 119 | glossary Glossary |
|
120 | 120 | hgignore Syntax for Mercurial Ignore Files |
|
121 | 121 | hgweb Configuring hgweb |
|
122 | 122 | internals Technical implementation topics |
|
123 | 123 | merge-tools Merge Tools |
|
124 | 124 | pager Pager Support |
|
125 | 125 | patterns File Name Patterns |
|
126 | 126 | phases Working with Phases |
|
127 | 127 | revisions Specifying Revisions |
|
128 | 128 | scripting Using Mercurial from scripts and automation |
|
129 | 129 | subrepos Subrepositories |
|
130 | 130 | templating Template Usage |
|
131 | 131 | urls URL Paths |
|
132 | 132 | |
|
133 | 133 | (use 'hg help -v' to show built-in aliases and global options) |
|
134 | 134 | |
|
135 | 135 | $ hg -q help |
|
136 | 136 | add add the specified files on the next commit |
|
137 | 137 | addremove add all new files, delete all missing files |
|
138 | 138 | annotate show changeset information by line for each file |
|
139 | 139 | archive create an unversioned archive of a repository revision |
|
140 | 140 | backout reverse effect of earlier changeset |
|
141 | 141 | bisect subdivision search of changesets |
|
142 | 142 | bookmarks create a new bookmark or list existing bookmarks |
|
143 | 143 | branch set or show the current branch name |
|
144 | 144 | branches list repository named branches |
|
145 | 145 | bundle create a bundle file |
|
146 | 146 | cat output the current or given revision of files |
|
147 | 147 | clone make a copy of an existing repository |
|
148 | 148 | commit commit the specified files or all outstanding changes |
|
149 | 149 | config show combined config settings from all hgrc files |
|
150 | 150 | copy mark files as copied for the next commit |
|
151 | 151 | diff diff repository (or selected files) |
|
152 | 152 | export dump the header and diffs for one or more changesets |
|
153 | 153 | files list tracked files |
|
154 | 154 | forget forget the specified files on the next commit |
|
155 | 155 | graft copy changes from other branches onto the current branch |
|
156 | 156 | grep search revision history for a pattern in specified files |
|
157 | 157 | heads show branch heads |
|
158 | 158 | help show help for a given topic or a help overview |
|
159 | 159 | identify identify the working directory or specified revision |
|
160 | 160 | import import an ordered set of patches |
|
161 | 161 | incoming show new changesets found in source |
|
162 | 162 | init create a new repository in the given directory |
|
163 | 163 | log show revision history of entire repository or files |
|
164 | 164 | manifest output the current or given revision of the project manifest |
|
165 | 165 | merge merge another revision into working directory |
|
166 | 166 | outgoing show changesets not found in the destination |
|
167 | 167 | paths show aliases for remote repositories |
|
168 | 168 | phase set or show the current phase name |
|
169 | 169 | pull pull changes from the specified source |
|
170 | 170 | push push changes to the specified destination |
|
171 | 171 | recover roll back an interrupted transaction |
|
172 | 172 | remove remove the specified files on the next commit |
|
173 | 173 | rename rename files; equivalent of copy + remove |
|
174 | 174 | resolve redo merges or set/view the merge status of files |
|
175 | 175 | revert restore files to their checkout state |
|
176 | 176 | root print the root (top) of the current working directory |
|
177 | 177 | serve start stand-alone webserver |
|
178 | 178 | status show changed files in the working directory |
|
179 | 179 | summary summarize working directory state |
|
180 | 180 | tag add one or more tags for the current or given revision |
|
181 | 181 | tags list repository tags |
|
182 | 182 | unbundle apply one or more bundle files |
|
183 | 183 | update update working directory (or switch revisions) |
|
184 | 184 | verify verify the integrity of the repository |
|
185 | 185 | version output version and copyright information |
|
186 | 186 | |
|
187 | 187 | additional help topics: |
|
188 | 188 | |
|
189 | 189 | bundlespec Bundle File Formats |
|
190 | 190 | color Colorizing Outputs |
|
191 | 191 | config Configuration Files |
|
192 | 192 | dates Date Formats |
|
193 | 193 | deprecated Deprecated Features |
|
194 | 194 | diffs Diff Formats |
|
195 | 195 | environment Environment Variables |
|
196 | 196 | extensions Using Additional Features |
|
197 | 197 | filesets Specifying File Sets |
|
198 | 198 | flags Command-line flags |
|
199 | 199 | glossary Glossary |
|
200 | 200 | hgignore Syntax for Mercurial Ignore Files |
|
201 | 201 | hgweb Configuring hgweb |
|
202 | 202 | internals Technical implementation topics |
|
203 | 203 | merge-tools Merge Tools |
|
204 | 204 | pager Pager Support |
|
205 | 205 | patterns File Name Patterns |
|
206 | 206 | phases Working with Phases |
|
207 | 207 | revisions Specifying Revisions |
|
208 | 208 | scripting Using Mercurial from scripts and automation |
|
209 | 209 | subrepos Subrepositories |
|
210 | 210 | templating Template Usage |
|
211 | 211 | urls URL Paths |
|
212 | 212 | |
|
213 | 213 | Test extension help: |
|
214 | 214 | $ hg help extensions --config extensions.rebase= --config extensions.children= |
|
215 | 215 | Using Additional Features |
|
216 | 216 | """"""""""""""""""""""""" |
|
217 | 217 | |
|
218 | 218 | Mercurial has the ability to add new features through the use of |
|
219 | 219 | extensions. Extensions may add new commands, add options to existing |
|
220 | 220 | commands, change the default behavior of commands, or implement hooks. |
|
221 | 221 | |
|
222 | 222 | To enable the "foo" extension, either shipped with Mercurial or in the |
|
223 | 223 | Python search path, create an entry for it in your configuration file, |
|
224 | 224 | like this: |
|
225 | 225 | |
|
226 | 226 | [extensions] |
|
227 | 227 | foo = |
|
228 | 228 | |
|
229 | 229 | You may also specify the full path to an extension: |
|
230 | 230 | |
|
231 | 231 | [extensions] |
|
232 | 232 | myfeature = ~/.hgext/myfeature.py |
|
233 | 233 | |
|
234 | 234 | See 'hg help config' for more information on configuration files. |
|
235 | 235 | |
|
236 | 236 | Extensions are not loaded by default for a variety of reasons: they can |
|
237 | 237 | increase startup overhead; they may be meant for advanced usage only; they |
|
238 | 238 | may provide potentially dangerous abilities (such as letting you destroy |
|
239 | 239 | or modify history); they might not be ready for prime time; or they may |
|
240 | 240 | alter some usual behaviors of stock Mercurial. It is thus up to the user |
|
241 | 241 | to activate extensions as needed. |
|
242 | 242 | |
|
243 | 243 | To explicitly disable an extension enabled in a configuration file of |
|
244 | 244 | broader scope, prepend its path with !: |
|
245 | 245 | |
|
246 | 246 | [extensions] |
|
247 | 247 | # disabling extension bar residing in /path/to/extension/bar.py |
|
248 | 248 | bar = !/path/to/extension/bar.py |
|
249 | 249 | # ditto, but no path was supplied for extension baz |
|
250 | 250 | baz = ! |
|
251 | 251 | |
|
252 | 252 | enabled extensions: |
|
253 | 253 | |
|
254 | 254 | children command to display child changesets (DEPRECATED) |
|
255 | 255 | rebase command to move sets of revisions to a different ancestor |
|
256 | 256 | |
|
257 | 257 | disabled extensions: |
|
258 | 258 | |
|
259 | 259 | acl hooks for controlling repository access |
|
260 | 260 | blackbox log repository events to a blackbox for debugging |
|
261 | 261 | bugzilla hooks for integrating with the Bugzilla bug tracker |
|
262 | 262 | censor erase file content at a given revision |
|
263 | 263 | churn command to display statistics about repository history |
|
264 | 264 | clonebundles advertise pre-generated bundles to seed clones |
|
265 | 265 | convert import revisions from foreign VCS repositories into |
|
266 | 266 | Mercurial |
|
267 | 267 | eol automatically manage newlines in repository files |
|
268 | 268 | extdiff command to allow external programs to compare revisions |
|
269 | 269 | factotum http authentication with factotum |
|
270 | 270 | githelp try mapping git commands to Mercurial commands |
|
271 | 271 | gpg commands to sign and verify changesets |
|
272 | 272 | hgk browse the repository in a graphical way |
|
273 | 273 | highlight syntax highlighting for hgweb (requires Pygments) |
|
274 | 274 | histedit interactive history editing |
|
275 | 275 | keyword expand keywords in tracked files |
|
276 | 276 | largefiles track large binary files |
|
277 | 277 | mq manage a stack of patches |
|
278 | 278 | notify hooks for sending email push notifications |
|
279 | 279 | patchbomb command to send changesets as (a series of) patch emails |
|
280 | 280 | purge command to delete untracked files from the working |
|
281 | 281 | directory |
|
282 | 282 | relink recreates hardlinks between repository clones |
|
283 | 283 | schemes extend schemes with shortcuts to repository swarms |
|
284 | 284 | share share a common history between several working directories |
|
285 | 285 | shelve save and restore changes to the working directory |
|
286 | 286 | strip strip changesets and their descendants from history |
|
287 | 287 | transplant command to transplant changesets from another branch |
|
288 | 288 | win32mbcs allow the use of MBCS paths with problematic encodings |
|
289 | 289 | zeroconf discover and advertise repositories on the local network |
|
290 | 290 | |
|
291 | 291 | #endif |
|
292 | 292 | |
|
293 | 293 | Verify that deprecated extensions are included if --verbose: |
|
294 | 294 | |
|
295 | 295 | $ hg -v help extensions | grep children |
|
296 | 296 | children command to display child changesets (DEPRECATED) |
|
297 | 297 | |
|
298 | 298 | Verify that extension keywords appear in help templates |
|
299 | 299 | |
|
300 | 300 | $ hg help --config extensions.transplant= templating|grep transplant > /dev/null |
|
301 | 301 | |
|
302 | 302 | Test short command list with verbose option |
|
303 | 303 | |
|
304 | 304 | $ hg -v help shortlist |
|
305 | 305 | Mercurial Distributed SCM |
|
306 | 306 | |
|
307 | 307 | basic commands: |
|
308 | 308 | |
|
309 | 309 | add add the specified files on the next commit |
|
310 | 310 | annotate, blame |
|
311 | 311 | show changeset information by line for each file |
|
312 | 312 | clone make a copy of an existing repository |
|
313 | 313 | commit, ci commit the specified files or all outstanding changes |
|
314 | 314 | diff diff repository (or selected files) |
|
315 | 315 | export dump the header and diffs for one or more changesets |
|
316 | 316 | forget forget the specified files on the next commit |
|
317 | 317 | init create a new repository in the given directory |
|
318 | 318 | log, history show revision history of entire repository or files |
|
319 | 319 | merge merge another revision into working directory |
|
320 | 320 | pull pull changes from the specified source |
|
321 | 321 | push push changes to the specified destination |
|
322 | 322 | remove, rm remove the specified files on the next commit |
|
323 | 323 | serve start stand-alone webserver |
|
324 | 324 | status, st show changed files in the working directory |
|
325 | 325 | summary, sum summarize working directory state |
|
326 | 326 | update, up, checkout, co |
|
327 | 327 | update working directory (or switch revisions) |
|
328 | 328 | |
|
329 | 329 | global options ([+] can be repeated): |
|
330 | 330 | |
|
331 | 331 | -R --repository REPO repository root directory or name of overlay bundle |
|
332 | 332 | file |
|
333 | 333 | --cwd DIR change working directory |
|
334 | 334 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
335 | 335 | all prompts |
|
336 | 336 | -q --quiet suppress output |
|
337 | 337 | -v --verbose enable additional output |
|
338 | 338 | --color TYPE when to colorize (boolean, always, auto, never, or |
|
339 | 339 | debug) |
|
340 | 340 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
341 | 341 | --debug enable debugging output |
|
342 | 342 | --debugger start debugger |
|
343 | 343 | --encoding ENCODE set the charset encoding (default: ascii) |
|
344 | 344 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
345 | 345 | --traceback always print a traceback on exception |
|
346 | 346 | --time time how long the command takes |
|
347 | 347 | --profile print command execution profile |
|
348 | 348 | --version output version information and exit |
|
349 | 349 | -h --help display help and exit |
|
350 | 350 | --hidden consider hidden changesets |
|
351 | 351 | --pager TYPE when to paginate (boolean, always, auto, or never) |
|
352 | 352 | (default: auto) |
|
353 | 353 | |
|
354 | 354 | (use 'hg help' for the full list of commands) |
|
355 | 355 | |
|
356 | 356 | $ hg add -h |
|
357 | 357 | hg add [OPTION]... [FILE]... |
|
358 | 358 | |
|
359 | 359 | add the specified files on the next commit |
|
360 | 360 | |
|
361 | 361 | Schedule files to be version controlled and added to the repository. |
|
362 | 362 | |
|
363 | 363 | The files will be added to the repository at the next commit. To undo an |
|
364 | 364 | add before that, see 'hg forget'. |
|
365 | 365 | |
|
366 | 366 | If no names are given, add all files to the repository (except files |
|
367 | 367 | matching ".hgignore"). |
|
368 | 368 | |
|
369 | 369 | Returns 0 if all files are successfully added. |
|
370 | 370 | |
|
371 | 371 | options ([+] can be repeated): |
|
372 | 372 | |
|
373 | 373 | -I --include PATTERN [+] include names matching the given patterns |
|
374 | 374 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
375 | 375 | -S --subrepos recurse into subrepositories |
|
376 | 376 | -n --dry-run do not perform actions, just print output |
|
377 | 377 | |
|
378 | 378 | (some details hidden, use --verbose to show complete help) |
|
379 | 379 | |
|
380 | 380 | Verbose help for add |
|
381 | 381 | |
|
382 | 382 | $ hg add -hv |
|
383 | 383 | hg add [OPTION]... [FILE]... |
|
384 | 384 | |
|
385 | 385 | add the specified files on the next commit |
|
386 | 386 | |
|
387 | 387 | Schedule files to be version controlled and added to the repository. |
|
388 | 388 | |
|
389 | 389 | The files will be added to the repository at the next commit. To undo an |
|
390 | 390 | add before that, see 'hg forget'. |
|
391 | 391 | |
|
392 | 392 | If no names are given, add all files to the repository (except files |
|
393 | 393 | matching ".hgignore"). |
|
394 | 394 | |
|
395 | 395 | Examples: |
|
396 | 396 | |
|
397 | 397 | - New (unknown) files are added automatically by 'hg add': |
|
398 | 398 | |
|
399 | 399 | $ ls |
|
400 | 400 | foo.c |
|
401 | 401 | $ hg status |
|
402 | 402 | ? foo.c |
|
403 | 403 | $ hg add |
|
404 | 404 | adding foo.c |
|
405 | 405 | $ hg status |
|
406 | 406 | A foo.c |
|
407 | 407 | |
|
408 | 408 | - Specific files to be added can be specified: |
|
409 | 409 | |
|
410 | 410 | $ ls |
|
411 | 411 | bar.c foo.c |
|
412 | 412 | $ hg status |
|
413 | 413 | ? bar.c |
|
414 | 414 | ? foo.c |
|
415 | 415 | $ hg add bar.c |
|
416 | 416 | $ hg status |
|
417 | 417 | A bar.c |
|
418 | 418 | ? foo.c |
|
419 | 419 | |
|
420 | 420 | Returns 0 if all files are successfully added. |
|
421 | 421 | |
|
422 | 422 | options ([+] can be repeated): |
|
423 | 423 | |
|
424 | 424 | -I --include PATTERN [+] include names matching the given patterns |
|
425 | 425 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
426 | 426 | -S --subrepos recurse into subrepositories |
|
427 | 427 | -n --dry-run do not perform actions, just print output |
|
428 | 428 | |
|
429 | 429 | global options ([+] can be repeated): |
|
430 | 430 | |
|
431 | 431 | -R --repository REPO repository root directory or name of overlay bundle |
|
432 | 432 | file |
|
433 | 433 | --cwd DIR change working directory |
|
434 | 434 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
435 | 435 | all prompts |
|
436 | 436 | -q --quiet suppress output |
|
437 | 437 | -v --verbose enable additional output |
|
438 | 438 | --color TYPE when to colorize (boolean, always, auto, never, or |
|
439 | 439 | debug) |
|
440 | 440 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
441 | 441 | --debug enable debugging output |
|
442 | 442 | --debugger start debugger |
|
443 | 443 | --encoding ENCODE set the charset encoding (default: ascii) |
|
444 | 444 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
445 | 445 | --traceback always print a traceback on exception |
|
446 | 446 | --time time how long the command takes |
|
447 | 447 | --profile print command execution profile |
|
448 | 448 | --version output version information and exit |
|
449 | 449 | -h --help display help and exit |
|
450 | 450 | --hidden consider hidden changesets |
|
451 | 451 | --pager TYPE when to paginate (boolean, always, auto, or never) |
|
452 | 452 | (default: auto) |
|
453 | 453 | |
|
454 | 454 | Test the textwidth config option |
|
455 | 455 | |
|
456 | 456 | $ hg root -h --config ui.textwidth=50 |
|
457 | 457 | hg root |
|
458 | 458 | |
|
459 | 459 | print the root (top) of the current working |
|
460 | 460 | directory |
|
461 | 461 | |
|
462 | 462 | Print the root directory of the current |
|
463 | 463 | repository. |
|
464 | 464 | |
|
465 | 465 | Returns 0 on success. |
|
466 | 466 | |
|
467 | 467 | (some details hidden, use --verbose to show |
|
468 | 468 | complete help) |
|
469 | 469 | |
|
470 | 470 | Test help option with version option |
|
471 | 471 | |
|
472 | 472 | $ hg add -h --version |
|
473 | 473 | Mercurial Distributed SCM (version *) (glob) |
|
474 | 474 | (see https://mercurial-scm.org for more information) |
|
475 | 475 | |
|
476 | 476 | Copyright (C) 2005-* Matt Mackall and others (glob) |
|
477 | 477 | This is free software; see the source for copying conditions. There is NO |
|
478 | 478 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
479 | 479 | |
|
480 | 480 | $ hg add --skjdfks |
|
481 | 481 | hg add: option --skjdfks not recognized |
|
482 | 482 | hg add [OPTION]... [FILE]... |
|
483 | 483 | |
|
484 | 484 | add the specified files on the next commit |
|
485 | 485 | |
|
486 | 486 | options ([+] can be repeated): |
|
487 | 487 | |
|
488 | 488 | -I --include PATTERN [+] include names matching the given patterns |
|
489 | 489 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
490 | 490 | -S --subrepos recurse into subrepositories |
|
491 | 491 | -n --dry-run do not perform actions, just print output |
|
492 | 492 | |
|
493 | 493 | (use 'hg add -h' to show more help) |
|
494 | 494 | [255] |
|
495 | 495 | |
|
496 | 496 | Test ambiguous command help |
|
497 | 497 | |
|
498 | 498 | $ hg help ad |
|
499 | 499 | list of commands: |
|
500 | 500 | |
|
501 | 501 | add add the specified files on the next commit |
|
502 | 502 | addremove add all new files, delete all missing files |
|
503 | 503 | |
|
504 | 504 | (use 'hg help -v ad' to show built-in aliases and global options) |
|
505 | 505 | |
|
506 | 506 | Test command without options |
|
507 | 507 | |
|
508 | 508 | $ hg help verify |
|
509 | 509 | hg verify |
|
510 | 510 | |
|
511 | 511 | verify the integrity of the repository |
|
512 | 512 | |
|
513 | 513 | Verify the integrity of the current repository. |
|
514 | 514 | |
|
515 | 515 | This will perform an extensive check of the repository's integrity, |
|
516 | 516 | validating the hashes and checksums of each entry in the changelog, |
|
517 | 517 | manifest, and tracked files, as well as the integrity of their crosslinks |
|
518 | 518 | and indices. |
|
519 | 519 | |
|
520 | 520 | Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more |
|
521 | 521 | information about recovery from corruption of the repository. |
|
522 | 522 | |
|
523 | 523 | Returns 0 on success, 1 if errors are encountered. |
|
524 | 524 | |
|
525 | 525 | (some details hidden, use --verbose to show complete help) |
|
526 | 526 | |
|
527 | 527 | $ hg help diff |
|
528 | 528 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... |
|
529 | 529 | |
|
530 | 530 | diff repository (or selected files) |
|
531 | 531 | |
|
532 | 532 | Show differences between revisions for the specified files. |
|
533 | 533 | |
|
534 | 534 | Differences between files are shown using the unified diff format. |
|
535 | 535 | |
|
536 | 536 | Note: |
|
537 | 537 | 'hg diff' may generate unexpected results for merges, as it will |
|
538 | 538 | default to comparing against the working directory's first parent |
|
539 | 539 | changeset if no revisions are specified. |
|
540 | 540 | |
|
541 | 541 | When two revision arguments are given, then changes are shown between |
|
542 | 542 | those revisions. If only one revision is specified then that revision is |
|
543 | 543 | compared to the working directory, and, when no revisions are specified, |
|
544 | 544 | the working directory files are compared to its first parent. |
|
545 | 545 | |
|
546 | 546 | Alternatively you can specify -c/--change with a revision to see the |
|
547 | 547 | changes in that changeset relative to its first parent. |
|
548 | 548 | |
|
549 | 549 | Without the -a/--text option, diff will avoid generating diffs of files it |
|
550 | 550 | detects as binary. With -a, diff will generate a diff anyway, probably |
|
551 | 551 | with undesirable results. |
|
552 | 552 | |
|
553 | 553 | Use the -g/--git option to generate diffs in the git extended diff format. |
|
554 | 554 | For more information, read 'hg help diffs'. |
|
555 | 555 | |
|
556 | 556 | Returns 0 on success. |
|
557 | 557 | |
|
558 | 558 | options ([+] can be repeated): |
|
559 | 559 | |
|
560 | 560 | -r --rev REV [+] revision |
|
561 | 561 | -c --change REV change made by revision |
|
562 | 562 | -a --text treat all files as text |
|
563 | 563 | -g --git use git extended diff format |
|
564 | 564 | --binary generate binary diffs in git mode (default) |
|
565 | 565 | --nodates omit dates from diff headers |
|
566 | 566 | --noprefix omit a/ and b/ prefixes from filenames |
|
567 | 567 | -p --show-function show which function each change is in |
|
568 | 568 | --reverse produce a diff that undoes the changes |
|
569 | 569 | -w --ignore-all-space ignore white space when comparing lines |
|
570 | 570 | -b --ignore-space-change ignore changes in the amount of white space |
|
571 | 571 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
572 | 572 | -Z --ignore-space-at-eol ignore changes in whitespace at EOL |
|
573 | 573 | -U --unified NUM number of lines of context to show |
|
574 | 574 | --stat output diffstat-style summary of changes |
|
575 | 575 | --root DIR produce diffs relative to subdirectory |
|
576 | 576 | -I --include PATTERN [+] include names matching the given patterns |
|
577 | 577 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
578 | 578 | -S --subrepos recurse into subrepositories |
|
579 | 579 | |
|
580 | 580 | (some details hidden, use --verbose to show complete help) |
|
581 | 581 | |
|
582 | 582 | $ hg help status |
|
583 | 583 | hg status [OPTION]... [FILE]... |
|
584 | 584 | |
|
585 | 585 | aliases: st |
|
586 | 586 | |
|
587 | 587 | show changed files in the working directory |
|
588 | 588 | |
|
589 | 589 | Show status of files in the repository. If names are given, only files |
|
590 | 590 | that match are shown. Files that are clean or ignored or the source of a |
|
591 | 591 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, |
|
592 | 592 | -C/--copies or -A/--all are given. Unless options described with "show |
|
593 | 593 | only ..." are given, the options -mardu are used. |
|
594 | 594 | |
|
595 | 595 | Option -q/--quiet hides untracked (unknown and ignored) files unless |
|
596 | 596 | explicitly requested with -u/--unknown or -i/--ignored. |
|
597 | 597 | |
|
598 | 598 | Note: |
|
599 | 599 | 'hg status' may appear to disagree with diff if permissions have |
|
600 | 600 | changed or a merge has occurred. The standard diff format does not |
|
601 | 601 | report permission changes and diff only reports changes relative to one |
|
602 | 602 | merge parent. |
|
603 | 603 | |
|
604 | 604 | If one revision is given, it is used as the base revision. If two |
|
605 | 605 | revisions are given, the differences between them are shown. The --change |
|
606 | 606 | option can also be used as a shortcut to list the changed files of a |
|
607 | 607 | revision from its first parent. |
|
608 | 608 | |
|
609 | 609 | The codes used to show the status of files are: |
|
610 | 610 | |
|
611 | 611 | M = modified |
|
612 | 612 | A = added |
|
613 | 613 | R = removed |
|
614 | 614 | C = clean |
|
615 | 615 | ! = missing (deleted by non-hg command, but still tracked) |
|
616 | 616 | ? = not tracked |
|
617 | 617 | I = ignored |
|
618 | 618 | = origin of the previous file (with --copies) |
|
619 | 619 | |
|
620 | 620 | Returns 0 on success. |
|
621 | 621 | |
|
622 | 622 | options ([+] can be repeated): |
|
623 | 623 | |
|
624 | 624 | -A --all show status of all files |
|
625 | 625 | -m --modified show only modified files |
|
626 | 626 | -a --added show only added files |
|
627 | 627 | -r --removed show only removed files |
|
628 | 628 | -d --deleted show only deleted (but tracked) files |
|
629 | 629 | -c --clean show only files without changes |
|
630 | 630 | -u --unknown show only unknown (not tracked) files |
|
631 | 631 | -i --ignored show only ignored files |
|
632 | 632 | -n --no-status hide status prefix |
|
633 | 633 | -C --copies show source of copied files |
|
634 | 634 | -0 --print0 end filenames with NUL, for use with xargs |
|
635 | 635 | --rev REV [+] show difference from revision |
|
636 | 636 | --change REV list the changed files of a revision |
|
637 | 637 | -I --include PATTERN [+] include names matching the given patterns |
|
638 | 638 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
639 | 639 | -S --subrepos recurse into subrepositories |
|
640 | 640 | |
|
641 | 641 | (some details hidden, use --verbose to show complete help) |
|
642 | 642 | |
|
643 | 643 | $ hg -q help status |
|
644 | 644 | hg status [OPTION]... [FILE]... |
|
645 | 645 | |
|
646 | 646 | show changed files in the working directory |
|
647 | 647 | |
|
648 | 648 | $ hg help foo |
|
649 | 649 | abort: no such help topic: foo |
|
650 | 650 | (try 'hg help --keyword foo') |
|
651 | 651 | [255] |
|
652 | 652 | |
|
653 | 653 | $ hg skjdfks |
|
654 | 654 | hg: unknown command 'skjdfks' |
|
655 | 655 | (use 'hg help' for a list of commands) |
|
656 | 656 | [255] |
|
657 | 657 | |
|
658 | 658 | Typoed command gives suggestion |
|
659 | 659 | $ hg puls |
|
660 | 660 | hg: unknown command 'puls' |
|
661 | 661 | (did you mean one of pull, push?) |
|
662 | 662 | [255] |
|
663 | 663 | |
|
664 | 664 | Not enabled extension gets suggested |
|
665 | 665 | |
|
666 | 666 | $ hg rebase |
|
667 | 667 | hg: unknown command 'rebase' |
|
668 | 668 | 'rebase' is provided by the following extension: |
|
669 | 669 | |
|
670 | 670 | rebase command to move sets of revisions to a different ancestor |
|
671 | 671 | |
|
672 | 672 | (use 'hg help extensions' for information on enabling extensions) |
|
673 | 673 | [255] |
|
674 | 674 | |
|
675 | 675 | Disabled extension gets suggested |
|
676 | 676 | $ hg --config extensions.rebase=! rebase |
|
677 | 677 | hg: unknown command 'rebase' |
|
678 | 678 | 'rebase' is provided by the following extension: |
|
679 | 679 | |
|
680 | 680 | rebase command to move sets of revisions to a different ancestor |
|
681 | 681 | |
|
682 | 682 | (use 'hg help extensions' for information on enabling extensions) |
|
683 | 683 | [255] |
|
684 | 684 | |
|
685 | 685 | Make sure that we don't run afoul of the help system thinking that |
|
686 | 686 | this is a section and erroring out weirdly. |
|
687 | 687 | |
|
688 | 688 | $ hg .log |
|
689 | 689 | hg: unknown command '.log' |
|
690 | 690 | (did you mean log?) |
|
691 | 691 | [255] |
|
692 | 692 | |
|
693 | 693 | $ hg log. |
|
694 | 694 | hg: unknown command 'log.' |
|
695 | 695 | (did you mean log?) |
|
696 | 696 | [255] |
|
697 | 697 | $ hg pu.lh |
|
698 | 698 | hg: unknown command 'pu.lh' |
|
699 | 699 | (did you mean one of pull, push?) |
|
700 | 700 | [255] |
|
701 | 701 | |
|
702 | 702 | $ cat > helpext.py <<EOF |
|
703 | 703 | > import os |
|
704 | 704 | > from mercurial import commands, fancyopts, registrar |
|
705 | 705 | > |
|
706 | 706 | > def func(arg): |
|
707 | 707 | > return '%sfoo' % arg |
|
708 | 708 | > class customopt(fancyopts.customopt): |
|
709 | 709 | > def newstate(self, oldstate, newparam, abort): |
|
710 | 710 | > return '%sbar' % oldstate |
|
711 | 711 | > cmdtable = {} |
|
712 | 712 | > command = registrar.command(cmdtable) |
|
713 | 713 | > |
|
714 | 714 | > @command(b'nohelp', |
|
715 | 715 | > [(b'', b'longdesc', 3, b'x'*67), |
|
716 | 716 | > (b'n', b'', None, b'normal desc'), |
|
717 | 717 | > (b'', b'newline', b'', b'line1\nline2'), |
|
718 | 718 | > (b'', b'callableopt', func, b'adds foo'), |
|
719 | 719 | > (b'', b'customopt', customopt(''), b'adds bar'), |
|
720 | 720 | > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')], |
|
721 | 721 | > b'hg nohelp', |
|
722 | 722 | > norepo=True) |
|
723 | 723 | > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) |
|
724 | 724 | > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) |
|
725 | 725 | > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) |
|
726 | 726 | > def nohelp(ui, *args, **kwargs): |
|
727 | 727 | > pass |
|
728 | 728 | > |
|
729 | 729 | > def uisetup(ui): |
|
730 | 730 | > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') |
|
731 | 731 | > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') |
|
732 | 732 | > |
|
733 | 733 | > EOF |
|
734 | 734 | $ echo '[extensions]' >> $HGRCPATH |
|
735 | 735 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
|
736 | 736 | |
|
737 | 737 | Test for aliases |
|
738 | 738 | |
|
739 | 739 | $ hg help hgalias |
|
740 | 740 | hg hgalias [--remote] |
|
741 | 741 | |
|
742 | 742 | alias for: hg summary |
|
743 | 743 | |
|
744 | 744 | summarize working directory state |
|
745 | 745 | |
|
746 | 746 | This generates a brief summary of the working directory state, including |
|
747 | 747 | parents, branch, commit status, phase and available updates. |
|
748 | 748 | |
|
749 | 749 | With the --remote option, this will check the default paths for incoming |
|
750 | 750 | and outgoing changes. This can be time-consuming. |
|
751 | 751 | |
|
752 | 752 | Returns 0 on success. |
|
753 | 753 | |
|
754 | 754 | defined by: helpext |
|
755 | 755 | |
|
756 | 756 | options: |
|
757 | 757 | |
|
758 | 758 | --remote check for push and pull |
|
759 | 759 | |
|
760 | 760 | (some details hidden, use --verbose to show complete help) |
|
761 | 761 | |
|
762 | 762 | $ hg help shellalias |
|
763 | 763 | hg shellalias |
|
764 | 764 | |
|
765 | 765 | shell alias for: echo hi |
|
766 | 766 | |
|
767 | 767 | (no help text available) |
|
768 | 768 | |
|
769 | 769 | defined by: helpext |
|
770 | 770 | |
|
771 | 771 | (some details hidden, use --verbose to show complete help) |
|
772 | 772 | |
|
773 | 773 | Test command with no help text |
|
774 | 774 | |
|
775 | 775 | $ hg help nohelp |
|
776 | 776 | hg nohelp |
|
777 | 777 | |
|
778 | 778 | (no help text available) |
|
779 | 779 | |
|
780 | 780 | options: |
|
781 | 781 | |
|
782 | 782 | --longdesc VALUE |
|
783 | 783 | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
784 | 784 | xxxxxxxxxxxxxxxxxxxxxxx (default: 3) |
|
785 | 785 | -n -- normal desc |
|
786 | 786 | --newline VALUE line1 line2 |
|
787 | 787 | --callableopt VALUE adds foo |
|
788 | 788 | --customopt VALUE adds bar |
|
789 | 789 | --customopt-withdefault VALUE adds bar (default: foo) |
|
790 | 790 | |
|
791 | 791 | (some details hidden, use --verbose to show complete help) |
|
792 | 792 | |
|
793 | 793 | $ hg help -k nohelp |
|
794 | 794 | Commands: |
|
795 | 795 | |
|
796 | 796 | nohelp hg nohelp |
|
797 | 797 | |
|
798 | 798 | Extension Commands: |
|
799 | 799 | |
|
800 | 800 | nohelp (no help text available) |
|
801 | 801 | |
|
802 | 802 | Test that default list of commands omits extension commands |
|
803 | 803 | |
|
804 | 804 | #if no-extraextensions |
|
805 | 805 | |
|
806 | 806 | $ hg help |
|
807 | 807 | Mercurial Distributed SCM |
|
808 | 808 | |
|
809 | 809 | list of commands: |
|
810 | 810 | |
|
811 | 811 | add add the specified files on the next commit |
|
812 | 812 | addremove add all new files, delete all missing files |
|
813 | 813 | annotate show changeset information by line for each file |
|
814 | 814 | archive create an unversioned archive of a repository revision |
|
815 | 815 | backout reverse effect of earlier changeset |
|
816 | 816 | bisect subdivision search of changesets |
|
817 | 817 | bookmarks create a new bookmark or list existing bookmarks |
|
818 | 818 | branch set or show the current branch name |
|
819 | 819 | branches list repository named branches |
|
820 | 820 | bundle create a bundle file |
|
821 | 821 | cat output the current or given revision of files |
|
822 | 822 | clone make a copy of an existing repository |
|
823 | 823 | commit commit the specified files or all outstanding changes |
|
824 | 824 | config show combined config settings from all hgrc files |
|
825 | 825 | copy mark files as copied for the next commit |
|
826 | 826 | diff diff repository (or selected files) |
|
827 | 827 | export dump the header and diffs for one or more changesets |
|
828 | 828 | files list tracked files |
|
829 | 829 | forget forget the specified files on the next commit |
|
830 | 830 | graft copy changes from other branches onto the current branch |
|
831 | 831 | grep search revision history for a pattern in specified files |
|
832 | 832 | heads show branch heads |
|
833 | 833 | help show help for a given topic or a help overview |
|
834 | 834 | identify identify the working directory or specified revision |
|
835 | 835 | import import an ordered set of patches |
|
836 | 836 | incoming show new changesets found in source |
|
837 | 837 | init create a new repository in the given directory |
|
838 | 838 | log show revision history of entire repository or files |
|
839 | 839 | manifest output the current or given revision of the project manifest |
|
840 | 840 | merge merge another revision into working directory |
|
841 | 841 | outgoing show changesets not found in the destination |
|
842 | 842 | paths show aliases for remote repositories |
|
843 | 843 | phase set or show the current phase name |
|
844 | 844 | pull pull changes from the specified source |
|
845 | 845 | push push changes to the specified destination |
|
846 | 846 | recover roll back an interrupted transaction |
|
847 | 847 | remove remove the specified files on the next commit |
|
848 | 848 | rename rename files; equivalent of copy + remove |
|
849 | 849 | resolve redo merges or set/view the merge status of files |
|
850 | 850 | revert restore files to their checkout state |
|
851 | 851 | root print the root (top) of the current working directory |
|
852 | 852 | serve start stand-alone webserver |
|
853 | 853 | status show changed files in the working directory |
|
854 | 854 | summary summarize working directory state |
|
855 | 855 | tag add one or more tags for the current or given revision |
|
856 | 856 | tags list repository tags |
|
857 | 857 | unbundle apply one or more bundle files |
|
858 | 858 | update update working directory (or switch revisions) |
|
859 | 859 | verify verify the integrity of the repository |
|
860 | 860 | version output version and copyright information |
|
861 | 861 | |
|
862 | 862 | enabled extensions: |
|
863 | 863 | |
|
864 | 864 | helpext (no help text available) |
|
865 | 865 | |
|
866 | 866 | additional help topics: |
|
867 | 867 | |
|
868 | 868 | bundlespec Bundle File Formats |
|
869 | 869 | color Colorizing Outputs |
|
870 | 870 | config Configuration Files |
|
871 | 871 | dates Date Formats |
|
872 | 872 | deprecated Deprecated Features |
|
873 | 873 | diffs Diff Formats |
|
874 | 874 | environment Environment Variables |
|
875 | 875 | extensions Using Additional Features |
|
876 | 876 | filesets Specifying File Sets |
|
877 | 877 | flags Command-line flags |
|
878 | 878 | glossary Glossary |
|
879 | 879 | hgignore Syntax for Mercurial Ignore Files |
|
880 | 880 | hgweb Configuring hgweb |
|
881 | 881 | internals Technical implementation topics |
|
882 | 882 | merge-tools Merge Tools |
|
883 | 883 | pager Pager Support |
|
884 | 884 | patterns File Name Patterns |
|
885 | 885 | phases Working with Phases |
|
886 | 886 | revisions Specifying Revisions |
|
887 | 887 | scripting Using Mercurial from scripts and automation |
|
888 | 888 | subrepos Subrepositories |
|
889 | 889 | templating Template Usage |
|
890 | 890 | urls URL Paths |
|
891 | 891 | |
|
892 | 892 | (use 'hg help -v' to show built-in aliases and global options) |
|
893 | 893 | |
|
894 | 894 | #endif |
|
895 | 895 | |
|
896 | 896 | Test list of internal help commands |
|
897 | 897 | |
|
898 | 898 | $ hg help debug |
|
899 | 899 | debug commands (internal and unsupported): |
|
900 | 900 | |
|
901 | 901 | debugancestor |
|
902 | 902 | find the ancestor revision of two revisions in a given index |
|
903 | 903 | debugapplystreamclonebundle |
|
904 | 904 | apply a stream clone bundle file |
|
905 | 905 | debugbuilddag |
|
906 | 906 | builds a repo with a given DAG from scratch in the current |
|
907 | 907 | empty repo |
|
908 | 908 | debugbundle lists the contents of a bundle |
|
909 | 909 | debugcapabilities |
|
910 | 910 | lists the capabilities of a remote peer |
|
911 | 911 | debugcheckstate |
|
912 | 912 | validate the correctness of the current dirstate |
|
913 | 913 | debugcolor show available color, effects or style |
|
914 | 914 | debugcommands |
|
915 | 915 | list all available commands and options |
|
916 | 916 | debugcomplete |
|
917 | 917 | returns the completion list associated with the given command |
|
918 | 918 | debugcreatestreamclonebundle |
|
919 | 919 | create a stream clone bundle file |
|
920 | 920 | debugdag format the changelog or an index DAG as a concise textual |
|
921 | 921 | description |
|
922 | 922 | debugdata dump the contents of a data file revision |
|
923 | 923 | debugdate parse and display a date |
|
924 | 924 | debugdeltachain |
|
925 | 925 | dump information about delta chains in a revlog |
|
926 | 926 | debugdirstate |
|
927 | 927 | show the contents of the current dirstate |
|
928 | 928 | debugdiscovery |
|
929 | 929 | runs the changeset discovery protocol in isolation |
|
930 | 930 | debugdownload |
|
931 | 931 | download a resource using Mercurial logic and config |
|
932 | 932 | debugextensions |
|
933 | 933 | show information about active extensions |
|
934 | 934 | debugfileset parse and apply a fileset specification |
|
935 | 935 | debugformat display format information about the current repository |
|
936 | 936 | debugfsinfo show information detected about current filesystem |
|
937 | 937 | debuggetbundle |
|
938 | 938 | retrieves a bundle from a repo |
|
939 | 939 | debugignore display the combined ignore pattern and information about |
|
940 | 940 | ignored files |
|
941 | 941 | debugindex dump the contents of an index file |
|
942 | 942 | debugindexdot |
|
943 | 943 | dump an index DAG as a graphviz dot file |
|
944 | 944 | debuginstall test Mercurial installation |
|
945 | 945 | debugknown test whether node ids are known to a repo |
|
946 | 946 | debuglocks show or modify state of locks |
|
947 | 947 | debugmanifestfulltextcache |
|
948 | 948 | show, clear or amend the contents of the manifest fulltext |
|
949 | 949 | cache |
|
950 | 950 | debugmergestate |
|
951 | 951 | print merge state |
|
952 | 952 | debugnamecomplete |
|
953 | 953 | complete "names" - tags, open branch names, bookmark names |
|
954 | 954 | debugobsolete |
|
955 | 955 | create arbitrary obsolete marker |
|
956 | 956 | debugoptADV (no help text available) |
|
957 | 957 | debugoptDEP (no help text available) |
|
958 | 958 | debugoptEXP (no help text available) |
|
959 | 959 | debugpathcomplete |
|
960 | 960 | complete part or all of a tracked path |
|
961 | 961 | debugpeer establish a connection to a peer repository |
|
962 | 962 | debugpickmergetool |
|
963 | 963 | examine which merge tool is chosen for specified file |
|
964 | 964 | debugpushkey access the pushkey key/value protocol |
|
965 | 965 | debugpvec (no help text available) |
|
966 | 966 | debugrebuilddirstate |
|
967 | 967 | rebuild the dirstate as it would look like for the given |
|
968 | 968 | revision |
|
969 | 969 | debugrebuildfncache |
|
970 | 970 | rebuild the fncache file |
|
971 | 971 | debugrename dump rename information |
|
972 | 972 | debugrevlog show data and statistics about a revlog |
|
973 | 973 | debugrevspec parse and apply a revision specification |
|
974 | 974 | debugserve run a server with advanced settings |
|
975 | 975 | debugsetparents |
|
976 | 976 | manually set the parents of the current working directory |
|
977 | 977 | debugssl test a secure connection to a server |
|
978 | 978 | debugsub (no help text available) |
|
979 | 979 | debugsuccessorssets |
|
980 | 980 | show set of successors for revision |
|
981 | 981 | debugtemplate |
|
982 | 982 | parse and apply a template |
|
983 | 983 | debuguigetpass |
|
984 | 984 | show prompt to type password |
|
985 | 985 | debuguiprompt |
|
986 | 986 | show plain prompt |
|
987 | 987 | debugupdatecaches |
|
988 | 988 | warm all known caches in the repository |
|
989 | 989 | debugupgraderepo |
|
990 | 990 | upgrade a repository to use different features |
|
991 | 991 | debugwalk show how files match on given patterns |
|
992 | 992 | debugwhyunstable |
|
993 | 993 | explain instabilities of a changeset |
|
994 | 994 | debugwireargs |
|
995 | 995 | (no help text available) |
|
996 | 996 | debugwireproto |
|
997 | 997 | send wire protocol commands to a server |
|
998 | 998 | |
|
999 | 999 | (use 'hg help -v debug' to show built-in aliases and global options) |
|
1000 | 1000 | |
|
1001 | 1001 | internals topic renders index of available sub-topics |
|
1002 | 1002 | |
|
1003 | 1003 | $ hg help internals |
|
1004 | 1004 | Technical implementation topics |
|
1005 | 1005 | """"""""""""""""""""""""""""""" |
|
1006 | 1006 | |
|
1007 | 1007 | To access a subtopic, use "hg help internals.{subtopic-name}" |
|
1008 | 1008 | |
|
1009 | 1009 | bundle2 Bundle2 |
|
1010 | 1010 | bundles Bundles |
|
1011 | 1011 | censor Censor |
|
1012 | 1012 | changegroups Changegroups |
|
1013 | 1013 | config Config Registrar |
|
1014 | 1014 | requirements Repository Requirements |
|
1015 | 1015 | revlogs Revision Logs |
|
1016 | 1016 | wireprotocol Wire Protocol |
|
1017 | 1017 | |
|
1018 | 1018 | sub-topics can be accessed |
|
1019 | 1019 | |
|
1020 | 1020 | $ hg help internals.changegroups |
|
1021 | 1021 | Changegroups |
|
1022 | 1022 | """""""""""" |
|
1023 | 1023 | |
|
1024 | 1024 | Changegroups are representations of repository revlog data, specifically |
|
1025 | 1025 | the changelog data, root/flat manifest data, treemanifest data, and |
|
1026 | 1026 | filelogs. |
|
1027 | 1027 | |
|
1028 | 1028 | There are 3 versions of changegroups: "1", "2", and "3". From a high- |
|
1029 | 1029 | level, versions "1" and "2" are almost exactly the same, with the only |
|
1030 | 1030 | difference being an additional item in the *delta header*. Version "3" |
|
1031 | 1031 | adds support for revlog flags in the *delta header* and optionally |
|
1032 | 1032 | exchanging treemanifests (enabled by setting an option on the |
|
1033 | 1033 | "changegroup" part in the bundle2). |
|
1034 | 1034 | |
|
1035 | 1035 | Changegroups when not exchanging treemanifests consist of 3 logical |
|
1036 | 1036 | segments: |
|
1037 | 1037 | |
|
1038 | 1038 | +---------------------------------+ |
|
1039 | 1039 | | | | | |
|
1040 | 1040 | | changeset | manifest | filelogs | |
|
1041 | 1041 | | | | | |
|
1042 | 1042 | | | | | |
|
1043 | 1043 | +---------------------------------+ |
|
1044 | 1044 | |
|
1045 | 1045 | When exchanging treemanifests, there are 4 logical segments: |
|
1046 | 1046 | |
|
1047 | 1047 | +-------------------------------------------------+ |
|
1048 | 1048 | | | | | | |
|
1049 | 1049 | | changeset | root | treemanifests | filelogs | |
|
1050 | 1050 | | | manifest | | | |
|
1051 | 1051 | | | | | | |
|
1052 | 1052 | +-------------------------------------------------+ |
|
1053 | 1053 | |
|
1054 | 1054 | The principle building block of each segment is a *chunk*. A *chunk* is a |
|
1055 | 1055 | framed piece of data: |
|
1056 | 1056 | |
|
1057 | 1057 | +---------------------------------------+ |
|
1058 | 1058 | | | | |
|
1059 | 1059 | | length | data | |
|
1060 | 1060 | | (4 bytes) | (<length - 4> bytes) | |
|
1061 | 1061 | | | | |
|
1062 | 1062 | +---------------------------------------+ |
|
1063 | 1063 | |
|
1064 | 1064 | All integers are big-endian signed integers. Each chunk starts with a |
|
1065 | 1065 | 32-bit integer indicating the length of the entire chunk (including the |
|
1066 | 1066 | length field itself). |
|
1067 | 1067 | |
|
1068 | 1068 | There is a special case chunk that has a value of 0 for the length |
|
1069 | 1069 | ("0x00000000"). We call this an *empty chunk*. |
|
1070 | 1070 | |
|
1071 | 1071 | Delta Groups |
|
1072 | 1072 | ============ |
|
1073 | 1073 | |
|
1074 | 1074 | A *delta group* expresses the content of a revlog as a series of deltas, |
|
1075 | 1075 | or patches against previous revisions. |
|
1076 | 1076 | |
|
1077 | 1077 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* |
|
1078 | 1078 | to signal the end of the delta group: |
|
1079 | 1079 | |
|
1080 | 1080 | +------------------------------------------------------------------------+ |
|
1081 | 1081 | | | | | | | |
|
1082 | 1082 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | |
|
1083 | 1083 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | |
|
1084 | 1084 | | | | | | | |
|
1085 | 1085 | +------------------------------------------------------------------------+ |
|
1086 | 1086 | |
|
1087 | 1087 | Each *chunk*'s data consists of the following: |
|
1088 | 1088 | |
|
1089 | 1089 | +---------------------------------------+ |
|
1090 | 1090 | | | | |
|
1091 | 1091 | | delta header | delta data | |
|
1092 | 1092 | | (various by version) | (various) | |
|
1093 | 1093 | | | | |
|
1094 | 1094 | +---------------------------------------+ |
|
1095 | 1095 | |
|
1096 | 1096 | The *delta data* is a series of *delta*s that describe a diff from an |
|
1097 | 1097 | existing entry (either that the recipient already has, or previously |
|
1098 | 1098 | specified in the bundle/changegroup). |
|
1099 | 1099 | |
|
1100 | 1100 | The *delta header* is different between versions "1", "2", and "3" of the |
|
1101 | 1101 | changegroup format. |
|
1102 | 1102 | |
|
1103 | 1103 | Version 1 (headerlen=80): |
|
1104 | 1104 | |
|
1105 | 1105 | +------------------------------------------------------+ |
|
1106 | 1106 | | | | | | |
|
1107 | 1107 | | node | p1 node | p2 node | link node | |
|
1108 | 1108 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
1109 | 1109 | | | | | | |
|
1110 | 1110 | +------------------------------------------------------+ |
|
1111 | 1111 | |
|
1112 | 1112 | Version 2 (headerlen=100): |
|
1113 | 1113 | |
|
1114 | 1114 | +------------------------------------------------------------------+ |
|
1115 | 1115 | | | | | | | |
|
1116 | 1116 | | node | p1 node | p2 node | base node | link node | |
|
1117 | 1117 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
1118 | 1118 | | | | | | | |
|
1119 | 1119 | +------------------------------------------------------------------+ |
|
1120 | 1120 | |
|
1121 | 1121 | Version 3 (headerlen=102): |
|
1122 | 1122 | |
|
1123 | 1123 | +------------------------------------------------------------------------------+ |
|
1124 | 1124 | | | | | | | | |
|
1125 | 1125 | | node | p1 node | p2 node | base node | link node | flags | |
|
1126 | 1126 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
|
1127 | 1127 | | | | | | | | |
|
1128 | 1128 | +------------------------------------------------------------------------------+ |
|
1129 | 1129 | |
|
1130 | 1130 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which |
|
1131 | 1131 | contain a series of *delta*s, densely packed (no separators). These deltas |
|
1132 | 1132 | describe a diff from an existing entry (either that the recipient already |
|
1133 | 1133 | has, or previously specified in the bundle/changegroup). The format is |
|
1134 | 1134 | described more fully in "hg help internals.bdiff", but briefly: |
|
1135 | 1135 | |
|
1136 | 1136 | +---------------------------------------------------------------+ |
|
1137 | 1137 | | | | | | |
|
1138 | 1138 | | start offset | end offset | new length | content | |
|
1139 | 1139 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | |
|
1140 | 1140 | | | | | | |
|
1141 | 1141 | +---------------------------------------------------------------+ |
|
1142 | 1142 | |
|
1143 | 1143 | Please note that the length field in the delta data does *not* include |
|
1144 | 1144 | itself. |
|
1145 | 1145 | |
|
1146 | 1146 | In version 1, the delta is always applied against the previous node from |
|
1147 | 1147 | the changegroup or the first parent if this is the first entry in the |
|
1148 | 1148 | changegroup. |
|
1149 | 1149 | |
|
1150 | 1150 | In version 2 and up, the delta base node is encoded in the entry in the |
|
1151 | 1151 | changegroup. This allows the delta to be expressed against any parent, |
|
1152 | 1152 | which can result in smaller deltas and more efficient encoding of data. |
|
1153 | 1153 | |
|
1154 | 1154 | Changeset Segment |
|
1155 | 1155 | ================= |
|
1156 | 1156 | |
|
1157 | 1157 | The *changeset segment* consists of a single *delta group* holding |
|
1158 | 1158 | changelog data. The *empty chunk* at the end of the *delta group* denotes |
|
1159 | 1159 | the boundary to the *manifest segment*. |
|
1160 | 1160 | |
|
1161 | 1161 | Manifest Segment |
|
1162 | 1162 | ================ |
|
1163 | 1163 | |
|
1164 | 1164 | The *manifest segment* consists of a single *delta group* holding manifest |
|
1165 | 1165 | data. If treemanifests are in use, it contains only the manifest for the |
|
1166 | 1166 | root directory of the repository. Otherwise, it contains the entire |
|
1167 | 1167 | manifest data. The *empty chunk* at the end of the *delta group* denotes |
|
1168 | 1168 | the boundary to the next segment (either the *treemanifests segment* or |
|
1169 | 1169 | the *filelogs segment*, depending on version and the request options). |
|
1170 | 1170 | |
|
1171 | 1171 | Treemanifests Segment |
|
1172 | 1172 | --------------------- |
|
1173 | 1173 | |
|
1174 | 1174 | The *treemanifests segment* only exists in changegroup version "3", and |
|
1175 | 1175 | only if the 'treemanifest' param is part of the bundle2 changegroup part |
|
1176 | 1176 | (it is not possible to use changegroup version 3 outside of bundle2). |
|
1177 | 1177 | Aside from the filenames in the *treemanifests segment* containing a |
|
1178 | 1178 | trailing "/" character, it behaves identically to the *filelogs segment* |
|
1179 | 1179 | (see below). The final sub-segment is followed by an *empty chunk* |
|
1180 | 1180 | (logically, a sub-segment with filename size 0). This denotes the boundary |
|
1181 | 1181 | to the *filelogs segment*. |
|
1182 | 1182 | |
|
1183 | 1183 | Filelogs Segment |
|
1184 | 1184 | ================ |
|
1185 | 1185 | |
|
1186 | 1186 | The *filelogs segment* consists of multiple sub-segments, each |
|
1187 | 1187 | corresponding to an individual file whose data is being described: |
|
1188 | 1188 | |
|
1189 | 1189 | +--------------------------------------------------+ |
|
1190 | 1190 | | | | | | | |
|
1191 | 1191 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | |
|
1192 | 1192 | | | | | | (4 bytes) | |
|
1193 | 1193 | | | | | | | |
|
1194 | 1194 | +--------------------------------------------------+ |
|
1195 | 1195 | |
|
1196 | 1196 | The final filelog sub-segment is followed by an *empty chunk* (logically, |
|
1197 | 1197 | a sub-segment with filename size 0). This denotes the end of the segment |
|
1198 | 1198 | and of the overall changegroup. |
|
1199 | 1199 | |
|
1200 | 1200 | Each filelog sub-segment consists of the following: |
|
1201 | 1201 | |
|
1202 | 1202 | +------------------------------------------------------+ |
|
1203 | 1203 | | | | | |
|
1204 | 1204 | | filename length | filename | delta group | |
|
1205 | 1205 | | (4 bytes) | (<length - 4> bytes) | (various) | |
|
1206 | 1206 | | | | | |
|
1207 | 1207 | +------------------------------------------------------+ |
|
1208 | 1208 | |
|
1209 | 1209 | That is, a *chunk* consisting of the filename (not terminated or padded) |
|
1210 | 1210 | followed by N chunks constituting the *delta group* for this file. The |
|
1211 | 1211 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
1212 | 1212 | next filelog sub-segment. |
|
1213 | 1213 | |
|
1214 | 1214 | Test list of commands with command with no help text |
|
1215 | 1215 | |
|
1216 | 1216 | $ hg help helpext |
|
1217 | 1217 | helpext extension - no help text available |
|
1218 | 1218 | |
|
1219 | 1219 | list of commands: |
|
1220 | 1220 | |
|
1221 | 1221 | nohelp (no help text available) |
|
1222 | 1222 | |
|
1223 | 1223 | (use 'hg help -v helpext' to show built-in aliases and global options) |
|
1224 | 1224 | |
|
1225 | 1225 | |
|
1226 | 1226 | test advanced, deprecated and experimental options are hidden in command help |
|
1227 | 1227 | $ hg help debugoptADV |
|
1228 | 1228 | hg debugoptADV |
|
1229 | 1229 | |
|
1230 | 1230 | (no help text available) |
|
1231 | 1231 | |
|
1232 | 1232 | options: |
|
1233 | 1233 | |
|
1234 | 1234 | (some details hidden, use --verbose to show complete help) |
|
1235 | 1235 | $ hg help debugoptDEP |
|
1236 | 1236 | hg debugoptDEP |
|
1237 | 1237 | |
|
1238 | 1238 | (no help text available) |
|
1239 | 1239 | |
|
1240 | 1240 | options: |
|
1241 | 1241 | |
|
1242 | 1242 | (some details hidden, use --verbose to show complete help) |
|
1243 | 1243 | |
|
1244 | 1244 | $ hg help debugoptEXP |
|
1245 | 1245 | hg debugoptEXP |
|
1246 | 1246 | |
|
1247 | 1247 | (no help text available) |
|
1248 | 1248 | |
|
1249 | 1249 | options: |
|
1250 | 1250 | |
|
1251 | 1251 | (some details hidden, use --verbose to show complete help) |
|
1252 | 1252 | |
|
1253 | 1253 | test advanced, deprecated and experimental options are shown with -v |
|
1254 | 1254 | $ hg help -v debugoptADV | grep aopt |
|
1255 | 1255 | --aopt option is (ADVANCED) |
|
1256 | 1256 | $ hg help -v debugoptDEP | grep dopt |
|
1257 | 1257 | --dopt option is (DEPRECATED) |
|
1258 | 1258 | $ hg help -v debugoptEXP | grep eopt |
|
1259 | 1259 | --eopt option is (EXPERIMENTAL) |
|
1260 | 1260 | |
|
1261 | 1261 | #if gettext |
|
1262 | 1262 | test deprecated option is hidden with translation with untranslated description |
|
1263 | 1263 | (use many globy for not failing on changed transaction) |
|
1264 | 1264 | $ LANGUAGE=sv hg help debugoptDEP |
|
1265 | 1265 | hg debugoptDEP |
|
1266 | 1266 | |
|
1267 | 1267 | (*) (glob) |
|
1268 | 1268 | |
|
1269 | 1269 | options: |
|
1270 | 1270 | |
|
1271 | 1271 | (some details hidden, use --verbose to show complete help) |
|
1272 | 1272 | #endif |
|
1273 | 1273 | |
|
1274 | 1274 | Test commands that collide with topics (issue4240) |
|
1275 | 1275 | |
|
1276 | 1276 | $ hg config -hq |
|
1277 | 1277 | hg config [-u] [NAME]... |
|
1278 | 1278 | |
|
1279 | 1279 | show combined config settings from all hgrc files |
|
1280 | 1280 | $ hg showconfig -hq |
|
1281 | 1281 | hg config [-u] [NAME]... |
|
1282 | 1282 | |
|
1283 | 1283 | show combined config settings from all hgrc files |
|
1284 | 1284 | |
|
1285 | 1285 | Test a help topic |
|
1286 | 1286 | |
|
1287 | 1287 | $ hg help dates |
|
1288 | 1288 | Date Formats |
|
1289 | 1289 | """""""""""" |
|
1290 | 1290 | |
|
1291 | 1291 | Some commands allow the user to specify a date, e.g.: |
|
1292 | 1292 | |
|
1293 | 1293 | - backout, commit, import, tag: Specify the commit date. |
|
1294 | 1294 | - log, revert, update: Select revision(s) by date. |
|
1295 | 1295 | |
|
1296 | 1296 | Many date formats are valid. Here are some examples: |
|
1297 | 1297 | |
|
1298 | 1298 | - "Wed Dec 6 13:18:29 2006" (local timezone assumed) |
|
1299 | 1299 | - "Dec 6 13:18 -0600" (year assumed, time offset provided) |
|
1300 | 1300 | - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) |
|
1301 | 1301 | - "Dec 6" (midnight) |
|
1302 | 1302 | - "13:18" (today assumed) |
|
1303 | 1303 | - "3:39" (3:39AM assumed) |
|
1304 | 1304 | - "3:39pm" (15:39) |
|
1305 | 1305 | - "2006-12-06 13:18:29" (ISO 8601 format) |
|
1306 | 1306 | - "2006-12-6 13:18" |
|
1307 | 1307 | - "2006-12-6" |
|
1308 | 1308 | - "12-6" |
|
1309 | 1309 | - "12/6" |
|
1310 | 1310 | - "12/6/6" (Dec 6 2006) |
|
1311 | 1311 | - "today" (midnight) |
|
1312 | 1312 | - "yesterday" (midnight) |
|
1313 | 1313 | - "now" - right now |
|
1314 | 1314 | |
|
1315 | 1315 | Lastly, there is Mercurial's internal format: |
|
1316 | 1316 | |
|
1317 | 1317 | - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) |
|
1318 | 1318 | |
|
1319 | 1319 | This is the internal representation format for dates. The first number is |
|
1320 | 1320 | the number of seconds since the epoch (1970-01-01 00:00 UTC). The second |
|
1321 | 1321 | is the offset of the local timezone, in seconds west of UTC (negative if |
|
1322 | 1322 | the timezone is east of UTC). |
|
1323 | 1323 | |
|
1324 | 1324 | The log command also accepts date ranges: |
|
1325 | 1325 | |
|
1326 | 1326 | - "<DATE" - at or before a given date/time |
|
1327 | 1327 | - ">DATE" - on or after a given date/time |
|
1328 | 1328 | - "DATE to DATE" - a date range, inclusive |
|
1329 | 1329 | - "-DAYS" - within a given number of days of today |
|
1330 | 1330 | |
|
1331 | 1331 | Test repeated config section name |
|
1332 | 1332 | |
|
1333 | 1333 | $ hg help config.host |
|
1334 | 1334 | "http_proxy.host" |
|
1335 | 1335 | Host name and (optional) port of the proxy server, for example |
|
1336 | 1336 | "myproxy:8000". |
|
1337 | 1337 | |
|
1338 | 1338 | "smtp.host" |
|
1339 | 1339 | Host name of mail server, e.g. "mail.example.com". |
|
1340 | 1340 | |
|
1341 | 1341 | Unrelated trailing paragraphs shouldn't be included |
|
1342 | 1342 | |
|
1343 | 1343 | $ hg help config.extramsg | grep '^$' |
|
1344 | 1344 | |
|
1345 | 1345 | |
|
1346 | 1346 | Test capitalized section name |
|
1347 | 1347 | |
|
1348 | 1348 | $ hg help scripting.HGPLAIN > /dev/null |
|
1349 | 1349 | |
|
1350 | 1350 | Help subsection: |
|
1351 | 1351 | |
|
1352 | 1352 | $ hg help config.charsets |grep "Email example:" > /dev/null |
|
1353 | 1353 | [1] |
|
1354 | 1354 | |
|
1355 | 1355 | Show nested definitions |
|
1356 | 1356 | ("profiling.type"[break]"ls"[break]"stat"[break]) |
|
1357 | 1357 | |
|
1358 | 1358 | $ hg help config.type | egrep '^$'|wc -l |
|
1359 | 1359 | \s*3 (re) |
|
1360 | 1360 | |
|
1361 | 1361 | Separate sections from subsections |
|
1362 | 1362 | |
|
1363 | 1363 | $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq |
|
1364 | 1364 | "format" |
|
1365 | 1365 | -------- |
|
1366 | 1366 | |
|
1367 | 1367 | "usegeneraldelta" |
|
1368 | 1368 | |
|
1369 | 1369 | "dotencode" |
|
1370 | 1370 | |
|
1371 | 1371 | "usefncache" |
|
1372 | 1372 | |
|
1373 | 1373 | "usestore" |
|
1374 | 1374 | |
|
1375 | 1375 | "profiling" |
|
1376 | 1376 | ----------- |
|
1377 | 1377 | |
|
1378 | 1378 | "format" |
|
1379 | 1379 | |
|
1380 | 1380 | "progress" |
|
1381 | 1381 | ---------- |
|
1382 | 1382 | |
|
1383 | 1383 | "format" |
|
1384 | 1384 | |
|
1385 | 1385 | |
|
1386 | 1386 | Last item in help config.*: |
|
1387 | 1387 | |
|
1388 | 1388 | $ hg help config.`hg help config|grep '^ "'| \ |
|
1389 | 1389 | > tail -1|sed 's![ "]*!!g'`| \ |
|
1390 | 1390 | > grep 'hg help -c config' > /dev/null |
|
1391 | 1391 | [1] |
|
1392 | 1392 | |
|
1393 | 1393 | note to use help -c for general hg help config: |
|
1394 | 1394 | |
|
1395 | 1395 | $ hg help config |grep 'hg help -c config' > /dev/null |
|
1396 | 1396 | |
|
1397 | 1397 | Test templating help |
|
1398 | 1398 | |
|
1399 | 1399 | $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) ' |
|
1400 | 1400 | desc String. The text of the changeset description. |
|
1401 | 1401 | diffstat String. Statistics of changes with the following format: |
|
1402 | 1402 | firstline Any text. Returns the first line of text. |
|
1403 | 1403 | nonempty Any text. Returns '(none)' if the string is empty. |
|
1404 | 1404 | |
|
1405 | 1405 | Test deprecated items |
|
1406 | 1406 | |
|
1407 | 1407 | $ hg help -v templating | grep currentbookmark |
|
1408 | 1408 | currentbookmark |
|
1409 | 1409 | $ hg help templating | (grep currentbookmark || true) |
|
1410 | 1410 | |
|
1411 | 1411 | Test help hooks |
|
1412 | 1412 | |
|
1413 | 1413 | $ cat > helphook1.py <<EOF |
|
1414 | 1414 | > from mercurial import help |
|
1415 | 1415 | > |
|
1416 | 1416 | > def rewrite(ui, topic, doc): |
|
1417 | 1417 | > return doc + '\nhelphook1\n' |
|
1418 | 1418 | > |
|
1419 | 1419 | > def extsetup(ui): |
|
1420 | 1420 | > help.addtopichook('revisions', rewrite) |
|
1421 | 1421 | > EOF |
|
1422 | 1422 | $ cat > helphook2.py <<EOF |
|
1423 | 1423 | > from mercurial import help |
|
1424 | 1424 | > |
|
1425 | 1425 | > def rewrite(ui, topic, doc): |
|
1426 | 1426 | > return doc + '\nhelphook2\n' |
|
1427 | 1427 | > |
|
1428 | 1428 | > def extsetup(ui): |
|
1429 | 1429 | > help.addtopichook('revisions', rewrite) |
|
1430 | 1430 | > EOF |
|
1431 | 1431 | $ echo '[extensions]' >> $HGRCPATH |
|
1432 | 1432 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
|
1433 | 1433 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
|
1434 | 1434 | $ hg help revsets | grep helphook |
|
1435 | 1435 | helphook1 |
|
1436 | 1436 | helphook2 |
|
1437 | 1437 | |
|
1438 | 1438 | help -c should only show debug --debug |
|
1439 | 1439 | |
|
1440 | 1440 | $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$' |
|
1441 | 1441 | [1] |
|
1442 | 1442 | |
|
1443 | 1443 | help -c should only show deprecated for -v |
|
1444 | 1444 | |
|
1445 | 1445 | $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$' |
|
1446 | 1446 | [1] |
|
1447 | 1447 | |
|
1448 | 1448 | Test -s / --system |
|
1449 | 1449 | |
|
1450 | 1450 | $ hg help config.files -s windows |grep 'etc/mercurial' | \ |
|
1451 | 1451 | > wc -l | sed -e 's/ //g' |
|
1452 | 1452 | 0 |
|
1453 | 1453 | $ hg help config.files --system unix | grep 'USER' | \ |
|
1454 | 1454 | > wc -l | sed -e 's/ //g' |
|
1455 | 1455 | 0 |
|
1456 | 1456 | |
|
1457 | 1457 | Test -e / -c / -k combinations |
|
1458 | 1458 | |
|
1459 | 1459 | $ hg help -c|egrep '^[A-Z].*:|^ debug' |
|
1460 | 1460 | Commands: |
|
1461 | 1461 | $ hg help -e|egrep '^[A-Z].*:|^ debug' |
|
1462 | 1462 | Extensions: |
|
1463 | 1463 | $ hg help -k|egrep '^[A-Z].*:|^ debug' |
|
1464 | 1464 | Topics: |
|
1465 | 1465 | Commands: |
|
1466 | 1466 | Extensions: |
|
1467 | 1467 | Extension Commands: |
|
1468 | 1468 | $ hg help -c schemes |
|
1469 | 1469 | abort: no such help topic: schemes |
|
1470 | 1470 | (try 'hg help --keyword schemes') |
|
1471 | 1471 | [255] |
|
1472 | 1472 | $ hg help -e schemes |head -1 |
|
1473 | 1473 | schemes extension - extend schemes with shortcuts to repository swarms |
|
1474 | 1474 | $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):' |
|
1475 | 1475 | Commands: |
|
1476 | 1476 | $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):' |
|
1477 | 1477 | Extensions: |
|
1478 | 1478 | $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):' |
|
1479 | 1479 | Extensions: |
|
1480 | 1480 | Commands: |
|
1481 | 1481 | $ hg help -c commit > /dev/null |
|
1482 | 1482 | $ hg help -e -c commit > /dev/null |
|
1483 | 1483 | $ hg help -e commit > /dev/null |
|
1484 | 1484 | abort: no such help topic: commit |
|
1485 | 1485 | (try 'hg help --keyword commit') |
|
1486 | 1486 | [255] |
|
1487 | 1487 | |
|
1488 | 1488 | Test keyword search help |
|
1489 | 1489 | |
|
1490 | 1490 | $ cat > prefixedname.py <<EOF |
|
1491 | 1491 | > '''matched against word "clone" |
|
1492 | 1492 | > ''' |
|
1493 | 1493 | > EOF |
|
1494 | 1494 | $ echo '[extensions]' >> $HGRCPATH |
|
1495 | 1495 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH |
|
1496 | 1496 | $ hg help -k clone |
|
1497 | 1497 | Topics: |
|
1498 | 1498 | |
|
1499 | 1499 | config Configuration Files |
|
1500 | 1500 | extensions Using Additional Features |
|
1501 | 1501 | glossary Glossary |
|
1502 | 1502 | phases Working with Phases |
|
1503 | 1503 | subrepos Subrepositories |
|
1504 | 1504 | urls URL Paths |
|
1505 | 1505 | |
|
1506 | 1506 | Commands: |
|
1507 | 1507 | |
|
1508 | 1508 | bookmarks create a new bookmark or list existing bookmarks |
|
1509 | 1509 | clone make a copy of an existing repository |
|
1510 | 1510 | paths show aliases for remote repositories |
|
1511 | 1511 | pull pull changes from the specified source |
|
1512 | 1512 | update update working directory (or switch revisions) |
|
1513 | 1513 | |
|
1514 | 1514 | Extensions: |
|
1515 | 1515 | |
|
1516 | 1516 | clonebundles advertise pre-generated bundles to seed clones |
|
1517 | 1517 | narrow create clones which fetch history data for subset of files |
|
1518 | 1518 | (EXPERIMENTAL) |
|
1519 | 1519 | prefixedname matched against word "clone" |
|
1520 | 1520 | relink recreates hardlinks between repository clones |
|
1521 | 1521 | |
|
1522 | 1522 | Extension Commands: |
|
1523 | 1523 | |
|
1524 | 1524 | qclone clone main and patch repository at same time |
|
1525 | 1525 | |
|
1526 | 1526 | Test unfound topic |
|
1527 | 1527 | |
|
1528 | 1528 | $ hg help nonexistingtopicthatwillneverexisteverever |
|
1529 | 1529 | abort: no such help topic: nonexistingtopicthatwillneverexisteverever |
|
1530 | 1530 | (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever') |
|
1531 | 1531 | [255] |
|
1532 | 1532 | |
|
1533 | 1533 | Test unfound keyword |
|
1534 | 1534 | |
|
1535 | 1535 | $ hg help --keyword nonexistingwordthatwillneverexisteverever |
|
1536 | 1536 | abort: no matches |
|
1537 | 1537 | (try 'hg help' for a list of topics) |
|
1538 | 1538 | [255] |
|
1539 | 1539 | |
|
1540 | 1540 | Test omit indicating for help |
|
1541 | 1541 | |
|
1542 | 1542 | $ cat > addverboseitems.py <<EOF |
|
1543 | 1543 | > '''extension to test omit indicating. |
|
1544 | 1544 | > |
|
1545 | 1545 | > This paragraph is never omitted (for extension) |
|
1546 | 1546 | > |
|
1547 | 1547 | > .. container:: verbose |
|
1548 | 1548 | > |
|
1549 | 1549 | > This paragraph is omitted, |
|
1550 | 1550 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension) |
|
1551 | 1551 | > |
|
1552 | 1552 | > This paragraph is never omitted, too (for extension) |
|
1553 | 1553 | > ''' |
|
1554 | 1554 | > from __future__ import absolute_import |
|
1555 | 1555 | > from mercurial import commands, help |
|
1556 | 1556 | > testtopic = """This paragraph is never omitted (for topic). |
|
1557 | 1557 | > |
|
1558 | 1558 | > .. container:: verbose |
|
1559 | 1559 | > |
|
1560 | 1560 | > This paragraph is omitted, |
|
1561 | 1561 | > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic) |
|
1562 | 1562 | > |
|
1563 | 1563 | > This paragraph is never omitted, too (for topic) |
|
1564 | 1564 | > """ |
|
1565 | 1565 | > def extsetup(ui): |
|
1566 | 1566 | > help.helptable.append((["topic-containing-verbose"], |
|
1567 | 1567 | > "This is the topic to test omit indicating.", |
|
1568 | 1568 | > lambda ui: testtopic)) |
|
1569 | 1569 | > EOF |
|
1570 | 1570 | $ echo '[extensions]' >> $HGRCPATH |
|
1571 | 1571 | $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
|
1572 | 1572 | $ hg help addverboseitems |
|
1573 | 1573 | addverboseitems extension - extension to test omit indicating. |
|
1574 | 1574 | |
|
1575 | 1575 | This paragraph is never omitted (for extension) |
|
1576 | 1576 | |
|
1577 | 1577 | This paragraph is never omitted, too (for extension) |
|
1578 | 1578 | |
|
1579 | 1579 | (some details hidden, use --verbose to show complete help) |
|
1580 | 1580 | |
|
1581 | 1581 | no commands defined |
|
1582 | 1582 | $ hg help -v addverboseitems |
|
1583 | 1583 | addverboseitems extension - extension to test omit indicating. |
|
1584 | 1584 | |
|
1585 | 1585 | This paragraph is never omitted (for extension) |
|
1586 | 1586 | |
|
1587 | 1587 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for |
|
1588 | 1588 | extension) |
|
1589 | 1589 | |
|
1590 | 1590 | This paragraph is never omitted, too (for extension) |
|
1591 | 1591 | |
|
1592 | 1592 | no commands defined |
|
1593 | 1593 | $ hg help topic-containing-verbose |
|
1594 | 1594 | This is the topic to test omit indicating. |
|
1595 | 1595 | """""""""""""""""""""""""""""""""""""""""" |
|
1596 | 1596 | |
|
1597 | 1597 | This paragraph is never omitted (for topic). |
|
1598 | 1598 | |
|
1599 | 1599 | This paragraph is never omitted, too (for topic) |
|
1600 | 1600 | |
|
1601 | 1601 | (some details hidden, use --verbose to show complete help) |
|
1602 | 1602 | $ hg help -v topic-containing-verbose |
|
1603 | 1603 | This is the topic to test omit indicating. |
|
1604 | 1604 | """""""""""""""""""""""""""""""""""""""""" |
|
1605 | 1605 | |
|
1606 | 1606 | This paragraph is never omitted (for topic). |
|
1607 | 1607 | |
|
1608 | 1608 | This paragraph is omitted, if 'hg help' is invoked without "-v" (for |
|
1609 | 1609 | topic) |
|
1610 | 1610 | |
|
1611 | 1611 | This paragraph is never omitted, too (for topic) |
|
1612 | 1612 | |
|
1613 | 1613 | Test section lookup |
|
1614 | 1614 | |
|
1615 | 1615 | $ hg help revset.merge |
|
1616 | 1616 | "merge()" |
|
1617 | 1617 | Changeset is a merge changeset. |
|
1618 | 1618 | |
|
1619 | 1619 | $ hg help glossary.dag |
|
1620 | 1620 | DAG |
|
1621 | 1621 | The repository of changesets of a distributed version control system |
|
1622 | 1622 | (DVCS) can be described as a directed acyclic graph (DAG), consisting |
|
1623 | 1623 | of nodes and edges, where nodes correspond to changesets and edges |
|
1624 | 1624 | imply a parent -> child relation. This graph can be visualized by |
|
1625 | 1625 | graphical tools such as 'hg log --graph'. In Mercurial, the DAG is |
|
1626 | 1626 | limited by the requirement for children to have at most two parents. |
|
1627 | 1627 | |
|
1628 | 1628 | |
|
1629 | 1629 | $ hg help hgrc.paths |
|
1630 | 1630 | "paths" |
|
1631 | 1631 | ------- |
|
1632 | 1632 | |
|
1633 | 1633 | Assigns symbolic names and behavior to repositories. |
|
1634 | 1634 | |
|
1635 | 1635 | Options are symbolic names defining the URL or directory that is the |
|
1636 | 1636 | location of the repository. Example: |
|
1637 | 1637 | |
|
1638 | 1638 | [paths] |
|
1639 | 1639 | my_server = https://example.com/my_repo |
|
1640 | 1640 | local_path = /home/me/repo |
|
1641 | 1641 | |
|
1642 | 1642 | These symbolic names can be used from the command line. To pull from |
|
1643 | 1643 | "my_server": 'hg pull my_server'. To push to "local_path": 'hg push |
|
1644 | 1644 | local_path'. |
|
1645 | 1645 | |
|
1646 | 1646 | Options containing colons (":") denote sub-options that can influence |
|
1647 | 1647 | behavior for that specific path. Example: |
|
1648 | 1648 | |
|
1649 | 1649 | [paths] |
|
1650 | 1650 | my_server = https://example.com/my_path |
|
1651 | 1651 | my_server:pushurl = ssh://example.com/my_path |
|
1652 | 1652 | |
|
1653 | 1653 | The following sub-options can be defined: |
|
1654 | 1654 | |
|
1655 | 1655 | "pushurl" |
|
1656 | 1656 | The URL to use for push operations. If not defined, the location |
|
1657 | 1657 | defined by the path's main entry is used. |
|
1658 | 1658 | |
|
1659 | 1659 | "pushrev" |
|
1660 | 1660 | A revset defining which revisions to push by default. |
|
1661 | 1661 | |
|
1662 | 1662 | When 'hg push' is executed without a "-r" argument, the revset defined |
|
1663 | 1663 | by this sub-option is evaluated to determine what to push. |
|
1664 | 1664 | |
|
1665 | 1665 | For example, a value of "." will push the working directory's revision |
|
1666 | 1666 | by default. |
|
1667 | 1667 | |
|
1668 | 1668 | Revsets specifying bookmarks will not result in the bookmark being |
|
1669 | 1669 | pushed. |
|
1670 | 1670 | |
|
1671 | 1671 | The following special named paths exist: |
|
1672 | 1672 | |
|
1673 | 1673 | "default" |
|
1674 | 1674 | The URL or directory to use when no source or remote is specified. |
|
1675 | 1675 | |
|
1676 | 1676 | 'hg clone' will automatically define this path to the location the |
|
1677 | 1677 | repository was cloned from. |
|
1678 | 1678 | |
|
1679 | 1679 | "default-push" |
|
1680 | 1680 | (deprecated) The URL or directory for the default 'hg push' location. |
|
1681 | 1681 | "default:pushurl" should be used instead. |
|
1682 | 1682 | |
|
1683 | 1683 | $ hg help glossary.mcguffin |
|
1684 | 1684 | abort: help section not found: glossary.mcguffin |
|
1685 | 1685 | [255] |
|
1686 | 1686 | |
|
1687 | 1687 | $ hg help glossary.mc.guffin |
|
1688 | 1688 | abort: help section not found: glossary.mc.guffin |
|
1689 | 1689 | [255] |
|
1690 | 1690 | |
|
1691 | 1691 | $ hg help template.files |
|
1692 | 1692 | files List of strings. All files modified, added, or removed by |
|
1693 | 1693 | this changeset. |
|
1694 | 1694 | files(pattern) |
|
1695 | 1695 | All files of the current changeset matching the pattern. See |
|
1696 | 1696 | 'hg help patterns'. |
|
1697 | 1697 | |
|
1698 | 1698 | Test section lookup by translated message |
|
1699 | 1699 | |
|
1700 | 1700 | str.lower() instead of encoding.lower(str) on translated message might |
|
1701 | 1701 | make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z) |
|
1702 | 1702 | as the second or later byte of multi-byte character. |
|
1703 | 1703 | |
|
1704 | 1704 | For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932) |
|
1705 | 1705 | contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this |
|
1706 | 1706 | replacement makes message meaningless. |
|
1707 | 1707 | |
|
1708 | 1708 | This tests that section lookup by translated string isn't broken by |
|
1709 | 1709 | such str.lower(). |
|
1710 | 1710 | |
|
1711 | 1711 | $ $PYTHON <<EOF |
|
1712 | 1712 | > def escape(s): |
|
1713 | 1713 | > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932')) |
|
1714 | 1714 | > # translation of "record" in ja_JP.cp932 |
|
1715 | 1715 | > upper = "\x8bL\x98^" |
|
1716 | 1716 | > # str.lower()-ed section name should be treated as different one |
|
1717 | 1717 | > lower = "\x8bl\x98^" |
|
1718 | 1718 | > with open('ambiguous.py', 'w') as fp: |
|
1719 | 1719 | > fp.write("""# ambiguous section names in ja_JP.cp932 |
|
1720 | 1720 | > u'''summary of extension |
|
1721 | 1721 | > |
|
1722 | 1722 | > %s |
|
1723 | 1723 | > ---- |
|
1724 | 1724 | > |
|
1725 | 1725 | > Upper name should show only this message |
|
1726 | 1726 | > |
|
1727 | 1727 | > %s |
|
1728 | 1728 | > ---- |
|
1729 | 1729 | > |
|
1730 | 1730 | > Lower name should show only this message |
|
1731 | 1731 | > |
|
1732 | 1732 | > subsequent section |
|
1733 | 1733 | > ------------------ |
|
1734 | 1734 | > |
|
1735 | 1735 | > This should be hidden at 'hg help ambiguous' with section name. |
|
1736 | 1736 | > ''' |
|
1737 | 1737 | > """ % (escape(upper), escape(lower))) |
|
1738 | 1738 | > EOF |
|
1739 | 1739 | |
|
1740 | 1740 | $ cat >> $HGRCPATH <<EOF |
|
1741 | 1741 | > [extensions] |
|
1742 | 1742 | > ambiguous = ./ambiguous.py |
|
1743 | 1743 | > EOF |
|
1744 | 1744 | |
|
1745 | 1745 | $ $PYTHON <<EOF | sh |
|
1746 | 1746 | > upper = "\x8bL\x98^" |
|
1747 | 1747 | > print("hg --encoding cp932 help -e ambiguous.%s" % upper) |
|
1748 | 1748 | > EOF |
|
1749 | 1749 | \x8bL\x98^ (esc) |
|
1750 | 1750 | ---- |
|
1751 | 1751 | |
|
1752 | 1752 | Upper name should show only this message |
|
1753 | 1753 | |
|
1754 | 1754 | |
|
1755 | 1755 | $ $PYTHON <<EOF | sh |
|
1756 | 1756 | > lower = "\x8bl\x98^" |
|
1757 | 1757 | > print("hg --encoding cp932 help -e ambiguous.%s" % lower) |
|
1758 | 1758 | > EOF |
|
1759 | 1759 | \x8bl\x98^ (esc) |
|
1760 | 1760 | ---- |
|
1761 | 1761 | |
|
1762 | 1762 | Lower name should show only this message |
|
1763 | 1763 | |
|
1764 | 1764 | |
|
1765 | 1765 | $ cat >> $HGRCPATH <<EOF |
|
1766 | 1766 | > [extensions] |
|
1767 | 1767 | > ambiguous = ! |
|
1768 | 1768 | > EOF |
|
1769 | 1769 | |
|
1770 | 1770 | Show help content of disabled extensions |
|
1771 | 1771 | |
|
1772 | 1772 | $ cat >> $HGRCPATH <<EOF |
|
1773 | 1773 | > [extensions] |
|
1774 | 1774 | > ambiguous = !./ambiguous.py |
|
1775 | 1775 | > EOF |
|
1776 | 1776 | $ hg help -e ambiguous |
|
1777 | 1777 | ambiguous extension - (no help text available) |
|
1778 | 1778 | |
|
1779 | 1779 | (use 'hg help extensions' for information on enabling extensions) |
|
1780 | 1780 | |
|
1781 | 1781 | Test dynamic list of merge tools only shows up once |
|
1782 | 1782 | $ hg help merge-tools |
|
1783 | 1783 | Merge Tools |
|
1784 | 1784 | """"""""""" |
|
1785 | 1785 | |
|
1786 | 1786 | To merge files Mercurial uses merge tools. |
|
1787 | 1787 | |
|
1788 | 1788 | A merge tool combines two different versions of a file into a merged file. |
|
1789 | 1789 | Merge tools are given the two files and the greatest common ancestor of |
|
1790 | 1790 | the two file versions, so they can determine the changes made on both |
|
1791 | 1791 | branches. |
|
1792 | 1792 | |
|
1793 | 1793 | Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg |
|
1794 | 1794 | backout' and in several extensions. |
|
1795 | 1795 | |
|
1796 | 1796 | Usually, the merge tool tries to automatically reconcile the files by |
|
1797 | 1797 | combining all non-overlapping changes that occurred separately in the two |
|
1798 | 1798 | different evolutions of the same initial base file. Furthermore, some |
|
1799 | 1799 | interactive merge programs make it easier to manually resolve conflicting |
|
1800 | 1800 | merges, either in a graphical way, or by inserting some conflict markers. |
|
1801 | 1801 | Mercurial does not include any interactive merge programs but relies on |
|
1802 | 1802 | external tools for that. |
|
1803 | 1803 | |
|
1804 | 1804 | Available merge tools |
|
1805 | 1805 | ===================== |
|
1806 | 1806 | |
|
1807 | 1807 | External merge tools and their properties are configured in the merge- |
|
1808 | 1808 | tools configuration section - see hgrc(5) - but they can often just be |
|
1809 | 1809 | named by their executable. |
|
1810 | 1810 | |
|
1811 | 1811 | A merge tool is generally usable if its executable can be found on the |
|
1812 | 1812 | system and if it can handle the merge. The executable is found if it is an |
|
1813 | 1813 | absolute or relative executable path or the name of an application in the |
|
1814 | 1814 | executable search path. The tool is assumed to be able to handle the merge |
|
1815 | 1815 | if it can handle symlinks if the file is a symlink, if it can handle |
|
1816 | 1816 | binary files if the file is binary, and if a GUI is available if the tool |
|
1817 | 1817 | requires a GUI. |
|
1818 | 1818 | |
|
1819 | 1819 | There are some internal merge tools which can be used. The internal merge |
|
1820 | 1820 | tools are: |
|
1821 | 1821 | |
|
1822 | 1822 | ":dump" |
|
1823 | 1823 | Creates three versions of the files to merge, containing the contents of |
|
1824 | 1824 | local, other and base. These files can then be used to perform a merge |
|
1825 | 1825 | manually. If the file to be merged is named "a.txt", these files will |
|
1826 | 1826 | accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and |
|
1827 | 1827 | they will be placed in the same directory as "a.txt". |
|
1828 | 1828 | |
|
1829 | 1829 | This implies premerge. Therefore, files aren't dumped, if premerge runs |
|
1830 | 1830 | successfully. Use :forcedump to forcibly write files out. |
|
1831 | 1831 | |
|
1832 | 1832 | ":fail" |
|
1833 | 1833 | Rather than attempting to merge files that were modified on both |
|
1834 | 1834 | branches, it marks them as unresolved. The resolve command must be used |
|
1835 | 1835 | to resolve these conflicts. |
|
1836 | 1836 | |
|
1837 | 1837 | ":forcedump" |
|
1838 | 1838 | Creates three versions of the files as same as :dump, but omits |
|
1839 | 1839 | premerge. |
|
1840 | 1840 | |
|
1841 | 1841 | ":local" |
|
1842 | 1842 | Uses the local 'p1()' version of files as the merged version. |
|
1843 | 1843 | |
|
1844 | 1844 | ":merge" |
|
1845 | 1845 | Uses the internal non-interactive simple merge algorithm for merging |
|
1846 | 1846 | files. It will fail if there are any conflicts and leave markers in the |
|
1847 | 1847 | partially merged file. Markers will have two sections, one for each side |
|
1848 | 1848 | of merge. |
|
1849 | 1849 | |
|
1850 | 1850 | ":merge-local" |
|
1851 | 1851 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
1852 | 1852 | local 'p1()' changes. |
|
1853 | 1853 | |
|
1854 | 1854 | ":merge-other" |
|
1855 | 1855 | Like :merge, but resolve all conflicts non-interactively in favor of the |
|
1856 | 1856 | other 'p2()' changes. |
|
1857 | 1857 | |
|
1858 | 1858 | ":merge3" |
|
1859 | 1859 | Uses the internal non-interactive simple merge algorithm for merging |
|
1860 | 1860 | files. It will fail if there are any conflicts and leave markers in the |
|
1861 | 1861 | partially merged file. Marker will have three sections, one from each |
|
1862 | 1862 | side of the merge and one for the base content. |
|
1863 | 1863 | |
|
1864 | 1864 | ":other" |
|
1865 | 1865 | Uses the other 'p2()' version of files as the merged version. |
|
1866 | 1866 | |
|
1867 | 1867 | ":prompt" |
|
1868 | 1868 | Asks the user which of the local 'p1()' or the other 'p2()' version to |
|
1869 | 1869 | keep as the merged version. |
|
1870 | 1870 | |
|
1871 | 1871 | ":tagmerge" |
|
1872 | 1872 | Uses the internal tag merge algorithm (experimental). |
|
1873 | 1873 | |
|
1874 | 1874 | ":union" |
|
1875 | 1875 | Uses the internal non-interactive simple merge algorithm for merging |
|
1876 | 1876 | files. It will use both left and right sides for conflict regions. No |
|
1877 | 1877 | markers are inserted. |
|
1878 | 1878 | |
|
1879 | 1879 | Internal tools are always available and do not require a GUI but will by |
|
1880 | 1880 | default not handle symlinks or binary files. |
|
1881 | 1881 | |
|
1882 | 1882 | Choosing a merge tool |
|
1883 | 1883 | ===================== |
|
1884 | 1884 | |
|
1885 | 1885 | Mercurial uses these rules when deciding which merge tool to use: |
|
1886 | 1886 | |
|
1887 | 1887 | 1. If a tool has been specified with the --tool option to merge or |
|
1888 | 1888 | resolve, it is used. If it is the name of a tool in the merge-tools |
|
1889 | 1889 | configuration, its configuration is used. Otherwise the specified tool |
|
1890 | 1890 | must be executable by the shell. |
|
1891 | 1891 | 2. If the "HGMERGE" environment variable is present, its value is used and |
|
1892 | 1892 | must be executable by the shell. |
|
1893 | 1893 | 3. If the filename of the file to be merged matches any of the patterns in |
|
1894 | 1894 | the merge-patterns configuration section, the first usable merge tool |
|
1895 | 1895 | corresponding to a matching pattern is used. |
|
1896 | 1896 | 4. If ui.merge is set it will be considered next. If the value is not the |
|
1897 | 1897 | name of a configured tool, the specified value is used and must be |
|
1898 | 1898 | executable by the shell. Otherwise the named tool is used if it is |
|
1899 | 1899 | usable. |
|
1900 | 1900 | 5. If any usable merge tools are present in the merge-tools configuration |
|
1901 | 1901 | section, the one with the highest priority is used. |
|
1902 | 1902 | 6. If a program named "hgmerge" can be found on the system, it is used - |
|
1903 | 1903 | but it will by default not be used for symlinks and binary files. |
|
1904 | 1904 | 7. If the file to be merged is not binary and is not a symlink, then |
|
1905 | 1905 | internal ":merge" is used. |
|
1906 | 1906 | 8. Otherwise, ":prompt" is used. |
|
1907 | 1907 | |
|
1908 | 1908 | For historical reason, Mercurial assumes capabilities of internal merge |
|
1909 | 1909 | tools as below while examining rules above, regardless of actual |
|
1910 | 1910 | capabilities of them. |
|
1911 | 1911 | |
|
1912 | 1912 | step specified via binary symlink |
|
1913 | 1913 | ---------------------------------- |
|
1914 | 1914 | 1. --tool o o |
|
1915 | 1915 | 2. HGMERGE o o |
|
1916 |
3. merge-patterns o |
|
|
1917 |
4. ui.merge x |
|
|
1916 | 3. merge-patterns o (*) x (*) | |
|
1917 | 4. ui.merge x (*) x (*) | |
|
1918 | ||
|
1919 | If "merge.strict-capability-check" configuration is true, Mercurial checks | |
|
1920 | capabilities of internal merge tools strictly in (*) cases above. It is | |
|
1921 | false by default for backward compatibility. | |
|
1918 | 1922 | |
|
1919 | 1923 | Note: |
|
1920 | 1924 | After selecting a merge program, Mercurial will by default attempt to |
|
1921 | 1925 | merge the files using a simple merge algorithm first. Only if it |
|
1922 | 1926 | doesn't succeed because of conflicting changes will Mercurial actually |
|
1923 | 1927 | execute the merge program. Whether to use the simple merge algorithm |
|
1924 | 1928 | first can be controlled by the premerge setting of the merge tool. |
|
1925 | 1929 | Premerge is enabled by default unless the file is binary or a symlink. |
|
1926 | 1930 | |
|
1927 | 1931 | See the merge-tools and ui sections of hgrc(5) for details on the |
|
1928 | 1932 | configuration of merge tools. |
|
1929 | 1933 | |
|
1930 | 1934 | Compression engines listed in `hg help bundlespec` |
|
1931 | 1935 | |
|
1932 | 1936 | $ hg help bundlespec | grep gzip |
|
1933 | 1937 | "v1" bundles can only use the "gzip", "bzip2", and "none" compression |
|
1934 | 1938 | An algorithm that produces smaller bundles than "gzip". |
|
1935 | 1939 | This engine will likely produce smaller bundles than "gzip" but will be |
|
1936 | 1940 | "gzip" |
|
1937 | 1941 | better compression than "gzip". It also frequently yields better (?) |
|
1938 | 1942 | |
|
1939 | 1943 | Test usage of section marks in help documents |
|
1940 | 1944 | |
|
1941 | 1945 | $ cd "$TESTDIR"/../doc |
|
1942 | 1946 | $ $PYTHON check-seclevel.py |
|
1943 | 1947 | $ cd $TESTTMP |
|
1944 | 1948 | |
|
1945 | 1949 | #if serve |
|
1946 | 1950 | |
|
1947 | 1951 | Test the help pages in hgweb. |
|
1948 | 1952 | |
|
1949 | 1953 | Dish up an empty repo; serve it cold. |
|
1950 | 1954 | |
|
1951 | 1955 | $ hg init "$TESTTMP/test" |
|
1952 | 1956 | $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid |
|
1953 | 1957 | $ cat hg.pid >> $DAEMON_PIDS |
|
1954 | 1958 | |
|
1955 | 1959 | $ get-with-headers.py $LOCALIP:$HGPORT "help" |
|
1956 | 1960 | 200 Script output follows |
|
1957 | 1961 | |
|
1958 | 1962 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
1959 | 1963 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
1960 | 1964 | <head> |
|
1961 | 1965 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
1962 | 1966 | <meta name="robots" content="index, nofollow" /> |
|
1963 | 1967 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
1964 | 1968 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
1965 | 1969 | |
|
1966 | 1970 | <title>Help: Index</title> |
|
1967 | 1971 | </head> |
|
1968 | 1972 | <body> |
|
1969 | 1973 | |
|
1970 | 1974 | <div class="container"> |
|
1971 | 1975 | <div class="menu"> |
|
1972 | 1976 | <div class="logo"> |
|
1973 | 1977 | <a href="https://mercurial-scm.org/"> |
|
1974 | 1978 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
1975 | 1979 | </div> |
|
1976 | 1980 | <ul> |
|
1977 | 1981 | <li><a href="/shortlog">log</a></li> |
|
1978 | 1982 | <li><a href="/graph">graph</a></li> |
|
1979 | 1983 | <li><a href="/tags">tags</a></li> |
|
1980 | 1984 | <li><a href="/bookmarks">bookmarks</a></li> |
|
1981 | 1985 | <li><a href="/branches">branches</a></li> |
|
1982 | 1986 | </ul> |
|
1983 | 1987 | <ul> |
|
1984 | 1988 | <li class="active">help</li> |
|
1985 | 1989 | </ul> |
|
1986 | 1990 | </div> |
|
1987 | 1991 | |
|
1988 | 1992 | <div class="main"> |
|
1989 | 1993 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
1990 | 1994 | |
|
1991 | 1995 | <form class="search" action="/log"> |
|
1992 | 1996 | |
|
1993 | 1997 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
1994 | 1998 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
1995 | 1999 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
1996 | 2000 | </form> |
|
1997 | 2001 | <table class="bigtable"> |
|
1998 | 2002 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> |
|
1999 | 2003 | |
|
2000 | 2004 | <tr><td> |
|
2001 | 2005 | <a href="/help/bundlespec"> |
|
2002 | 2006 | bundlespec |
|
2003 | 2007 | </a> |
|
2004 | 2008 | </td><td> |
|
2005 | 2009 | Bundle File Formats |
|
2006 | 2010 | </td></tr> |
|
2007 | 2011 | <tr><td> |
|
2008 | 2012 | <a href="/help/color"> |
|
2009 | 2013 | color |
|
2010 | 2014 | </a> |
|
2011 | 2015 | </td><td> |
|
2012 | 2016 | Colorizing Outputs |
|
2013 | 2017 | </td></tr> |
|
2014 | 2018 | <tr><td> |
|
2015 | 2019 | <a href="/help/config"> |
|
2016 | 2020 | config |
|
2017 | 2021 | </a> |
|
2018 | 2022 | </td><td> |
|
2019 | 2023 | Configuration Files |
|
2020 | 2024 | </td></tr> |
|
2021 | 2025 | <tr><td> |
|
2022 | 2026 | <a href="/help/dates"> |
|
2023 | 2027 | dates |
|
2024 | 2028 | </a> |
|
2025 | 2029 | </td><td> |
|
2026 | 2030 | Date Formats |
|
2027 | 2031 | </td></tr> |
|
2028 | 2032 | <tr><td> |
|
2029 | 2033 | <a href="/help/deprecated"> |
|
2030 | 2034 | deprecated |
|
2031 | 2035 | </a> |
|
2032 | 2036 | </td><td> |
|
2033 | 2037 | Deprecated Features |
|
2034 | 2038 | </td></tr> |
|
2035 | 2039 | <tr><td> |
|
2036 | 2040 | <a href="/help/diffs"> |
|
2037 | 2041 | diffs |
|
2038 | 2042 | </a> |
|
2039 | 2043 | </td><td> |
|
2040 | 2044 | Diff Formats |
|
2041 | 2045 | </td></tr> |
|
2042 | 2046 | <tr><td> |
|
2043 | 2047 | <a href="/help/environment"> |
|
2044 | 2048 | environment |
|
2045 | 2049 | </a> |
|
2046 | 2050 | </td><td> |
|
2047 | 2051 | Environment Variables |
|
2048 | 2052 | </td></tr> |
|
2049 | 2053 | <tr><td> |
|
2050 | 2054 | <a href="/help/extensions"> |
|
2051 | 2055 | extensions |
|
2052 | 2056 | </a> |
|
2053 | 2057 | </td><td> |
|
2054 | 2058 | Using Additional Features |
|
2055 | 2059 | </td></tr> |
|
2056 | 2060 | <tr><td> |
|
2057 | 2061 | <a href="/help/filesets"> |
|
2058 | 2062 | filesets |
|
2059 | 2063 | </a> |
|
2060 | 2064 | </td><td> |
|
2061 | 2065 | Specifying File Sets |
|
2062 | 2066 | </td></tr> |
|
2063 | 2067 | <tr><td> |
|
2064 | 2068 | <a href="/help/flags"> |
|
2065 | 2069 | flags |
|
2066 | 2070 | </a> |
|
2067 | 2071 | </td><td> |
|
2068 | 2072 | Command-line flags |
|
2069 | 2073 | </td></tr> |
|
2070 | 2074 | <tr><td> |
|
2071 | 2075 | <a href="/help/glossary"> |
|
2072 | 2076 | glossary |
|
2073 | 2077 | </a> |
|
2074 | 2078 | </td><td> |
|
2075 | 2079 | Glossary |
|
2076 | 2080 | </td></tr> |
|
2077 | 2081 | <tr><td> |
|
2078 | 2082 | <a href="/help/hgignore"> |
|
2079 | 2083 | hgignore |
|
2080 | 2084 | </a> |
|
2081 | 2085 | </td><td> |
|
2082 | 2086 | Syntax for Mercurial Ignore Files |
|
2083 | 2087 | </td></tr> |
|
2084 | 2088 | <tr><td> |
|
2085 | 2089 | <a href="/help/hgweb"> |
|
2086 | 2090 | hgweb |
|
2087 | 2091 | </a> |
|
2088 | 2092 | </td><td> |
|
2089 | 2093 | Configuring hgweb |
|
2090 | 2094 | </td></tr> |
|
2091 | 2095 | <tr><td> |
|
2092 | 2096 | <a href="/help/internals"> |
|
2093 | 2097 | internals |
|
2094 | 2098 | </a> |
|
2095 | 2099 | </td><td> |
|
2096 | 2100 | Technical implementation topics |
|
2097 | 2101 | </td></tr> |
|
2098 | 2102 | <tr><td> |
|
2099 | 2103 | <a href="/help/merge-tools"> |
|
2100 | 2104 | merge-tools |
|
2101 | 2105 | </a> |
|
2102 | 2106 | </td><td> |
|
2103 | 2107 | Merge Tools |
|
2104 | 2108 | </td></tr> |
|
2105 | 2109 | <tr><td> |
|
2106 | 2110 | <a href="/help/pager"> |
|
2107 | 2111 | pager |
|
2108 | 2112 | </a> |
|
2109 | 2113 | </td><td> |
|
2110 | 2114 | Pager Support |
|
2111 | 2115 | </td></tr> |
|
2112 | 2116 | <tr><td> |
|
2113 | 2117 | <a href="/help/patterns"> |
|
2114 | 2118 | patterns |
|
2115 | 2119 | </a> |
|
2116 | 2120 | </td><td> |
|
2117 | 2121 | File Name Patterns |
|
2118 | 2122 | </td></tr> |
|
2119 | 2123 | <tr><td> |
|
2120 | 2124 | <a href="/help/phases"> |
|
2121 | 2125 | phases |
|
2122 | 2126 | </a> |
|
2123 | 2127 | </td><td> |
|
2124 | 2128 | Working with Phases |
|
2125 | 2129 | </td></tr> |
|
2126 | 2130 | <tr><td> |
|
2127 | 2131 | <a href="/help/revisions"> |
|
2128 | 2132 | revisions |
|
2129 | 2133 | </a> |
|
2130 | 2134 | </td><td> |
|
2131 | 2135 | Specifying Revisions |
|
2132 | 2136 | </td></tr> |
|
2133 | 2137 | <tr><td> |
|
2134 | 2138 | <a href="/help/scripting"> |
|
2135 | 2139 | scripting |
|
2136 | 2140 | </a> |
|
2137 | 2141 | </td><td> |
|
2138 | 2142 | Using Mercurial from scripts and automation |
|
2139 | 2143 | </td></tr> |
|
2140 | 2144 | <tr><td> |
|
2141 | 2145 | <a href="/help/subrepos"> |
|
2142 | 2146 | subrepos |
|
2143 | 2147 | </a> |
|
2144 | 2148 | </td><td> |
|
2145 | 2149 | Subrepositories |
|
2146 | 2150 | </td></tr> |
|
2147 | 2151 | <tr><td> |
|
2148 | 2152 | <a href="/help/templating"> |
|
2149 | 2153 | templating |
|
2150 | 2154 | </a> |
|
2151 | 2155 | </td><td> |
|
2152 | 2156 | Template Usage |
|
2153 | 2157 | </td></tr> |
|
2154 | 2158 | <tr><td> |
|
2155 | 2159 | <a href="/help/urls"> |
|
2156 | 2160 | urls |
|
2157 | 2161 | </a> |
|
2158 | 2162 | </td><td> |
|
2159 | 2163 | URL Paths |
|
2160 | 2164 | </td></tr> |
|
2161 | 2165 | <tr><td> |
|
2162 | 2166 | <a href="/help/topic-containing-verbose"> |
|
2163 | 2167 | topic-containing-verbose |
|
2164 | 2168 | </a> |
|
2165 | 2169 | </td><td> |
|
2166 | 2170 | This is the topic to test omit indicating. |
|
2167 | 2171 | </td></tr> |
|
2168 | 2172 | |
|
2169 | 2173 | |
|
2170 | 2174 | <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr> |
|
2171 | 2175 | |
|
2172 | 2176 | <tr><td> |
|
2173 | 2177 | <a href="/help/add"> |
|
2174 | 2178 | add |
|
2175 | 2179 | </a> |
|
2176 | 2180 | </td><td> |
|
2177 | 2181 | add the specified files on the next commit |
|
2178 | 2182 | </td></tr> |
|
2179 | 2183 | <tr><td> |
|
2180 | 2184 | <a href="/help/annotate"> |
|
2181 | 2185 | annotate |
|
2182 | 2186 | </a> |
|
2183 | 2187 | </td><td> |
|
2184 | 2188 | show changeset information by line for each file |
|
2185 | 2189 | </td></tr> |
|
2186 | 2190 | <tr><td> |
|
2187 | 2191 | <a href="/help/clone"> |
|
2188 | 2192 | clone |
|
2189 | 2193 | </a> |
|
2190 | 2194 | </td><td> |
|
2191 | 2195 | make a copy of an existing repository |
|
2192 | 2196 | </td></tr> |
|
2193 | 2197 | <tr><td> |
|
2194 | 2198 | <a href="/help/commit"> |
|
2195 | 2199 | commit |
|
2196 | 2200 | </a> |
|
2197 | 2201 | </td><td> |
|
2198 | 2202 | commit the specified files or all outstanding changes |
|
2199 | 2203 | </td></tr> |
|
2200 | 2204 | <tr><td> |
|
2201 | 2205 | <a href="/help/diff"> |
|
2202 | 2206 | diff |
|
2203 | 2207 | </a> |
|
2204 | 2208 | </td><td> |
|
2205 | 2209 | diff repository (or selected files) |
|
2206 | 2210 | </td></tr> |
|
2207 | 2211 | <tr><td> |
|
2208 | 2212 | <a href="/help/export"> |
|
2209 | 2213 | export |
|
2210 | 2214 | </a> |
|
2211 | 2215 | </td><td> |
|
2212 | 2216 | dump the header and diffs for one or more changesets |
|
2213 | 2217 | </td></tr> |
|
2214 | 2218 | <tr><td> |
|
2215 | 2219 | <a href="/help/forget"> |
|
2216 | 2220 | forget |
|
2217 | 2221 | </a> |
|
2218 | 2222 | </td><td> |
|
2219 | 2223 | forget the specified files on the next commit |
|
2220 | 2224 | </td></tr> |
|
2221 | 2225 | <tr><td> |
|
2222 | 2226 | <a href="/help/init"> |
|
2223 | 2227 | init |
|
2224 | 2228 | </a> |
|
2225 | 2229 | </td><td> |
|
2226 | 2230 | create a new repository in the given directory |
|
2227 | 2231 | </td></tr> |
|
2228 | 2232 | <tr><td> |
|
2229 | 2233 | <a href="/help/log"> |
|
2230 | 2234 | log |
|
2231 | 2235 | </a> |
|
2232 | 2236 | </td><td> |
|
2233 | 2237 | show revision history of entire repository or files |
|
2234 | 2238 | </td></tr> |
|
2235 | 2239 | <tr><td> |
|
2236 | 2240 | <a href="/help/merge"> |
|
2237 | 2241 | merge |
|
2238 | 2242 | </a> |
|
2239 | 2243 | </td><td> |
|
2240 | 2244 | merge another revision into working directory |
|
2241 | 2245 | </td></tr> |
|
2242 | 2246 | <tr><td> |
|
2243 | 2247 | <a href="/help/pull"> |
|
2244 | 2248 | pull |
|
2245 | 2249 | </a> |
|
2246 | 2250 | </td><td> |
|
2247 | 2251 | pull changes from the specified source |
|
2248 | 2252 | </td></tr> |
|
2249 | 2253 | <tr><td> |
|
2250 | 2254 | <a href="/help/push"> |
|
2251 | 2255 | push |
|
2252 | 2256 | </a> |
|
2253 | 2257 | </td><td> |
|
2254 | 2258 | push changes to the specified destination |
|
2255 | 2259 | </td></tr> |
|
2256 | 2260 | <tr><td> |
|
2257 | 2261 | <a href="/help/remove"> |
|
2258 | 2262 | remove |
|
2259 | 2263 | </a> |
|
2260 | 2264 | </td><td> |
|
2261 | 2265 | remove the specified files on the next commit |
|
2262 | 2266 | </td></tr> |
|
2263 | 2267 | <tr><td> |
|
2264 | 2268 | <a href="/help/serve"> |
|
2265 | 2269 | serve |
|
2266 | 2270 | </a> |
|
2267 | 2271 | </td><td> |
|
2268 | 2272 | start stand-alone webserver |
|
2269 | 2273 | </td></tr> |
|
2270 | 2274 | <tr><td> |
|
2271 | 2275 | <a href="/help/status"> |
|
2272 | 2276 | status |
|
2273 | 2277 | </a> |
|
2274 | 2278 | </td><td> |
|
2275 | 2279 | show changed files in the working directory |
|
2276 | 2280 | </td></tr> |
|
2277 | 2281 | <tr><td> |
|
2278 | 2282 | <a href="/help/summary"> |
|
2279 | 2283 | summary |
|
2280 | 2284 | </a> |
|
2281 | 2285 | </td><td> |
|
2282 | 2286 | summarize working directory state |
|
2283 | 2287 | </td></tr> |
|
2284 | 2288 | <tr><td> |
|
2285 | 2289 | <a href="/help/update"> |
|
2286 | 2290 | update |
|
2287 | 2291 | </a> |
|
2288 | 2292 | </td><td> |
|
2289 | 2293 | update working directory (or switch revisions) |
|
2290 | 2294 | </td></tr> |
|
2291 | 2295 | |
|
2292 | 2296 | |
|
2293 | 2297 | |
|
2294 | 2298 | <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr> |
|
2295 | 2299 | |
|
2296 | 2300 | <tr><td> |
|
2297 | 2301 | <a href="/help/addremove"> |
|
2298 | 2302 | addremove |
|
2299 | 2303 | </a> |
|
2300 | 2304 | </td><td> |
|
2301 | 2305 | add all new files, delete all missing files |
|
2302 | 2306 | </td></tr> |
|
2303 | 2307 | <tr><td> |
|
2304 | 2308 | <a href="/help/archive"> |
|
2305 | 2309 | archive |
|
2306 | 2310 | </a> |
|
2307 | 2311 | </td><td> |
|
2308 | 2312 | create an unversioned archive of a repository revision |
|
2309 | 2313 | </td></tr> |
|
2310 | 2314 | <tr><td> |
|
2311 | 2315 | <a href="/help/backout"> |
|
2312 | 2316 | backout |
|
2313 | 2317 | </a> |
|
2314 | 2318 | </td><td> |
|
2315 | 2319 | reverse effect of earlier changeset |
|
2316 | 2320 | </td></tr> |
|
2317 | 2321 | <tr><td> |
|
2318 | 2322 | <a href="/help/bisect"> |
|
2319 | 2323 | bisect |
|
2320 | 2324 | </a> |
|
2321 | 2325 | </td><td> |
|
2322 | 2326 | subdivision search of changesets |
|
2323 | 2327 | </td></tr> |
|
2324 | 2328 | <tr><td> |
|
2325 | 2329 | <a href="/help/bookmarks"> |
|
2326 | 2330 | bookmarks |
|
2327 | 2331 | </a> |
|
2328 | 2332 | </td><td> |
|
2329 | 2333 | create a new bookmark or list existing bookmarks |
|
2330 | 2334 | </td></tr> |
|
2331 | 2335 | <tr><td> |
|
2332 | 2336 | <a href="/help/branch"> |
|
2333 | 2337 | branch |
|
2334 | 2338 | </a> |
|
2335 | 2339 | </td><td> |
|
2336 | 2340 | set or show the current branch name |
|
2337 | 2341 | </td></tr> |
|
2338 | 2342 | <tr><td> |
|
2339 | 2343 | <a href="/help/branches"> |
|
2340 | 2344 | branches |
|
2341 | 2345 | </a> |
|
2342 | 2346 | </td><td> |
|
2343 | 2347 | list repository named branches |
|
2344 | 2348 | </td></tr> |
|
2345 | 2349 | <tr><td> |
|
2346 | 2350 | <a href="/help/bundle"> |
|
2347 | 2351 | bundle |
|
2348 | 2352 | </a> |
|
2349 | 2353 | </td><td> |
|
2350 | 2354 | create a bundle file |
|
2351 | 2355 | </td></tr> |
|
2352 | 2356 | <tr><td> |
|
2353 | 2357 | <a href="/help/cat"> |
|
2354 | 2358 | cat |
|
2355 | 2359 | </a> |
|
2356 | 2360 | </td><td> |
|
2357 | 2361 | output the current or given revision of files |
|
2358 | 2362 | </td></tr> |
|
2359 | 2363 | <tr><td> |
|
2360 | 2364 | <a href="/help/config"> |
|
2361 | 2365 | config |
|
2362 | 2366 | </a> |
|
2363 | 2367 | </td><td> |
|
2364 | 2368 | show combined config settings from all hgrc files |
|
2365 | 2369 | </td></tr> |
|
2366 | 2370 | <tr><td> |
|
2367 | 2371 | <a href="/help/copy"> |
|
2368 | 2372 | copy |
|
2369 | 2373 | </a> |
|
2370 | 2374 | </td><td> |
|
2371 | 2375 | mark files as copied for the next commit |
|
2372 | 2376 | </td></tr> |
|
2373 | 2377 | <tr><td> |
|
2374 | 2378 | <a href="/help/files"> |
|
2375 | 2379 | files |
|
2376 | 2380 | </a> |
|
2377 | 2381 | </td><td> |
|
2378 | 2382 | list tracked files |
|
2379 | 2383 | </td></tr> |
|
2380 | 2384 | <tr><td> |
|
2381 | 2385 | <a href="/help/graft"> |
|
2382 | 2386 | graft |
|
2383 | 2387 | </a> |
|
2384 | 2388 | </td><td> |
|
2385 | 2389 | copy changes from other branches onto the current branch |
|
2386 | 2390 | </td></tr> |
|
2387 | 2391 | <tr><td> |
|
2388 | 2392 | <a href="/help/grep"> |
|
2389 | 2393 | grep |
|
2390 | 2394 | </a> |
|
2391 | 2395 | </td><td> |
|
2392 | 2396 | search revision history for a pattern in specified files |
|
2393 | 2397 | </td></tr> |
|
2394 | 2398 | <tr><td> |
|
2395 | 2399 | <a href="/help/heads"> |
|
2396 | 2400 | heads |
|
2397 | 2401 | </a> |
|
2398 | 2402 | </td><td> |
|
2399 | 2403 | show branch heads |
|
2400 | 2404 | </td></tr> |
|
2401 | 2405 | <tr><td> |
|
2402 | 2406 | <a href="/help/help"> |
|
2403 | 2407 | help |
|
2404 | 2408 | </a> |
|
2405 | 2409 | </td><td> |
|
2406 | 2410 | show help for a given topic or a help overview |
|
2407 | 2411 | </td></tr> |
|
2408 | 2412 | <tr><td> |
|
2409 | 2413 | <a href="/help/hgalias"> |
|
2410 | 2414 | hgalias |
|
2411 | 2415 | </a> |
|
2412 | 2416 | </td><td> |
|
2413 | 2417 | summarize working directory state |
|
2414 | 2418 | </td></tr> |
|
2415 | 2419 | <tr><td> |
|
2416 | 2420 | <a href="/help/identify"> |
|
2417 | 2421 | identify |
|
2418 | 2422 | </a> |
|
2419 | 2423 | </td><td> |
|
2420 | 2424 | identify the working directory or specified revision |
|
2421 | 2425 | </td></tr> |
|
2422 | 2426 | <tr><td> |
|
2423 | 2427 | <a href="/help/import"> |
|
2424 | 2428 | import |
|
2425 | 2429 | </a> |
|
2426 | 2430 | </td><td> |
|
2427 | 2431 | import an ordered set of patches |
|
2428 | 2432 | </td></tr> |
|
2429 | 2433 | <tr><td> |
|
2430 | 2434 | <a href="/help/incoming"> |
|
2431 | 2435 | incoming |
|
2432 | 2436 | </a> |
|
2433 | 2437 | </td><td> |
|
2434 | 2438 | show new changesets found in source |
|
2435 | 2439 | </td></tr> |
|
2436 | 2440 | <tr><td> |
|
2437 | 2441 | <a href="/help/manifest"> |
|
2438 | 2442 | manifest |
|
2439 | 2443 | </a> |
|
2440 | 2444 | </td><td> |
|
2441 | 2445 | output the current or given revision of the project manifest |
|
2442 | 2446 | </td></tr> |
|
2443 | 2447 | <tr><td> |
|
2444 | 2448 | <a href="/help/nohelp"> |
|
2445 | 2449 | nohelp |
|
2446 | 2450 | </a> |
|
2447 | 2451 | </td><td> |
|
2448 | 2452 | (no help text available) |
|
2449 | 2453 | </td></tr> |
|
2450 | 2454 | <tr><td> |
|
2451 | 2455 | <a href="/help/outgoing"> |
|
2452 | 2456 | outgoing |
|
2453 | 2457 | </a> |
|
2454 | 2458 | </td><td> |
|
2455 | 2459 | show changesets not found in the destination |
|
2456 | 2460 | </td></tr> |
|
2457 | 2461 | <tr><td> |
|
2458 | 2462 | <a href="/help/paths"> |
|
2459 | 2463 | paths |
|
2460 | 2464 | </a> |
|
2461 | 2465 | </td><td> |
|
2462 | 2466 | show aliases for remote repositories |
|
2463 | 2467 | </td></tr> |
|
2464 | 2468 | <tr><td> |
|
2465 | 2469 | <a href="/help/phase"> |
|
2466 | 2470 | phase |
|
2467 | 2471 | </a> |
|
2468 | 2472 | </td><td> |
|
2469 | 2473 | set or show the current phase name |
|
2470 | 2474 | </td></tr> |
|
2471 | 2475 | <tr><td> |
|
2472 | 2476 | <a href="/help/recover"> |
|
2473 | 2477 | recover |
|
2474 | 2478 | </a> |
|
2475 | 2479 | </td><td> |
|
2476 | 2480 | roll back an interrupted transaction |
|
2477 | 2481 | </td></tr> |
|
2478 | 2482 | <tr><td> |
|
2479 | 2483 | <a href="/help/rename"> |
|
2480 | 2484 | rename |
|
2481 | 2485 | </a> |
|
2482 | 2486 | </td><td> |
|
2483 | 2487 | rename files; equivalent of copy + remove |
|
2484 | 2488 | </td></tr> |
|
2485 | 2489 | <tr><td> |
|
2486 | 2490 | <a href="/help/resolve"> |
|
2487 | 2491 | resolve |
|
2488 | 2492 | </a> |
|
2489 | 2493 | </td><td> |
|
2490 | 2494 | redo merges or set/view the merge status of files |
|
2491 | 2495 | </td></tr> |
|
2492 | 2496 | <tr><td> |
|
2493 | 2497 | <a href="/help/revert"> |
|
2494 | 2498 | revert |
|
2495 | 2499 | </a> |
|
2496 | 2500 | </td><td> |
|
2497 | 2501 | restore files to their checkout state |
|
2498 | 2502 | </td></tr> |
|
2499 | 2503 | <tr><td> |
|
2500 | 2504 | <a href="/help/root"> |
|
2501 | 2505 | root |
|
2502 | 2506 | </a> |
|
2503 | 2507 | </td><td> |
|
2504 | 2508 | print the root (top) of the current working directory |
|
2505 | 2509 | </td></tr> |
|
2506 | 2510 | <tr><td> |
|
2507 | 2511 | <a href="/help/shellalias"> |
|
2508 | 2512 | shellalias |
|
2509 | 2513 | </a> |
|
2510 | 2514 | </td><td> |
|
2511 | 2515 | (no help text available) |
|
2512 | 2516 | </td></tr> |
|
2513 | 2517 | <tr><td> |
|
2514 | 2518 | <a href="/help/tag"> |
|
2515 | 2519 | tag |
|
2516 | 2520 | </a> |
|
2517 | 2521 | </td><td> |
|
2518 | 2522 | add one or more tags for the current or given revision |
|
2519 | 2523 | </td></tr> |
|
2520 | 2524 | <tr><td> |
|
2521 | 2525 | <a href="/help/tags"> |
|
2522 | 2526 | tags |
|
2523 | 2527 | </a> |
|
2524 | 2528 | </td><td> |
|
2525 | 2529 | list repository tags |
|
2526 | 2530 | </td></tr> |
|
2527 | 2531 | <tr><td> |
|
2528 | 2532 | <a href="/help/unbundle"> |
|
2529 | 2533 | unbundle |
|
2530 | 2534 | </a> |
|
2531 | 2535 | </td><td> |
|
2532 | 2536 | apply one or more bundle files |
|
2533 | 2537 | </td></tr> |
|
2534 | 2538 | <tr><td> |
|
2535 | 2539 | <a href="/help/verify"> |
|
2536 | 2540 | verify |
|
2537 | 2541 | </a> |
|
2538 | 2542 | </td><td> |
|
2539 | 2543 | verify the integrity of the repository |
|
2540 | 2544 | </td></tr> |
|
2541 | 2545 | <tr><td> |
|
2542 | 2546 | <a href="/help/version"> |
|
2543 | 2547 | version |
|
2544 | 2548 | </a> |
|
2545 | 2549 | </td><td> |
|
2546 | 2550 | output version and copyright information |
|
2547 | 2551 | </td></tr> |
|
2548 | 2552 | |
|
2549 | 2553 | |
|
2550 | 2554 | </table> |
|
2551 | 2555 | </div> |
|
2552 | 2556 | </div> |
|
2553 | 2557 | |
|
2554 | 2558 | |
|
2555 | 2559 | |
|
2556 | 2560 | </body> |
|
2557 | 2561 | </html> |
|
2558 | 2562 | |
|
2559 | 2563 | |
|
2560 | 2564 | $ get-with-headers.py $LOCALIP:$HGPORT "help/add" |
|
2561 | 2565 | 200 Script output follows |
|
2562 | 2566 | |
|
2563 | 2567 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2564 | 2568 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2565 | 2569 | <head> |
|
2566 | 2570 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2567 | 2571 | <meta name="robots" content="index, nofollow" /> |
|
2568 | 2572 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2569 | 2573 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2570 | 2574 | |
|
2571 | 2575 | <title>Help: add</title> |
|
2572 | 2576 | </head> |
|
2573 | 2577 | <body> |
|
2574 | 2578 | |
|
2575 | 2579 | <div class="container"> |
|
2576 | 2580 | <div class="menu"> |
|
2577 | 2581 | <div class="logo"> |
|
2578 | 2582 | <a href="https://mercurial-scm.org/"> |
|
2579 | 2583 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2580 | 2584 | </div> |
|
2581 | 2585 | <ul> |
|
2582 | 2586 | <li><a href="/shortlog">log</a></li> |
|
2583 | 2587 | <li><a href="/graph">graph</a></li> |
|
2584 | 2588 | <li><a href="/tags">tags</a></li> |
|
2585 | 2589 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2586 | 2590 | <li><a href="/branches">branches</a></li> |
|
2587 | 2591 | </ul> |
|
2588 | 2592 | <ul> |
|
2589 | 2593 | <li class="active"><a href="/help">help</a></li> |
|
2590 | 2594 | </ul> |
|
2591 | 2595 | </div> |
|
2592 | 2596 | |
|
2593 | 2597 | <div class="main"> |
|
2594 | 2598 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2595 | 2599 | <h3>Help: add</h3> |
|
2596 | 2600 | |
|
2597 | 2601 | <form class="search" action="/log"> |
|
2598 | 2602 | |
|
2599 | 2603 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2600 | 2604 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2601 | 2605 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2602 | 2606 | </form> |
|
2603 | 2607 | <div id="doc"> |
|
2604 | 2608 | <p> |
|
2605 | 2609 | hg add [OPTION]... [FILE]... |
|
2606 | 2610 | </p> |
|
2607 | 2611 | <p> |
|
2608 | 2612 | add the specified files on the next commit |
|
2609 | 2613 | </p> |
|
2610 | 2614 | <p> |
|
2611 | 2615 | Schedule files to be version controlled and added to the |
|
2612 | 2616 | repository. |
|
2613 | 2617 | </p> |
|
2614 | 2618 | <p> |
|
2615 | 2619 | The files will be added to the repository at the next commit. To |
|
2616 | 2620 | undo an add before that, see 'hg forget'. |
|
2617 | 2621 | </p> |
|
2618 | 2622 | <p> |
|
2619 | 2623 | If no names are given, add all files to the repository (except |
|
2620 | 2624 | files matching ".hgignore"). |
|
2621 | 2625 | </p> |
|
2622 | 2626 | <p> |
|
2623 | 2627 | Examples: |
|
2624 | 2628 | </p> |
|
2625 | 2629 | <ul> |
|
2626 | 2630 | <li> New (unknown) files are added automatically by 'hg add': |
|
2627 | 2631 | <pre> |
|
2628 | 2632 | \$ ls (re) |
|
2629 | 2633 | foo.c |
|
2630 | 2634 | \$ hg status (re) |
|
2631 | 2635 | ? foo.c |
|
2632 | 2636 | \$ hg add (re) |
|
2633 | 2637 | adding foo.c |
|
2634 | 2638 | \$ hg status (re) |
|
2635 | 2639 | A foo.c |
|
2636 | 2640 | </pre> |
|
2637 | 2641 | <li> Specific files to be added can be specified: |
|
2638 | 2642 | <pre> |
|
2639 | 2643 | \$ ls (re) |
|
2640 | 2644 | bar.c foo.c |
|
2641 | 2645 | \$ hg status (re) |
|
2642 | 2646 | ? bar.c |
|
2643 | 2647 | ? foo.c |
|
2644 | 2648 | \$ hg add bar.c (re) |
|
2645 | 2649 | \$ hg status (re) |
|
2646 | 2650 | A bar.c |
|
2647 | 2651 | ? foo.c |
|
2648 | 2652 | </pre> |
|
2649 | 2653 | </ul> |
|
2650 | 2654 | <p> |
|
2651 | 2655 | Returns 0 if all files are successfully added. |
|
2652 | 2656 | </p> |
|
2653 | 2657 | <p> |
|
2654 | 2658 | options ([+] can be repeated): |
|
2655 | 2659 | </p> |
|
2656 | 2660 | <table> |
|
2657 | 2661 | <tr><td>-I</td> |
|
2658 | 2662 | <td>--include PATTERN [+]</td> |
|
2659 | 2663 | <td>include names matching the given patterns</td></tr> |
|
2660 | 2664 | <tr><td>-X</td> |
|
2661 | 2665 | <td>--exclude PATTERN [+]</td> |
|
2662 | 2666 | <td>exclude names matching the given patterns</td></tr> |
|
2663 | 2667 | <tr><td>-S</td> |
|
2664 | 2668 | <td>--subrepos</td> |
|
2665 | 2669 | <td>recurse into subrepositories</td></tr> |
|
2666 | 2670 | <tr><td>-n</td> |
|
2667 | 2671 | <td>--dry-run</td> |
|
2668 | 2672 | <td>do not perform actions, just print output</td></tr> |
|
2669 | 2673 | </table> |
|
2670 | 2674 | <p> |
|
2671 | 2675 | global options ([+] can be repeated): |
|
2672 | 2676 | </p> |
|
2673 | 2677 | <table> |
|
2674 | 2678 | <tr><td>-R</td> |
|
2675 | 2679 | <td>--repository REPO</td> |
|
2676 | 2680 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
2677 | 2681 | <tr><td></td> |
|
2678 | 2682 | <td>--cwd DIR</td> |
|
2679 | 2683 | <td>change working directory</td></tr> |
|
2680 | 2684 | <tr><td>-y</td> |
|
2681 | 2685 | <td>--noninteractive</td> |
|
2682 | 2686 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
2683 | 2687 | <tr><td>-q</td> |
|
2684 | 2688 | <td>--quiet</td> |
|
2685 | 2689 | <td>suppress output</td></tr> |
|
2686 | 2690 | <tr><td>-v</td> |
|
2687 | 2691 | <td>--verbose</td> |
|
2688 | 2692 | <td>enable additional output</td></tr> |
|
2689 | 2693 | <tr><td></td> |
|
2690 | 2694 | <td>--color TYPE</td> |
|
2691 | 2695 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> |
|
2692 | 2696 | <tr><td></td> |
|
2693 | 2697 | <td>--config CONFIG [+]</td> |
|
2694 | 2698 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
2695 | 2699 | <tr><td></td> |
|
2696 | 2700 | <td>--debug</td> |
|
2697 | 2701 | <td>enable debugging output</td></tr> |
|
2698 | 2702 | <tr><td></td> |
|
2699 | 2703 | <td>--debugger</td> |
|
2700 | 2704 | <td>start debugger</td></tr> |
|
2701 | 2705 | <tr><td></td> |
|
2702 | 2706 | <td>--encoding ENCODE</td> |
|
2703 | 2707 | <td>set the charset encoding (default: ascii)</td></tr> |
|
2704 | 2708 | <tr><td></td> |
|
2705 | 2709 | <td>--encodingmode MODE</td> |
|
2706 | 2710 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
2707 | 2711 | <tr><td></td> |
|
2708 | 2712 | <td>--traceback</td> |
|
2709 | 2713 | <td>always print a traceback on exception</td></tr> |
|
2710 | 2714 | <tr><td></td> |
|
2711 | 2715 | <td>--time</td> |
|
2712 | 2716 | <td>time how long the command takes</td></tr> |
|
2713 | 2717 | <tr><td></td> |
|
2714 | 2718 | <td>--profile</td> |
|
2715 | 2719 | <td>print command execution profile</td></tr> |
|
2716 | 2720 | <tr><td></td> |
|
2717 | 2721 | <td>--version</td> |
|
2718 | 2722 | <td>output version information and exit</td></tr> |
|
2719 | 2723 | <tr><td>-h</td> |
|
2720 | 2724 | <td>--help</td> |
|
2721 | 2725 | <td>display help and exit</td></tr> |
|
2722 | 2726 | <tr><td></td> |
|
2723 | 2727 | <td>--hidden</td> |
|
2724 | 2728 | <td>consider hidden changesets</td></tr> |
|
2725 | 2729 | <tr><td></td> |
|
2726 | 2730 | <td>--pager TYPE</td> |
|
2727 | 2731 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> |
|
2728 | 2732 | </table> |
|
2729 | 2733 | |
|
2730 | 2734 | </div> |
|
2731 | 2735 | </div> |
|
2732 | 2736 | </div> |
|
2733 | 2737 | |
|
2734 | 2738 | |
|
2735 | 2739 | |
|
2736 | 2740 | </body> |
|
2737 | 2741 | </html> |
|
2738 | 2742 | |
|
2739 | 2743 | |
|
2740 | 2744 | $ get-with-headers.py $LOCALIP:$HGPORT "help/remove" |
|
2741 | 2745 | 200 Script output follows |
|
2742 | 2746 | |
|
2743 | 2747 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2744 | 2748 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2745 | 2749 | <head> |
|
2746 | 2750 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2747 | 2751 | <meta name="robots" content="index, nofollow" /> |
|
2748 | 2752 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2749 | 2753 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2750 | 2754 | |
|
2751 | 2755 | <title>Help: remove</title> |
|
2752 | 2756 | </head> |
|
2753 | 2757 | <body> |
|
2754 | 2758 | |
|
2755 | 2759 | <div class="container"> |
|
2756 | 2760 | <div class="menu"> |
|
2757 | 2761 | <div class="logo"> |
|
2758 | 2762 | <a href="https://mercurial-scm.org/"> |
|
2759 | 2763 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2760 | 2764 | </div> |
|
2761 | 2765 | <ul> |
|
2762 | 2766 | <li><a href="/shortlog">log</a></li> |
|
2763 | 2767 | <li><a href="/graph">graph</a></li> |
|
2764 | 2768 | <li><a href="/tags">tags</a></li> |
|
2765 | 2769 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2766 | 2770 | <li><a href="/branches">branches</a></li> |
|
2767 | 2771 | </ul> |
|
2768 | 2772 | <ul> |
|
2769 | 2773 | <li class="active"><a href="/help">help</a></li> |
|
2770 | 2774 | </ul> |
|
2771 | 2775 | </div> |
|
2772 | 2776 | |
|
2773 | 2777 | <div class="main"> |
|
2774 | 2778 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2775 | 2779 | <h3>Help: remove</h3> |
|
2776 | 2780 | |
|
2777 | 2781 | <form class="search" action="/log"> |
|
2778 | 2782 | |
|
2779 | 2783 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2780 | 2784 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2781 | 2785 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2782 | 2786 | </form> |
|
2783 | 2787 | <div id="doc"> |
|
2784 | 2788 | <p> |
|
2785 | 2789 | hg remove [OPTION]... FILE... |
|
2786 | 2790 | </p> |
|
2787 | 2791 | <p> |
|
2788 | 2792 | aliases: rm |
|
2789 | 2793 | </p> |
|
2790 | 2794 | <p> |
|
2791 | 2795 | remove the specified files on the next commit |
|
2792 | 2796 | </p> |
|
2793 | 2797 | <p> |
|
2794 | 2798 | Schedule the indicated files for removal from the current branch. |
|
2795 | 2799 | </p> |
|
2796 | 2800 | <p> |
|
2797 | 2801 | This command schedules the files to be removed at the next commit. |
|
2798 | 2802 | To undo a remove before that, see 'hg revert'. To undo added |
|
2799 | 2803 | files, see 'hg forget'. |
|
2800 | 2804 | </p> |
|
2801 | 2805 | <p> |
|
2802 | 2806 | -A/--after can be used to remove only files that have already |
|
2803 | 2807 | been deleted, -f/--force can be used to force deletion, and -Af |
|
2804 | 2808 | can be used to remove files from the next revision without |
|
2805 | 2809 | deleting them from the working directory. |
|
2806 | 2810 | </p> |
|
2807 | 2811 | <p> |
|
2808 | 2812 | The following table details the behavior of remove for different |
|
2809 | 2813 | file states (columns) and option combinations (rows). The file |
|
2810 | 2814 | states are Added [A], Clean [C], Modified [M] and Missing [!] |
|
2811 | 2815 | (as reported by 'hg status'). The actions are Warn, Remove |
|
2812 | 2816 | (from branch) and Delete (from disk): |
|
2813 | 2817 | </p> |
|
2814 | 2818 | <table> |
|
2815 | 2819 | <tr><td>opt/state</td> |
|
2816 | 2820 | <td>A</td> |
|
2817 | 2821 | <td>C</td> |
|
2818 | 2822 | <td>M</td> |
|
2819 | 2823 | <td>!</td></tr> |
|
2820 | 2824 | <tr><td>none</td> |
|
2821 | 2825 | <td>W</td> |
|
2822 | 2826 | <td>RD</td> |
|
2823 | 2827 | <td>W</td> |
|
2824 | 2828 | <td>R</td></tr> |
|
2825 | 2829 | <tr><td>-f</td> |
|
2826 | 2830 | <td>R</td> |
|
2827 | 2831 | <td>RD</td> |
|
2828 | 2832 | <td>RD</td> |
|
2829 | 2833 | <td>R</td></tr> |
|
2830 | 2834 | <tr><td>-A</td> |
|
2831 | 2835 | <td>W</td> |
|
2832 | 2836 | <td>W</td> |
|
2833 | 2837 | <td>W</td> |
|
2834 | 2838 | <td>R</td></tr> |
|
2835 | 2839 | <tr><td>-Af</td> |
|
2836 | 2840 | <td>R</td> |
|
2837 | 2841 | <td>R</td> |
|
2838 | 2842 | <td>R</td> |
|
2839 | 2843 | <td>R</td></tr> |
|
2840 | 2844 | </table> |
|
2841 | 2845 | <p> |
|
2842 | 2846 | <b>Note:</b> |
|
2843 | 2847 | </p> |
|
2844 | 2848 | <p> |
|
2845 | 2849 | 'hg remove' never deletes files in Added [A] state from the |
|
2846 | 2850 | working directory, not even if "--force" is specified. |
|
2847 | 2851 | </p> |
|
2848 | 2852 | <p> |
|
2849 | 2853 | Returns 0 on success, 1 if any warnings encountered. |
|
2850 | 2854 | </p> |
|
2851 | 2855 | <p> |
|
2852 | 2856 | options ([+] can be repeated): |
|
2853 | 2857 | </p> |
|
2854 | 2858 | <table> |
|
2855 | 2859 | <tr><td>-A</td> |
|
2856 | 2860 | <td>--after</td> |
|
2857 | 2861 | <td>record delete for missing files</td></tr> |
|
2858 | 2862 | <tr><td>-f</td> |
|
2859 | 2863 | <td>--force</td> |
|
2860 | 2864 | <td>forget added files, delete modified files</td></tr> |
|
2861 | 2865 | <tr><td>-S</td> |
|
2862 | 2866 | <td>--subrepos</td> |
|
2863 | 2867 | <td>recurse into subrepositories</td></tr> |
|
2864 | 2868 | <tr><td>-I</td> |
|
2865 | 2869 | <td>--include PATTERN [+]</td> |
|
2866 | 2870 | <td>include names matching the given patterns</td></tr> |
|
2867 | 2871 | <tr><td>-X</td> |
|
2868 | 2872 | <td>--exclude PATTERN [+]</td> |
|
2869 | 2873 | <td>exclude names matching the given patterns</td></tr> |
|
2870 | 2874 | <tr><td>-n</td> |
|
2871 | 2875 | <td>--dry-run</td> |
|
2872 | 2876 | <td>do not perform actions, just print output</td></tr> |
|
2873 | 2877 | </table> |
|
2874 | 2878 | <p> |
|
2875 | 2879 | global options ([+] can be repeated): |
|
2876 | 2880 | </p> |
|
2877 | 2881 | <table> |
|
2878 | 2882 | <tr><td>-R</td> |
|
2879 | 2883 | <td>--repository REPO</td> |
|
2880 | 2884 | <td>repository root directory or name of overlay bundle file</td></tr> |
|
2881 | 2885 | <tr><td></td> |
|
2882 | 2886 | <td>--cwd DIR</td> |
|
2883 | 2887 | <td>change working directory</td></tr> |
|
2884 | 2888 | <tr><td>-y</td> |
|
2885 | 2889 | <td>--noninteractive</td> |
|
2886 | 2890 | <td>do not prompt, automatically pick the first choice for all prompts</td></tr> |
|
2887 | 2891 | <tr><td>-q</td> |
|
2888 | 2892 | <td>--quiet</td> |
|
2889 | 2893 | <td>suppress output</td></tr> |
|
2890 | 2894 | <tr><td>-v</td> |
|
2891 | 2895 | <td>--verbose</td> |
|
2892 | 2896 | <td>enable additional output</td></tr> |
|
2893 | 2897 | <tr><td></td> |
|
2894 | 2898 | <td>--color TYPE</td> |
|
2895 | 2899 | <td>when to colorize (boolean, always, auto, never, or debug)</td></tr> |
|
2896 | 2900 | <tr><td></td> |
|
2897 | 2901 | <td>--config CONFIG [+]</td> |
|
2898 | 2902 | <td>set/override config option (use 'section.name=value')</td></tr> |
|
2899 | 2903 | <tr><td></td> |
|
2900 | 2904 | <td>--debug</td> |
|
2901 | 2905 | <td>enable debugging output</td></tr> |
|
2902 | 2906 | <tr><td></td> |
|
2903 | 2907 | <td>--debugger</td> |
|
2904 | 2908 | <td>start debugger</td></tr> |
|
2905 | 2909 | <tr><td></td> |
|
2906 | 2910 | <td>--encoding ENCODE</td> |
|
2907 | 2911 | <td>set the charset encoding (default: ascii)</td></tr> |
|
2908 | 2912 | <tr><td></td> |
|
2909 | 2913 | <td>--encodingmode MODE</td> |
|
2910 | 2914 | <td>set the charset encoding mode (default: strict)</td></tr> |
|
2911 | 2915 | <tr><td></td> |
|
2912 | 2916 | <td>--traceback</td> |
|
2913 | 2917 | <td>always print a traceback on exception</td></tr> |
|
2914 | 2918 | <tr><td></td> |
|
2915 | 2919 | <td>--time</td> |
|
2916 | 2920 | <td>time how long the command takes</td></tr> |
|
2917 | 2921 | <tr><td></td> |
|
2918 | 2922 | <td>--profile</td> |
|
2919 | 2923 | <td>print command execution profile</td></tr> |
|
2920 | 2924 | <tr><td></td> |
|
2921 | 2925 | <td>--version</td> |
|
2922 | 2926 | <td>output version information and exit</td></tr> |
|
2923 | 2927 | <tr><td>-h</td> |
|
2924 | 2928 | <td>--help</td> |
|
2925 | 2929 | <td>display help and exit</td></tr> |
|
2926 | 2930 | <tr><td></td> |
|
2927 | 2931 | <td>--hidden</td> |
|
2928 | 2932 | <td>consider hidden changesets</td></tr> |
|
2929 | 2933 | <tr><td></td> |
|
2930 | 2934 | <td>--pager TYPE</td> |
|
2931 | 2935 | <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr> |
|
2932 | 2936 | </table> |
|
2933 | 2937 | |
|
2934 | 2938 | </div> |
|
2935 | 2939 | </div> |
|
2936 | 2940 | </div> |
|
2937 | 2941 | |
|
2938 | 2942 | |
|
2939 | 2943 | |
|
2940 | 2944 | </body> |
|
2941 | 2945 | </html> |
|
2942 | 2946 | |
|
2943 | 2947 | |
|
2944 | 2948 | $ get-with-headers.py $LOCALIP:$HGPORT "help/dates" |
|
2945 | 2949 | 200 Script output follows |
|
2946 | 2950 | |
|
2947 | 2951 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2948 | 2952 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
2949 | 2953 | <head> |
|
2950 | 2954 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
2951 | 2955 | <meta name="robots" content="index, nofollow" /> |
|
2952 | 2956 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
2953 | 2957 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
2954 | 2958 | |
|
2955 | 2959 | <title>Help: dates</title> |
|
2956 | 2960 | </head> |
|
2957 | 2961 | <body> |
|
2958 | 2962 | |
|
2959 | 2963 | <div class="container"> |
|
2960 | 2964 | <div class="menu"> |
|
2961 | 2965 | <div class="logo"> |
|
2962 | 2966 | <a href="https://mercurial-scm.org/"> |
|
2963 | 2967 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
2964 | 2968 | </div> |
|
2965 | 2969 | <ul> |
|
2966 | 2970 | <li><a href="/shortlog">log</a></li> |
|
2967 | 2971 | <li><a href="/graph">graph</a></li> |
|
2968 | 2972 | <li><a href="/tags">tags</a></li> |
|
2969 | 2973 | <li><a href="/bookmarks">bookmarks</a></li> |
|
2970 | 2974 | <li><a href="/branches">branches</a></li> |
|
2971 | 2975 | </ul> |
|
2972 | 2976 | <ul> |
|
2973 | 2977 | <li class="active"><a href="/help">help</a></li> |
|
2974 | 2978 | </ul> |
|
2975 | 2979 | </div> |
|
2976 | 2980 | |
|
2977 | 2981 | <div class="main"> |
|
2978 | 2982 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
2979 | 2983 | <h3>Help: dates</h3> |
|
2980 | 2984 | |
|
2981 | 2985 | <form class="search" action="/log"> |
|
2982 | 2986 | |
|
2983 | 2987 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
2984 | 2988 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
2985 | 2989 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
2986 | 2990 | </form> |
|
2987 | 2991 | <div id="doc"> |
|
2988 | 2992 | <h1>Date Formats</h1> |
|
2989 | 2993 | <p> |
|
2990 | 2994 | Some commands allow the user to specify a date, e.g.: |
|
2991 | 2995 | </p> |
|
2992 | 2996 | <ul> |
|
2993 | 2997 | <li> backout, commit, import, tag: Specify the commit date. |
|
2994 | 2998 | <li> log, revert, update: Select revision(s) by date. |
|
2995 | 2999 | </ul> |
|
2996 | 3000 | <p> |
|
2997 | 3001 | Many date formats are valid. Here are some examples: |
|
2998 | 3002 | </p> |
|
2999 | 3003 | <ul> |
|
3000 | 3004 | <li> "Wed Dec 6 13:18:29 2006" (local timezone assumed) |
|
3001 | 3005 | <li> "Dec 6 13:18 -0600" (year assumed, time offset provided) |
|
3002 | 3006 | <li> "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000) |
|
3003 | 3007 | <li> "Dec 6" (midnight) |
|
3004 | 3008 | <li> "13:18" (today assumed) |
|
3005 | 3009 | <li> "3:39" (3:39AM assumed) |
|
3006 | 3010 | <li> "3:39pm" (15:39) |
|
3007 | 3011 | <li> "2006-12-06 13:18:29" (ISO 8601 format) |
|
3008 | 3012 | <li> "2006-12-6 13:18" |
|
3009 | 3013 | <li> "2006-12-6" |
|
3010 | 3014 | <li> "12-6" |
|
3011 | 3015 | <li> "12/6" |
|
3012 | 3016 | <li> "12/6/6" (Dec 6 2006) |
|
3013 | 3017 | <li> "today" (midnight) |
|
3014 | 3018 | <li> "yesterday" (midnight) |
|
3015 | 3019 | <li> "now" - right now |
|
3016 | 3020 | </ul> |
|
3017 | 3021 | <p> |
|
3018 | 3022 | Lastly, there is Mercurial's internal format: |
|
3019 | 3023 | </p> |
|
3020 | 3024 | <ul> |
|
3021 | 3025 | <li> "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC) |
|
3022 | 3026 | </ul> |
|
3023 | 3027 | <p> |
|
3024 | 3028 | This is the internal representation format for dates. The first number |
|
3025 | 3029 | is the number of seconds since the epoch (1970-01-01 00:00 UTC). The |
|
3026 | 3030 | second is the offset of the local timezone, in seconds west of UTC |
|
3027 | 3031 | (negative if the timezone is east of UTC). |
|
3028 | 3032 | </p> |
|
3029 | 3033 | <p> |
|
3030 | 3034 | The log command also accepts date ranges: |
|
3031 | 3035 | </p> |
|
3032 | 3036 | <ul> |
|
3033 | 3037 | <li> "<DATE" - at or before a given date/time |
|
3034 | 3038 | <li> ">DATE" - on or after a given date/time |
|
3035 | 3039 | <li> "DATE to DATE" - a date range, inclusive |
|
3036 | 3040 | <li> "-DAYS" - within a given number of days of today |
|
3037 | 3041 | </ul> |
|
3038 | 3042 | |
|
3039 | 3043 | </div> |
|
3040 | 3044 | </div> |
|
3041 | 3045 | </div> |
|
3042 | 3046 | |
|
3043 | 3047 | |
|
3044 | 3048 | |
|
3045 | 3049 | </body> |
|
3046 | 3050 | </html> |
|
3047 | 3051 | |
|
3048 | 3052 | |
|
3049 | 3053 | $ get-with-headers.py $LOCALIP:$HGPORT "help/pager" |
|
3050 | 3054 | 200 Script output follows |
|
3051 | 3055 | |
|
3052 | 3056 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3053 | 3057 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3054 | 3058 | <head> |
|
3055 | 3059 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3056 | 3060 | <meta name="robots" content="index, nofollow" /> |
|
3057 | 3061 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3058 | 3062 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3059 | 3063 | |
|
3060 | 3064 | <title>Help: pager</title> |
|
3061 | 3065 | </head> |
|
3062 | 3066 | <body> |
|
3063 | 3067 | |
|
3064 | 3068 | <div class="container"> |
|
3065 | 3069 | <div class="menu"> |
|
3066 | 3070 | <div class="logo"> |
|
3067 | 3071 | <a href="https://mercurial-scm.org/"> |
|
3068 | 3072 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3069 | 3073 | </div> |
|
3070 | 3074 | <ul> |
|
3071 | 3075 | <li><a href="/shortlog">log</a></li> |
|
3072 | 3076 | <li><a href="/graph">graph</a></li> |
|
3073 | 3077 | <li><a href="/tags">tags</a></li> |
|
3074 | 3078 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3075 | 3079 | <li><a href="/branches">branches</a></li> |
|
3076 | 3080 | </ul> |
|
3077 | 3081 | <ul> |
|
3078 | 3082 | <li class="active"><a href="/help">help</a></li> |
|
3079 | 3083 | </ul> |
|
3080 | 3084 | </div> |
|
3081 | 3085 | |
|
3082 | 3086 | <div class="main"> |
|
3083 | 3087 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3084 | 3088 | <h3>Help: pager</h3> |
|
3085 | 3089 | |
|
3086 | 3090 | <form class="search" action="/log"> |
|
3087 | 3091 | |
|
3088 | 3092 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3089 | 3093 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3090 | 3094 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3091 | 3095 | </form> |
|
3092 | 3096 | <div id="doc"> |
|
3093 | 3097 | <h1>Pager Support</h1> |
|
3094 | 3098 | <p> |
|
3095 | 3099 | Some Mercurial commands can produce a lot of output, and Mercurial will |
|
3096 | 3100 | attempt to use a pager to make those commands more pleasant. |
|
3097 | 3101 | </p> |
|
3098 | 3102 | <p> |
|
3099 | 3103 | To set the pager that should be used, set the application variable: |
|
3100 | 3104 | </p> |
|
3101 | 3105 | <pre> |
|
3102 | 3106 | [pager] |
|
3103 | 3107 | pager = less -FRX |
|
3104 | 3108 | </pre> |
|
3105 | 3109 | <p> |
|
3106 | 3110 | If no pager is set in the user or repository configuration, Mercurial uses the |
|
3107 | 3111 | environment variable $PAGER. If $PAGER is not set, pager.pager from the default |
|
3108 | 3112 | or system configuration is used. If none of these are set, a default pager will |
|
3109 | 3113 | be used, typically 'less' on Unix and 'more' on Windows. |
|
3110 | 3114 | </p> |
|
3111 | 3115 | <p> |
|
3112 | 3116 | You can disable the pager for certain commands by adding them to the |
|
3113 | 3117 | pager.ignore list: |
|
3114 | 3118 | </p> |
|
3115 | 3119 | <pre> |
|
3116 | 3120 | [pager] |
|
3117 | 3121 | ignore = version, help, update |
|
3118 | 3122 | </pre> |
|
3119 | 3123 | <p> |
|
3120 | 3124 | To ignore global commands like 'hg version' or 'hg help', you have |
|
3121 | 3125 | to specify them in your user configuration file. |
|
3122 | 3126 | </p> |
|
3123 | 3127 | <p> |
|
3124 | 3128 | To control whether the pager is used at all for an individual command, |
|
3125 | 3129 | you can use --pager=<value>: |
|
3126 | 3130 | </p> |
|
3127 | 3131 | <ul> |
|
3128 | 3132 | <li> use as needed: 'auto'. |
|
3129 | 3133 | <li> require the pager: 'yes' or 'on'. |
|
3130 | 3134 | <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work). |
|
3131 | 3135 | </ul> |
|
3132 | 3136 | <p> |
|
3133 | 3137 | To globally turn off all attempts to use a pager, set: |
|
3134 | 3138 | </p> |
|
3135 | 3139 | <pre> |
|
3136 | 3140 | [ui] |
|
3137 | 3141 | paginate = never |
|
3138 | 3142 | </pre> |
|
3139 | 3143 | <p> |
|
3140 | 3144 | which will prevent the pager from running. |
|
3141 | 3145 | </p> |
|
3142 | 3146 | |
|
3143 | 3147 | </div> |
|
3144 | 3148 | </div> |
|
3145 | 3149 | </div> |
|
3146 | 3150 | |
|
3147 | 3151 | |
|
3148 | 3152 | |
|
3149 | 3153 | </body> |
|
3150 | 3154 | </html> |
|
3151 | 3155 | |
|
3152 | 3156 | |
|
3153 | 3157 | Sub-topic indexes rendered properly |
|
3154 | 3158 | |
|
3155 | 3159 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals" |
|
3156 | 3160 | 200 Script output follows |
|
3157 | 3161 | |
|
3158 | 3162 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3159 | 3163 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3160 | 3164 | <head> |
|
3161 | 3165 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3162 | 3166 | <meta name="robots" content="index, nofollow" /> |
|
3163 | 3167 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3164 | 3168 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3165 | 3169 | |
|
3166 | 3170 | <title>Help: internals</title> |
|
3167 | 3171 | </head> |
|
3168 | 3172 | <body> |
|
3169 | 3173 | |
|
3170 | 3174 | <div class="container"> |
|
3171 | 3175 | <div class="menu"> |
|
3172 | 3176 | <div class="logo"> |
|
3173 | 3177 | <a href="https://mercurial-scm.org/"> |
|
3174 | 3178 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3175 | 3179 | </div> |
|
3176 | 3180 | <ul> |
|
3177 | 3181 | <li><a href="/shortlog">log</a></li> |
|
3178 | 3182 | <li><a href="/graph">graph</a></li> |
|
3179 | 3183 | <li><a href="/tags">tags</a></li> |
|
3180 | 3184 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3181 | 3185 | <li><a href="/branches">branches</a></li> |
|
3182 | 3186 | </ul> |
|
3183 | 3187 | <ul> |
|
3184 | 3188 | <li><a href="/help">help</a></li> |
|
3185 | 3189 | </ul> |
|
3186 | 3190 | </div> |
|
3187 | 3191 | |
|
3188 | 3192 | <div class="main"> |
|
3189 | 3193 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3190 | 3194 | |
|
3191 | 3195 | <form class="search" action="/log"> |
|
3192 | 3196 | |
|
3193 | 3197 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3194 | 3198 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3195 | 3199 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3196 | 3200 | </form> |
|
3197 | 3201 | <table class="bigtable"> |
|
3198 | 3202 | <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr> |
|
3199 | 3203 | |
|
3200 | 3204 | <tr><td> |
|
3201 | 3205 | <a href="/help/internals.bundle2"> |
|
3202 | 3206 | bundle2 |
|
3203 | 3207 | </a> |
|
3204 | 3208 | </td><td> |
|
3205 | 3209 | Bundle2 |
|
3206 | 3210 | </td></tr> |
|
3207 | 3211 | <tr><td> |
|
3208 | 3212 | <a href="/help/internals.bundles"> |
|
3209 | 3213 | bundles |
|
3210 | 3214 | </a> |
|
3211 | 3215 | </td><td> |
|
3212 | 3216 | Bundles |
|
3213 | 3217 | </td></tr> |
|
3214 | 3218 | <tr><td> |
|
3215 | 3219 | <a href="/help/internals.censor"> |
|
3216 | 3220 | censor |
|
3217 | 3221 | </a> |
|
3218 | 3222 | </td><td> |
|
3219 | 3223 | Censor |
|
3220 | 3224 | </td></tr> |
|
3221 | 3225 | <tr><td> |
|
3222 | 3226 | <a href="/help/internals.changegroups"> |
|
3223 | 3227 | changegroups |
|
3224 | 3228 | </a> |
|
3225 | 3229 | </td><td> |
|
3226 | 3230 | Changegroups |
|
3227 | 3231 | </td></tr> |
|
3228 | 3232 | <tr><td> |
|
3229 | 3233 | <a href="/help/internals.config"> |
|
3230 | 3234 | config |
|
3231 | 3235 | </a> |
|
3232 | 3236 | </td><td> |
|
3233 | 3237 | Config Registrar |
|
3234 | 3238 | </td></tr> |
|
3235 | 3239 | <tr><td> |
|
3236 | 3240 | <a href="/help/internals.requirements"> |
|
3237 | 3241 | requirements |
|
3238 | 3242 | </a> |
|
3239 | 3243 | </td><td> |
|
3240 | 3244 | Repository Requirements |
|
3241 | 3245 | </td></tr> |
|
3242 | 3246 | <tr><td> |
|
3243 | 3247 | <a href="/help/internals.revlogs"> |
|
3244 | 3248 | revlogs |
|
3245 | 3249 | </a> |
|
3246 | 3250 | </td><td> |
|
3247 | 3251 | Revision Logs |
|
3248 | 3252 | </td></tr> |
|
3249 | 3253 | <tr><td> |
|
3250 | 3254 | <a href="/help/internals.wireprotocol"> |
|
3251 | 3255 | wireprotocol |
|
3252 | 3256 | </a> |
|
3253 | 3257 | </td><td> |
|
3254 | 3258 | Wire Protocol |
|
3255 | 3259 | </td></tr> |
|
3256 | 3260 | |
|
3257 | 3261 | |
|
3258 | 3262 | |
|
3259 | 3263 | |
|
3260 | 3264 | |
|
3261 | 3265 | </table> |
|
3262 | 3266 | </div> |
|
3263 | 3267 | </div> |
|
3264 | 3268 | |
|
3265 | 3269 | |
|
3266 | 3270 | |
|
3267 | 3271 | </body> |
|
3268 | 3272 | </html> |
|
3269 | 3273 | |
|
3270 | 3274 | |
|
3271 | 3275 | Sub-topic topics rendered properly |
|
3272 | 3276 | |
|
3273 | 3277 | $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups" |
|
3274 | 3278 | 200 Script output follows |
|
3275 | 3279 | |
|
3276 | 3280 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3277 | 3281 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3278 | 3282 | <head> |
|
3279 | 3283 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3280 | 3284 | <meta name="robots" content="index, nofollow" /> |
|
3281 | 3285 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3282 | 3286 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3283 | 3287 | |
|
3284 | 3288 | <title>Help: internals.changegroups</title> |
|
3285 | 3289 | </head> |
|
3286 | 3290 | <body> |
|
3287 | 3291 | |
|
3288 | 3292 | <div class="container"> |
|
3289 | 3293 | <div class="menu"> |
|
3290 | 3294 | <div class="logo"> |
|
3291 | 3295 | <a href="https://mercurial-scm.org/"> |
|
3292 | 3296 | <img src="/static/hglogo.png" alt="mercurial" /></a> |
|
3293 | 3297 | </div> |
|
3294 | 3298 | <ul> |
|
3295 | 3299 | <li><a href="/shortlog">log</a></li> |
|
3296 | 3300 | <li><a href="/graph">graph</a></li> |
|
3297 | 3301 | <li><a href="/tags">tags</a></li> |
|
3298 | 3302 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3299 | 3303 | <li><a href="/branches">branches</a></li> |
|
3300 | 3304 | </ul> |
|
3301 | 3305 | <ul> |
|
3302 | 3306 | <li class="active"><a href="/help">help</a></li> |
|
3303 | 3307 | </ul> |
|
3304 | 3308 | </div> |
|
3305 | 3309 | |
|
3306 | 3310 | <div class="main"> |
|
3307 | 3311 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3308 | 3312 | <h3>Help: internals.changegroups</h3> |
|
3309 | 3313 | |
|
3310 | 3314 | <form class="search" action="/log"> |
|
3311 | 3315 | |
|
3312 | 3316 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3313 | 3317 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3314 | 3318 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3315 | 3319 | </form> |
|
3316 | 3320 | <div id="doc"> |
|
3317 | 3321 | <h1>Changegroups</h1> |
|
3318 | 3322 | <p> |
|
3319 | 3323 | Changegroups are representations of repository revlog data, specifically |
|
3320 | 3324 | the changelog data, root/flat manifest data, treemanifest data, and |
|
3321 | 3325 | filelogs. |
|
3322 | 3326 | </p> |
|
3323 | 3327 | <p> |
|
3324 | 3328 | There are 3 versions of changegroups: "1", "2", and "3". From a |
|
3325 | 3329 | high-level, versions "1" and "2" are almost exactly the same, with the |
|
3326 | 3330 | only difference being an additional item in the *delta header*. Version |
|
3327 | 3331 | "3" adds support for revlog flags in the *delta header* and optionally |
|
3328 | 3332 | exchanging treemanifests (enabled by setting an option on the |
|
3329 | 3333 | "changegroup" part in the bundle2). |
|
3330 | 3334 | </p> |
|
3331 | 3335 | <p> |
|
3332 | 3336 | Changegroups when not exchanging treemanifests consist of 3 logical |
|
3333 | 3337 | segments: |
|
3334 | 3338 | </p> |
|
3335 | 3339 | <pre> |
|
3336 | 3340 | +---------------------------------+ |
|
3337 | 3341 | | | | | |
|
3338 | 3342 | | changeset | manifest | filelogs | |
|
3339 | 3343 | | | | | |
|
3340 | 3344 | | | | | |
|
3341 | 3345 | +---------------------------------+ |
|
3342 | 3346 | </pre> |
|
3343 | 3347 | <p> |
|
3344 | 3348 | When exchanging treemanifests, there are 4 logical segments: |
|
3345 | 3349 | </p> |
|
3346 | 3350 | <pre> |
|
3347 | 3351 | +-------------------------------------------------+ |
|
3348 | 3352 | | | | | | |
|
3349 | 3353 | | changeset | root | treemanifests | filelogs | |
|
3350 | 3354 | | | manifest | | | |
|
3351 | 3355 | | | | | | |
|
3352 | 3356 | +-------------------------------------------------+ |
|
3353 | 3357 | </pre> |
|
3354 | 3358 | <p> |
|
3355 | 3359 | The principle building block of each segment is a *chunk*. A *chunk* |
|
3356 | 3360 | is a framed piece of data: |
|
3357 | 3361 | </p> |
|
3358 | 3362 | <pre> |
|
3359 | 3363 | +---------------------------------------+ |
|
3360 | 3364 | | | | |
|
3361 | 3365 | | length | data | |
|
3362 | 3366 | | (4 bytes) | (<length - 4> bytes) | |
|
3363 | 3367 | | | | |
|
3364 | 3368 | +---------------------------------------+ |
|
3365 | 3369 | </pre> |
|
3366 | 3370 | <p> |
|
3367 | 3371 | All integers are big-endian signed integers. Each chunk starts with a 32-bit |
|
3368 | 3372 | integer indicating the length of the entire chunk (including the length field |
|
3369 | 3373 | itself). |
|
3370 | 3374 | </p> |
|
3371 | 3375 | <p> |
|
3372 | 3376 | There is a special case chunk that has a value of 0 for the length |
|
3373 | 3377 | ("0x00000000"). We call this an *empty chunk*. |
|
3374 | 3378 | </p> |
|
3375 | 3379 | <h2>Delta Groups</h2> |
|
3376 | 3380 | <p> |
|
3377 | 3381 | A *delta group* expresses the content of a revlog as a series of deltas, |
|
3378 | 3382 | or patches against previous revisions. |
|
3379 | 3383 | </p> |
|
3380 | 3384 | <p> |
|
3381 | 3385 | Delta groups consist of 0 or more *chunks* followed by the *empty chunk* |
|
3382 | 3386 | to signal the end of the delta group: |
|
3383 | 3387 | </p> |
|
3384 | 3388 | <pre> |
|
3385 | 3389 | +------------------------------------------------------------------------+ |
|
3386 | 3390 | | | | | | | |
|
3387 | 3391 | | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 | |
|
3388 | 3392 | | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) | |
|
3389 | 3393 | | | | | | | |
|
3390 | 3394 | +------------------------------------------------------------------------+ |
|
3391 | 3395 | </pre> |
|
3392 | 3396 | <p> |
|
3393 | 3397 | Each *chunk*'s data consists of the following: |
|
3394 | 3398 | </p> |
|
3395 | 3399 | <pre> |
|
3396 | 3400 | +---------------------------------------+ |
|
3397 | 3401 | | | | |
|
3398 | 3402 | | delta header | delta data | |
|
3399 | 3403 | | (various by version) | (various) | |
|
3400 | 3404 | | | | |
|
3401 | 3405 | +---------------------------------------+ |
|
3402 | 3406 | </pre> |
|
3403 | 3407 | <p> |
|
3404 | 3408 | The *delta data* is a series of *delta*s that describe a diff from an existing |
|
3405 | 3409 | entry (either that the recipient already has, or previously specified in the |
|
3406 | 3410 | bundle/changegroup). |
|
3407 | 3411 | </p> |
|
3408 | 3412 | <p> |
|
3409 | 3413 | The *delta header* is different between versions "1", "2", and |
|
3410 | 3414 | "3" of the changegroup format. |
|
3411 | 3415 | </p> |
|
3412 | 3416 | <p> |
|
3413 | 3417 | Version 1 (headerlen=80): |
|
3414 | 3418 | </p> |
|
3415 | 3419 | <pre> |
|
3416 | 3420 | +------------------------------------------------------+ |
|
3417 | 3421 | | | | | | |
|
3418 | 3422 | | node | p1 node | p2 node | link node | |
|
3419 | 3423 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
3420 | 3424 | | | | | | |
|
3421 | 3425 | +------------------------------------------------------+ |
|
3422 | 3426 | </pre> |
|
3423 | 3427 | <p> |
|
3424 | 3428 | Version 2 (headerlen=100): |
|
3425 | 3429 | </p> |
|
3426 | 3430 | <pre> |
|
3427 | 3431 | +------------------------------------------------------------------+ |
|
3428 | 3432 | | | | | | | |
|
3429 | 3433 | | node | p1 node | p2 node | base node | link node | |
|
3430 | 3434 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | |
|
3431 | 3435 | | | | | | | |
|
3432 | 3436 | +------------------------------------------------------------------+ |
|
3433 | 3437 | </pre> |
|
3434 | 3438 | <p> |
|
3435 | 3439 | Version 3 (headerlen=102): |
|
3436 | 3440 | </p> |
|
3437 | 3441 | <pre> |
|
3438 | 3442 | +------------------------------------------------------------------------------+ |
|
3439 | 3443 | | | | | | | | |
|
3440 | 3444 | | node | p1 node | p2 node | base node | link node | flags | |
|
3441 | 3445 | | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) | |
|
3442 | 3446 | | | | | | | | |
|
3443 | 3447 | +------------------------------------------------------------------------------+ |
|
3444 | 3448 | </pre> |
|
3445 | 3449 | <p> |
|
3446 | 3450 | The *delta data* consists of "chunklen - 4 - headerlen" bytes, which contain a |
|
3447 | 3451 | series of *delta*s, densely packed (no separators). These deltas describe a diff |
|
3448 | 3452 | from an existing entry (either that the recipient already has, or previously |
|
3449 | 3453 | specified in the bundle/changegroup). The format is described more fully in |
|
3450 | 3454 | "hg help internals.bdiff", but briefly: |
|
3451 | 3455 | </p> |
|
3452 | 3456 | <pre> |
|
3453 | 3457 | +---------------------------------------------------------------+ |
|
3454 | 3458 | | | | | | |
|
3455 | 3459 | | start offset | end offset | new length | content | |
|
3456 | 3460 | | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) | |
|
3457 | 3461 | | | | | | |
|
3458 | 3462 | +---------------------------------------------------------------+ |
|
3459 | 3463 | </pre> |
|
3460 | 3464 | <p> |
|
3461 | 3465 | Please note that the length field in the delta data does *not* include itself. |
|
3462 | 3466 | </p> |
|
3463 | 3467 | <p> |
|
3464 | 3468 | In version 1, the delta is always applied against the previous node from |
|
3465 | 3469 | the changegroup or the first parent if this is the first entry in the |
|
3466 | 3470 | changegroup. |
|
3467 | 3471 | </p> |
|
3468 | 3472 | <p> |
|
3469 | 3473 | In version 2 and up, the delta base node is encoded in the entry in the |
|
3470 | 3474 | changegroup. This allows the delta to be expressed against any parent, |
|
3471 | 3475 | which can result in smaller deltas and more efficient encoding of data. |
|
3472 | 3476 | </p> |
|
3473 | 3477 | <h2>Changeset Segment</h2> |
|
3474 | 3478 | <p> |
|
3475 | 3479 | The *changeset segment* consists of a single *delta group* holding |
|
3476 | 3480 | changelog data. The *empty chunk* at the end of the *delta group* denotes |
|
3477 | 3481 | the boundary to the *manifest segment*. |
|
3478 | 3482 | </p> |
|
3479 | 3483 | <h2>Manifest Segment</h2> |
|
3480 | 3484 | <p> |
|
3481 | 3485 | The *manifest segment* consists of a single *delta group* holding manifest |
|
3482 | 3486 | data. If treemanifests are in use, it contains only the manifest for the |
|
3483 | 3487 | root directory of the repository. Otherwise, it contains the entire |
|
3484 | 3488 | manifest data. The *empty chunk* at the end of the *delta group* denotes |
|
3485 | 3489 | the boundary to the next segment (either the *treemanifests segment* or the |
|
3486 | 3490 | *filelogs segment*, depending on version and the request options). |
|
3487 | 3491 | </p> |
|
3488 | 3492 | <h3>Treemanifests Segment</h3> |
|
3489 | 3493 | <p> |
|
3490 | 3494 | The *treemanifests segment* only exists in changegroup version "3", and |
|
3491 | 3495 | only if the 'treemanifest' param is part of the bundle2 changegroup part |
|
3492 | 3496 | (it is not possible to use changegroup version 3 outside of bundle2). |
|
3493 | 3497 | Aside from the filenames in the *treemanifests segment* containing a |
|
3494 | 3498 | trailing "/" character, it behaves identically to the *filelogs segment* |
|
3495 | 3499 | (see below). The final sub-segment is followed by an *empty chunk* (logically, |
|
3496 | 3500 | a sub-segment with filename size 0). This denotes the boundary to the |
|
3497 | 3501 | *filelogs segment*. |
|
3498 | 3502 | </p> |
|
3499 | 3503 | <h2>Filelogs Segment</h2> |
|
3500 | 3504 | <p> |
|
3501 | 3505 | The *filelogs segment* consists of multiple sub-segments, each |
|
3502 | 3506 | corresponding to an individual file whose data is being described: |
|
3503 | 3507 | </p> |
|
3504 | 3508 | <pre> |
|
3505 | 3509 | +--------------------------------------------------+ |
|
3506 | 3510 | | | | | | | |
|
3507 | 3511 | | filelog0 | filelog1 | filelog2 | ... | 0x0 | |
|
3508 | 3512 | | | | | | (4 bytes) | |
|
3509 | 3513 | | | | | | | |
|
3510 | 3514 | +--------------------------------------------------+ |
|
3511 | 3515 | </pre> |
|
3512 | 3516 | <p> |
|
3513 | 3517 | The final filelog sub-segment is followed by an *empty chunk* (logically, |
|
3514 | 3518 | a sub-segment with filename size 0). This denotes the end of the segment |
|
3515 | 3519 | and of the overall changegroup. |
|
3516 | 3520 | </p> |
|
3517 | 3521 | <p> |
|
3518 | 3522 | Each filelog sub-segment consists of the following: |
|
3519 | 3523 | </p> |
|
3520 | 3524 | <pre> |
|
3521 | 3525 | +------------------------------------------------------+ |
|
3522 | 3526 | | | | | |
|
3523 | 3527 | | filename length | filename | delta group | |
|
3524 | 3528 | | (4 bytes) | (<length - 4> bytes) | (various) | |
|
3525 | 3529 | | | | | |
|
3526 | 3530 | +------------------------------------------------------+ |
|
3527 | 3531 | </pre> |
|
3528 | 3532 | <p> |
|
3529 | 3533 | That is, a *chunk* consisting of the filename (not terminated or padded) |
|
3530 | 3534 | followed by N chunks constituting the *delta group* for this file. The |
|
3531 | 3535 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
3532 | 3536 | next filelog sub-segment. |
|
3533 | 3537 | </p> |
|
3534 | 3538 | |
|
3535 | 3539 | </div> |
|
3536 | 3540 | </div> |
|
3537 | 3541 | </div> |
|
3538 | 3542 | |
|
3539 | 3543 | |
|
3540 | 3544 | |
|
3541 | 3545 | </body> |
|
3542 | 3546 | </html> |
|
3543 | 3547 | |
|
3544 | 3548 | |
|
3545 | 3549 | $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic" |
|
3546 | 3550 | 404 Not Found |
|
3547 | 3551 | |
|
3548 | 3552 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
3549 | 3553 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> |
|
3550 | 3554 | <head> |
|
3551 | 3555 | <link rel="icon" href="/static/hgicon.png" type="image/png" /> |
|
3552 | 3556 | <meta name="robots" content="index, nofollow" /> |
|
3553 | 3557 | <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> |
|
3554 | 3558 | <script type="text/javascript" src="/static/mercurial.js"></script> |
|
3555 | 3559 | |
|
3556 | 3560 | <title>test: error</title> |
|
3557 | 3561 | </head> |
|
3558 | 3562 | <body> |
|
3559 | 3563 | |
|
3560 | 3564 | <div class="container"> |
|
3561 | 3565 | <div class="menu"> |
|
3562 | 3566 | <div class="logo"> |
|
3563 | 3567 | <a href="https://mercurial-scm.org/"> |
|
3564 | 3568 | <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> |
|
3565 | 3569 | </div> |
|
3566 | 3570 | <ul> |
|
3567 | 3571 | <li><a href="/shortlog">log</a></li> |
|
3568 | 3572 | <li><a href="/graph">graph</a></li> |
|
3569 | 3573 | <li><a href="/tags">tags</a></li> |
|
3570 | 3574 | <li><a href="/bookmarks">bookmarks</a></li> |
|
3571 | 3575 | <li><a href="/branches">branches</a></li> |
|
3572 | 3576 | </ul> |
|
3573 | 3577 | <ul> |
|
3574 | 3578 | <li><a href="/help">help</a></li> |
|
3575 | 3579 | </ul> |
|
3576 | 3580 | </div> |
|
3577 | 3581 | |
|
3578 | 3582 | <div class="main"> |
|
3579 | 3583 | |
|
3580 | 3584 | <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> |
|
3581 | 3585 | <h3>error</h3> |
|
3582 | 3586 | |
|
3583 | 3587 | |
|
3584 | 3588 | <form class="search" action="/log"> |
|
3585 | 3589 | |
|
3586 | 3590 | <p><input name="rev" id="search1" type="text" size="30" value="" /></p> |
|
3587 | 3591 | <div id="hint">Find changesets by keywords (author, files, the commit message), revision |
|
3588 | 3592 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
3589 | 3593 | </form> |
|
3590 | 3594 | |
|
3591 | 3595 | <div class="description"> |
|
3592 | 3596 | <p> |
|
3593 | 3597 | An error occurred while processing your request: |
|
3594 | 3598 | </p> |
|
3595 | 3599 | <p> |
|
3596 | 3600 | Not Found |
|
3597 | 3601 | </p> |
|
3598 | 3602 | </div> |
|
3599 | 3603 | </div> |
|
3600 | 3604 | </div> |
|
3601 | 3605 | |
|
3602 | 3606 | |
|
3603 | 3607 | |
|
3604 | 3608 | </body> |
|
3605 | 3609 | </html> |
|
3606 | 3610 | |
|
3607 | 3611 | [1] |
|
3608 | 3612 | |
|
3609 | 3613 | $ killdaemons.py |
|
3610 | 3614 | |
|
3611 | 3615 | #endif |
@@ -1,1909 +1,1984 | |||
|
1 | 1 | test merge-tools configuration - mostly exercising filemerge.py |
|
2 | 2 | |
|
3 | 3 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test |
|
4 | 4 | $ hg init repo |
|
5 | 5 | $ cd repo |
|
6 | 6 | |
|
7 | 7 | revision 0 |
|
8 | 8 | |
|
9 | 9 | $ echo "revision 0" > f |
|
10 | 10 | $ echo "space" >> f |
|
11 | 11 | $ hg commit -Am "revision 0" |
|
12 | 12 | adding f |
|
13 | 13 | |
|
14 | 14 | revision 1 |
|
15 | 15 | |
|
16 | 16 | $ echo "revision 1" > f |
|
17 | 17 | $ echo "space" >> f |
|
18 | 18 | $ hg commit -Am "revision 1" |
|
19 | 19 | $ hg update 0 > /dev/null |
|
20 | 20 | |
|
21 | 21 | revision 2 |
|
22 | 22 | |
|
23 | 23 | $ echo "revision 2" > f |
|
24 | 24 | $ echo "space" >> f |
|
25 | 25 | $ hg commit -Am "revision 2" |
|
26 | 26 | created new head |
|
27 | 27 | $ hg update 0 > /dev/null |
|
28 | 28 | |
|
29 | 29 | revision 3 - simple to merge |
|
30 | 30 | |
|
31 | 31 | $ echo "revision 3" >> f |
|
32 | 32 | $ hg commit -Am "revision 3" |
|
33 | 33 | created new head |
|
34 | 34 | |
|
35 | 35 | revision 4 - hard to merge |
|
36 | 36 | |
|
37 | 37 | $ hg update 0 > /dev/null |
|
38 | 38 | $ echo "revision 4" > f |
|
39 | 39 | $ hg commit -Am "revision 4" |
|
40 | 40 | created new head |
|
41 | 41 | |
|
42 | 42 | $ echo "[merge-tools]" > .hg/hgrc |
|
43 | 43 | |
|
44 | 44 | $ beforemerge() { |
|
45 | 45 | > cat .hg/hgrc |
|
46 | 46 | > echo "# hg update -C 1" |
|
47 | 47 | > hg update -C 1 > /dev/null |
|
48 | 48 | > } |
|
49 | 49 | $ aftermerge() { |
|
50 | 50 | > echo "# cat f" |
|
51 | 51 | > cat f |
|
52 | 52 | > echo "# hg stat" |
|
53 | 53 | > hg stat |
|
54 | 54 | > echo "# hg resolve --list" |
|
55 | 55 | > hg resolve --list |
|
56 | 56 | > rm -f f.orig |
|
57 | 57 | > } |
|
58 | 58 | |
|
59 | 59 | Tool selection |
|
60 | 60 | |
|
61 | 61 | default is internal merge: |
|
62 | 62 | |
|
63 | 63 | $ beforemerge |
|
64 | 64 | [merge-tools] |
|
65 | 65 | # hg update -C 1 |
|
66 | 66 | |
|
67 | 67 | hg merge -r 2 |
|
68 | 68 | override $PATH to ensure hgmerge not visible; use $PYTHON in case we're |
|
69 | 69 | running from a devel copy, not a temp installation |
|
70 | 70 | |
|
71 | 71 | $ PATH="$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2 |
|
72 | 72 | merging f |
|
73 | 73 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
74 | 74 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
75 | 75 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
76 | 76 | [1] |
|
77 | 77 | $ aftermerge |
|
78 | 78 | # cat f |
|
79 | 79 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
80 | 80 | revision 1 |
|
81 | 81 | ======= |
|
82 | 82 | revision 2 |
|
83 | 83 | >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2 |
|
84 | 84 | space |
|
85 | 85 | # hg stat |
|
86 | 86 | M f |
|
87 | 87 | ? f.orig |
|
88 | 88 | # hg resolve --list |
|
89 | 89 | U f |
|
90 | 90 | |
|
91 | 91 | simplest hgrc using false for merge: |
|
92 | 92 | |
|
93 | 93 | $ echo "false.whatever=" >> .hg/hgrc |
|
94 | 94 | $ beforemerge |
|
95 | 95 | [merge-tools] |
|
96 | 96 | false.whatever= |
|
97 | 97 | # hg update -C 1 |
|
98 | 98 | $ hg merge -r 2 |
|
99 | 99 | merging f |
|
100 | 100 | merging f failed! |
|
101 | 101 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
102 | 102 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
103 | 103 | [1] |
|
104 | 104 | $ aftermerge |
|
105 | 105 | # cat f |
|
106 | 106 | revision 1 |
|
107 | 107 | space |
|
108 | 108 | # hg stat |
|
109 | 109 | M f |
|
110 | 110 | ? f.orig |
|
111 | 111 | # hg resolve --list |
|
112 | 112 | U f |
|
113 | 113 | |
|
114 | 114 | #if unix-permissions |
|
115 | 115 | |
|
116 | 116 | unexecutable file in $PATH shouldn't be found: |
|
117 | 117 | |
|
118 | 118 | $ echo "echo fail" > false |
|
119 | 119 | $ hg up -qC 1 |
|
120 | 120 | $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2 |
|
121 | 121 | merging f |
|
122 | 122 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
123 | 123 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
124 | 124 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
125 | 125 | [1] |
|
126 | 126 | $ rm false |
|
127 | 127 | |
|
128 | 128 | #endif |
|
129 | 129 | |
|
130 | 130 | executable directory in $PATH shouldn't be found: |
|
131 | 131 | |
|
132 | 132 | $ mkdir false |
|
133 | 133 | $ hg up -qC 1 |
|
134 | 134 | $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2 |
|
135 | 135 | merging f |
|
136 | 136 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
137 | 137 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
138 | 138 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
139 | 139 | [1] |
|
140 | 140 | $ rmdir false |
|
141 | 141 | |
|
142 | 142 | true with higher .priority gets precedence: |
|
143 | 143 | |
|
144 | 144 | $ echo "true.priority=1" >> .hg/hgrc |
|
145 | 145 | $ beforemerge |
|
146 | 146 | [merge-tools] |
|
147 | 147 | false.whatever= |
|
148 | 148 | true.priority=1 |
|
149 | 149 | # hg update -C 1 |
|
150 | 150 | $ hg merge -r 2 |
|
151 | 151 | merging f |
|
152 | 152 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
153 | 153 | (branch merge, don't forget to commit) |
|
154 | 154 | $ aftermerge |
|
155 | 155 | # cat f |
|
156 | 156 | revision 1 |
|
157 | 157 | space |
|
158 | 158 | # hg stat |
|
159 | 159 | M f |
|
160 | 160 | # hg resolve --list |
|
161 | 161 | R f |
|
162 | 162 | |
|
163 | 163 | unless lowered on command line: |
|
164 | 164 | |
|
165 | 165 | $ beforemerge |
|
166 | 166 | [merge-tools] |
|
167 | 167 | false.whatever= |
|
168 | 168 | true.priority=1 |
|
169 | 169 | # hg update -C 1 |
|
170 | 170 | $ hg merge -r 2 --config merge-tools.true.priority=-7 |
|
171 | 171 | merging f |
|
172 | 172 | merging f failed! |
|
173 | 173 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
174 | 174 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
175 | 175 | [1] |
|
176 | 176 | $ aftermerge |
|
177 | 177 | # cat f |
|
178 | 178 | revision 1 |
|
179 | 179 | space |
|
180 | 180 | # hg stat |
|
181 | 181 | M f |
|
182 | 182 | ? f.orig |
|
183 | 183 | # hg resolve --list |
|
184 | 184 | U f |
|
185 | 185 | |
|
186 | 186 | or false set higher on command line: |
|
187 | 187 | |
|
188 | 188 | $ beforemerge |
|
189 | 189 | [merge-tools] |
|
190 | 190 | false.whatever= |
|
191 | 191 | true.priority=1 |
|
192 | 192 | # hg update -C 1 |
|
193 | 193 | $ hg merge -r 2 --config merge-tools.false.priority=117 |
|
194 | 194 | merging f |
|
195 | 195 | merging f failed! |
|
196 | 196 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
197 | 197 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
198 | 198 | [1] |
|
199 | 199 | $ aftermerge |
|
200 | 200 | # cat f |
|
201 | 201 | revision 1 |
|
202 | 202 | space |
|
203 | 203 | # hg stat |
|
204 | 204 | M f |
|
205 | 205 | ? f.orig |
|
206 | 206 | # hg resolve --list |
|
207 | 207 | U f |
|
208 | 208 | |
|
209 | 209 | or true set to disabled: |
|
210 | 210 | $ beforemerge |
|
211 | 211 | [merge-tools] |
|
212 | 212 | false.whatever= |
|
213 | 213 | true.priority=1 |
|
214 | 214 | # hg update -C 1 |
|
215 | 215 | $ hg merge -r 2 --config merge-tools.true.disabled=yes |
|
216 | 216 | merging f |
|
217 | 217 | merging f failed! |
|
218 | 218 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
219 | 219 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
220 | 220 | [1] |
|
221 | 221 | $ aftermerge |
|
222 | 222 | # cat f |
|
223 | 223 | revision 1 |
|
224 | 224 | space |
|
225 | 225 | # hg stat |
|
226 | 226 | M f |
|
227 | 227 | ? f.orig |
|
228 | 228 | # hg resolve --list |
|
229 | 229 | U f |
|
230 | 230 | |
|
231 | 231 | or true.executable not found in PATH: |
|
232 | 232 | |
|
233 | 233 | $ beforemerge |
|
234 | 234 | [merge-tools] |
|
235 | 235 | false.whatever= |
|
236 | 236 | true.priority=1 |
|
237 | 237 | # hg update -C 1 |
|
238 | 238 | $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool |
|
239 | 239 | merging f |
|
240 | 240 | merging f failed! |
|
241 | 241 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
242 | 242 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
243 | 243 | [1] |
|
244 | 244 | $ aftermerge |
|
245 | 245 | # cat f |
|
246 | 246 | revision 1 |
|
247 | 247 | space |
|
248 | 248 | # hg stat |
|
249 | 249 | M f |
|
250 | 250 | ? f.orig |
|
251 | 251 | # hg resolve --list |
|
252 | 252 | U f |
|
253 | 253 | |
|
254 | 254 | or true.executable with bogus path: |
|
255 | 255 | |
|
256 | 256 | $ beforemerge |
|
257 | 257 | [merge-tools] |
|
258 | 258 | false.whatever= |
|
259 | 259 | true.priority=1 |
|
260 | 260 | # hg update -C 1 |
|
261 | 261 | $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool |
|
262 | 262 | merging f |
|
263 | 263 | merging f failed! |
|
264 | 264 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
265 | 265 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
266 | 266 | [1] |
|
267 | 267 | $ aftermerge |
|
268 | 268 | # cat f |
|
269 | 269 | revision 1 |
|
270 | 270 | space |
|
271 | 271 | # hg stat |
|
272 | 272 | M f |
|
273 | 273 | ? f.orig |
|
274 | 274 | # hg resolve --list |
|
275 | 275 | U f |
|
276 | 276 | |
|
277 | 277 | but true.executable set to cat found in PATH works: |
|
278 | 278 | |
|
279 | 279 | $ echo "true.executable=cat" >> .hg/hgrc |
|
280 | 280 | $ beforemerge |
|
281 | 281 | [merge-tools] |
|
282 | 282 | false.whatever= |
|
283 | 283 | true.priority=1 |
|
284 | 284 | true.executable=cat |
|
285 | 285 | # hg update -C 1 |
|
286 | 286 | $ hg merge -r 2 |
|
287 | 287 | merging f |
|
288 | 288 | revision 1 |
|
289 | 289 | space |
|
290 | 290 | revision 0 |
|
291 | 291 | space |
|
292 | 292 | revision 2 |
|
293 | 293 | space |
|
294 | 294 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
295 | 295 | (branch merge, don't forget to commit) |
|
296 | 296 | $ aftermerge |
|
297 | 297 | # cat f |
|
298 | 298 | revision 1 |
|
299 | 299 | space |
|
300 | 300 | # hg stat |
|
301 | 301 | M f |
|
302 | 302 | # hg resolve --list |
|
303 | 303 | R f |
|
304 | 304 | |
|
305 | 305 | and true.executable set to cat with path works: |
|
306 | 306 | |
|
307 | 307 | $ beforemerge |
|
308 | 308 | [merge-tools] |
|
309 | 309 | false.whatever= |
|
310 | 310 | true.priority=1 |
|
311 | 311 | true.executable=cat |
|
312 | 312 | # hg update -C 1 |
|
313 | 313 | $ hg merge -r 2 --config merge-tools.true.executable=cat |
|
314 | 314 | merging f |
|
315 | 315 | revision 1 |
|
316 | 316 | space |
|
317 | 317 | revision 0 |
|
318 | 318 | space |
|
319 | 319 | revision 2 |
|
320 | 320 | space |
|
321 | 321 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
322 | 322 | (branch merge, don't forget to commit) |
|
323 | 323 | $ aftermerge |
|
324 | 324 | # cat f |
|
325 | 325 | revision 1 |
|
326 | 326 | space |
|
327 | 327 | # hg stat |
|
328 | 328 | M f |
|
329 | 329 | # hg resolve --list |
|
330 | 330 | R f |
|
331 | 331 | |
|
332 | 332 | executable set to python script that succeeds: |
|
333 | 333 | |
|
334 | 334 | $ cat > "$TESTTMP/myworkingmerge.py" <<EOF |
|
335 | 335 | > def myworkingmergefn(ui, repo, args, **kwargs): |
|
336 | 336 | > return False |
|
337 | 337 | > EOF |
|
338 | 338 | $ beforemerge |
|
339 | 339 | [merge-tools] |
|
340 | 340 | false.whatever= |
|
341 | 341 | true.priority=1 |
|
342 | 342 | true.executable=cat |
|
343 | 343 | # hg update -C 1 |
|
344 | 344 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:myworkingmergefn" |
|
345 | 345 | merging f |
|
346 | 346 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
347 | 347 | (branch merge, don't forget to commit) |
|
348 | 348 | $ aftermerge |
|
349 | 349 | # cat f |
|
350 | 350 | revision 1 |
|
351 | 351 | space |
|
352 | 352 | # hg stat |
|
353 | 353 | M f |
|
354 | 354 | # hg resolve --list |
|
355 | 355 | R f |
|
356 | 356 | |
|
357 | 357 | executable set to python script that fails: |
|
358 | 358 | |
|
359 | 359 | $ cat > "$TESTTMP/mybrokenmerge.py" <<EOF |
|
360 | 360 | > def mybrokenmergefn(ui, repo, args, **kwargs): |
|
361 | 361 | > ui.write(b"some fail message\n") |
|
362 | 362 | > return True |
|
363 | 363 | > EOF |
|
364 | 364 | $ beforemerge |
|
365 | 365 | [merge-tools] |
|
366 | 366 | false.whatever= |
|
367 | 367 | true.priority=1 |
|
368 | 368 | true.executable=cat |
|
369 | 369 | # hg update -C 1 |
|
370 | 370 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/mybrokenmerge.py:mybrokenmergefn" |
|
371 | 371 | merging f |
|
372 | 372 | some fail message |
|
373 | 373 | abort: $TESTTMP/mybrokenmerge.py hook failed |
|
374 | 374 | [255] |
|
375 | 375 | $ aftermerge |
|
376 | 376 | # cat f |
|
377 | 377 | revision 1 |
|
378 | 378 | space |
|
379 | 379 | # hg stat |
|
380 | 380 | ? f.orig |
|
381 | 381 | # hg resolve --list |
|
382 | 382 | U f |
|
383 | 383 | |
|
384 | 384 | executable set to python script that is missing function: |
|
385 | 385 | |
|
386 | 386 | $ beforemerge |
|
387 | 387 | [merge-tools] |
|
388 | 388 | false.whatever= |
|
389 | 389 | true.priority=1 |
|
390 | 390 | true.executable=cat |
|
391 | 391 | # hg update -C 1 |
|
392 | 392 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:missingFunction" |
|
393 | 393 | merging f |
|
394 | 394 | abort: $TESTTMP/myworkingmerge.py does not have function: missingFunction |
|
395 | 395 | [255] |
|
396 | 396 | $ aftermerge |
|
397 | 397 | # cat f |
|
398 | 398 | revision 1 |
|
399 | 399 | space |
|
400 | 400 | # hg stat |
|
401 | 401 | ? f.orig |
|
402 | 402 | # hg resolve --list |
|
403 | 403 | U f |
|
404 | 404 | |
|
405 | 405 | executable set to missing python script: |
|
406 | 406 | |
|
407 | 407 | $ beforemerge |
|
408 | 408 | [merge-tools] |
|
409 | 409 | false.whatever= |
|
410 | 410 | true.priority=1 |
|
411 | 411 | true.executable=cat |
|
412 | 412 | # hg update -C 1 |
|
413 | 413 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/missingpythonscript.py:mergefn" |
|
414 | 414 | merging f |
|
415 | 415 | abort: loading python merge script failed: $TESTTMP/missingpythonscript.py |
|
416 | 416 | [255] |
|
417 | 417 | $ aftermerge |
|
418 | 418 | # cat f |
|
419 | 419 | revision 1 |
|
420 | 420 | space |
|
421 | 421 | # hg stat |
|
422 | 422 | ? f.orig |
|
423 | 423 | # hg resolve --list |
|
424 | 424 | U f |
|
425 | 425 | |
|
426 | 426 | executable set to python script but callable function is missing: |
|
427 | 427 | |
|
428 | 428 | $ beforemerge |
|
429 | 429 | [merge-tools] |
|
430 | 430 | false.whatever= |
|
431 | 431 | true.priority=1 |
|
432 | 432 | true.executable=cat |
|
433 | 433 | # hg update -C 1 |
|
434 | 434 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py" |
|
435 | 435 | abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py |
|
436 | 436 | [255] |
|
437 | 437 | $ aftermerge |
|
438 | 438 | # cat f |
|
439 | 439 | revision 1 |
|
440 | 440 | space |
|
441 | 441 | # hg stat |
|
442 | 442 | # hg resolve --list |
|
443 | 443 | U f |
|
444 | 444 | |
|
445 | 445 | executable set to python script but callable function is empty string: |
|
446 | 446 | |
|
447 | 447 | $ beforemerge |
|
448 | 448 | [merge-tools] |
|
449 | 449 | false.whatever= |
|
450 | 450 | true.priority=1 |
|
451 | 451 | true.executable=cat |
|
452 | 452 | # hg update -C 1 |
|
453 | 453 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:" |
|
454 | 454 | abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py: |
|
455 | 455 | [255] |
|
456 | 456 | $ aftermerge |
|
457 | 457 | # cat f |
|
458 | 458 | revision 1 |
|
459 | 459 | space |
|
460 | 460 | # hg stat |
|
461 | 461 | # hg resolve --list |
|
462 | 462 | U f |
|
463 | 463 | |
|
464 | 464 | executable set to python script but callable function is missing and path contains colon: |
|
465 | 465 | |
|
466 | 466 | $ beforemerge |
|
467 | 467 | [merge-tools] |
|
468 | 468 | false.whatever= |
|
469 | 469 | true.priority=1 |
|
470 | 470 | true.executable=cat |
|
471 | 471 | # hg update -C 1 |
|
472 | 472 | $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/some:dir/myworkingmerge.py" |
|
473 | 473 | abort: invalid 'python:' syntax: python:$TESTTMP/some:dir/myworkingmerge.py |
|
474 | 474 | [255] |
|
475 | 475 | $ aftermerge |
|
476 | 476 | # cat f |
|
477 | 477 | revision 1 |
|
478 | 478 | space |
|
479 | 479 | # hg stat |
|
480 | 480 | # hg resolve --list |
|
481 | 481 | U f |
|
482 | 482 | |
|
483 | 483 | executable set to python script filename that contains spaces: |
|
484 | 484 | |
|
485 | 485 | $ mkdir -p "$TESTTMP/my path" |
|
486 | 486 | $ cat > "$TESTTMP/my path/my working merge with spaces in filename.py" <<EOF |
|
487 | 487 | > def myworkingmergefn(ui, repo, args, **kwargs): |
|
488 | 488 | > return False |
|
489 | 489 | > EOF |
|
490 | 490 | $ beforemerge |
|
491 | 491 | [merge-tools] |
|
492 | 492 | false.whatever= |
|
493 | 493 | true.priority=1 |
|
494 | 494 | true.executable=cat |
|
495 | 495 | # hg update -C 1 |
|
496 | 496 | $ hg merge -r 2 --config "merge-tools.true.executable=python:$TESTTMP/my path/my working merge with spaces in filename.py:myworkingmergefn" |
|
497 | 497 | merging f |
|
498 | 498 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
499 | 499 | (branch merge, don't forget to commit) |
|
500 | 500 | $ aftermerge |
|
501 | 501 | # cat f |
|
502 | 502 | revision 1 |
|
503 | 503 | space |
|
504 | 504 | # hg stat |
|
505 | 505 | M f |
|
506 | 506 | # hg resolve --list |
|
507 | 507 | R f |
|
508 | 508 | |
|
509 | 509 | #if unix-permissions |
|
510 | 510 | |
|
511 | 511 | environment variables in true.executable are handled: |
|
512 | 512 | |
|
513 | 513 | $ echo 'echo "custom merge tool"' > .hg/merge.sh |
|
514 | 514 | $ beforemerge |
|
515 | 515 | [merge-tools] |
|
516 | 516 | false.whatever= |
|
517 | 517 | true.priority=1 |
|
518 | 518 | true.executable=cat |
|
519 | 519 | # hg update -C 1 |
|
520 | 520 | $ hg --config merge-tools.true.executable='sh' \ |
|
521 | 521 | > --config merge-tools.true.args=.hg/merge.sh \ |
|
522 | 522 | > merge -r 2 |
|
523 | 523 | merging f |
|
524 | 524 | custom merge tool |
|
525 | 525 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
526 | 526 | (branch merge, don't forget to commit) |
|
527 | 527 | $ aftermerge |
|
528 | 528 | # cat f |
|
529 | 529 | revision 1 |
|
530 | 530 | space |
|
531 | 531 | # hg stat |
|
532 | 532 | M f |
|
533 | 533 | # hg resolve --list |
|
534 | 534 | R f |
|
535 | 535 | |
|
536 | 536 | #endif |
|
537 | 537 | |
|
538 | 538 | Tool selection and merge-patterns |
|
539 | 539 | |
|
540 | 540 | merge-patterns specifies new tool false: |
|
541 | 541 | |
|
542 | 542 | $ beforemerge |
|
543 | 543 | [merge-tools] |
|
544 | 544 | false.whatever= |
|
545 | 545 | true.priority=1 |
|
546 | 546 | true.executable=cat |
|
547 | 547 | # hg update -C 1 |
|
548 | 548 | $ hg merge -r 2 --config merge-patterns.f=false |
|
549 | 549 | merging f |
|
550 | 550 | merging f failed! |
|
551 | 551 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
552 | 552 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
553 | 553 | [1] |
|
554 | 554 | $ aftermerge |
|
555 | 555 | # cat f |
|
556 | 556 | revision 1 |
|
557 | 557 | space |
|
558 | 558 | # hg stat |
|
559 | 559 | M f |
|
560 | 560 | ? f.orig |
|
561 | 561 | # hg resolve --list |
|
562 | 562 | U f |
|
563 | 563 | |
|
564 | 564 | merge-patterns specifies executable not found in PATH and gets warning: |
|
565 | 565 | |
|
566 | 566 | $ beforemerge |
|
567 | 567 | [merge-tools] |
|
568 | 568 | false.whatever= |
|
569 | 569 | true.priority=1 |
|
570 | 570 | true.executable=cat |
|
571 | 571 | # hg update -C 1 |
|
572 | 572 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool |
|
573 | 573 | couldn't find merge tool true (for pattern f) |
|
574 | 574 | merging f |
|
575 | 575 | couldn't find merge tool true (for pattern f) |
|
576 | 576 | merging f failed! |
|
577 | 577 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
578 | 578 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
579 | 579 | [1] |
|
580 | 580 | $ aftermerge |
|
581 | 581 | # cat f |
|
582 | 582 | revision 1 |
|
583 | 583 | space |
|
584 | 584 | # hg stat |
|
585 | 585 | M f |
|
586 | 586 | ? f.orig |
|
587 | 587 | # hg resolve --list |
|
588 | 588 | U f |
|
589 | 589 | |
|
590 | 590 | merge-patterns specifies executable with bogus path and gets warning: |
|
591 | 591 | |
|
592 | 592 | $ beforemerge |
|
593 | 593 | [merge-tools] |
|
594 | 594 | false.whatever= |
|
595 | 595 | true.priority=1 |
|
596 | 596 | true.executable=cat |
|
597 | 597 | # hg update -C 1 |
|
598 | 598 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool |
|
599 | 599 | couldn't find merge tool true (for pattern f) |
|
600 | 600 | merging f |
|
601 | 601 | couldn't find merge tool true (for pattern f) |
|
602 | 602 | merging f failed! |
|
603 | 603 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
604 | 604 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
605 | 605 | [1] |
|
606 | 606 | $ aftermerge |
|
607 | 607 | # cat f |
|
608 | 608 | revision 1 |
|
609 | 609 | space |
|
610 | 610 | # hg stat |
|
611 | 611 | M f |
|
612 | 612 | ? f.orig |
|
613 | 613 | # hg resolve --list |
|
614 | 614 | U f |
|
615 | 615 | |
|
616 | 616 | ui.merge overrules priority |
|
617 | 617 | |
|
618 | 618 | ui.merge specifies false: |
|
619 | 619 | |
|
620 | 620 | $ beforemerge |
|
621 | 621 | [merge-tools] |
|
622 | 622 | false.whatever= |
|
623 | 623 | true.priority=1 |
|
624 | 624 | true.executable=cat |
|
625 | 625 | # hg update -C 1 |
|
626 | 626 | $ hg merge -r 2 --config ui.merge=false |
|
627 | 627 | merging f |
|
628 | 628 | merging f failed! |
|
629 | 629 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
630 | 630 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
631 | 631 | [1] |
|
632 | 632 | $ aftermerge |
|
633 | 633 | # cat f |
|
634 | 634 | revision 1 |
|
635 | 635 | space |
|
636 | 636 | # hg stat |
|
637 | 637 | M f |
|
638 | 638 | ? f.orig |
|
639 | 639 | # hg resolve --list |
|
640 | 640 | U f |
|
641 | 641 | |
|
642 | 642 | ui.merge specifies internal:fail: |
|
643 | 643 | |
|
644 | 644 | $ beforemerge |
|
645 | 645 | [merge-tools] |
|
646 | 646 | false.whatever= |
|
647 | 647 | true.priority=1 |
|
648 | 648 | true.executable=cat |
|
649 | 649 | # hg update -C 1 |
|
650 | 650 | $ hg merge -r 2 --config ui.merge=internal:fail |
|
651 | 651 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
652 | 652 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
653 | 653 | [1] |
|
654 | 654 | $ aftermerge |
|
655 | 655 | # cat f |
|
656 | 656 | revision 1 |
|
657 | 657 | space |
|
658 | 658 | # hg stat |
|
659 | 659 | M f |
|
660 | 660 | # hg resolve --list |
|
661 | 661 | U f |
|
662 | 662 | |
|
663 | 663 | ui.merge specifies :local (without internal prefix): |
|
664 | 664 | |
|
665 | 665 | $ beforemerge |
|
666 | 666 | [merge-tools] |
|
667 | 667 | false.whatever= |
|
668 | 668 | true.priority=1 |
|
669 | 669 | true.executable=cat |
|
670 | 670 | # hg update -C 1 |
|
671 | 671 | $ hg merge -r 2 --config ui.merge=:local |
|
672 | 672 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
673 | 673 | (branch merge, don't forget to commit) |
|
674 | 674 | $ aftermerge |
|
675 | 675 | # cat f |
|
676 | 676 | revision 1 |
|
677 | 677 | space |
|
678 | 678 | # hg stat |
|
679 | 679 | M f |
|
680 | 680 | # hg resolve --list |
|
681 | 681 | R f |
|
682 | 682 | |
|
683 | 683 | ui.merge specifies internal:other: |
|
684 | 684 | |
|
685 | 685 | $ beforemerge |
|
686 | 686 | [merge-tools] |
|
687 | 687 | false.whatever= |
|
688 | 688 | true.priority=1 |
|
689 | 689 | true.executable=cat |
|
690 | 690 | # hg update -C 1 |
|
691 | 691 | $ hg merge -r 2 --config ui.merge=internal:other |
|
692 | 692 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
693 | 693 | (branch merge, don't forget to commit) |
|
694 | 694 | $ aftermerge |
|
695 | 695 | # cat f |
|
696 | 696 | revision 2 |
|
697 | 697 | space |
|
698 | 698 | # hg stat |
|
699 | 699 | M f |
|
700 | 700 | # hg resolve --list |
|
701 | 701 | R f |
|
702 | 702 | |
|
703 | 703 | ui.merge specifies internal:prompt: |
|
704 | 704 | |
|
705 | 705 | $ beforemerge |
|
706 | 706 | [merge-tools] |
|
707 | 707 | false.whatever= |
|
708 | 708 | true.priority=1 |
|
709 | 709 | true.executable=cat |
|
710 | 710 | # hg update -C 1 |
|
711 | 711 | $ hg merge -r 2 --config ui.merge=internal:prompt |
|
712 | 712 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u |
|
713 | 713 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
714 | 714 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
715 | 715 | [1] |
|
716 | 716 | $ aftermerge |
|
717 | 717 | # cat f |
|
718 | 718 | revision 1 |
|
719 | 719 | space |
|
720 | 720 | # hg stat |
|
721 | 721 | M f |
|
722 | 722 | # hg resolve --list |
|
723 | 723 | U f |
|
724 | 724 | |
|
725 | 725 | ui.merge specifies :prompt, with 'leave unresolved' chosen |
|
726 | 726 | |
|
727 | 727 | $ beforemerge |
|
728 | 728 | [merge-tools] |
|
729 | 729 | false.whatever= |
|
730 | 730 | true.priority=1 |
|
731 | 731 | true.executable=cat |
|
732 | 732 | # hg update -C 1 |
|
733 | 733 | $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF |
|
734 | 734 | > u |
|
735 | 735 | > EOF |
|
736 | 736 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u |
|
737 | 737 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
738 | 738 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
739 | 739 | [1] |
|
740 | 740 | $ aftermerge |
|
741 | 741 | # cat f |
|
742 | 742 | revision 1 |
|
743 | 743 | space |
|
744 | 744 | # hg stat |
|
745 | 745 | M f |
|
746 | 746 | # hg resolve --list |
|
747 | 747 | U f |
|
748 | 748 | |
|
749 | 749 | prompt with EOF |
|
750 | 750 | |
|
751 | 751 | $ beforemerge |
|
752 | 752 | [merge-tools] |
|
753 | 753 | false.whatever= |
|
754 | 754 | true.priority=1 |
|
755 | 755 | true.executable=cat |
|
756 | 756 | # hg update -C 1 |
|
757 | 757 | $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true |
|
758 | 758 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? |
|
759 | 759 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
760 | 760 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
761 | 761 | [1] |
|
762 | 762 | $ aftermerge |
|
763 | 763 | # cat f |
|
764 | 764 | revision 1 |
|
765 | 765 | space |
|
766 | 766 | # hg stat |
|
767 | 767 | M f |
|
768 | 768 | # hg resolve --list |
|
769 | 769 | U f |
|
770 | 770 | $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true |
|
771 | 771 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? |
|
772 | 772 | [1] |
|
773 | 773 | $ aftermerge |
|
774 | 774 | # cat f |
|
775 | 775 | revision 1 |
|
776 | 776 | space |
|
777 | 777 | # hg stat |
|
778 | 778 | M f |
|
779 | 779 | ? f.orig |
|
780 | 780 | # hg resolve --list |
|
781 | 781 | U f |
|
782 | 782 | $ rm f |
|
783 | 783 | $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true |
|
784 | 784 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? |
|
785 | 785 | [1] |
|
786 | 786 | $ aftermerge |
|
787 | 787 | # cat f |
|
788 | 788 | revision 1 |
|
789 | 789 | space |
|
790 | 790 | # hg stat |
|
791 | 791 | M f |
|
792 | 792 | # hg resolve --list |
|
793 | 793 | U f |
|
794 | 794 | $ hg resolve --all --config ui.merge=internal:prompt |
|
795 | 795 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u |
|
796 | 796 | [1] |
|
797 | 797 | $ aftermerge |
|
798 | 798 | # cat f |
|
799 | 799 | revision 1 |
|
800 | 800 | space |
|
801 | 801 | # hg stat |
|
802 | 802 | M f |
|
803 | 803 | ? f.orig |
|
804 | 804 | # hg resolve --list |
|
805 | 805 | U f |
|
806 | 806 | |
|
807 | 807 | ui.merge specifies internal:dump: |
|
808 | 808 | |
|
809 | 809 | $ beforemerge |
|
810 | 810 | [merge-tools] |
|
811 | 811 | false.whatever= |
|
812 | 812 | true.priority=1 |
|
813 | 813 | true.executable=cat |
|
814 | 814 | # hg update -C 1 |
|
815 | 815 | $ hg merge -r 2 --config ui.merge=internal:dump |
|
816 | 816 | merging f |
|
817 | 817 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
818 | 818 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
819 | 819 | [1] |
|
820 | 820 | $ aftermerge |
|
821 | 821 | # cat f |
|
822 | 822 | revision 1 |
|
823 | 823 | space |
|
824 | 824 | # hg stat |
|
825 | 825 | M f |
|
826 | 826 | ? f.base |
|
827 | 827 | ? f.local |
|
828 | 828 | ? f.orig |
|
829 | 829 | ? f.other |
|
830 | 830 | # hg resolve --list |
|
831 | 831 | U f |
|
832 | 832 | |
|
833 | 833 | f.base: |
|
834 | 834 | |
|
835 | 835 | $ cat f.base |
|
836 | 836 | revision 0 |
|
837 | 837 | space |
|
838 | 838 | |
|
839 | 839 | f.local: |
|
840 | 840 | |
|
841 | 841 | $ cat f.local |
|
842 | 842 | revision 1 |
|
843 | 843 | space |
|
844 | 844 | |
|
845 | 845 | f.other: |
|
846 | 846 | |
|
847 | 847 | $ cat f.other |
|
848 | 848 | revision 2 |
|
849 | 849 | space |
|
850 | 850 | $ rm f.base f.local f.other |
|
851 | 851 | |
|
852 | 852 | check that internal:dump doesn't dump files if premerge runs |
|
853 | 853 | successfully |
|
854 | 854 | |
|
855 | 855 | $ beforemerge |
|
856 | 856 | [merge-tools] |
|
857 | 857 | false.whatever= |
|
858 | 858 | true.priority=1 |
|
859 | 859 | true.executable=cat |
|
860 | 860 | # hg update -C 1 |
|
861 | 861 | $ hg merge -r 3 --config ui.merge=internal:dump |
|
862 | 862 | merging f |
|
863 | 863 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
864 | 864 | (branch merge, don't forget to commit) |
|
865 | 865 | |
|
866 | 866 | $ aftermerge |
|
867 | 867 | # cat f |
|
868 | 868 | revision 1 |
|
869 | 869 | space |
|
870 | 870 | revision 3 |
|
871 | 871 | # hg stat |
|
872 | 872 | M f |
|
873 | 873 | # hg resolve --list |
|
874 | 874 | R f |
|
875 | 875 | |
|
876 | 876 | check that internal:forcedump dumps files, even if local and other can |
|
877 | 877 | be merged easily |
|
878 | 878 | |
|
879 | 879 | $ beforemerge |
|
880 | 880 | [merge-tools] |
|
881 | 881 | false.whatever= |
|
882 | 882 | true.priority=1 |
|
883 | 883 | true.executable=cat |
|
884 | 884 | # hg update -C 1 |
|
885 | 885 | $ hg merge -r 3 --config ui.merge=internal:forcedump |
|
886 | 886 | merging f |
|
887 | 887 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
888 | 888 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
889 | 889 | [1] |
|
890 | 890 | $ aftermerge |
|
891 | 891 | # cat f |
|
892 | 892 | revision 1 |
|
893 | 893 | space |
|
894 | 894 | # hg stat |
|
895 | 895 | M f |
|
896 | 896 | ? f.base |
|
897 | 897 | ? f.local |
|
898 | 898 | ? f.orig |
|
899 | 899 | ? f.other |
|
900 | 900 | # hg resolve --list |
|
901 | 901 | U f |
|
902 | 902 | |
|
903 | 903 | $ cat f.base |
|
904 | 904 | revision 0 |
|
905 | 905 | space |
|
906 | 906 | |
|
907 | 907 | $ cat f.local |
|
908 | 908 | revision 1 |
|
909 | 909 | space |
|
910 | 910 | |
|
911 | 911 | $ cat f.other |
|
912 | 912 | revision 0 |
|
913 | 913 | space |
|
914 | 914 | revision 3 |
|
915 | 915 | |
|
916 | 916 | $ rm -f f.base f.local f.other |
|
917 | 917 | |
|
918 | 918 | ui.merge specifies internal:other but is overruled by pattern for false: |
|
919 | 919 | |
|
920 | 920 | $ beforemerge |
|
921 | 921 | [merge-tools] |
|
922 | 922 | false.whatever= |
|
923 | 923 | true.priority=1 |
|
924 | 924 | true.executable=cat |
|
925 | 925 | # hg update -C 1 |
|
926 | 926 | $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false |
|
927 | 927 | merging f |
|
928 | 928 | merging f failed! |
|
929 | 929 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
930 | 930 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
931 | 931 | [1] |
|
932 | 932 | $ aftermerge |
|
933 | 933 | # cat f |
|
934 | 934 | revision 1 |
|
935 | 935 | space |
|
936 | 936 | # hg stat |
|
937 | 937 | M f |
|
938 | 938 | ? f.orig |
|
939 | 939 | # hg resolve --list |
|
940 | 940 | U f |
|
941 | 941 | |
|
942 | 942 | Premerge |
|
943 | 943 | |
|
944 | 944 | ui.merge specifies internal:other but is overruled by --tool=false |
|
945 | 945 | |
|
946 | 946 | $ beforemerge |
|
947 | 947 | [merge-tools] |
|
948 | 948 | false.whatever= |
|
949 | 949 | true.priority=1 |
|
950 | 950 | true.executable=cat |
|
951 | 951 | # hg update -C 1 |
|
952 | 952 | $ hg merge -r 2 --config ui.merge=internal:other --tool=false |
|
953 | 953 | merging f |
|
954 | 954 | merging f failed! |
|
955 | 955 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
956 | 956 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
957 | 957 | [1] |
|
958 | 958 | $ aftermerge |
|
959 | 959 | # cat f |
|
960 | 960 | revision 1 |
|
961 | 961 | space |
|
962 | 962 | # hg stat |
|
963 | 963 | M f |
|
964 | 964 | ? f.orig |
|
965 | 965 | # hg resolve --list |
|
966 | 966 | U f |
|
967 | 967 | |
|
968 | 968 | HGMERGE specifies internal:other but is overruled by --tool=false |
|
969 | 969 | |
|
970 | 970 | $ HGMERGE=internal:other ; export HGMERGE |
|
971 | 971 | $ beforemerge |
|
972 | 972 | [merge-tools] |
|
973 | 973 | false.whatever= |
|
974 | 974 | true.priority=1 |
|
975 | 975 | true.executable=cat |
|
976 | 976 | # hg update -C 1 |
|
977 | 977 | $ hg merge -r 2 --tool=false |
|
978 | 978 | merging f |
|
979 | 979 | merging f failed! |
|
980 | 980 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
981 | 981 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
982 | 982 | [1] |
|
983 | 983 | $ aftermerge |
|
984 | 984 | # cat f |
|
985 | 985 | revision 1 |
|
986 | 986 | space |
|
987 | 987 | # hg stat |
|
988 | 988 | M f |
|
989 | 989 | ? f.orig |
|
990 | 990 | # hg resolve --list |
|
991 | 991 | U f |
|
992 | 992 | |
|
993 | 993 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests |
|
994 | 994 | |
|
995 | 995 | update is a merge ... |
|
996 | 996 | |
|
997 | 997 | (this also tests that files reverted with '--rev REV' are treated as |
|
998 | 998 | "modified", even if none of mode, size and timestamp of them isn't |
|
999 | 999 | changed on the filesystem (see also issue4583)) |
|
1000 | 1000 | |
|
1001 | 1001 | $ cat >> $HGRCPATH <<EOF |
|
1002 | 1002 | > [fakedirstatewritetime] |
|
1003 | 1003 | > # emulate invoking dirstate.write() via repo.status() |
|
1004 | 1004 | > # at 2000-01-01 00:00 |
|
1005 | 1005 | > fakenow = 200001010000 |
|
1006 | 1006 | > EOF |
|
1007 | 1007 | |
|
1008 | 1008 | $ beforemerge |
|
1009 | 1009 | [merge-tools] |
|
1010 | 1010 | false.whatever= |
|
1011 | 1011 | true.priority=1 |
|
1012 | 1012 | true.executable=cat |
|
1013 | 1013 | # hg update -C 1 |
|
1014 | 1014 | $ hg update -q 0 |
|
1015 | 1015 | $ f -s f |
|
1016 | 1016 | f: size=17 |
|
1017 | 1017 | $ touch -t 200001010000 f |
|
1018 | 1018 | $ hg debugrebuildstate |
|
1019 | 1019 | $ cat >> $HGRCPATH <<EOF |
|
1020 | 1020 | > [extensions] |
|
1021 | 1021 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
1022 | 1022 | > EOF |
|
1023 | 1023 | $ hg revert -q -r 1 . |
|
1024 | 1024 | $ cat >> $HGRCPATH <<EOF |
|
1025 | 1025 | > [extensions] |
|
1026 | 1026 | > fakedirstatewritetime = ! |
|
1027 | 1027 | > EOF |
|
1028 | 1028 | $ f -s f |
|
1029 | 1029 | f: size=17 |
|
1030 | 1030 | $ touch -t 200001010000 f |
|
1031 | 1031 | $ hg status f |
|
1032 | 1032 | M f |
|
1033 | 1033 | $ hg update -r 2 |
|
1034 | 1034 | merging f |
|
1035 | 1035 | revision 1 |
|
1036 | 1036 | space |
|
1037 | 1037 | revision 0 |
|
1038 | 1038 | space |
|
1039 | 1039 | revision 2 |
|
1040 | 1040 | space |
|
1041 | 1041 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1042 | 1042 | $ aftermerge |
|
1043 | 1043 | # cat f |
|
1044 | 1044 | revision 1 |
|
1045 | 1045 | space |
|
1046 | 1046 | # hg stat |
|
1047 | 1047 | M f |
|
1048 | 1048 | # hg resolve --list |
|
1049 | 1049 | R f |
|
1050 | 1050 | |
|
1051 | 1051 | update should also have --tool |
|
1052 | 1052 | |
|
1053 | 1053 | $ beforemerge |
|
1054 | 1054 | [merge-tools] |
|
1055 | 1055 | false.whatever= |
|
1056 | 1056 | true.priority=1 |
|
1057 | 1057 | true.executable=cat |
|
1058 | 1058 | # hg update -C 1 |
|
1059 | 1059 | $ hg update -q 0 |
|
1060 | 1060 | $ f -s f |
|
1061 | 1061 | f: size=17 |
|
1062 | 1062 | $ touch -t 200001010000 f |
|
1063 | 1063 | $ hg debugrebuildstate |
|
1064 | 1064 | $ cat >> $HGRCPATH <<EOF |
|
1065 | 1065 | > [extensions] |
|
1066 | 1066 | > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py |
|
1067 | 1067 | > EOF |
|
1068 | 1068 | $ hg revert -q -r 1 . |
|
1069 | 1069 | $ cat >> $HGRCPATH <<EOF |
|
1070 | 1070 | > [extensions] |
|
1071 | 1071 | > fakedirstatewritetime = ! |
|
1072 | 1072 | > EOF |
|
1073 | 1073 | $ f -s f |
|
1074 | 1074 | f: size=17 |
|
1075 | 1075 | $ touch -t 200001010000 f |
|
1076 | 1076 | $ hg status f |
|
1077 | 1077 | M f |
|
1078 | 1078 | $ hg update -r 2 --tool false |
|
1079 | 1079 | merging f |
|
1080 | 1080 | merging f failed! |
|
1081 | 1081 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1082 | 1082 | use 'hg resolve' to retry unresolved file merges |
|
1083 | 1083 | [1] |
|
1084 | 1084 | $ aftermerge |
|
1085 | 1085 | # cat f |
|
1086 | 1086 | revision 1 |
|
1087 | 1087 | space |
|
1088 | 1088 | # hg stat |
|
1089 | 1089 | M f |
|
1090 | 1090 | ? f.orig |
|
1091 | 1091 | # hg resolve --list |
|
1092 | 1092 | U f |
|
1093 | 1093 | |
|
1094 | 1094 | Default is silent simplemerge: |
|
1095 | 1095 | |
|
1096 | 1096 | $ beforemerge |
|
1097 | 1097 | [merge-tools] |
|
1098 | 1098 | false.whatever= |
|
1099 | 1099 | true.priority=1 |
|
1100 | 1100 | true.executable=cat |
|
1101 | 1101 | # hg update -C 1 |
|
1102 | 1102 | $ hg merge -r 3 |
|
1103 | 1103 | merging f |
|
1104 | 1104 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1105 | 1105 | (branch merge, don't forget to commit) |
|
1106 | 1106 | $ aftermerge |
|
1107 | 1107 | # cat f |
|
1108 | 1108 | revision 1 |
|
1109 | 1109 | space |
|
1110 | 1110 | revision 3 |
|
1111 | 1111 | # hg stat |
|
1112 | 1112 | M f |
|
1113 | 1113 | # hg resolve --list |
|
1114 | 1114 | R f |
|
1115 | 1115 | |
|
1116 | 1116 | .premerge=True is same: |
|
1117 | 1117 | |
|
1118 | 1118 | $ beforemerge |
|
1119 | 1119 | [merge-tools] |
|
1120 | 1120 | false.whatever= |
|
1121 | 1121 | true.priority=1 |
|
1122 | 1122 | true.executable=cat |
|
1123 | 1123 | # hg update -C 1 |
|
1124 | 1124 | $ hg merge -r 3 --config merge-tools.true.premerge=True |
|
1125 | 1125 | merging f |
|
1126 | 1126 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1127 | 1127 | (branch merge, don't forget to commit) |
|
1128 | 1128 | $ aftermerge |
|
1129 | 1129 | # cat f |
|
1130 | 1130 | revision 1 |
|
1131 | 1131 | space |
|
1132 | 1132 | revision 3 |
|
1133 | 1133 | # hg stat |
|
1134 | 1134 | M f |
|
1135 | 1135 | # hg resolve --list |
|
1136 | 1136 | R f |
|
1137 | 1137 | |
|
1138 | 1138 | .premerge=False executes merge-tool: |
|
1139 | 1139 | |
|
1140 | 1140 | $ beforemerge |
|
1141 | 1141 | [merge-tools] |
|
1142 | 1142 | false.whatever= |
|
1143 | 1143 | true.priority=1 |
|
1144 | 1144 | true.executable=cat |
|
1145 | 1145 | # hg update -C 1 |
|
1146 | 1146 | $ hg merge -r 3 --config merge-tools.true.premerge=False |
|
1147 | 1147 | merging f |
|
1148 | 1148 | revision 1 |
|
1149 | 1149 | space |
|
1150 | 1150 | revision 0 |
|
1151 | 1151 | space |
|
1152 | 1152 | revision 0 |
|
1153 | 1153 | space |
|
1154 | 1154 | revision 3 |
|
1155 | 1155 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1156 | 1156 | (branch merge, don't forget to commit) |
|
1157 | 1157 | $ aftermerge |
|
1158 | 1158 | # cat f |
|
1159 | 1159 | revision 1 |
|
1160 | 1160 | space |
|
1161 | 1161 | # hg stat |
|
1162 | 1162 | M f |
|
1163 | 1163 | # hg resolve --list |
|
1164 | 1164 | R f |
|
1165 | 1165 | |
|
1166 | 1166 | premerge=keep keeps conflict markers in: |
|
1167 | 1167 | |
|
1168 | 1168 | $ beforemerge |
|
1169 | 1169 | [merge-tools] |
|
1170 | 1170 | false.whatever= |
|
1171 | 1171 | true.priority=1 |
|
1172 | 1172 | true.executable=cat |
|
1173 | 1173 | # hg update -C 1 |
|
1174 | 1174 | $ hg merge -r 4 --config merge-tools.true.premerge=keep |
|
1175 | 1175 | merging f |
|
1176 | 1176 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
1177 | 1177 | revision 1 |
|
1178 | 1178 | space |
|
1179 | 1179 | ======= |
|
1180 | 1180 | revision 4 |
|
1181 | 1181 | >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 |
|
1182 | 1182 | revision 0 |
|
1183 | 1183 | space |
|
1184 | 1184 | revision 4 |
|
1185 | 1185 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1186 | 1186 | (branch merge, don't forget to commit) |
|
1187 | 1187 | $ aftermerge |
|
1188 | 1188 | # cat f |
|
1189 | 1189 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
1190 | 1190 | revision 1 |
|
1191 | 1191 | space |
|
1192 | 1192 | ======= |
|
1193 | 1193 | revision 4 |
|
1194 | 1194 | >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 |
|
1195 | 1195 | # hg stat |
|
1196 | 1196 | M f |
|
1197 | 1197 | # hg resolve --list |
|
1198 | 1198 | R f |
|
1199 | 1199 | |
|
1200 | 1200 | premerge=keep-merge3 keeps conflict markers with base content: |
|
1201 | 1201 | |
|
1202 | 1202 | $ beforemerge |
|
1203 | 1203 | [merge-tools] |
|
1204 | 1204 | false.whatever= |
|
1205 | 1205 | true.priority=1 |
|
1206 | 1206 | true.executable=cat |
|
1207 | 1207 | # hg update -C 1 |
|
1208 | 1208 | $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3 |
|
1209 | 1209 | merging f |
|
1210 | 1210 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
1211 | 1211 | revision 1 |
|
1212 | 1212 | space |
|
1213 | 1213 | ||||||| base |
|
1214 | 1214 | revision 0 |
|
1215 | 1215 | space |
|
1216 | 1216 | ======= |
|
1217 | 1217 | revision 4 |
|
1218 | 1218 | >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 |
|
1219 | 1219 | revision 0 |
|
1220 | 1220 | space |
|
1221 | 1221 | revision 4 |
|
1222 | 1222 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1223 | 1223 | (branch merge, don't forget to commit) |
|
1224 | 1224 | $ aftermerge |
|
1225 | 1225 | # cat f |
|
1226 | 1226 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
1227 | 1227 | revision 1 |
|
1228 | 1228 | space |
|
1229 | 1229 | ||||||| base |
|
1230 | 1230 | revision 0 |
|
1231 | 1231 | space |
|
1232 | 1232 | ======= |
|
1233 | 1233 | revision 4 |
|
1234 | 1234 | >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 |
|
1235 | 1235 | # hg stat |
|
1236 | 1236 | M f |
|
1237 | 1237 | # hg resolve --list |
|
1238 | 1238 | R f |
|
1239 | 1239 | |
|
1240 | 1240 | premerge=keep respects ui.mergemarkers=basic: |
|
1241 | 1241 | |
|
1242 | 1242 | $ beforemerge |
|
1243 | 1243 | [merge-tools] |
|
1244 | 1244 | false.whatever= |
|
1245 | 1245 | true.priority=1 |
|
1246 | 1246 | true.executable=cat |
|
1247 | 1247 | # hg update -C 1 |
|
1248 | 1248 | $ hg merge -r 4 --config merge-tools.true.premerge=keep --config ui.mergemarkers=basic |
|
1249 | 1249 | merging f |
|
1250 | 1250 | <<<<<<< working copy |
|
1251 | 1251 | revision 1 |
|
1252 | 1252 | space |
|
1253 | 1253 | ======= |
|
1254 | 1254 | revision 4 |
|
1255 | 1255 | >>>>>>> merge rev |
|
1256 | 1256 | revision 0 |
|
1257 | 1257 | space |
|
1258 | 1258 | revision 4 |
|
1259 | 1259 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1260 | 1260 | (branch merge, don't forget to commit) |
|
1261 | 1261 | $ aftermerge |
|
1262 | 1262 | # cat f |
|
1263 | 1263 | <<<<<<< working copy |
|
1264 | 1264 | revision 1 |
|
1265 | 1265 | space |
|
1266 | 1266 | ======= |
|
1267 | 1267 | revision 4 |
|
1268 | 1268 | >>>>>>> merge rev |
|
1269 | 1269 | # hg stat |
|
1270 | 1270 | M f |
|
1271 | 1271 | # hg resolve --list |
|
1272 | 1272 | R f |
|
1273 | 1273 | |
|
1274 | 1274 | premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed: |
|
1275 | 1275 | |
|
1276 | 1276 | $ beforemerge |
|
1277 | 1277 | [merge-tools] |
|
1278 | 1278 | false.whatever= |
|
1279 | 1279 | true.priority=1 |
|
1280 | 1280 | true.executable=cat |
|
1281 | 1281 | # hg update -C 1 |
|
1282 | 1282 | $ hg merge -r 4 --config merge-tools.true.premerge=keep \ |
|
1283 | 1283 | > --config ui.mergemarkers=basic \ |
|
1284 | 1284 | > --config merge-tools.true.mergemarkers=detailed |
|
1285 | 1285 | merging f |
|
1286 | 1286 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
1287 | 1287 | revision 1 |
|
1288 | 1288 | space |
|
1289 | 1289 | ======= |
|
1290 | 1290 | revision 4 |
|
1291 | 1291 | >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 |
|
1292 | 1292 | revision 0 |
|
1293 | 1293 | space |
|
1294 | 1294 | revision 4 |
|
1295 | 1295 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1296 | 1296 | (branch merge, don't forget to commit) |
|
1297 | 1297 | $ aftermerge |
|
1298 | 1298 | # cat f |
|
1299 | 1299 | <<<<<<< working copy: ef83787e2614 - test: revision 1 |
|
1300 | 1300 | revision 1 |
|
1301 | 1301 | space |
|
1302 | 1302 | ======= |
|
1303 | 1303 | revision 4 |
|
1304 | 1304 | >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 |
|
1305 | 1305 | # hg stat |
|
1306 | 1306 | M f |
|
1307 | 1307 | # hg resolve --list |
|
1308 | 1308 | R f |
|
1309 | 1309 | |
|
1310 | 1310 | premerge=keep respects ui.mergemarkertemplate instead of |
|
1311 | 1311 | true.mergemarkertemplate if true.mergemarkers=basic: |
|
1312 | 1312 | |
|
1313 | 1313 | $ beforemerge |
|
1314 | 1314 | [merge-tools] |
|
1315 | 1315 | false.whatever= |
|
1316 | 1316 | true.priority=1 |
|
1317 | 1317 | true.executable=cat |
|
1318 | 1318 | # hg update -C 1 |
|
1319 | 1319 | $ hg merge -r 4 --config merge-tools.true.premerge=keep \ |
|
1320 | 1320 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1321 | 1321 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' |
|
1322 | 1322 | merging f |
|
1323 | 1323 | <<<<<<< working copy: uitmpl 1 |
|
1324 | 1324 | revision 1 |
|
1325 | 1325 | space |
|
1326 | 1326 | ======= |
|
1327 | 1327 | revision 4 |
|
1328 | 1328 | >>>>>>> merge rev: uitmpl 4 |
|
1329 | 1329 | revision 0 |
|
1330 | 1330 | space |
|
1331 | 1331 | revision 4 |
|
1332 | 1332 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1333 | 1333 | (branch merge, don't forget to commit) |
|
1334 | 1334 | $ aftermerge |
|
1335 | 1335 | # cat f |
|
1336 | 1336 | <<<<<<< working copy: uitmpl 1 |
|
1337 | 1337 | revision 1 |
|
1338 | 1338 | space |
|
1339 | 1339 | ======= |
|
1340 | 1340 | revision 4 |
|
1341 | 1341 | >>>>>>> merge rev: uitmpl 4 |
|
1342 | 1342 | # hg stat |
|
1343 | 1343 | M f |
|
1344 | 1344 | # hg resolve --list |
|
1345 | 1345 | R f |
|
1346 | 1346 | |
|
1347 | 1347 | premerge=keep respects true.mergemarkertemplate instead of |
|
1348 | 1348 | true.mergemarkertemplate if true.mergemarkers=detailed: |
|
1349 | 1349 | |
|
1350 | 1350 | $ beforemerge |
|
1351 | 1351 | [merge-tools] |
|
1352 | 1352 | false.whatever= |
|
1353 | 1353 | true.priority=1 |
|
1354 | 1354 | true.executable=cat |
|
1355 | 1355 | # hg update -C 1 |
|
1356 | 1356 | $ hg merge -r 4 --config merge-tools.true.premerge=keep \ |
|
1357 | 1357 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1358 | 1358 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ |
|
1359 | 1359 | > --config merge-tools.true.mergemarkers=detailed |
|
1360 | 1360 | merging f |
|
1361 | 1361 | <<<<<<< working copy: tooltmpl ef83787e2614 |
|
1362 | 1362 | revision 1 |
|
1363 | 1363 | space |
|
1364 | 1364 | ======= |
|
1365 | 1365 | revision 4 |
|
1366 | 1366 | >>>>>>> merge rev: tooltmpl 81448d39c9a0 |
|
1367 | 1367 | revision 0 |
|
1368 | 1368 | space |
|
1369 | 1369 | revision 4 |
|
1370 | 1370 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1371 | 1371 | (branch merge, don't forget to commit) |
|
1372 | 1372 | $ aftermerge |
|
1373 | 1373 | # cat f |
|
1374 | 1374 | <<<<<<< working copy: tooltmpl ef83787e2614 |
|
1375 | 1375 | revision 1 |
|
1376 | 1376 | space |
|
1377 | 1377 | ======= |
|
1378 | 1378 | revision 4 |
|
1379 | 1379 | >>>>>>> merge rev: tooltmpl 81448d39c9a0 |
|
1380 | 1380 | # hg stat |
|
1381 | 1381 | M f |
|
1382 | 1382 | # hg resolve --list |
|
1383 | 1383 | R f |
|
1384 | 1384 | |
|
1385 | 1385 | Tool execution |
|
1386 | 1386 | |
|
1387 | 1387 | set tools.args explicit to include $base $local $other $output: |
|
1388 | 1388 | |
|
1389 | 1389 | $ beforemerge |
|
1390 | 1390 | [merge-tools] |
|
1391 | 1391 | false.whatever= |
|
1392 | 1392 | true.priority=1 |
|
1393 | 1393 | true.executable=cat |
|
1394 | 1394 | # hg update -C 1 |
|
1395 | 1395 | $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ |
|
1396 | 1396 | > | sed 's,==> .* <==,==> ... <==,g' |
|
1397 | 1397 | merging f |
|
1398 | 1398 | ==> ... <== |
|
1399 | 1399 | revision 0 |
|
1400 | 1400 | space |
|
1401 | 1401 | |
|
1402 | 1402 | ==> ... <== |
|
1403 | 1403 | revision 1 |
|
1404 | 1404 | space |
|
1405 | 1405 | |
|
1406 | 1406 | ==> ... <== |
|
1407 | 1407 | revision 2 |
|
1408 | 1408 | space |
|
1409 | 1409 | |
|
1410 | 1410 | ==> ... <== |
|
1411 | 1411 | revision 1 |
|
1412 | 1412 | space |
|
1413 | 1413 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1414 | 1414 | (branch merge, don't forget to commit) |
|
1415 | 1415 | $ aftermerge |
|
1416 | 1416 | # cat f |
|
1417 | 1417 | revision 1 |
|
1418 | 1418 | space |
|
1419 | 1419 | # hg stat |
|
1420 | 1420 | M f |
|
1421 | 1421 | # hg resolve --list |
|
1422 | 1422 | R f |
|
1423 | 1423 | |
|
1424 | 1424 | Merge with "echo mergeresult > $local": |
|
1425 | 1425 | |
|
1426 | 1426 | $ beforemerge |
|
1427 | 1427 | [merge-tools] |
|
1428 | 1428 | false.whatever= |
|
1429 | 1429 | true.priority=1 |
|
1430 | 1430 | true.executable=cat |
|
1431 | 1431 | # hg update -C 1 |
|
1432 | 1432 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local' |
|
1433 | 1433 | merging f |
|
1434 | 1434 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1435 | 1435 | (branch merge, don't forget to commit) |
|
1436 | 1436 | $ aftermerge |
|
1437 | 1437 | # cat f |
|
1438 | 1438 | mergeresult |
|
1439 | 1439 | # hg stat |
|
1440 | 1440 | M f |
|
1441 | 1441 | # hg resolve --list |
|
1442 | 1442 | R f |
|
1443 | 1443 | |
|
1444 | 1444 | - and $local is the file f: |
|
1445 | 1445 | |
|
1446 | 1446 | $ beforemerge |
|
1447 | 1447 | [merge-tools] |
|
1448 | 1448 | false.whatever= |
|
1449 | 1449 | true.priority=1 |
|
1450 | 1450 | true.executable=cat |
|
1451 | 1451 | # hg update -C 1 |
|
1452 | 1452 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f' |
|
1453 | 1453 | merging f |
|
1454 | 1454 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1455 | 1455 | (branch merge, don't forget to commit) |
|
1456 | 1456 | $ aftermerge |
|
1457 | 1457 | # cat f |
|
1458 | 1458 | mergeresult |
|
1459 | 1459 | # hg stat |
|
1460 | 1460 | M f |
|
1461 | 1461 | # hg resolve --list |
|
1462 | 1462 | R f |
|
1463 | 1463 | |
|
1464 | 1464 | Merge with "echo mergeresult > $output" - the variable is a bit magic: |
|
1465 | 1465 | |
|
1466 | 1466 | $ beforemerge |
|
1467 | 1467 | [merge-tools] |
|
1468 | 1468 | false.whatever= |
|
1469 | 1469 | true.priority=1 |
|
1470 | 1470 | true.executable=cat |
|
1471 | 1471 | # hg update -C 1 |
|
1472 | 1472 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output' |
|
1473 | 1473 | merging f |
|
1474 | 1474 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1475 | 1475 | (branch merge, don't forget to commit) |
|
1476 | 1476 | $ aftermerge |
|
1477 | 1477 | # cat f |
|
1478 | 1478 | mergeresult |
|
1479 | 1479 | # hg stat |
|
1480 | 1480 | M f |
|
1481 | 1481 | # hg resolve --list |
|
1482 | 1482 | R f |
|
1483 | 1483 | |
|
1484 | 1484 | Merge using tool with a path that must be quoted: |
|
1485 | 1485 | |
|
1486 | 1486 | $ beforemerge |
|
1487 | 1487 | [merge-tools] |
|
1488 | 1488 | false.whatever= |
|
1489 | 1489 | true.priority=1 |
|
1490 | 1490 | true.executable=cat |
|
1491 | 1491 | # hg update -C 1 |
|
1492 | 1492 | $ cat <<EOF > 'my merge tool' |
|
1493 | 1493 | > cat "\$1" "\$2" "\$3" > "\$4" |
|
1494 | 1494 | > EOF |
|
1495 | 1495 | $ hg --config merge-tools.true.executable='sh' \ |
|
1496 | 1496 | > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \ |
|
1497 | 1497 | > merge -r 2 |
|
1498 | 1498 | merging f |
|
1499 | 1499 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1500 | 1500 | (branch merge, don't forget to commit) |
|
1501 | 1501 | $ rm -f 'my merge tool' |
|
1502 | 1502 | $ aftermerge |
|
1503 | 1503 | # cat f |
|
1504 | 1504 | revision 0 |
|
1505 | 1505 | space |
|
1506 | 1506 | revision 1 |
|
1507 | 1507 | space |
|
1508 | 1508 | revision 2 |
|
1509 | 1509 | space |
|
1510 | 1510 | # hg stat |
|
1511 | 1511 | M f |
|
1512 | 1512 | # hg resolve --list |
|
1513 | 1513 | R f |
|
1514 | 1514 | |
|
1515 | 1515 | Merge using a tool that supports labellocal, labelother, and labelbase, checking |
|
1516 | 1516 | that they're quoted properly as well. This is using the default 'basic' |
|
1517 | 1517 | mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both |
|
1518 | 1518 | mergemarkertemplate settings: |
|
1519 | 1519 | |
|
1520 | 1520 | $ beforemerge |
|
1521 | 1521 | [merge-tools] |
|
1522 | 1522 | false.whatever= |
|
1523 | 1523 | true.priority=1 |
|
1524 | 1524 | true.executable=cat |
|
1525 | 1525 | # hg update -C 1 |
|
1526 | 1526 | $ cat <<EOF > printargs_merge_tool |
|
1527 | 1527 | > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done |
|
1528 | 1528 | > EOF |
|
1529 | 1529 | $ hg --config merge-tools.true.executable='sh' \ |
|
1530 | 1530 | > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ |
|
1531 | 1531 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ |
|
1532 | 1532 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1533 | 1533 | > --config ui.mergemarkers=detailed \ |
|
1534 | 1534 | > merge -r 2 |
|
1535 | 1535 | merging f |
|
1536 | 1536 | arg: "ll:working copy" |
|
1537 | 1537 | arg: "lo:" |
|
1538 | 1538 | arg: "merge rev" |
|
1539 | 1539 | arg: "lb:base: */f~base.*" (glob) |
|
1540 | 1540 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1541 | 1541 | (branch merge, don't forget to commit) |
|
1542 | 1542 | $ rm -f 'printargs_merge_tool' |
|
1543 | 1543 | |
|
1544 | 1544 | Same test with experimental.mergetempdirprefix set: |
|
1545 | 1545 | |
|
1546 | 1546 | $ beforemerge |
|
1547 | 1547 | [merge-tools] |
|
1548 | 1548 | false.whatever= |
|
1549 | 1549 | true.priority=1 |
|
1550 | 1550 | true.executable=cat |
|
1551 | 1551 | # hg update -C 1 |
|
1552 | 1552 | $ cat <<EOF > printargs_merge_tool |
|
1553 | 1553 | > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done |
|
1554 | 1554 | > EOF |
|
1555 | 1555 | $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \ |
|
1556 | 1556 | > --config merge-tools.true.executable='sh' \ |
|
1557 | 1557 | > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ |
|
1558 | 1558 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ |
|
1559 | 1559 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1560 | 1560 | > --config ui.mergemarkers=detailed \ |
|
1561 | 1561 | > merge -r 2 |
|
1562 | 1562 | merging f |
|
1563 | 1563 | arg: "ll:working copy" |
|
1564 | 1564 | arg: "lo:" |
|
1565 | 1565 | arg: "merge rev" |
|
1566 | 1566 | arg: "lb:base: */hgmerge.*/f~base" (glob) |
|
1567 | 1567 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1568 | 1568 | (branch merge, don't forget to commit) |
|
1569 | 1569 | $ rm -f 'printargs_merge_tool' |
|
1570 | 1570 | |
|
1571 | 1571 | Merge using a tool that supports labellocal, labelother, and labelbase, checking |
|
1572 | 1572 | that they're quoted properly as well. This is using 'detailed' mergemarkers, |
|
1573 | 1573 | even though ui.mergemarkers is 'basic', and using the tool's |
|
1574 | 1574 | mergemarkertemplate: |
|
1575 | 1575 | |
|
1576 | 1576 | $ beforemerge |
|
1577 | 1577 | [merge-tools] |
|
1578 | 1578 | false.whatever= |
|
1579 | 1579 | true.priority=1 |
|
1580 | 1580 | true.executable=cat |
|
1581 | 1581 | # hg update -C 1 |
|
1582 | 1582 | $ cat <<EOF > printargs_merge_tool |
|
1583 | 1583 | > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done |
|
1584 | 1584 | > EOF |
|
1585 | 1585 | $ hg --config merge-tools.true.executable='sh' \ |
|
1586 | 1586 | > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ |
|
1587 | 1587 | > --config merge-tools.true.mergemarkers=detailed \ |
|
1588 | 1588 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ |
|
1589 | 1589 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1590 | 1590 | > --config ui.mergemarkers=basic \ |
|
1591 | 1591 | > merge -r 2 |
|
1592 | 1592 | merging f |
|
1593 | 1593 | arg: "ll:working copy: tooltmpl ef83787e2614" |
|
1594 | 1594 | arg: "lo:" |
|
1595 | 1595 | arg: "merge rev: tooltmpl 0185f4e0cf02" |
|
1596 | 1596 | arg: "lb:base: */f~base.*" (glob) |
|
1597 | 1597 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1598 | 1598 | (branch merge, don't forget to commit) |
|
1599 | 1599 | $ rm -f 'printargs_merge_tool' |
|
1600 | 1600 | |
|
1601 | 1601 | The merge tool still gets labellocal and labelother as 'basic' even when |
|
1602 | 1602 | premerge=keep is used and has 'detailed' markers: |
|
1603 | 1603 | |
|
1604 | 1604 | $ beforemerge |
|
1605 | 1605 | [merge-tools] |
|
1606 | 1606 | false.whatever= |
|
1607 | 1607 | true.priority=1 |
|
1608 | 1608 | true.executable=cat |
|
1609 | 1609 | # hg update -C 1 |
|
1610 | 1610 | $ cat <<EOF > mytool |
|
1611 | 1611 | > echo labellocal: \"\$1\" |
|
1612 | 1612 | > echo labelother: \"\$2\" |
|
1613 | 1613 | > echo "output (arg)": \"\$3\" |
|
1614 | 1614 | > echo "output (contents)": |
|
1615 | 1615 | > cat "\$3" |
|
1616 | 1616 | > EOF |
|
1617 | 1617 | $ hg --config merge-tools.true.executable='sh' \ |
|
1618 | 1618 | > --config merge-tools.true.args='mytool $labellocal $labelother $output' \ |
|
1619 | 1619 | > --config merge-tools.true.premerge=keep \ |
|
1620 | 1620 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ |
|
1621 | 1621 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1622 | 1622 | > --config ui.mergemarkers=detailed \ |
|
1623 | 1623 | > merge -r 2 |
|
1624 | 1624 | merging f |
|
1625 | 1625 | labellocal: "working copy" |
|
1626 | 1626 | labelother: "merge rev" |
|
1627 | 1627 | output (arg): "$TESTTMP/repo/f" |
|
1628 | 1628 | output (contents): |
|
1629 | 1629 | <<<<<<< working copy: uitmpl 1 |
|
1630 | 1630 | revision 1 |
|
1631 | 1631 | ======= |
|
1632 | 1632 | revision 2 |
|
1633 | 1633 | >>>>>>> merge rev: uitmpl 2 |
|
1634 | 1634 | space |
|
1635 | 1635 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1636 | 1636 | (branch merge, don't forget to commit) |
|
1637 | 1637 | $ rm -f 'mytool' |
|
1638 | 1638 | |
|
1639 | 1639 | premerge=keep uses the *tool's* mergemarkertemplate if tool's |
|
1640 | 1640 | mergemarkers=detailed; labellocal and labelother also use the tool's template |
|
1641 | 1641 | |
|
1642 | 1642 | $ beforemerge |
|
1643 | 1643 | [merge-tools] |
|
1644 | 1644 | false.whatever= |
|
1645 | 1645 | true.priority=1 |
|
1646 | 1646 | true.executable=cat |
|
1647 | 1647 | # hg update -C 1 |
|
1648 | 1648 | $ cat <<EOF > mytool |
|
1649 | 1649 | > echo labellocal: \"\$1\" |
|
1650 | 1650 | > echo labelother: \"\$2\" |
|
1651 | 1651 | > echo "output (arg)": \"\$3\" |
|
1652 | 1652 | > echo "output (contents)": |
|
1653 | 1653 | > cat "\$3" |
|
1654 | 1654 | > EOF |
|
1655 | 1655 | $ hg --config merge-tools.true.executable='sh' \ |
|
1656 | 1656 | > --config merge-tools.true.args='mytool $labellocal $labelother $output' \ |
|
1657 | 1657 | > --config merge-tools.true.premerge=keep \ |
|
1658 | 1658 | > --config merge-tools.true.mergemarkers=detailed \ |
|
1659 | 1659 | > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ |
|
1660 | 1660 | > --config ui.mergemarkertemplate='uitmpl {rev}' \ |
|
1661 | 1661 | > --config ui.mergemarkers=detailed \ |
|
1662 | 1662 | > merge -r 2 |
|
1663 | 1663 | merging f |
|
1664 | 1664 | labellocal: "working copy: tooltmpl ef83787e2614" |
|
1665 | 1665 | labelother: "merge rev: tooltmpl 0185f4e0cf02" |
|
1666 | 1666 | output (arg): "$TESTTMP/repo/f" |
|
1667 | 1667 | output (contents): |
|
1668 | 1668 | <<<<<<< working copy: tooltmpl ef83787e2614 |
|
1669 | 1669 | revision 1 |
|
1670 | 1670 | ======= |
|
1671 | 1671 | revision 2 |
|
1672 | 1672 | >>>>>>> merge rev: tooltmpl 0185f4e0cf02 |
|
1673 | 1673 | space |
|
1674 | 1674 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1675 | 1675 | (branch merge, don't forget to commit) |
|
1676 | 1676 | $ rm -f 'mytool' |
|
1677 | 1677 | |
|
1678 | 1678 | Issue3581: Merging a filename that needs to be quoted |
|
1679 | 1679 | (This test doesn't work on Windows filesystems even on Linux, so check |
|
1680 | 1680 | for Unix-like permission) |
|
1681 | 1681 | |
|
1682 | 1682 | #if unix-permissions |
|
1683 | 1683 | $ beforemerge |
|
1684 | 1684 | [merge-tools] |
|
1685 | 1685 | false.whatever= |
|
1686 | 1686 | true.priority=1 |
|
1687 | 1687 | true.executable=cat |
|
1688 | 1688 | # hg update -C 1 |
|
1689 | 1689 | $ echo "revision 5" > '"; exit 1; echo "' |
|
1690 | 1690 | $ hg commit -Am "revision 5" |
|
1691 | 1691 | adding "; exit 1; echo " |
|
1692 | 1692 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' |
|
1693 | 1693 | $ hg update -C 1 > /dev/null |
|
1694 | 1694 | $ echo "revision 6" > '"; exit 1; echo "' |
|
1695 | 1695 | $ hg commit -Am "revision 6" |
|
1696 | 1696 | adding "; exit 1; echo " |
|
1697 | 1697 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' |
|
1698 | 1698 | created new head |
|
1699 | 1699 | $ hg merge --config merge-tools.true.executable="true" -r 5 |
|
1700 | 1700 | merging "; exit 1; echo " |
|
1701 | 1701 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1702 | 1702 | (branch merge, don't forget to commit) |
|
1703 | 1703 | $ hg update -C 1 > /dev/null |
|
1704 | 1704 | #endif |
|
1705 | 1705 | |
|
1706 | 1706 | Merge post-processing |
|
1707 | 1707 | |
|
1708 | 1708 | cat is a bad merge-tool and doesn't change: |
|
1709 | 1709 | |
|
1710 | 1710 | $ beforemerge |
|
1711 | 1711 | [merge-tools] |
|
1712 | 1712 | false.whatever= |
|
1713 | 1713 | true.priority=1 |
|
1714 | 1714 | true.executable=cat |
|
1715 | 1715 | # hg update -C 1 |
|
1716 | 1716 | $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 |
|
1717 | 1717 | merging f |
|
1718 | 1718 | revision 1 |
|
1719 | 1719 | space |
|
1720 | 1720 | revision 0 |
|
1721 | 1721 | space |
|
1722 | 1722 | revision 2 |
|
1723 | 1723 | space |
|
1724 | 1724 | output file f appears unchanged |
|
1725 | 1725 | was merge successful (yn)? n |
|
1726 | 1726 | merging f failed! |
|
1727 | 1727 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1728 | 1728 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
1729 | 1729 | [1] |
|
1730 | 1730 | $ aftermerge |
|
1731 | 1731 | # cat f |
|
1732 | 1732 | revision 1 |
|
1733 | 1733 | space |
|
1734 | 1734 | # hg stat |
|
1735 | 1735 | M f |
|
1736 | 1736 | ? f.orig |
|
1737 | 1737 | # hg resolve --list |
|
1738 | 1738 | U f |
|
1739 | 1739 | |
|
1740 | 1740 | missingbinary is a merge-tool that doesn't exist: |
|
1741 | 1741 | |
|
1742 | 1742 | $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc |
|
1743 | 1743 | $ beforemerge |
|
1744 | 1744 | [merge-tools] |
|
1745 | 1745 | false.whatever= |
|
1746 | 1746 | true.priority=1 |
|
1747 | 1747 | true.executable=cat |
|
1748 | 1748 | missingbinary.executable=doesnotexist |
|
1749 | 1749 | # hg update -C 1 |
|
1750 | 1750 | $ hg merge -y -r 2 --config ui.merge=missingbinary |
|
1751 | 1751 | couldn't find merge tool missingbinary (for pattern f) |
|
1752 | 1752 | merging f |
|
1753 | 1753 | couldn't find merge tool missingbinary (for pattern f) |
|
1754 | 1754 | revision 1 |
|
1755 | 1755 | space |
|
1756 | 1756 | revision 0 |
|
1757 | 1757 | space |
|
1758 | 1758 | revision 2 |
|
1759 | 1759 | space |
|
1760 | 1760 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1761 | 1761 | (branch merge, don't forget to commit) |
|
1762 | 1762 | |
|
1763 | 1763 | #if symlink |
|
1764 | 1764 | |
|
1765 | 1765 | internal merge cannot handle symlinks and shouldn't try: |
|
1766 | 1766 | |
|
1767 | 1767 | $ hg update -q -C 1 |
|
1768 | 1768 | $ rm f |
|
1769 | 1769 | $ ln -s symlink f |
|
1770 | 1770 | $ hg commit -qm 'f is symlink' |
|
1771 | 1771 | $ hg merge -r 2 --tool internal:merge |
|
1772 | 1772 | merging f |
|
1773 | 1773 | warning: internal :merge cannot merge symlinks for f |
|
1774 | 1774 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
1775 | 1775 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1776 | 1776 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
1777 | 1777 | [1] |
|
1778 | 1778 | |
|
1779 | 1779 | #endif |
|
1780 | 1780 | |
|
1781 | 1781 | Verify naming of temporary files and that extension is preserved: |
|
1782 | 1782 | |
|
1783 | 1783 | $ hg update -q -C 1 |
|
1784 | 1784 | $ hg mv f f.txt |
|
1785 | 1785 | $ hg ci -qm "f.txt" |
|
1786 | 1786 | $ hg update -q -C 2 |
|
1787 | 1787 | $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output' |
|
1788 | 1788 | merging f and f.txt to f.txt |
|
1789 | 1789 | */f~base.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob) |
|
1790 | 1790 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1791 | 1791 | (branch merge, don't forget to commit) |
|
1792 | 1792 | |
|
1793 | 1793 | Verify naming of temporary files and that extension is preserved |
|
1794 | 1794 | (experimental.mergetempdirprefix version): |
|
1795 | 1795 | |
|
1796 | 1796 | $ hg update -q -C 1 |
|
1797 | 1797 | $ hg mv f f.txt |
|
1798 | 1798 | $ hg ci -qm "f.txt" |
|
1799 | 1799 | $ hg update -q -C 2 |
|
1800 | 1800 | $ hg merge -y -r tip --tool echo \ |
|
1801 | 1801 | > --config merge-tools.echo.args='$base $local $other $output' \ |
|
1802 | 1802 | > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. |
|
1803 | 1803 | merging f and f.txt to f.txt |
|
1804 | 1804 | $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob) |
|
1805 | 1805 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1806 | 1806 | (branch merge, don't forget to commit) |
|
1807 | 1807 | |
|
1808 | 1808 | Binary files capability checking |
|
1809 | 1809 | |
|
1810 | 1810 | $ hg update -q -C 0 |
|
1811 | 1811 | $ python <<EOF |
|
1812 | 1812 | > with open('b', 'wb') as fp: |
|
1813 | 1813 | > fp.write(b'\x00\x01\x02\x03') |
|
1814 | 1814 | > EOF |
|
1815 | 1815 | $ hg add b |
|
1816 | 1816 | $ hg commit -qm "add binary file (#1)" |
|
1817 | 1817 | |
|
1818 | 1818 | $ hg update -q -C 0 |
|
1819 | 1819 | $ python <<EOF |
|
1820 | 1820 | > with open('b', 'wb') as fp: |
|
1821 | 1821 | > fp.write(b'\x03\x02\x01\x00') |
|
1822 | 1822 | > EOF |
|
1823 | 1823 | $ hg add b |
|
1824 | 1824 | $ hg commit -qm "add binary file (#2)" |
|
1825 | 1825 | |
|
1826 | 1826 | By default, binary files capability of internal merge tools is not |
|
1827 | 1827 | checked strictly. |
|
1828 | 1828 | |
|
1829 | 1829 | (for merge-patterns, chosen unintentionally) |
|
1830 | 1830 | |
|
1831 | 1831 | $ hg merge 9 \ |
|
1832 | 1832 | > --config merge-patterns.b=:merge-other \ |
|
1833 | 1833 | > --config merge-patterns.re:[a-z]=:other |
|
1834 | 1834 | warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional |
|
1835 | 1835 | (see 'hg help merge-tools' for binary files capability) |
|
1836 | 1836 | merging b |
|
1837 | 1837 | warning: b looks like a binary file. |
|
1838 | 1838 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
1839 | 1839 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
1840 | 1840 | [1] |
|
1841 | 1841 | $ hg merge --abort -q |
|
1842 | 1842 | |
|
1843 | (for ui.merge, ignored unintentionally) | |
|
1844 | ||
|
1845 | $ hg merge 9 \ | |
|
1846 | > --config ui.merge=:other | |
|
1847 | tool :other (for pattern b) can't handle binary | |
|
1848 | tool true can't handle binary | |
|
1849 | tool false can't handle binary | |
|
1850 | no tool found to merge b | |
|
1851 | keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for b? u | |
|
1852 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
|
1853 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
|
1854 | [1] | |
|
1855 | $ hg merge --abort -q | |
|
1856 | ||
|
1857 | With merge.strict-capability-check=true, binary files capability of | |
|
1858 | internal merge tools is checked strictly. | |
|
1859 | ||
|
1860 | $ f --hexdump b | |
|
1861 | b: | |
|
1862 | 0000: 03 02 01 00 |....| | |
|
1863 | ||
|
1864 | (for merge-patterns) | |
|
1865 | ||
|
1866 | $ hg merge 9 --config merge.strict-capability-check=true \ | |
|
1867 | > --config merge-patterns.b=:merge-other \ | |
|
1868 | > --config merge-patterns.re:[a-z]=:other | |
|
1869 | tool :merge-other (for pattern b) can't handle binary | |
|
1870 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
1871 | (branch merge, don't forget to commit) | |
|
1872 | $ f --hexdump b | |
|
1873 | b: | |
|
1874 | 0000: 00 01 02 03 |....| | |
|
1875 | $ hg merge --abort -q | |
|
1876 | ||
|
1877 | (for ui.merge) | |
|
1878 | ||
|
1879 | $ hg merge 9 --config merge.strict-capability-check=true \ | |
|
1880 | > --config ui.merge=:other | |
|
1881 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
1882 | (branch merge, don't forget to commit) | |
|
1883 | $ f --hexdump b | |
|
1884 | b: | |
|
1885 | 0000: 00 01 02 03 |....| | |
|
1886 | $ hg merge --abort -q | |
|
1887 | ||
|
1843 | 1888 | Check that debugpicktool examines which merge tool is chosen for |
|
1844 | 1889 | specified file as expected |
|
1845 | 1890 | |
|
1846 | 1891 | $ beforemerge |
|
1847 | 1892 | [merge-tools] |
|
1848 | 1893 | false.whatever= |
|
1849 | 1894 | true.priority=1 |
|
1850 | 1895 | true.executable=cat |
|
1851 | 1896 | missingbinary.executable=doesnotexist |
|
1852 | 1897 | # hg update -C 1 |
|
1853 | 1898 | |
|
1854 | 1899 | (default behavior: checking files in the working parent context) |
|
1855 | 1900 | |
|
1856 | 1901 | $ hg manifest |
|
1857 | 1902 | f |
|
1858 | 1903 | $ hg debugpickmergetool |
|
1859 | 1904 | f = true |
|
1860 | 1905 | |
|
1861 | 1906 | (-X/-I and file patterns limmit examination targets) |
|
1862 | 1907 | |
|
1863 | 1908 | $ hg debugpickmergetool -X f |
|
1864 | 1909 | $ hg debugpickmergetool unknown |
|
1865 | 1910 | unknown: no such file in rev ef83787e2614 |
|
1866 | 1911 | |
|
1867 | 1912 | (--changedelete emulates merging change and delete) |
|
1868 | 1913 | |
|
1869 | 1914 | $ hg debugpickmergetool --changedelete |
|
1870 | 1915 | f = :prompt |
|
1871 | 1916 | |
|
1872 | 1917 | (-r REV causes checking files in specified revision) |
|
1873 | 1918 | |
|
1874 | 1919 | $ hg manifest -r 8 |
|
1875 | 1920 | f.txt |
|
1876 | 1921 | $ hg debugpickmergetool -r 8 |
|
1877 | 1922 | f.txt = true |
|
1878 | 1923 | |
|
1879 | 1924 | #if symlink |
|
1880 | 1925 | |
|
1881 | 1926 | (symlink causes chosing :prompt) |
|
1882 | 1927 | |
|
1883 | 1928 | $ hg debugpickmergetool -r 6d00b3726f6e |
|
1884 | 1929 | f = :prompt |
|
1885 | 1930 | |
|
1931 | (by default, it is assumed that no internal merge tools has symlinks | |
|
1932 | capability) | |
|
1933 | ||
|
1934 | $ hg debugpickmergetool \ | |
|
1935 | > -r 6d00b3726f6e \ | |
|
1936 | > --config merge-patterns.f=:merge-other \ | |
|
1937 | > --config merge-patterns.re:[f]=:merge-local \ | |
|
1938 | > --config merge-patterns.re:[a-z]=:other | |
|
1939 | f = :prompt | |
|
1940 | ||
|
1941 | $ hg debugpickmergetool \ | |
|
1942 | > -r 6d00b3726f6e \ | |
|
1943 | > --config ui.merge=:other | |
|
1944 | f = :prompt | |
|
1945 | ||
|
1946 | (with strict-capability-check=true, actual symlink capabilities are | |
|
1947 | checked striclty) | |
|
1948 | ||
|
1949 | $ hg debugpickmergetool --config merge.strict-capability-check=true \ | |
|
1950 | > -r 6d00b3726f6e \ | |
|
1951 | > --config merge-patterns.f=:merge-other \ | |
|
1952 | > --config merge-patterns.re:[f]=:merge-local \ | |
|
1953 | > --config merge-patterns.re:[a-z]=:other | |
|
1954 | f = :other | |
|
1955 | ||
|
1956 | $ hg debugpickmergetool --config merge.strict-capability-check=true \ | |
|
1957 | > -r 6d00b3726f6e \ | |
|
1958 | > --config ui.merge=:other | |
|
1959 | f = :other | |
|
1960 | ||
|
1886 | 1961 | #endif |
|
1887 | 1962 | |
|
1888 | 1963 | (--verbose shows some configurations) |
|
1889 | 1964 | |
|
1890 | 1965 | $ hg debugpickmergetool --tool foobar -v |
|
1891 | 1966 | with --tool 'foobar' |
|
1892 | 1967 | f = foobar |
|
1893 | 1968 | |
|
1894 | 1969 | $ HGMERGE=false hg debugpickmergetool -v |
|
1895 | 1970 | with HGMERGE='false' |
|
1896 | 1971 | f = false |
|
1897 | 1972 | |
|
1898 | 1973 | $ hg debugpickmergetool --config ui.merge=false -v |
|
1899 | 1974 | with ui.merge='false' |
|
1900 | 1975 | f = false |
|
1901 | 1976 | |
|
1902 | 1977 | (--debug shows errors detected intermediately) |
|
1903 | 1978 | |
|
1904 | 1979 | $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f |
|
1905 | 1980 | couldn't find merge tool true (for pattern f) |
|
1906 | 1981 | couldn't find merge tool true |
|
1907 | 1982 | f = false |
|
1908 | 1983 | |
|
1909 | 1984 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now