Patchwork [09,of,12,V3] bundle2: add a 'modes' dictionary to the bundle operation

mail settings
Submitter Boris Feld
Date Nov. 20, 2017, 4:52 p.m.
Message ID <ab0fe3f91e7b9ed7bd50.1511196720@FB>
Download mbox | patch
Permalink /patch/25661/
State Accepted
Headers show


Boris Feld - Nov. 20, 2017, 4:52 p.m.
# HG changeset patch
# User Boris Feld <>
# Date 1508247574 -7200
#      Tue Oct 17 15:39:34 2017 +0200
# Node ID ab0fe3f91e7b9ed7bd508a9affa0b91128facf13
# Parent  1ced6a7918ff64068d36d039e88ba72f0ad0a078
# EXP-Topic b2.bookmarks
# Available At
#              hg pull -r ab0fe3f91e7b
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


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -301,6 +301,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()