--- a/hgext3rd/topic/__init__.py Thu Jul 06 03:56:36 2017 +0530
+++ b/hgext3rd/topic/__init__.py Thu Jul 06 03:31:11 2017 +0530
@@ -232,6 +232,11 @@
current = self.currenttopic
if current:
ctx.extra()[constants.extrakey] = current
+ else:
+ if ui.configbool('experimental', 'enforce-topic', False):
+ # calling a function to raise an error as error variable
+ # in this function does not refer to the error module
+ panicforuntopicedcommit()
if (isinstance(ctx, context.memctx) and
ctx.extra().get('amend_source') and
ctx.topic() and
@@ -489,6 +494,12 @@
fm.plain('\n')
fm.end()
+def panicforuntopicedcommit():
+ msg = _("no active topic")
+ hint = _("set a current topic or use '--config " +
+ "experimental.enforce-topic=no' to commit without a topic")
+ raise error.Abort(msg, hint=hint)
+
def summaryhook(ui, repo):
t = repo.currenttopic
if not t: