Mercurial > evolve
comparison hgext3rd/topic/__init__.py @ 3667:a346b1641dfa
topic: allow '.' in topic names
This is also commonly used.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 16 Apr 2018 20:18:10 +0200 |
parents | 81985b9d3e74 |
children | 2a62f0f480f3 |
comparison
equal
deleted
inserted
replaced
3666:af9981930dbd | 3667:a346b1641dfa |
---|---|
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 | 596 |
597 rmatch = re.match(br'[\w\-]+', topic) | 597 rmatch = re.match(br'[-_.\w]+', topic) |
598 if not rmatch or rmatch.group(0) != topic: | 598 if not rmatch or rmatch.group(0) != topic: |
599 helptxt = _("topic names can only consist of alphanumeric, '-'" | 599 helptxt = _("topic names can only consist of alphanumeric, '-'" |
600 " and '_' characters") | 600 " '_' and '.' characters") |
601 raise error.Abort(_("invalid topic name: '%s'") % topic, hint=helptxt) | 601 raise error.Abort(_("invalid topic name: '%s'") % topic, hint=helptxt) |
602 | 602 |
603 compat.startpager(ui, 'topics') | 603 compat.startpager(ui, 'topics') |
604 | 604 |
605 if list: | 605 if list: |