##// END OF EJS Templates
bundle2: move handler validation out of processpart...
Durham Goode -
r34260:07e4170f default
parent child Browse files
Show More
@@ -460,14 +460,9 b' def _processchangegroup(op, cg, tr, sour'
460 })
460 })
461 return ret
461 return ret
462
462
463 def _processpart(op, part):
463 def _gethandler(op, part):
464 """process a single part from a bundle
465
466 The part is guaranteed to have been fully consumed when the function exits
467 (even if an exception is raised)."""
468 status = 'unknown' # used by debug output
464 status = 'unknown' # used by debug output
469 try:
465 try:
470 try:
471 handler = parthandlermapping.get(part.type)
466 handler = parthandlermapping.get(part.type)
472 if handler is None:
467 if handler is None:
473 status = 'unsupported-type'
468 status = 'unsupported-type'
@@ -503,6 +498,18 b' def _processpart(op, part):'
503 msg.append(' %s\n' % status)
498 msg.append(' %s\n' % status)
504 op.ui.debug(''.join(msg))
499 op.ui.debug(''.join(msg))
505
500
501 return handler
502
503 def _processpart(op, part):
504 """process a single part from a bundle
505
506 The part is guaranteed to have been fully consumed when the function exits
507 (even if an exception is raised)."""
508 try:
509 handler = _gethandler(op, part)
510 if handler is None:
511 return
512
506 # handler is called outside the above try block so that we don't
513 # handler is called outside the above try block so that we don't
507 # risk catching KeyErrors from anything other than the
514 # risk catching KeyErrors from anything other than the
508 # parthandlermapping lookup (any KeyError raised by handler()
515 # parthandlermapping lookup (any KeyError raised by handler()
General Comments 0
You need to be logged in to leave comments. Login now