# HG changeset patch # User Pierre-Yves David # Date 1498206097 -7200 # Node ID 417490bdf28ad531f657506e046a8e110d5cf714 # Parent 320f4faef18c0425652ff0912cbe356434c78034 topic: avoid crash when topic is loaded but not enabled for a repository diff --git a/hgext3rd/topic/__init__.py b/hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py +++ b/hgext3rd/topic/__init__.py @@ -229,7 +229,7 @@ def branchmap(self, topic=None): if topic is None: - topic = self._autobranchmaptopic + topic = getattr(repo, '_autobranchmaptopic', False) topicfilter = topicmap.topicfilter(self.filtername) if not topic or topicfilter == self.filtername: return super(topicrepo, self).branchmap() diff --git a/hgext3rd/topic/topicmap.py b/hgext3rd/topic/topicmap.py --- a/hgext3rd/topic/topicmap.py +++ b/hgext3rd/topic/topicmap.py @@ -103,7 +103,7 @@ extensions.wrapfunction(branchmap, 'updatecache', _wrapupdatebmcache) def _wrapupdatebmcache(orig, repo): - previous = repo._autobranchmaptopic + previous = getattr(repo, '_autobranchmaptopic', False) try: repo._autobranchmaptopic = False return orig(repo)