src/topic/__init__.py
changeset 1894 f8ee36489d3c
parent 1890 e846b8f402d0
child 1895 c8e4c6e03957
equal deleted inserted replaced
1893:9d1157fcdc6c 1894:f8ee36489d3c
   168 ])
   168 ])
   169 def topics(ui, repo, topic='', clear=False, change=None):
   169 def topics(ui, repo, topic='', clear=False, change=None):
   170     """View current topic, set current topic, or see all topics."""
   170     """View current topic, set current topic, or see all topics."""
   171     if change:
   171     if change:
   172         if not obsolete.isenabled(repo, obsolete.createmarkersopt):
   172         if not obsolete.isenabled(repo, obsolete.createmarkersopt):
   173             raise util.Abort(_('must have obsolete enabled to use --change'))
   173             raise error.Abort(_('must have obsolete enabled to use --change'))
   174         if not topic and not clear:
   174         if not topic and not clear:
   175             raise util.Abort('changing topic requires a topic name or --clear')
   175             raise error.Abort('changing topic requires a topic name or --clear')
   176         if any(not c.mutable() for c in repo.set('%r and public()', change)):
   176         if any(not c.mutable() for c in repo.set('%r and public()', change)):
   177             raise util.Abort("can't change topic of a public change")
   177             raise error.Abort("can't change topic of a public change")
   178         rewrote = 0
   178         rewrote = 0
   179         needevolve = False
   179         needevolve = False
   180         l = repo.lock()
   180         l = repo.lock()
   181         txn = repo.transaction('rewrite-topics')
   181         txn = repo.transaction('rewrite-topics')
   182         try:
   182         try: