Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGa9d1ac7b91a8: py3: open files in bytes mode in transplant.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
nodemod.short(node))) | nodemod.short(node))) | ||||
else: | else: | ||||
parent = parents[0] | parent = parents[0] | ||||
if skipmerge: | if skipmerge: | ||||
patchfile = None | patchfile = None | ||||
else: | else: | ||||
fd, patchfile = tempfile.mkstemp(prefix='hg-transplant-') | fd, patchfile = tempfile.mkstemp(prefix='hg-transplant-') | ||||
fp = os.fdopen(fd, pycompat.sysstr('w')) | fp = os.fdopen(fd, pycompat.sysstr('wb')) | ||||
gen = patch.diff(source, parent, node, opts=diffopts) | gen = patch.diff(source, parent, node, opts=diffopts) | ||||
for chunk in gen: | for chunk in gen: | ||||
fp.write(chunk) | fp.write(chunk) | ||||
fp.close() | fp.close() | ||||
del revmap[rev] | del revmap[rev] | ||||
if patchfile or domerge: | if patchfile or domerge: | ||||
try: | try: | ||||
lock.release() | lock.release() | ||||
def filter(self, filter, node, changelog, patchfile): | def filter(self, filter, node, changelog, patchfile): | ||||
'''arbitrarily rewrite changeset before applying it''' | '''arbitrarily rewrite changeset before applying it''' | ||||
self.ui.status(_('filtering %s\n') % patchfile) | self.ui.status(_('filtering %s\n') % patchfile) | ||||
user, date, msg = (changelog[1], changelog[2], changelog[4]) | user, date, msg = (changelog[1], changelog[2], changelog[4]) | ||||
fd, headerfile = tempfile.mkstemp(prefix='hg-transplant-') | fd, headerfile = tempfile.mkstemp(prefix='hg-transplant-') | ||||
fp = os.fdopen(fd, pycompat.sysstr('w')) | fp = os.fdopen(fd, pycompat.sysstr('wb')) | ||||
fp.write("# HG changeset patch\n") | fp.write("# HG changeset patch\n") | ||||
fp.write("# User %s\n" % user) | fp.write("# User %s\n" % user) | ||||
fp.write("# Date %d %d\n" % date) | fp.write("# Date %d %d\n" % date) | ||||
fp.write(msg + '\n') | fp.write(msg + '\n') | ||||
fp.close() | fp.close() | ||||
try: | try: | ||||
self.ui.system('%s %s %s' % (filter, util.shellquote(headerfile), | self.ui.system('%s %s %s' % (filter, util.shellquote(headerfile), |