diff hgext3rd/topic/topicmap.py @ 2655:417490bdf28a

topic: avoid crash when topic is loaded but not enabled for a repository
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 23 Jun 2017 10:21:37 +0200
parents 13313d0cab71
children f7129e3d5a38
line wrap: on
line diff
--- a/hgext3rd/topic/topicmap.py	Thu Jun 22 15:18:49 2017 +0200
+++ b/hgext3rd/topic/topicmap.py	Fri Jun 23 10:21:37 2017 +0200
@@ -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)