Mercurial > public > mercurial-scm > hg
diff tests/test-tag.t @ 21237:0054a77f49df
localrepo: add "editor" argument to "tag()"
Before this patch, "localrepository.tag()" doesn't take "editor"
argument, and this prevents callers from passing "editor" argument to
"localrepository.commit()" invoked internally.
This patch adds "editor" argument to "localrepository.tag()" (and
"_tag()", too), and makes "commands.tag()" invoke it with "editor"
argument.
This patch also omits explicit "localrepository.savecommitmesssage()"
invocation, because "localrepository.commit()" will invoke specified
"editor" and save edited commit message into ".hg/last-message.txt"
automatically.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 05 May 2014 21:26:40 +0900 |
parents | bcfc4f625e57 |
children | d4b8fc753455 |
line wrap: on
line diff
--- a/tests/test-tag.t Mon May 05 21:26:40 2014 +0900 +++ b/tests/test-tag.t Mon May 05 21:26:40 2014 +0900 @@ -225,8 +225,11 @@ at first, test saving last-message.txt +(test that editor is not invoked before transaction starting) + $ cat > .hg/hgrc << '__EOF__' > [hooks] + > # this failure occurs before editor invocation > pretag.test-saving-lastmessage = false > __EOF__ $ rm -f .hg/last-message.txt @@ -234,12 +237,37 @@ abort: pretag.test-saving-lastmessage hook exited with status 1 [255] $ cat .hg/last-message.txt + cat: .hg/last-message.txt: No such file or directory + [1] + +(test that editor is invoked and commit message is saved into +"last-message.txt") + + $ cat >> .hg/hgrc << '__EOF__' + > [hooks] + > pretag.test-saving-lastmessage = + > # this failure occurs after editor invocation + > pretxncommit.unexpectedabort = false + > __EOF__ + + $ rm -f .hg/last-message.txt + $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e + transaction abort! + rollback completed + note: commit message saved in .hg/last-message.txt + abort: pretxncommit.unexpectedabort hook exited with status 1 + [255] + $ cat .hg/last-message.txt custom tag message second line - $ cat > .hg/hgrc << '__EOF__' + + $ cat >> .hg/hgrc << '__EOF__' > [hooks] - > pretag.test-saving-lastmessage = + > pretxncommit.unexpectedabort = > __EOF__ + $ hg status .hgtags + M .hgtags + $ hg revert --no-backup -q .hgtags then, test custom commit message itself