# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1523902690 -7200
#      Mon Apr 16 20:18:10 2018 +0200
# Node ID a346b1641dfa6f35f3f156bd233702847358369b
# Parent  af9981930dbd4160f4d1875a03d7ecdcff5d4aee
topic: allow '.' in topic names

This is also commonly used.

diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,8 @@
 
   * fixed issue 5833 and 5832
 
+  * topic: restring name to letter, '-', '_' and '.'
+
 7.3.0 -- 2018-03-21
 ---------------------
 
diff --git a/hgext3rd/topic/__init__.py b/hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py
+++ b/hgext3rd/topic/__init__.py
@@ -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 --git a/tests/test-topic.t b/tests/test-topic.t
--- a/tests/test-topic.t
+++ b/tests/test-topic.t
@@ -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