--- a/mercurial/hg.py Sat Jan 13 13:23:16 2018 +0900
+++ b/mercurial/hg.py Sat Jan 13 13:24:17 2018 +0900
@@ -681,13 +681,10 @@
destrepo = destpeer.local()
if destrepo:
template = uimod.samplehgrcs['cloned']
- fp = destrepo.vfs("hgrc", "wb")
u = util.url(abspath)
u.passwd = None
defaulturl = bytes(u)
- fp.write(util.tonativeeol(template % defaulturl))
- fp.close()
-
+ destrepo.vfs.write('hgrc', util.tonativeeol(template % defaulturl))
destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
if ui.configbool('experimental', 'remotenames'):