Mercurial > evolve
changeset 5427:5b1011a5c824
pullbundle: compatibility with discovery.outgoing and ancestorsof in 5.5
outgoing.missingheads property and keyword argument to __init__() was renamed
to ancestorsof.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Tue, 21 Jul 2020 12:52:52 +0800 |
parents | 86736040b0ec |
children | 2bfd0cc1b04c |
files | hgext3rd/pullbundle.py |
diffstat | 1 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/pullbundle.py Tue Jul 21 11:59:28 2020 +0800 +++ b/hgext3rd/pullbundle.py Tue Jul 21 12:52:52 2020 +0800 @@ -190,7 +190,12 @@ ms = missingrevs.copy() ss = [] allslices = [] - missingheads = [rev(n) for n in sorted(outgoing.missingheads, reverse=True)] + # hg <= 5.4 (c93dd9d9f1e6) + if util.safehasattr(outgoing, 'ancestorsof'): + missingheads = outgoing.ancestorsof + else: + missingheads = outgoing.missingheads + missingheads = [rev(n) for n in sorted(missingheads, reverse=True)] for head in missingheads: localslices = [] localmissing = set(repo.revs(b'%ld and ::%d', missingrevs, head)) @@ -375,9 +380,11 @@ return num and not num & (num - 1) def outgoingfromnodes(repo, nodes): - return discovery.outgoing(repo, - missingroots=nodes, - missingheads=nodes) + # hg <= 5.4 (c93dd9d9f1e6) + if r'ancestorsof' in discovery.outgoing.__init__.__code__.co_varnames: + return discovery.outgoing(repo, missingroots=nodes, ancestorsof=nodes) + else: + return discovery.outgoing(repo, missingroots=nodes, missingheads=nodes) # changegroup part construction