283 |
283 |
284 Raise an exception to highlight the fact that no transaction was expected |
284 Raise an exception to highlight the fact that no transaction was expected |
285 to be created""" |
285 to be created""" |
286 raise TransactionUnavailable() |
286 raise TransactionUnavailable() |
287 |
287 |
288 def processbundle(repo, unbundler, transactiongetter=None): |
288 def processbundle(repo, unbundler, transactiongetter=None, op=None): |
289 """This function process a bundle, apply effect to/from a repo |
289 """This function process a bundle, apply effect to/from a repo |
290 |
290 |
291 It iterates over each part then searches for and uses the proper handling |
291 It iterates over each part then searches for and uses the proper handling |
292 code to process the part. Parts are processed in order. |
292 code to process the part. Parts are processed in order. |
293 |
293 |
294 This is very early version of this function that will be strongly reworked |
294 This is very early version of this function that will be strongly reworked |
295 before final usage. |
295 before final usage. |
296 |
296 |
297 Unknown Mandatory part will abort the process. |
297 Unknown Mandatory part will abort the process. |
|
298 |
|
299 It is temporarily possible to provide a prebuilt bundleoperation to the |
|
300 function. This is used to ensure output is properly propagated in case of |
|
301 an error during the unbundling. This output capturing part will likely be |
|
302 reworked and this ability will probably go away in the process. |
298 """ |
303 """ |
299 if transactiongetter is None: |
304 if op is None: |
300 transactiongetter = _notransaction |
305 if transactiongetter is None: |
301 op = bundleoperation(repo, transactiongetter) |
306 transactiongetter = _notransaction |
|
307 op = bundleoperation(repo, transactiongetter) |
302 # todo: |
308 # todo: |
303 # - replace this is a init function soon. |
309 # - replace this is a init function soon. |
304 # - exception catching |
310 # - exception catching |
305 unbundler.params |
311 unbundler.params |
306 iterparts = unbundler.iterparts() |
312 iterparts = unbundler.iterparts() |