diff hgext3rd/topic/__init__.py @ 2339:f641cccbd119

topic: automatically configure thg to display topic If no other config is set, we configure Tortoise-hg to display topic. This should helps usability.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 10 May 2017 13:03:05 +0200
parents b6ea9049693d
children e6d3b83b306b
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Wed May 10 13:08:45 2017 +0200
+++ b/hgext3rd/topic/__init__.py	Wed May 10 13:03:05 2017 +0200
@@ -157,6 +157,10 @@
     if not isinstance(repo, localrepo.localrepository):
         return # this can be a peer in the ssh case (puzzling)
 
+    if repo.ui.config('experimental', 'thg.displaynames', None) is None:
+        repo.ui.setconfig('experimental', 'thg.displaynames', 'topics',
+                          source='topic-extension')
+
     class topicrepo(repo.__class__):
 
         def _restrictcapabilities(self, caps):