Mercurial > public > mercurial-scm > hg-stable
diff tests/test-commit-interactive.t @ 25483:fb04372d7b38
record: exiting editor with non-zero status should not stop recording session
Before this patch, exiting a hunk edit in record with a non-zero status lead
to the end of the recording session, losing previously-selected hunks to record.
This patch introduces the more desirable behavior of warning the user and
continuing the recording session.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Fri, 05 Jun 2015 13:31:18 -0700 |
parents | 6084926366b9 |
children | ff11c1565c04 |
line wrap: on
line diff
--- a/tests/test-commit-interactive.t Sun Jun 07 18:11:23 2015 -0700 +++ b/tests/test-commit-interactive.t Fri Jun 05 13:31:18 2015 -0700 @@ -1291,6 +1291,33 @@ abort: error parsing patch: unhandled transition: range -> range [255] +Exiting editor with status 1, ignores the edit but does not stop the recording +session + + $ HGEDITOR=false hg commit -i <<EOF + > y + > e + > n + > EOF + diff --git a/editedfile b/editedfile + 1 hunks, 3 lines changed + examine changes to 'editedfile'? [Ynesfdaq?] y + + @@ -1,3 +1,3 @@ + -This is the first line + -This change will be committed + -This is the third line + +This change will not be committed + +This is the second line + +This line has been added + record this change to 'editedfile'? [Ynesfdaq?] e + + editor exited with exit code 1 + record this change to 'editedfile'? [Ynesfdaq?] n + + no changes to record + + random text in random positions is still an error $ cat > editor.sh << '__EOF__'