diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1272,7 +1272,7 @@ if msg == defaultmsg.strip(): msg = '' ph.setmessage(msg) - p.write(str(ph)) + p.write(bytes(ph)) if commitfiles: parent = self.qparents(repo, n) if inclsubs: @@ -1853,7 +1853,7 @@ self.putsubstate2changes(substatestate, c) chunks = patchmod.diff(repo, patchparent, changes=c, opts=diffopts) - comments = str(ph) + comments = bytes(ph) if comments: patchf.write(comments) for chunk in chunks: