Patchwork [11,of,15,V2] bundle2: add a 'modes' dictionary to the bundle operation

login
register
mail settings
Submitter Boris Feld
Date Nov. 2, 2017, 1:18 p.m.
Message ID <bd3927325fe48e104b16.1509628688@FB>
Download mbox | patch
Permalink /patch/25338/
State Accepted
Headers show

Comments

Boris Feld - Nov. 2, 2017, 1:18 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1508247574 -7200
#      Tue Oct 17 15:39:34 2017 +0200
# Node ID bd3927325fe48e104b1627e5681ccd09a9a49e44
# Parent  9a8c55d83b3601a41f0d406f80de2f245bbb6c83
# EXP-Topic b2.bookmarks
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r bd3927325fe4
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.

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -300,6 +300,8 @@  class bundleoperation(object):
         self.captureoutput = captureoutput
         self.hookargs = {}
         self._gettransaction = transactiongetter
+        # carries value that can modify part behavior
+        self.modes = {}
 
     def gettransaction(self):
         transaction = self._gettransaction()