diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -97,7 +97,8 @@ class bundle20(object): This object does not support payload part yet.""" - def __init__(self): + def __init__(self, ui): + self.ui = ui self._params = [] self._parts = [] @@ -110,8 +111,10 @@ class bundle20(object): self._params.append((name, value)) def getchunks(self): + self.ui.debug('start emission of %s stream\n' % _magicstring) yield _magicstring param = self._paramchunk() + self.ui.debug('bundle parameter: %s\n' % param) yield _pack(_fstreamparamsize, len(param)) if param: yield param @@ -119,6 +122,7 @@ class bundle20(object): # no support for parts # to be obviously fixed soon. assert not self._parts + self.ui.debug('end of bundle\n') yield '\0\0' def _paramchunk(self): diff --git a/tests/test-bundle2.t b/tests/test-bundle2.t --- a/tests/test-bundle2.t +++ b/tests/test-bundle2.t @@ -20,7 +20,7 @@ Create an extension to test bundle2 API > '[OUTPUTFILE]') > def cmdbundle2(ui, repo, path=None, **opts): > """write a bundle2 container on standard ouput""" - > bundler = bundle2.bundle20() + > bundler = bundle2.bundle20(ui) > for p in opts['param']: > p = p.split('=', 1) > try: @@ -161,9 +161,11 @@ Test unbundling Test debug output --------------------------------------------------- -(no debug output yet) $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2 + start emission of HG20 stream + bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple + end of bundle file content is ok