comparison hgext3rd/topic/discovery.py @ 4543:7f1e1ba3d16b stable

topic: only wrap _pushb2phases 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:52 +0200
parents f5127bfc1588
children 75b414b298f5
comparison
equal deleted inserted replaced
4542:f5127bfc1588 4543:7f1e1ba3d16b
187 else: 187 else:
188 tr._validator = validator 188 tr._validator = validator
189 handlecheckheads.params = frozenset() 189 handlecheckheads.params = frozenset()
190 190
191 def _pushb2phases(orig, pushop, bundler): 191 def _pushb2phases(orig, pushop, bundler):
192 checktypes = ('check:heads', 'check:updated-heads') 192 if common.hastopicext(pushop.repo):
193 hascheck = any(p.type in checktypes for p in bundler._parts) 193 checktypes = ('check:heads', 'check:updated-heads')
194 if not hascheck and pushop.outdatedphases: 194 hascheck = any(p.type in checktypes for p in bundler._parts)
195 exchange._pushb2ctxcheckheads(pushop, bundler) 195 if not hascheck and pushop.outdatedphases:
196 exchange._pushb2ctxcheckheads(pushop, bundler)
196 return orig(pushop, bundler) 197 return orig(pushop, bundler)
197 198
198 def wireprotocaps(orig, repo, proto): 199 def wireprotocaps(orig, repo, proto):
199 caps = orig(repo, proto) 200 caps = orig(repo, proto)
200 if repo.peer().capable('topics'): 201 if repo.peer().capable('topics'):