Show More
@@ -79,7 +79,7 b' def link(src, dest):' | |||||
79 | except OSError: |
|
79 | except OSError: | |
80 | # if hardlinks fail, fallback on atomic copy |
|
80 | # if hardlinks fail, fallback on atomic copy | |
81 | dst = util.atomictempfile(dest) |
|
81 | dst = util.atomictempfile(dest) | |
82 | for chunk in util.filechunkiter(open(src)): |
|
82 | for chunk in util.filechunkiter(open(src, 'rb')): | |
83 | dst.write(chunk) |
|
83 | dst.write(chunk) | |
84 | dst.close() |
|
84 | dst.close() | |
85 | os.chmod(dest, os.stat(src).st_mode) |
|
85 | os.chmod(dest, os.stat(src).st_mode) | |
@@ -238,7 +238,7 b' def copytostoreabsolute(repo, file, hash' | |||||
238 | link(usercachepath(repo.ui, hash), storepath(repo, hash)) |
|
238 | link(usercachepath(repo.ui, hash), storepath(repo, hash)) | |
239 | else: |
|
239 | else: | |
240 | dst = util.atomictempfile(storepath(repo, hash)) |
|
240 | dst = util.atomictempfile(storepath(repo, hash)) | |
241 | for chunk in util.filechunkiter(open(file)): |
|
241 | for chunk in util.filechunkiter(open(file, 'rb')): | |
242 | dst.write(chunk) |
|
242 | dst.write(chunk) | |
243 | dst.close() |
|
243 | dst.close() | |
244 | util.copymode(file, storepath(repo, hash)) |
|
244 | util.copymode(file, storepath(repo, hash)) |
General Comments 0
You need to be logged in to leave comments.
Login now