##// END OF EJS Templates
bundle2: feed a unbundle20 to the `processbundle` function...
Pierre-Yves David -
r20947:c33d7bf5 default
parent child Browse files
Show More
@@ -183,15 +183,11 b' def parthandler(parttype):'
183 183 return func
184 184 return _decorator
185 185
186 def processbundle(repo, stream):
186 def processbundle(repo, unbundler):
187 187 """This function process a bundle, apply effect to/from a repo
188 188
189 Currently it:
190 - parse a stream into an unbundle20 object
191 - iterate over each parts then search and use the proper handling code to
192 process the part.
193
194 Parts are processes in order.
189 It iterates over each part then searches for and uses the proper handling
190 code to process the part. Parts are processed in order.
195 191
196 192 This is very early version of this function that will be strongly reworked
197 193 before final usage.
@@ -199,11 +195,6 b' def processbundle(repo, stream):'
199 195 Unknown Mandatory part will abort the process.
200 196 """
201 197 ui = repo.ui
202 # Extraction of the unbundler object will most likely change. It may be
203 # done outside of this function, the unbundler would be passed as argument.
204 # in all case the unbundler will eventually be created by a
205 # `changegroup.readbundle` style function.
206 unbundler = unbundle20(ui, stream)
207 198 # todo:
208 199 # - replace this is a init function soon.
209 200 # - exception catching
@@ -74,7 +74,8 b' Create an extension to test bundle2 API'
74 74 > try:
75 75 > lock = repo.lock()
76 76 > try:
77 > bundle2.processbundle(repo, sys.stdin)
77 > unbundler = bundle2.unbundle20(ui, sys.stdin)
78 > bundle2.processbundle(repo, unbundler)
78 79 > except KeyError, exc:
79 80 > raise util.Abort('missing support for %s' % exc)
80 81 > finally:
General Comments 0
You need to be logged in to leave comments. Login now