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.
--- 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)
--- 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