##// END OF EJS Templates
record: exiting editor with non-zero status should not stop recording session...
Laurent Charignon -
r25483:fb04372d default
parent child Browse files
Show More
@@ -1023,9 +1023,11 b' the hunk is left unchanged.'
1023 1023 f.close()
1024 1024 # Start the editor and wait for it to complete
1025 1025 editor = ui.geteditor()
1026 ui.system("%s \"%s\"" % (editor, patchfn),
1027 environ={'HGUSER': ui.username()},
1028 onerr=util.Abort, errprefix=_("edit failed"))
1026 ret = ui.system("%s \"%s\"" % (editor, patchfn),
1027 environ={'HGUSER': ui.username()})
1028 if ret != 0:
1029 ui.warn(_("editor exited with exit code %d\n") % ret)
1030 continue
1029 1031 # Remove comment lines
1030 1032 patchfp = open(patchfn)
1031 1033 ncpatchfp = cStringIO.StringIO()
@@ -1291,6 +1291,33 b' Malformed patch - error handling'
1291 1291 abort: error parsing patch: unhandled transition: range -> range
1292 1292 [255]
1293 1293
1294 Exiting editor with status 1, ignores the edit but does not stop the recording
1295 session
1296
1297 $ HGEDITOR=false hg commit -i <<EOF
1298 > y
1299 > e
1300 > n
1301 > EOF
1302 diff --git a/editedfile b/editedfile
1303 1 hunks, 3 lines changed
1304 examine changes to 'editedfile'? [Ynesfdaq?] y
1305
1306 @@ -1,3 +1,3 @@
1307 -This is the first line
1308 -This change will be committed
1309 -This is the third line
1310 +This change will not be committed
1311 +This is the second line
1312 +This line has been added
1313 record this change to 'editedfile'? [Ynesfdaq?] e
1314
1315 editor exited with exit code 1
1316 record this change to 'editedfile'? [Ynesfdaq?] n
1317
1318 no changes to record
1319
1320
1294 1321 random text in random positions is still an error
1295 1322
1296 1323 $ cat > editor.sh << '__EOF__'
General Comments 0
You need to be logged in to leave comments. Login now