Show More
@@ -1461,6 +1461,52 def commit(ui, repo, *pats, **opts): | |||
|
1461 | 1461 | |
|
1462 | 1462 | cmdutil.commitstatus(repo, node, branch, bheads, opts) |
|
1463 | 1463 | |
|
1464 | @command('config|showconfig|debugconfig', | |
|
1465 | [('u', 'untrusted', None, _('show untrusted configuration options'))], | |
|
1466 | _('[-u] [NAME]...')) | |
|
1467 | def config(ui, repo, *values, **opts): | |
|
1468 | """show combined config settings from all hgrc files | |
|
1469 | ||
|
1470 | With no arguments, print names and values of all config items. | |
|
1471 | ||
|
1472 | With one argument of the form section.name, print just the value | |
|
1473 | of that config item. | |
|
1474 | ||
|
1475 | With multiple arguments, print names and values of all config | |
|
1476 | items with matching section names. | |
|
1477 | ||
|
1478 | With --debug, the source (filename and line number) is printed | |
|
1479 | for each config item. | |
|
1480 | ||
|
1481 | Returns 0 on success. | |
|
1482 | """ | |
|
1483 | ||
|
1484 | for f in scmutil.rcpath(): | |
|
1485 | ui.debug('read config from: %s\n' % f) | |
|
1486 | untrusted = bool(opts.get('untrusted')) | |
|
1487 | if values: | |
|
1488 | sections = [v for v in values if '.' not in v] | |
|
1489 | items = [v for v in values if '.' in v] | |
|
1490 | if len(items) > 1 or items and sections: | |
|
1491 | raise util.Abort(_('only one config item permitted')) | |
|
1492 | for section, name, value in ui.walkconfig(untrusted=untrusted): | |
|
1493 | value = str(value).replace('\n', '\\n') | |
|
1494 | sectname = section + '.' + name | |
|
1495 | if values: | |
|
1496 | for v in values: | |
|
1497 | if v == section: | |
|
1498 | ui.debug('%s: ' % | |
|
1499 | ui.configsource(section, name, untrusted)) | |
|
1500 | ui.write('%s=%s\n' % (sectname, value)) | |
|
1501 | elif v == sectname: | |
|
1502 | ui.debug('%s: ' % | |
|
1503 | ui.configsource(section, name, untrusted)) | |
|
1504 | ui.write(value, '\n') | |
|
1505 | else: | |
|
1506 | ui.debug('%s: ' % | |
|
1507 | ui.configsource(section, name, untrusted)) | |
|
1508 | ui.write('%s=%s\n' % (sectname, value)) | |
|
1509 | ||
|
1464 | 1510 | @command('copy|cp', |
|
1465 | 1511 | [('A', 'after', None, _('record a copy that has already occurred')), |
|
1466 | 1512 | ('f', 'force', None, _('forcibly copy over an existing managed file')), |
@@ -5162,52 +5208,6 class httpservice(object): | |||
|
5162 | 5208 | self.httpd.serve_forever() |
|
5163 | 5209 | |
|
5164 | 5210 | |
|
5165 | @command('showconfig|debugconfig', | |
|
5166 | [('u', 'untrusted', None, _('show untrusted configuration options'))], | |
|
5167 | _('[-u] [NAME]...')) | |
|
5168 | def showconfig(ui, repo, *values, **opts): | |
|
5169 | """show combined config settings from all hgrc files | |
|
5170 | ||
|
5171 | With no arguments, print names and values of all config items. | |
|
5172 | ||
|
5173 | With one argument of the form section.name, print just the value | |
|
5174 | of that config item. | |
|
5175 | ||
|
5176 | With multiple arguments, print names and values of all config | |
|
5177 | items with matching section names. | |
|
5178 | ||
|
5179 | With --debug, the source (filename and line number) is printed | |
|
5180 | for each config item. | |
|
5181 | ||
|
5182 | Returns 0 on success. | |
|
5183 | """ | |
|
5184 | ||
|
5185 | for f in scmutil.rcpath(): | |
|
5186 | ui.debug('read config from: %s\n' % f) | |
|
5187 | untrusted = bool(opts.get('untrusted')) | |
|
5188 | if values: | |
|
5189 | sections = [v for v in values if '.' not in v] | |
|
5190 | items = [v for v in values if '.' in v] | |
|
5191 | if len(items) > 1 or items and sections: | |
|
5192 | raise util.Abort(_('only one config item permitted')) | |
|
5193 | for section, name, value in ui.walkconfig(untrusted=untrusted): | |
|
5194 | value = str(value).replace('\n', '\\n') | |
|
5195 | sectname = section + '.' + name | |
|
5196 | if values: | |
|
5197 | for v in values: | |
|
5198 | if v == section: | |
|
5199 | ui.debug('%s: ' % | |
|
5200 | ui.configsource(section, name, untrusted)) | |
|
5201 | ui.write('%s=%s\n' % (sectname, value)) | |
|
5202 | elif v == sectname: | |
|
5203 | ui.debug('%s: ' % | |
|
5204 | ui.configsource(section, name, untrusted)) | |
|
5205 | ui.write(value, '\n') | |
|
5206 | else: | |
|
5207 | ui.debug('%s: ' % | |
|
5208 | ui.configsource(section, name, untrusted)) | |
|
5209 | ui.write('%s=%s\n' % (sectname, value)) | |
|
5210 | ||
|
5211 | 5211 | @command('^status|st', |
|
5212 | 5212 | [('A', 'all', None, _('show status of all files')), |
|
5213 | 5213 | ('m', 'modified', None, _('show only modified files')), |
@@ -13,6 +13,7 Show all commands except debug commands | |||
|
13 | 13 | cat |
|
14 | 14 | clone |
|
15 | 15 | commit |
|
16 | config | |
|
16 | 17 | copy |
|
17 | 18 | diff |
|
18 | 19 | export |
@@ -43,7 +44,6 Show all commands except debug commands | |||
|
43 | 44 | rollback |
|
44 | 45 | root |
|
45 | 46 | serve |
|
46 | showconfig | |
|
47 | 47 | status |
|
48 | 48 | summary |
|
49 | 49 | tag |
@@ -222,6 +222,7 Show all commands + options | |||
|
222 | 222 | branches: active, closed |
|
223 | 223 | bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure |
|
224 | 224 | cat: output, rev, decode, include, exclude |
|
225 | config: untrusted | |
|
225 | 226 | copy: after, force, include, exclude, dry-run |
|
226 | 227 | debugancestor: |
|
227 | 228 | debugbuilddag: mergeable-file, overwritten-file, new-file |
@@ -275,7 +276,6 Show all commands + options | |||
|
275 | 276 | revert: all, date, rev, no-backup, include, exclude, dry-run |
|
276 | 277 | rollback: dry-run, force |
|
277 | 278 | root: |
|
278 | showconfig: untrusted | |
|
279 | 279 | tag: force, local, rev, remove, edit, message, date, user |
|
280 | 280 | tags: |
|
281 | 281 | tip: patch, git, style, template |
@@ -297,6 +297,7 Testing -h/--help: | |||
|
297 | 297 | cat output the current or given revision of files |
|
298 | 298 | clone make a copy of an existing repository |
|
299 | 299 | commit commit the specified files or all outstanding changes |
|
300 | config show combined config settings from all hgrc files | |
|
300 | 301 | copy mark files as copied for the next commit |
|
301 | 302 | diff diff repository (or selected files) |
|
302 | 303 | export dump the header and diffs for one or more changesets |
@@ -326,7 +327,6 Testing -h/--help: | |||
|
326 | 327 | revert restore files to their checkout state |
|
327 | 328 | root print the root (top) of the current working directory |
|
328 | 329 | serve start stand-alone webserver |
|
329 | showconfig show combined config settings from all hgrc files | |
|
330 | 330 | status show changed files in the working directory |
|
331 | 331 | summary summarize working directory state |
|
332 | 332 | tag add one or more tags for the current or given revision |
@@ -379,6 +379,7 Testing -h/--help: | |||
|
379 | 379 | cat output the current or given revision of files |
|
380 | 380 | clone make a copy of an existing repository |
|
381 | 381 | commit commit the specified files or all outstanding changes |
|
382 | config show combined config settings from all hgrc files | |
|
382 | 383 | copy mark files as copied for the next commit |
|
383 | 384 | diff diff repository (or selected files) |
|
384 | 385 | export dump the header and diffs for one or more changesets |
@@ -408,7 +409,6 Testing -h/--help: | |||
|
408 | 409 | revert restore files to their checkout state |
|
409 | 410 | root print the root (top) of the current working directory |
|
410 | 411 | serve start stand-alone webserver |
|
411 | showconfig show combined config settings from all hgrc files | |
|
412 | 412 | status show changed files in the working directory |
|
413 | 413 | summary summarize working directory state |
|
414 | 414 | tag add one or more tags for the current or given revision |
@@ -62,6 +62,7 Short help: | |||
|
62 | 62 | cat output the current or given revision of files |
|
63 | 63 | clone make a copy of an existing repository |
|
64 | 64 | commit commit the specified files or all outstanding changes |
|
65 | config show combined config settings from all hgrc files | |
|
65 | 66 | copy mark files as copied for the next commit |
|
66 | 67 | diff diff repository (or selected files) |
|
67 | 68 | export dump the header and diffs for one or more changesets |
@@ -91,7 +92,6 Short help: | |||
|
91 | 92 | revert restore files to their checkout state |
|
92 | 93 | root print the root (top) of the current working directory |
|
93 | 94 | serve start stand-alone webserver |
|
94 | showconfig show combined config settings from all hgrc files | |
|
95 | 95 | status show changed files in the working directory |
|
96 | 96 | summary summarize working directory state |
|
97 | 97 | tag add one or more tags for the current or given revision |
@@ -138,6 +138,7 Short help: | |||
|
138 | 138 | cat output the current or given revision of files |
|
139 | 139 | clone make a copy of an existing repository |
|
140 | 140 | commit commit the specified files or all outstanding changes |
|
141 | config show combined config settings from all hgrc files | |
|
141 | 142 | copy mark files as copied for the next commit |
|
142 | 143 | diff diff repository (or selected files) |
|
143 | 144 | export dump the header and diffs for one or more changesets |
@@ -167,7 +168,6 Short help: | |||
|
167 | 168 | revert restore files to their checkout state |
|
168 | 169 | root print the root (top) of the current working directory |
|
169 | 170 | serve start stand-alone webserver |
|
170 | showconfig show combined config settings from all hgrc files | |
|
171 | 171 | status show changed files in the working directory |
|
172 | 172 | summary summarize working directory state |
|
173 | 173 | tag add one or more tags for the current or given revision |
@@ -623,6 +623,7 Test that default list of commands omits | |||
|
623 | 623 | cat output the current or given revision of files |
|
624 | 624 | clone make a copy of an existing repository |
|
625 | 625 | commit commit the specified files or all outstanding changes |
|
626 | config show combined config settings from all hgrc files | |
|
626 | 627 | copy mark files as copied for the next commit |
|
627 | 628 | diff diff repository (or selected files) |
|
628 | 629 | export dump the header and diffs for one or more changesets |
@@ -652,7 +653,6 Test that default list of commands omits | |||
|
652 | 653 | revert restore files to their checkout state |
|
653 | 654 | root print the root (top) of the current working directory |
|
654 | 655 | serve start stand-alone webserver |
|
655 | showconfig show combined config settings from all hgrc files | |
|
656 | 656 | status show changed files in the working directory |
|
657 | 657 | summary summarize working directory state |
|
658 | 658 | tag add one or more tags for the current or given revision |
@@ -1259,6 +1259,13 Dish up an empty repo; serve it cold. | |||
|
1259 | 1259 | output the current or given revision of files |
|
1260 | 1260 | </td></tr> |
|
1261 | 1261 | <tr><td> |
|
1262 | <a href="/help/config"> | |
|
1263 | config | |
|
1264 | </a> | |
|
1265 | </td><td> | |
|
1266 | show combined config settings from all hgrc files | |
|
1267 | </td></tr> | |
|
1268 | <tr><td> | |
|
1262 | 1269 | <a href="/help/copy"> |
|
1263 | 1270 | copy |
|
1264 | 1271 | </a> |
@@ -1399,13 +1406,6 Dish up an empty repo; serve it cold. | |||
|
1399 | 1406 | print the root (top) of the current working directory |
|
1400 | 1407 | </td></tr> |
|
1401 | 1408 | <tr><td> |
|
1402 | <a href="/help/showconfig"> | |
|
1403 | showconfig | |
|
1404 | </a> | |
|
1405 | </td><td> | |
|
1406 | show combined config settings from all hgrc files | |
|
1407 | </td></tr> | |
|
1408 | <tr><td> | |
|
1409 | 1409 | <a href="/help/tag"> |
|
1410 | 1410 | tag |
|
1411 | 1411 | </a> |
General Comments 0
You need to be logged in to leave comments.
Login now