equal
deleted
inserted
replaced
12 |
12 |
13 from mercurial import cmdutil |
13 from mercurial import cmdutil |
14 from mercurial import commands |
14 from mercurial import commands |
15 from mercurial import extensions |
15 from mercurial import extensions |
16 from mercurial import namespaces |
16 from mercurial import namespaces |
|
17 from mercurial import obsolete |
17 from mercurial import phases |
18 from mercurial import phases |
18 from mercurial import util |
19 from mercurial import util |
19 |
20 |
20 cmdtable = {} |
21 cmdtable = {} |
21 command = cmdutil.command(cmdtable) |
22 command = cmdutil.command(cmdtable) |
60 @command('topics', [ |
61 @command('topics', [ |
61 ('', 'clear', False, 'clear active topic if any'), |
62 ('', 'clear', False, 'clear active topic if any'), |
62 ]) |
63 ]) |
63 def topics(ui, repo, topic=None, clear=False): |
64 def topics(ui, repo, topic=None, clear=False): |
64 """View current topic, set current topic, or see all topics.""" |
65 """View current topic, set current topic, or see all topics.""" |
|
66 if not obsolete.isenabled(repo, obsolete.createmarkersopt): |
|
67 raise util.Abort('current reality means you should only ' |
|
68 'use topic with obsolete enabled') |
65 if clear: |
69 if clear: |
66 if repo.vfs.exists('topic'): |
70 if repo.vfs.exists('topic'): |
67 repo.vfs.unlink('topic') |
71 repo.vfs.unlink('topic') |
68 return |
72 return |
69 if topic is not None: |
73 if topic is not None: |