comparison mercurial/bundle2.py @ 27325:ea390d889d3a

bundle2: gracefully skip 'obsmarkers' part if evolution is disabled We would skip the part if it was fully unknown, so we should also skip it if we know we won't be able to apply it. This will allow us to produce bundles with obsolescence markers alongside changegroup while still being able to apply them on any client.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 15 Oct 2015 03:29:00 +0100
parents 56b2bcea2529
children c94cdeeb586a
comparison
equal deleted inserted replaced
27324:74ff350c208c 27325:ea390d889d3a
1479 tr = op.gettransaction() 1479 tr = op.gettransaction()
1480 markerdata = inpart.read() 1480 markerdata = inpart.read()
1481 if op.ui.config('experimental', 'obsmarkers-exchange-debug', False): 1481 if op.ui.config('experimental', 'obsmarkers-exchange-debug', False):
1482 op.ui.write(('obsmarker-exchange: %i bytes received\n') 1482 op.ui.write(('obsmarker-exchange: %i bytes received\n')
1483 % len(markerdata)) 1483 % len(markerdata))
1484 # The mergemarkers call will crash if marker creation is not enabled.
1485 # we want to avoid this if the part is advisory.
1486 if not inpart.mandatory and op.repo.obsstore.readonly:
1487 op.repo.ui.debug('ignoring obsolescence markers, feature not enabled')
1488 return
1484 new = op.repo.obsstore.mergemarkers(tr, markerdata) 1489 new = op.repo.obsstore.mergemarkers(tr, markerdata)
1485 if new: 1490 if new:
1486 op.repo.ui.status(_('%i new obsolescence markers\n') % new) 1491 op.repo.ui.status(_('%i new obsolescence markers\n') % new)
1487 op.records.add('obsmarkers', {'new': new}) 1492 op.records.add('obsmarkers', {'new': new})
1488 if op.reply is not None: 1493 if op.reply is not None: