Patchwork [05,of,14,FIX-bundle2] unbundle: use 'source' argument with applybundle

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 20, 2015, 2:36 p.m.
Message ID <629c8862faa83a0cb61a.1445351781@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11186/
State Accepted
Commit 238d21f684b57194f0ab653e2c2473151021d3ac
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 1445349187 -7200
#      Tue Oct 20 15:53:07 2015 +0200
# Node ID 629c8862faa83a0cb61a0279ae0af484f895e824
# Parent  3949b5bbf0d712f214cf3cbc4c9a11d99799efa1
# EXP-Topic generaldelta
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 629c8862faa8
unbundle: use 'source' argument with applybundle

This will let the hook get access to the 'source' value.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6529,11 +6529,11 @@  def unbundle(ui, repo, fname1, *fnames, 
             f = hg.openpath(ui, fname)
             gen = exchange.readbundle(ui, f, fname)
             if isinstance(gen, bundle2.unbundle20):
                 tr = repo.transaction('unbundle')
                 try:
-                    op = bundle2.applybundle(repo, gen, tr)
+                    op = bundle2.applybundle(repo, gen, tr, source='unbundle')
                     tr.close()
                 except error.BundleUnknownFeatureError as exc:
                     raise error.Abort(_('%s: unknown bundle feature, %s')
                                      % (fname, exc),
                                      hint=_("see https://mercurial-scm.org/"