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.
--- 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):