equal
deleted
inserted
replaced
1100 file will be generated: you can use that when you try again. If |
1100 file will be generated: you can use that when you try again. If |
1101 all lines of the hunk are removed, then the edit is aborted and |
1101 all lines of the hunk are removed, then the edit is aborted and |
1102 the hunk is left unchanged. |
1102 the hunk is left unchanged. |
1103 """) |
1103 """) |
1104 (patchfd, patchfn) = tempfile.mkstemp(prefix="hg-editor-", |
1104 (patchfd, patchfn) = tempfile.mkstemp(prefix="hg-editor-", |
1105 suffix=".diff", text=True) |
1105 suffix=".diff") |
1106 ncpatchfp = None |
1106 ncpatchfp = None |
1107 try: |
1107 try: |
1108 # Write the initial patch |
1108 # Write the initial patch |
1109 f = os.fdopen(patchfd, r"w") |
1109 f = util.nativeeolwriter(os.fdopen(patchfd, r'wb')) |
1110 chunk.header.write(f) |
1110 chunk.header.write(f) |
1111 chunk.write(f) |
1111 chunk.write(f) |
1112 f.write('\n'.join(['# ' + i for i in phelp.splitlines()])) |
1112 f.write('\n'.join(['# ' + i for i in phelp.splitlines()])) |
1113 f.close() |
1113 f.close() |
1114 # Start the editor and wait for it to complete |
1114 # Start the editor and wait for it to complete |