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