# HG changeset patch # User Pierre-Yves David # Date 1508527754 -7200 # Node ID f06c86fd2ffdecf62c9b2060bfc7b4933ac7ab1d # Parent c458c0856ee534037ea0963c292d4e15d0ad6cc6 topic: do to check to topic while amending Right know the 'topic-mode' mess with amend. Especially in case of amending merge where the merge is not properly detected. diff -r c458c0856ee5 -r f06c86fd2ffd hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Fri Oct 20 21:43:13 2017 +0200 +++ b/hgext3rd/topic/__init__.py Fri Oct 20 21:29:14 2017 +0200 @@ -1004,6 +1004,8 @@ t = opts['topic'] with repo.vfs.open('topic', 'w') as f: f.write(t) + elif opts.get('amend'): + pass elif notopic and mayabort: msg = _("no active topic") raise error.Abort(msg, hint=hint) diff -r c458c0856ee5 -r f06c86fd2ffd tests/test-topic-mode.t --- a/tests/test-topic-mode.t Fri Oct 20 21:43:13 2017 +0200 +++ b/tests/test-topic-mode.t Fri Oct 20 21:29:14 2017 +0200 @@ -50,15 +50,32 @@ > EOF $ touch a b c d $ hg add a - $ hg ci -m "Added a" - warning: new draft commit without topic - (see 'hg help -e topic.topic-mode' for details) (same test, checking we abort before the editor) - $ EDITOR=cat hg ci --amend -m "Added a" --edit + $ HGEDITOR=cat hg ci -m "Added a" --edit warning: new draft commit without topic (see 'hg help -e topic.topic-mode' for details) + Added a + + + 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 a + + $ HGEDITOR=cat hg ci --amend -m "Added a" --edit + Added a + + + 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 a $ hg ci --amend -m "added a'" --config experimental.topic-mode=ignore $ hg log changeset: 2:2e862d8b5eff