##// END OF EJS Templates
config: add --global and --local flags...
Matt Mackall -
r20782:13fcb9ca default
parent child Browse files
Show More
@@ -1462,7 +1462,9 b' def commit(ui, repo, *pats, **opts):'
1462
1462
1463 @command('config|showconfig|debugconfig',
1463 @command('config|showconfig|debugconfig',
1464 [('u', 'untrusted', None, _('show untrusted configuration options')),
1464 [('u', 'untrusted', None, _('show untrusted configuration options')),
1465 ('e', 'edit', None, _('start editor'))],
1465 ('e', 'edit', None, _('edit user config')),
1466 ('l', 'local', None, _('edit repository config')),
1467 ('g', 'global', None, _('edit global config'))],
1466 _('[-u] [NAME]...'))
1468 _('[-u] [NAME]...'))
1467 def config(ui, repo, *values, **opts):
1469 def config(ui, repo, *values, **opts):
1468 """show combined config settings from all hgrc files
1470 """show combined config settings from all hgrc files
@@ -1481,8 +1483,19 b' def config(ui, repo, *values, **opts):'
1481 Returns 0 on success.
1483 Returns 0 on success.
1482 """
1484 """
1483
1485
1484 if opts.get('edit'):
1486 if opts.get('edit') or opts.get('local') or opts.get('global'):
1487 if opts.get('local') and opts.get('global'):
1488 raise util.Abort(_("can't use --local and --global together"))
1489
1490 if opts.get('local'):
1491 if not repo:
1492 raise util.Abort(_("can't use --local outside a repository"))
1493 paths = [repo.join('hgrc')]
1494 elif opts.get('global'):
1495 paths = scmutil.systemrcpath()
1496 else:
1485 paths = scmutil.userrcpath()
1497 paths = scmutil.userrcpath()
1498
1486 for f in paths:
1499 for f in paths:
1487 if os.path.exists(f):
1500 if os.path.exists(f):
1488 break
1501 break
@@ -222,7 +222,7 b' Show all commands + options'
222 branches: active, closed
222 branches: active, closed
223 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
223 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
224 cat: output, rev, decode, include, exclude
224 cat: output, rev, decode, include, exclude
225 config: untrusted, edit
225 config: untrusted, edit, local, global
226 copy: after, force, include, exclude, dry-run
226 copy: after, force, include, exclude, dry-run
227 debugancestor:
227 debugancestor:
228 debugbuilddag: mergeable-file, overwritten-file, new-file
228 debugbuilddag: mergeable-file, overwritten-file, new-file
General Comments 0
You need to be logged in to leave comments. Login now