# HG changeset patch # User Yuya Nishihara # Date 1515818471 -32400 # Node ID 188b1371d1eda051f74025ebff92cbf64f2b5ea7 # Parent f56f8abbeaf19f6f035b3cdc31f9a1bd831f4d2b lfs: convert EOL of hgrc before appending to bytes IO Text IO is useless on Python 3 as it must be a unicode stream. diff -r f56f8abbeaf1 -r 188b1371d1ed hgext/lfs/wrapper.py --- a/hgext/lfs/wrapper.py Sat Jan 13 13:33:55 2018 +0900 +++ b/hgext/lfs/wrapper.py Sat Jan 13 13:41:11 2018 +0900 @@ -197,8 +197,8 @@ self.repo._writerequirements() # Permanently enable lfs locally - with self.repo.vfs('hgrc', 'a', text=True) as fp: - fp.write('\n[extensions]\nlfs=\n') + self.repo.vfs.append( + 'hgrc', util.tonativeeol('\n[extensions]\nlfs=\n')) return node @@ -232,8 +232,8 @@ # If lfs is required for this repo, permanently enable it locally if 'lfs' in repo.requirements: - with repo.vfs('hgrc', 'a', text=True) as fp: - fp.write('\n[extensions]\nlfs=\n') + repo.vfs.append('hgrc', + util.tonativeeol('\n[extensions]\nlfs=\n')) return result @@ -242,8 +242,7 @@ # If lfs is required for this repo, permanently enable it locally if 'lfs' in destrepo.requirements: - with destrepo.vfs('hgrc', 'a', text=True) as fp: - fp.write('\n[extensions]\nlfs=\n') + destrepo.vfs.append('hgrc', util.tonativeeol('\n[extensions]\nlfs=\n')) def _canskipupload(repo): # if remotestore is a null store, upload is a no-op and can be skipped