Mercurial > public > mercurial-scm > hg
diff tests/test-histedit-edit.t @ 21409:37a3ac247c0d
histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
This omits (redundant) adding "\n' to "message", because:
- empty line is inserted by "commitforceeditor", if editor is invoked
- tail white-spaces are stripped at storing into chaneglog, otherwise
This patch also enhances "test-histedit-edit.t", because "hg histedit"
hasn't been explicitly tested around editor invocation and
"--continue" option.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 11 May 2014 00:49:35 +0900 |
parents | 47bfe5d433ac |
children | a5168eb9b2bc |
line wrap: on
line diff
--- a/tests/test-histedit-edit.t Sun May 11 00:49:35 2014 +0900 +++ b/tests/test-histedit-edit.t Sun May 11 00:49:35 2014 +0900 @@ -156,7 +156,19 @@ update: 1 new changesets (update) hist: 1 remaining (histedit --continue) - $ HGEDITOR='true' hg histedit --continue +(test also that editor is invoked if histedit is continued for +"edit" action) + + $ HGEDITOR='cat' hg histedit --continue + f + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'default' + HG: added f 0 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-backup.hg (glob) @@ -271,6 +283,25 @@ check saving last-message.txt +(test also that editor is invoked if histedit is continued for "message" +action) + + $ HGEDITOR=cat hg histedit --continue + f + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'default' + HG: added f + transaction abort! + rollback completed + note: commit message saved in .hg/last-message.txt + abort: pretxncommit.unexpectedabort hook exited with status 1 + [255] + $ cat >> .hg/hgrc <<EOF > [hooks] > pretxncommit.unexpectedabort =