bundle2-test: use the new way to extend push content
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 02 Jul 2014 16:10:14 +0200
changeset 21905 7923648ad915
parent 21904 5fbccbcc07ea
child 21906 08dcb572a456
bundle2-test: use the new way to extend push content The only core user of the old way were tests. We update them.
tests/test-bundle2.t
--- a/tests/test-bundle2.t	Wed Jul 02 15:26:04 2014 +0200
+++ b/tests/test-bundle2.t	Wed Jul 02 16:10:14 2014 +0200
@@ -947,8 +947,7 @@
   > 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 @@
   >     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