# HG changeset patch # User Boris Feld # Date 1508247574 -7200 # Node ID 1f30cbac34b655436b1479d4d43c6ab47dec04e2 # Parent a1e70c1dbec08e3eae1c3f79e376664572db7b43 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. diff -r a1e70c1dbec0 -r 1f30cbac34b6 mercurial/bundle2.py --- a/mercurial/bundle2.py Tue Oct 17 12:38:13 2017 +0200 +++ b/mercurial/bundle2.py Tue Oct 17 15:39:34 2017 +0200 @@ -301,6 +301,8 @@ self.captureoutput = captureoutput self.hookargs = {} self._gettransaction = transactiongetter + # carries value that can modify part behavior + self.modes = {} def gettransaction(self): transaction = self._gettransaction()