69 ('', 'clear', False, 'clear active topic if any'), |
69 ('', 'clear', False, 'clear active topic if any'), |
70 ('', 'change', '', 'revset of existing revisions to change topic'), |
70 ('', 'change', '', 'revset of existing revisions to change topic'), |
71 ]) |
71 ]) |
72 def topics(ui, repo, topic=None, clear=False, change=None): |
72 def topics(ui, repo, topic=None, clear=False, change=None): |
73 """View current topic, set current topic, or see all topics.""" |
73 """View current topic, set current topic, or see all topics.""" |
74 if not obsolete.isenabled(repo, obsolete.createmarkersopt): |
|
75 raise util.Abort('current reality means you should only ' |
|
76 'use topic with obsolete enabled') |
|
77 if change: |
74 if change: |
|
75 if not obsolete.isenabled(repo, obsolete.createmarkersopt): |
|
76 raise util.Abort(_('must have obsolete enabled to use --change')) |
78 if topic is None and not clear: |
77 if topic is None and not clear: |
79 raise util.Abort('changing topic requires a topic name or --clear') |
78 raise util.Abort('changing topic requires a topic name or --clear') |
80 if any(not c.mutable() for c in repo.set('%r and public()', change)): |
79 if any(not c.mutable() for c in repo.set('%r and public()', change)): |
81 raise util.Abort("can't change topic of a public change") |
80 raise util.Abort("can't change topic of a public change") |
82 rewrote = 0 |
81 rewrote = 0 |