Bug 1049893 - Allow mach mercurial-setup to work if no ~/.hgrc exists; r=gps

DONTBUILD (NPOTB)

--HG--
extra : rebase_source : 8788d55cd5cfa5e64627d7951209c5f2c1222f0a
This commit is contained in:
Felix Baylac-Jacque 2014-08-07 00:19:06 +02:00
parent 9ecd02fd9c
commit c54d74da9e

View File

@ -42,11 +42,12 @@ class MercurialConfig(object):
# Mercurial configuration files allow an %include directive to include
# other files, this is not supported by ConfigObj, so throw a useful
# error saying this.
with open(infile, 'r') as f:
for line in f:
if line.startswith('%include'):
raise HgIncludeException(
'%include directive is not supported by MercurialConfig')
if os.path.exists(infile):
with open(infile, 'r') as f:
for line in f:
if line.startswith('%include'):
raise HgIncludeException(
'%include directive is not supported by MercurialConfig')
# write_empty_values is necessary to prevent built-in extensions (which
# have no value) from being dropped on write.