Mercurial > hg-stable
changeset 15699:84e55467093c stable
largefiles: copy files in binary mode (issue3164)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 20 Dec 2011 11:43:38 -0600 |
parents | 43e068c15619 |
children | 1facaad963a8 32a6e00e4cfe |
files | hgext/largefiles/lfutil.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py Thu Dec 15 16:41:03 2011 -0500 +++ b/hgext/largefiles/lfutil.py Tue Dec 20 11:43:38 2011 -0600 @@ -79,7 +79,7 @@ except OSError: # if hardlinks fail, fallback on atomic copy dst = util.atomictempfile(dest) - for chunk in util.filechunkiter(open(src)): + for chunk in util.filechunkiter(open(src, 'rb')): dst.write(chunk) dst.close() os.chmod(dest, os.stat(src).st_mode) @@ -238,7 +238,7 @@ link(usercachepath(repo.ui, hash), storepath(repo, hash)) else: dst = util.atomictempfile(storepath(repo, hash)) - for chunk in util.filechunkiter(open(file)): + for chunk in util.filechunkiter(open(file, 'rb')): dst.write(chunk) dst.close() util.copymode(file, storepath(repo, hash))