mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
bundle2-test: use the new way to extend push content
The only core user of the old way were tests. We update them.
This commit is contained in:
parent
1df43f3299
commit
e38236d704
@ -947,8 +947,7 @@ Setting up
|
||||
> from mercurial import exchange
|
||||
> from mercurial import extensions
|
||||
>
|
||||
> def _pushbundle2failpart(orig, pushop, bundler):
|
||||
> extradata = orig(pushop, bundler)
|
||||
> def _pushbundle2failpart(pushop, bundler):
|
||||
> reason = pushop.ui.config('failpush', 'reason', None)
|
||||
> part = None
|
||||
> if reason == 'abort':
|
||||
@ -958,14 +957,14 @@ Setting up
|
||||
> if reason == 'race':
|
||||
> # 20 Bytes of crap
|
||||
> bundler.newpart('b2x:check:heads', data='01234567890123456789')
|
||||
> return extradata
|
||||
> return lambda op: None
|
||||
>
|
||||
> @bundle2.parthandler("test:abort")
|
||||
> def handleabort(op, part):
|
||||
> raise util.Abort('Abandon ship!', hint="don't panic")
|
||||
>
|
||||
> def uisetup(ui):
|
||||
> extensions.wrapfunction(exchange, '_pushbundle2extraparts', _pushbundle2failpart)
|
||||
> exchange.bundle2partsgenerators.insert(0, _pushbundle2failpart)
|
||||
>
|
||||
> EOF
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user