[PATCH evolve-ext] obsdiscovery: adopt to calling convention change
Boris FELD
boris.feld at octobus.net
Fri Oct 19 16:06:04 UTC 2018
I was checking the in-flight patches and saw that we never acknowledge
the reception of those patches.
Thank you, they have been merged in evolve.
Sorry about the delay.
On 17/09/2018 18:26, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1537201528 25200
> # Mon Sep 17 09:25:28 2018 -0700
> # Node ID eb8410cf882514e7db8cb1ab0ca17be6f2225135
> # Parent d3ea35ad88f35c158070077b83fa66e5f708940f
> obsdiscovery: adopt to calling convention change
>
> Upstream commits 71d83b315778 and abce899c985f changed the calling
> convention of setdiscovery._takefullsample().
>
> We inspect the signature of the function before calling it so
> we can pass the proper arguments.
>
> diff --git a/hgext3rd/evolve/obsdiscovery.py b/hgext3rd/evolve/obsdiscovery.py
> --- a/hgext3rd/evolve/obsdiscovery.py
> +++ b/hgext3rd/evolve/obsdiscovery.py
> @@ -24,6 +24,7 @@ except ImportError:
>
> import hashlib
> import heapq
> +import inspect
> import sqlite3
> import struct
> import weakref
> @@ -110,7 +111,12 @@ def findcommonobsmarkers(ui, local, remo
> if len(undecided) < fullsamplesize:
> sample = set(undecided)
> else:
> - sample = _takefullsample(dag, undecided, size=fullsamplesize)
> + # Mercurial 4.8 changed calling convention.
> + if len(inspect.getargspec(_takefullsample)[0]) == 4:
> + sample = _takefullsample(local, None, undecided,
> + size=fullsamplesize)
> + else:
> + sample = _takefullsample(dag, undecided, size=fullsamplesize)
>
> roundtrips += 1
> ui.progress(_("comparing with other"), totalnb - len(undecided),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list