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

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 20, 2015, 2:36 p.m.
Message ID <1e5811a59d778df4f38b.1445351783@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11194/
State Accepted
Commit 1760ca4ee919da17e8a643cefa6a81e444494ddd
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 1445349382 -7200
#      Tue Oct 20 15:56:22 2015 +0200
# Node ID 1e5811a59d778df4f38b244376bbc64c673690eb
# Parent  6a047ac5272421588ec1ac05bb27a37b97d02998
# EXP-Topic generaldelta
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 1e5811a59d77
unbundle: use 'url' argument with applybundle

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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6529,11 +6529,12 @@  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, source='unbundle')
+                    op = bundle2.applybundle(repo, gen, tr, source='unbundle',
+                                             url='bundle:' + fname)
                     tr.close()
                 except error.BundleUnknownFeatureError as exc:
                     raise error.Abort(_('%s: unknown bundle feature, %s')
                                      % (fname, exc),
                                      hint=_("see https://mercurial-scm.org/"