Mercurial > hg-stable
changeset 26428:b75c4651b186
bundle2: generate check:heads in a independent function
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Thu, 01 Oct 2015 10:48:14 -0700 |
parents | 97dc6ab42aad |
children | 703d331c44ac |
files | mercurial/exchange.py |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/exchange.py Thu Oct 01 12:17:46 2015 -0500 +++ b/mercurial/exchange.py Thu Oct 01 10:48:14 2015 -0700 @@ -475,6 +475,14 @@ return func return dec +def _pushb2ctxcheckheads(pushop, bundler): + """Generate race condition checking parts + + Exists as an indepedent function to aid extensions + """ + if not pushop.force: + bundler.newpart('check:heads', data=iter(pushop.remoteheads)) + @b2partsgenerator('changeset') def _pushb2ctx(pushop, bundler): """handle changegroup push through bundle2 @@ -490,8 +498,9 @@ pushop.repo.prepushoutgoinghooks(pushop.repo, pushop.remote, pushop.outgoing) - if not pushop.force: - bundler.newpart('check:heads', data=iter(pushop.remoteheads)) + + _pushb2ctxcheckheads(pushop, bundler) + b2caps = bundle2.bundle2caps(pushop.remote) version = None cgversions = b2caps.get('changegroup')