# HG changeset patch # User Pierre-Yves David # Date 1523902690 -7200 # Node ID a346b1641dfa6f35f3f156bd233702847358369b # Parent af9981930dbd4160f4d1875a03d7ecdcff5d4aee topic: allow '.' in topic names This is also commonly used. diff -r af9981930dbd -r a346b1641dfa CHANGELOG --- a/CHANGELOG Mon Apr 16 10:58:06 2018 -0700 +++ b/CHANGELOG Mon Apr 16 20:18:10 2018 +0200 @@ -18,6 +18,8 @@ * fixed issue 5833 and 5832 + * topic: restring name to letter, '-', '_' and '.' + 7.3.0 -- 2018-03-21 --------------------- diff -r af9981930dbd -r a346b1641dfa hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Apr 16 10:58:06 2018 -0700 +++ b/hgext3rd/topic/__init__.py Mon Apr 16 20:18:10 2018 +0200 @@ -594,10 +594,10 @@ # Have some restrictions on the topic name just like bookmark name scmutil.checknewlabel(repo, topic, 'topic') - rmatch = re.match(br'[\w\-]+', topic) + rmatch = re.match(br'[-_.\w]+', topic) if not rmatch or rmatch.group(0) != topic: helptxt = _("topic names can only consist of alphanumeric, '-'" - " and '_' characters") + " '_' and '.' characters") raise error.Abort(_("invalid topic name: '%s'") % topic, hint=helptxt) compat.startpager(ui, 'topics') diff -r af9981930dbd -r a346b1641dfa tests/test-topic.t --- a/tests/test-topic.t Mon Apr 16 10:58:06 2018 -0700 +++ b/tests/test-topic.t Mon Apr 16 20:18:10 2018 +0200 @@ -117,12 +117,12 @@ $ hg topic 'a12#45' abort: invalid topic name: 'a12#45' - (topic names can only consist of alphanumeric, '-' and '_' characters) + (topic names can only consist of alphanumeric, '-' '_' and '.' characters) [255] $ hg topic 'foo bar' abort: invalid topic name: 'foo bar' - (topic names can only consist of alphanumeric, '-' and '_' characters) + (topic names can only consist of alphanumeric, '-' '_' and '.' characters) [255] this is trying to list topic names @@ -130,7 +130,7 @@ $ hg topic '*12 B23' abort: invalid topic name: '*12 B23' - (topic names can only consist of alphanumeric, '-' and '_' characters) + (topic names can only consist of alphanumeric, '-' '_' and '.' characters) [255] Test commit flag and help text