Mercurial > hg > mercurial-source
changeset 14156:839086b25c36
share: create 'hgrc' using an opener, like clone
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Sun, 01 May 2011 18:43:20 +0200 |
parents | 921683f14ad7 |
children | a8f136f430da |
files | mercurial/hg.py |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -146,13 +146,14 @@ file(os.path.join(roothg, 'requires'), 'w').write(requirements) file(os.path.join(roothg, 'sharedpath'), 'w').write(sharedpath) + r = repository(ui, root) + default = srcrepo.ui.config('paths', 'default') if default: - f = file(os.path.join(roothg, 'hgrc'), 'w') - f.write('[paths]\ndefault = %s\n' % default) - f.close() - - r = repository(ui, root) + fp = r.opener("hgrc", "w", text=True) + fp.write("[paths]\n") + fp.write("default = %s\n" % default) + fp.close() if update: r.ui.status(_("updating working directory\n"))