comparison mercurial/bundle2.py @ 34321:4ef472b975ff

bundle2: only grab a transaction when 'phase-heads' affect the repository The next patch will use the 'phase-heads' part to exchange phase data relevant to the pulled set. 'handlephases' currently acquires a transaction even in case of no-op pull, which would results in an empty transaction and messing with the existing journal. Pass the transaction fetcher to updatephases so it can fetch it if necessary.
author Boris Feld <boris.feld@octobus.net>
date Wed, 20 Sep 2017 18:29:10 +0200
parents 12c42bcd4133
children 10e162bb9bf5
comparison
equal deleted inserted replaced
34320:12c42bcd4133 34321:4ef472b975ff
1838 1838
1839 @parthandler('phase-heads') 1839 @parthandler('phase-heads')
1840 def handlephases(op, inpart): 1840 def handlephases(op, inpart):
1841 """apply phases from bundle part to repo""" 1841 """apply phases from bundle part to repo"""
1842 headsbyphase = phases.binarydecode(inpart) 1842 headsbyphase = phases.binarydecode(inpart)
1843 phases.updatephases(op.repo.unfiltered(), op.gettransaction(), headsbyphase) 1843 phases.updatephases(op.repo.unfiltered(), op.gettransaction, headsbyphase)
1844 op.records.add('phase-heads', {}) 1844 op.records.add('phase-heads', {})
1845 1845
1846 @parthandler('reply:pushkey', ('return', 'in-reply-to')) 1846 @parthandler('reply:pushkey', ('return', 'in-reply-to'))
1847 def handlepushkeyreply(op, inpart): 1847 def handlepushkeyreply(op, inpart):
1848 """retrieve the result of a pushkey request""" 1848 """retrieve the result of a pushkey request"""