hgext3rd/topic/__init__.py
changeset 3652 81985b9d3e74
parent 3614 9ad461df4d4d
child 3667 a346b1641dfa
equal deleted inserted replaced
3651:fa15068a9945 3652:81985b9d3e74
   591         topic = topic.strip()
   591         topic = topic.strip()
   592         if not topic:
   592         if not topic:
   593             raise error.Abort(_("topic name cannot consist entirely of whitespaces"))
   593             raise error.Abort(_("topic name cannot consist entirely of whitespaces"))
   594         # Have some restrictions on the topic name just like bookmark name
   594         # Have some restrictions on the topic name just like bookmark name
   595         scmutil.checknewlabel(repo, topic, 'topic')
   595         scmutil.checknewlabel(repo, topic, 'topic')
       
   596 
       
   597         rmatch = re.match(br'[\w\-]+', topic)
       
   598         if not rmatch or rmatch.group(0) != topic:
       
   599             helptxt = _("topic names can only consist of alphanumeric, '-'"
       
   600                         " and '_' characters")
       
   601             raise error.Abort(_("invalid topic name: '%s'") % topic, hint=helptxt)
   596 
   602 
   597     compat.startpager(ui, 'topics')
   603     compat.startpager(ui, 'topics')
   598 
   604 
   599     if list:
   605     if list:
   600         if clear or rev:
   606         if clear or rev: