dispatch: check for None before closing repo stable
authorIdan Kamara <idankk86@gmail.com>
Fri, 24 Jun 2011 16:30:43 +0300
branchstable
changeset 14727 d4b9d3b91ce7
parent 14726 e0039716f3ea
child 14728 350dcd481410
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.
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):