mercurial/commands.py
changeset 31679 0f8ba0bc1154
parent 31670 adace35f931d
child 31682 07d62fa518a4
equal deleted inserted replaced
31678:1ed57a7dd904 31679:0f8ba0bc1154
    41     merge as mergemod,
    41     merge as mergemod,
    42     obsolete,
    42     obsolete,
    43     patch,
    43     patch,
    44     phases,
    44     phases,
    45     pycompat,
    45     pycompat,
       
    46     rcutil,
    46     revsetlang,
    47     revsetlang,
    47     scmutil,
    48     scmutil,
    48     server,
    49     server,
    49     sshserver,
    50     sshserver,
    50     streamclone,
    51     streamclone,
  1774         if opts.get('local'):
  1775         if opts.get('local'):
  1775             if not repo:
  1776             if not repo:
  1776                 raise error.Abort(_("can't use --local outside a repository"))
  1777                 raise error.Abort(_("can't use --local outside a repository"))
  1777             paths = [repo.vfs.join('hgrc')]
  1778             paths = [repo.vfs.join('hgrc')]
  1778         elif opts.get('global'):
  1779         elif opts.get('global'):
  1779             paths = scmutil.systemrcpath()
  1780             paths = rcutil.systemrcpath()
  1780         else:
  1781         else:
  1781             paths = scmutil.userrcpath()
  1782             paths = rcutil.userrcpath()
  1782 
  1783 
  1783         for f in paths:
  1784         for f in paths:
  1784             if os.path.exists(f):
  1785             if os.path.exists(f):
  1785                 break
  1786                 break
  1786         else:
  1787         else:
  1801                   onerr=error.Abort, errprefix=_("edit failed"),
  1802                   onerr=error.Abort, errprefix=_("edit failed"),
  1802                   blockedtag='config_edit')
  1803                   blockedtag='config_edit')
  1803         return
  1804         return
  1804     ui.pager('config')
  1805     ui.pager('config')
  1805     fm = ui.formatter('config', opts)
  1806     fm = ui.formatter('config', opts)
  1806     for f in scmutil.rcpath():
  1807     for f in rcutil.rcpath():
  1807         ui.debug('read config from: %s\n' % f)
  1808         ui.debug('read config from: %s\n' % f)
  1808     untrusted = bool(opts.get('untrusted'))
  1809     untrusted = bool(opts.get('untrusted'))
  1809     if values:
  1810     if values:
  1810         sections = [v for v in values if '.' not in v]
  1811         sections = [v for v in values if '.' not in v]
  1811         items = [v for v in values if '.' in v]
  1812         items = [v for v in values if '.' in v]