[PATCH 06 of 14 FIX-bundle2] applybundle: take url as argument

Gregory Szorc gregory.szorc at gmail.com
Tue Oct 20 10:54:14 CDT 2015


On Tue, Oct 20, 2015 at 7:36 AM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1445349304 -7200
> #      Tue Oct 20 15:55:04 2015 +0200
> # Node ID 6a047ac5272421588ec1ac05bb27a37b97d02998
> # Parent  629c8862faa83a0cb61a0279ae0af484f895e824
> # EXP-Topic generaldelta
> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r
> 6a047ac52724
> applybundle: take url as argument
>
> We allow to specify the url to carry it to hooks. This get use closer to
> 'bundle1.apply(...)' and will also use to remove regression in multiple
> place
> were we forget to pass the url to hooks.
>
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -300,15 +300,17 @@ def _notransaction():
>
>      Raise an exception to highlight the fact that no transaction was
> expected
>      to be created"""
>      raise TransactionUnavailable()
>
> -def applybundle(repo, unbundler, tr, source=None, op=None):
> +def applybundle(repo, unbundler, tr, source=None, url=None, op=None):
>      # transform me in unbundler.apply() as soon as the freeze is lifted
>      tr.hookargs['bundle2'] = '1'
>      if source is not None and 'source' not in tr.hookargs:
>          tr.hookargs['source'] = source
> +    if url is not None and 'source' not in tr.hookargs:
> +        tr.hookargs['url'] = source
>

Two typos where "source" should be "url"


>      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
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151020/481ea623/attachment.html>


More information about the Mercurial-devel mailing list