Patchwork [03,of,14,FIX-bundle2] applybundle: set 'bundle2=1' env for all transaction

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 20, 2015, 2:36 p.m.
Message ID <2e2e372d50d71af76fe2.1445351779@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11185/
State Accepted
Commit a84e0cacb2dd0527eecd99c07d25e672c18eca2c
Headers show

Comments

Pierre-Yves David - Oct. 20, 2015, 2:36 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1445348904 -7200
#      Tue Oct 20 15:48:24 2015 +0200
# Node ID 2e2e372d50d71af76fe290a7d745896a65b8f990
# Parent  00ab5df11ddd122686a34101b91e2ea15088da13
# EXP-Topic generaldelta
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 2e2e372d50d7
applybundle: set 'bundle2=1' env for all transaction

This should be set for all bundle2 application, we enforce that at a low level.
This is for courtesy with hooks.

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -302,10 +302,11 @@  def _notransaction():
     to be created"""
     raise TransactionUnavailable()
 
 def applybundle(repo, unbundler, tr, op=None):
     # transform me in unbundler.apply() as soon as the freeze is lifted
+    tr.hookargs['bundle2'] = '1'
     return processbundle(repo, unbundler, lambda: tr, op=op)
 
 def processbundle(repo, unbundler, transactiongetter=None, op=None):
     """This function process a bundle, apply effect to/from a repo