comparison mercurial/hg.py @ 19313:3b96d6e44a4d

hg: move return statement after finally block return is always run after finally block. Now we have same functionality, but clearer readability.
author simon@laptop-tosh
date Sat, 08 Jun 2013 22:37:08 +0200
parents a9c443b3b240
children 648d1974b3f3
comparison
equal deleted inserted replaced
19312:aedb4d0012ff 19313:3b96d6e44a4d
435 status = _("updating to branch %s\n") % bn 435 status = _("updating to branch %s\n") % bn
436 destrepo.ui.status(status) 436 destrepo.ui.status(status)
437 _update(destrepo, uprev) 437 _update(destrepo, uprev)
438 if update in destrepo._bookmarks: 438 if update in destrepo._bookmarks:
439 bookmarks.setcurrent(destrepo, update) 439 bookmarks.setcurrent(destrepo, update)
440
441 return srcpeer, destpeer
442 finally: 440 finally:
443 release(srclock, destlock) 441 release(srclock, destlock)
444 if cleandir is not None: 442 if cleandir is not None:
445 shutil.rmtree(cleandir, True) 443 shutil.rmtree(cleandir, True)
446 if srcpeer is not None: 444 if srcpeer is not None:
447 srcpeer.close() 445 srcpeer.close()
446 return srcpeer, destpeer
448 447
449 def _showstats(repo, stats): 448 def _showstats(repo, stats):
450 repo.ui.status(_("%d files updated, %d files merged, " 449 repo.ui.status(_("%d files updated, %d files merged, "
451 "%d files removed, %d files unresolved\n") % stats) 450 "%d files removed, %d files unresolved\n") % stats)
452 451