sapling/tests/setconfig.py
Jun Wu df73510ede tests: fix tests caused by tinit change
Reviewed By: singhsrb

Differential Revision: D7141028

fbshipit-source-id: 186955ce5f91befcdbbc1ccdc8ba7ff2c3e4fa92
2018-04-13 21:51:20 -07:00

20 lines
351 B
Python

from __future__ import absolute_import
import os
import sys
if os.path.exists('.hg'):
hgrcpath = '.hg/hgrc'
else:
hgrcpath = os.getenv('HGRCPATH')
content = ''
for config in sys.argv[1:]:
section, namevalue = config.split('.', 1)
content += "[%s]\n%s\n" % (section, namevalue)
with open(hgrcpath, 'a') as f:
f.write(content)