equal
deleted
inserted
replaced
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: |