topic: further simplify the clear logic
We just set 'topic' to None and the rest should follow.
--- a/hgext3rd/topic/__init__.py Wed Jun 21 03:28:25 2017 +0530
+++ b/hgext3rd/topic/__init__.py Wed Jun 21 11:55:45 2017 +0200
@@ -274,14 +274,13 @@
if rev:
if not obsolete.isenabled(repo, obsolete.createmarkersopt):
raise error.Abort(_('must have obsolete enabled to change topics'))
- if not topic and not clear:
+ if clear:
+ topic = None
+ elif not topic:
raise error.Abort('changing topic requires a topic name or --clear')
if any(not c.mutable() for c in repo.set('%r and public()', rev)):
raise error.Abort("can't change topic of a public change")
- if clear:
- _changetopics(ui, repo, rev, None)
- else:
- _changetopics(ui, repo, rev, topic)
+ _changetopics(ui, repo, rev, topic)
if clear:
if repo.vfs.exists('topic'):
repo.vfs.unlink('topic')