comparison mercurial/bundle2.py @ 35274:1f30cbac34b6

bundle2: add a 'modes' dictionary to the bundle operation This new attribute allows the codes requesting an unbundling to pass important information to individual part handlers. The current target use case is to allow for receiving 'bookmarks' part without directly updating local repository, but just recording the received data instead. This is necessary for pull where the remote bookmarks are processed locally. I expect the concept to be beneficial to other parts in the future. To clarify the bookmark behavior on pull, the remote bookmark value are not just taken -as-is- into the local repository. There is an extra step to detect bookmark divergence. The remote bookmarks data are stored until this processing happens.
author Boris Feld <boris.feld@octobus.net>
date Tue, 17 Oct 2017 15:39:34 +0200
parents f392066d127c
children 496154e41968
comparison
equal deleted inserted replaced
35273:a1e70c1dbec0 35274:1f30cbac34b6
299 self.records = unbundlerecords() 299 self.records = unbundlerecords()
300 self.reply = None 300 self.reply = None
301 self.captureoutput = captureoutput 301 self.captureoutput = captureoutput
302 self.hookargs = {} 302 self.hookargs = {}
303 self._gettransaction = transactiongetter 303 self._gettransaction = transactiongetter
304 # carries value that can modify part behavior
305 self.modes = {}
304 306
305 def gettransaction(self): 307 def gettransaction(self):
306 transaction = self._gettransaction() 308 transaction = self._gettransaction()
307 309
308 if self.hookargs: 310 if self.hookargs: