Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHGf87641bf4d23: py3: use bytes instead of str
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| durin42 |
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| ph.setuser(user) | ph.setuser(user) | ||||
| if date: | if date: | ||||
| ph.setdate('%s %s' % date) | ph.setdate('%s %s' % date) | ||||
| ph.setparent(hex(nctx.p1().node())) | ph.setparent(hex(nctx.p1().node())) | ||||
| msg = nctx.description().strip() | msg = nctx.description().strip() | ||||
| if msg == defaultmsg.strip(): | if msg == defaultmsg.strip(): | ||||
| msg = '' | msg = '' | ||||
| ph.setmessage(msg) | ph.setmessage(msg) | ||||
| p.write(str(ph)) | p.write(bytes(ph)) | ||||
| if commitfiles: | if commitfiles: | ||||
| parent = self.qparents(repo, n) | parent = self.qparents(repo, n) | ||||
| if inclsubs: | if inclsubs: | ||||
| self.putsubstate2changes(substatestate, changes) | self.putsubstate2changes(substatestate, changes) | ||||
| chunks = patchmod.diff(repo, node1=parent, node2=n, | chunks = patchmod.diff(repo, node1=parent, node2=n, | ||||
| changes=changes, opts=diffopts) | changes=changes, opts=diffopts) | ||||
| for chunk in chunks: | for chunk in chunks: | ||||
| p.write(chunk) | p.write(chunk) | ||||
| n = newcommit(repo, oldphase, message, user, ph.date, | n = newcommit(repo, oldphase, message, user, ph.date, | ||||
| match=match, force=True, editor=editor) | match=match, force=True, editor=editor) | ||||
| # only write patch after a successful commit | # only write patch after a successful commit | ||||
| c = [list(x) for x in refreshchanges] | c = [list(x) for x in refreshchanges] | ||||
| if inclsubs: | if inclsubs: | ||||
| self.putsubstate2changes(substatestate, c) | self.putsubstate2changes(substatestate, c) | ||||
| chunks = patchmod.diff(repo, patchparent, | chunks = patchmod.diff(repo, patchparent, | ||||
| changes=c, opts=diffopts) | changes=c, opts=diffopts) | ||||
| comments = str(ph) | comments = bytes(ph) | ||||
| if comments: | if comments: | ||||
| patchf.write(comments) | patchf.write(comments) | ||||
| for chunk in chunks: | for chunk in chunks: | ||||
| patchf.write(chunk) | patchf.write(chunk) | ||||
| patchf.close() | patchf.close() | ||||
| marks = repo._bookmarks | marks = repo._bookmarks | ||||
| marks.applychanges(repo, tr, [(bm, n) for bm in bmlist]) | marks.applychanges(repo, tr, [(bm, n) for bm in bmlist]) | ||||