# HG changeset patch # User Idan Kamara # Date 1308922243 -10800 # Node ID d4b9d3b91ce720d626d1ea52d2b658a0b57fb49e # Parent e0039716f3ea7bc2b2f45713bbff5da5a24f9919 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. diff -r e0039716f3ea -r d4b9d3b91ce7 mercurial/dispatch.py --- a/mercurial/dispatch.py Fri Jun 24 12:37:29 2011 +0200 +++ b/mercurial/dispatch.py Fri Jun 24 16:30:43 2011 +0300 @@ -654,7 +654,7 @@ return runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions) finally: - if repo != req.repo: + if repo and repo != req.repo: repo.close() def _runcommand(ui, options, cmd, cmdfunc):