##// END OF EJS Templates
bundle2: print debug information during bundling...
Pierre-Yves David -
r20842:938718d7 default
parent child Browse files
Show More
@@ -97,7 +97,8 b' class bundle20(object):'
97
97
98 This object does not support payload part yet."""
98 This object does not support payload part yet."""
99
99
100 def __init__(self):
100 def __init__(self, ui):
101 self.ui = ui
101 self._params = []
102 self._params = []
102 self._parts = []
103 self._parts = []
103
104
@@ -110,8 +111,10 b' class bundle20(object):'
110 self._params.append((name, value))
111 self._params.append((name, value))
111
112
112 def getchunks(self):
113 def getchunks(self):
114 self.ui.debug('start emission of %s stream\n' % _magicstring)
113 yield _magicstring
115 yield _magicstring
114 param = self._paramchunk()
116 param = self._paramchunk()
117 self.ui.debug('bundle parameter: %s\n' % param)
115 yield _pack(_fstreamparamsize, len(param))
118 yield _pack(_fstreamparamsize, len(param))
116 if param:
119 if param:
117 yield param
120 yield param
@@ -119,6 +122,7 b' class bundle20(object):'
119 # no support for parts
122 # no support for parts
120 # to be obviously fixed soon.
123 # to be obviously fixed soon.
121 assert not self._parts
124 assert not self._parts
125 self.ui.debug('end of bundle\n')
122 yield '\0\0'
126 yield '\0\0'
123
127
124 def _paramchunk(self):
128 def _paramchunk(self):
@@ -20,7 +20,7 b' Create an extension to test bundle2 API'
20 > '[OUTPUTFILE]')
20 > '[OUTPUTFILE]')
21 > def cmdbundle2(ui, repo, path=None, **opts):
21 > def cmdbundle2(ui, repo, path=None, **opts):
22 > """write a bundle2 container on standard ouput"""
22 > """write a bundle2 container on standard ouput"""
23 > bundler = bundle2.bundle20()
23 > bundler = bundle2.bundle20(ui)
24 > for p in opts['param']:
24 > for p in opts['param']:
25 > p = p.split('=', 1)
25 > p = p.split('=', 1)
26 > try:
26 > try:
@@ -161,9 +161,11 b' Test unbundling'
161
161
162 Test debug output
162 Test debug output
163 ---------------------------------------------------
163 ---------------------------------------------------
164 (no debug output yet)
165
164
166 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
165 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
166 start emission of HG20 stream
167 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
168 end of bundle
167
169
168 file content is ok
170 file content is ok
169
171
General Comments 0
You need to be logged in to leave comments. Login now