##// END OF EJS Templates
merge with stable
Matt Mackall -
r15700:1facaad9 merge default
parent child Browse files
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))
@@ -588,16 +588,17 b' def diffordiffstat(ui, repo, diffopts, n'
588 ctx1 = repo[node1]
588 ctx1 = repo[node1]
589 ctx2 = repo[node2]
589 ctx2 = repo[node2]
590 for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
590 for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
591 tempnode2 = node2
591 try:
592 try:
592 if node2 is not None:
593 if node2 is not None:
593 node2 = ctx2.substate[subpath][1]
594 tempnode2 = ctx2.substate[subpath][1]
594 except KeyError:
595 except KeyError:
595 # A subrepo that existed in node1 was deleted between node1 and
596 # A subrepo that existed in node1 was deleted between node1 and
596 # node2 (inclusive). Thus, ctx2's substate won't contain that
597 # node2 (inclusive). Thus, ctx2's substate won't contain that
597 # subpath. The best we can do is to ignore it.
598 # subpath. The best we can do is to ignore it.
598 node2 = None
599 tempnode2 = None
599 submatch = matchmod.narrowmatcher(subpath, match)
600 submatch = matchmod.narrowmatcher(subpath, match)
600 sub.diff(diffopts, node2, submatch, changes=changes,
601 sub.diff(diffopts, tempnode2, submatch, changes=changes,
601 stat=stat, fp=fp, prefix=prefix)
602 stat=stat, fp=fp, prefix=prefix)
602
603
603 class changeset_printer(object):
604 class changeset_printer(object):
General Comments 0
You need to be logged in to leave comments. Login now