# HG changeset patch # User Pierre-Yves David # Date 1506845448 -3600 # Node ID b220e2f5ebd5b449054b1a2df482e2b207362ff3 # Parent e9935c2c4672373e9c084f853281aa66cc697f28 topic: update the topic-mode hint The hint is now shorter and reference the documentation. That should provide more concise output with more details for user who seeks it. diff -r e9935c2c4672 -r b220e2f5ebd5 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Sun Oct 01 09:05:42 2017 +0100 +++ b/hgext3rd/topic/__init__.py Sun Oct 01 09:10:48 2017 +0100 @@ -925,17 +925,18 @@ mayabort = True maywarn = False + hint = _("see 'hg help -e topic.topic-mode' for details") if opts.get('topic'): t = opts['topic'] with repo.vfs.open('topic', 'w') as f: f.write(t) elif notopic and mayabort: msg = _("no active topic") - hint = _("set a current topic or use '--config " + - "experimental.topic-mode=off' to commit without a topic") raise error.Abort(msg, hint=hint) elif notopic and maywarn: ui.warn(_("warning: new draft commit without topic\n")) + if not ui.quiet: + ui.warn(("(%s)") % hint) return orig(ui, repo, *args, **opts) def committextwrap(orig, repo, ctx, subs, extramsg): diff -r e9935c2c4672 -r b220e2f5ebd5 tests/test-topic-tutorial.t --- a/tests/test-topic-tutorial.t Sun Oct 01 09:05:42 2017 +0100 +++ b/tests/test-topic-tutorial.t Sun Oct 01 09:10:48 2017 +0100 @@ -714,7 +714,7 @@ $ echo sickle >> shopping $ hg commit -m 'Adding sickle' abort: no active topic - (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic) + (see 'hg help -e topic.topic-mode' for details) [255] Ok, let's clean this up and delve into multiple topics. diff -r e9935c2c4672 -r b220e2f5ebd5 tests/test-topic.t --- a/tests/test-topic.t Sun Oct 01 09:05:42 2017 +0100 +++ b/tests/test-topic.t Sun Oct 01 09:10:48 2017 +0100 @@ -926,14 +926,14 @@ $ hg add a $ hg ci -m "Added a" abort: no active topic - (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic) + (see 'hg help -e topic.topic-mode' for details) [255] (same test, checking we abort before the editor) $ EDITOR=cat hg ci -m "Added a" --edit abort: no active topic - (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic) + (see 'hg help -e topic.topic-mode' for details) [255] $ hg ci -m "added a" --config experimental.topic-mode=off $ hg log diff -r e9935c2c4672 -r b220e2f5ebd5 tests/test-topicmode.t --- a/tests/test-topicmode.t Sun Oct 01 09:05:42 2017 +0100 +++ b/tests/test-topicmode.t Sun Oct 01 09:10:48 2017 +0100 @@ -17,14 +17,14 @@ $ hg add a $ hg ci -m "Added a" abort: no active topic - (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic) + (see 'hg help -e topic.topic-mode' for details) [255] (same test, checking we abort before the editor) $ EDITOR=cat hg ci -m "Added a" --edit abort: no active topic - (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic) + (see 'hg help -e topic.topic-mode' for details) [255] $ hg ci -m "added a" --config experimental.topic-mode=off $ hg log @@ -52,11 +52,13 @@ $ hg add a $ hg ci -m "Added a" warning: new draft commit without topic + (see 'hg help -e topic.topic-mode' for details) (no-eol) (same test, checking we abort before the editor) $ EDITOR=cat hg ci --amend -m "Added a" --edit warning: new draft commit without topic + (see 'hg help -e topic.topic-mode' for details) (no-eol) $ hg ci --amend -m "added a'" --config experimental.topic-mode=off $ hg log changeset: 2:2e862d8b5eff @@ -101,6 +103,7 @@ (branch merge, don't forget to commit) $ hg commit -m "merge mytopic" warning: new draft commit without topic + (see 'hg help -e topic.topic-mode' for details) (no-eol) $ hg log -G @ changeset: 3:676a445d1c09 @@ -163,7 +166,7 @@ (branch merge, don't forget to commit) $ hg commit -m "merge mytopic" abort: no active topic - (set a current topic or use '--config experimental.topic-mode=off' to commit without a topic) + (see 'hg help -e topic.topic-mode' for details) [255] $ hg log -G