comparison mercurial/dispatch.py @ 14727:d4b9d3b91ce7 stable

dispatch: check for None before closing repo We were trying to call close() if repo == None and req.repo != None. This can happen when running commands that don't take a repo.
author Idan Kamara <idankk86@gmail.com>
date Fri, 24 Jun 2011 16:30:43 +0300
parents 8a62bae94425
children 84a680daa4b2
comparison
equal deleted inserted replaced
14726:e0039716f3ea 14727:d4b9d3b91ce7
652 d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) 652 d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
653 try: 653 try:
654 return runcommand(lui, repo, cmd, fullargs, ui, options, d, 654 return runcommand(lui, repo, cmd, fullargs, ui, options, d,
655 cmdpats, cmdoptions) 655 cmdpats, cmdoptions)
656 finally: 656 finally:
657 if repo != req.repo: 657 if repo and repo != req.repo:
658 repo.close() 658 repo.close()
659 659
660 def _runcommand(ui, options, cmd, cmdfunc): 660 def _runcommand(ui, options, cmd, cmdfunc):
661 def checkargs(): 661 def checkargs():
662 try: 662 try: