comparison hgext3rd/topic/discovery.py @ 4542:f5127bfc1588 stable

topic: only wrap handlecheckheads for repo with topic This helps repository with and without topic to coexist in the same process.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 18 Apr 2019 13:02:44 +0200
parents 7e98faf278d6
children 7f1e1ba3d16b
comparison
equal deleted inserted replaced
4541:7e98faf278d6 4542:f5127bfc1588
152 return data 152 return data
153 153
154 def handlecheckheads(orig, op, inpart): 154 def handlecheckheads(orig, op, inpart):
155 """This is used to check for new heads when publishing changeset""" 155 """This is used to check for new heads when publishing changeset"""
156 orig(op, inpart) 156 orig(op, inpart)
157 if op.repo.publishing(): 157 if not common.hastopicext(op.repo) or op.repo.publishing():
158 return 158 return
159 tr = op.gettransaction() 159 tr = op.gettransaction()
160 if tr.hookargs['source'] not in ('push', 'serve'): # not a push 160 if tr.hookargs['source'] not in ('push', 'serve'): # not a push
161 return 161 return
162 tr._prepushheads = _nbheads(op.repo) 162 tr._prepushheads = _nbheads(op.repo)