# HG changeset patch # User Augie Fackler # Date 1433962896 14400 # Node ID 94bbc18daa99f2663e3e40fce3d1a736d2c998ec # Parent 72a58a5bfb6252c01e917ece108a071843668ab2 topic: disallow use of topics without obsolete enabled This is a prelude to allowing changing topics. The experience will be disastrous without obsolete markers, so let's just preempt any potential problems. diff -r 72a58a5bfb62 -r 94bbc18daa99 src/topic/__init__.py --- a/src/topic/__init__.py Wed Jun 10 14:59:46 2015 -0400 +++ b/src/topic/__init__.py Wed Jun 10 15:01:36 2015 -0400 @@ -14,6 +14,7 @@ from mercurial import commands from mercurial import extensions from mercurial import namespaces +from mercurial import obsolete from mercurial import phases from mercurial import util @@ -62,6 +63,9 @@ ]) def topics(ui, repo, topic=None, clear=False): """View current topic, set current topic, or see all topics.""" + if not obsolete.isenabled(repo, obsolete.createmarkersopt): + raise util.Abort('current reality means you should only ' + 'use topic with obsolete enabled') if clear: if repo.vfs.exists('topic'): repo.vfs.unlink('topic')