Mercurial > hg
comparison mercurial/hg.py @ 35622:e925f33ac088
share: convert EOL of hgrc before writing to bytes IO
Text IO is useless on Python 3 as it must be a unicode stream.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 13 Jan 2018 13:31:27 +0900 |
parents | 545967ec33dc |
children | 41ef02ba329b |
comparison
equal
deleted
inserted
replaced
35621:38649e2fbf6c | 35622:e925f33ac088 |
---|---|
305 Extensions can wrap this function and write additional entries to | 305 Extensions can wrap this function and write additional entries to |
306 destrepo/.hg/shared to indicate additional pieces of data to be shared. | 306 destrepo/.hg/shared to indicate additional pieces of data to be shared. |
307 """ | 307 """ |
308 default = defaultpath or sourcerepo.ui.config('paths', 'default') | 308 default = defaultpath or sourcerepo.ui.config('paths', 'default') |
309 if default: | 309 if default: |
310 with destrepo.vfs("hgrc", "w", text=True) as fp: | 310 template = ('[paths]\n' |
311 fp.write("[paths]\n") | 311 'default = %s\n') |
312 fp.write("default = %s\n" % default) | 312 destrepo.vfs.write('hgrc', util.tonativeeol(template % default)) |
313 | 313 |
314 with destrepo.wlock(): | 314 with destrepo.wlock(): |
315 if bookmarks: | 315 if bookmarks: |
316 destrepo.vfs.write('shared', sharedbookmarks + '\n') | 316 destrepo.vfs.write('shared', sharedbookmarks + '\n') |
317 | 317 |