[PATCH] dispatch: do not close the request repo

Idan Kamara idankk86 at gmail.com
Tue Jun 21 09:09:07 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1308665301 -10800
# Branch stable
# Node ID 5a51f8ac81842c84e6d44a82b25e53138b24a86f
# Parent  31a5d95f682fd602b3f37c3faecba3bccdbd6e7c
dispatch: do not close the request repo

Closing here means we've closed the repo passed to us in the request,
which is not our responsibility.

This is essential for bundlerepo, and possibly other localrepository
subclasses who do something in their close().

diff -r 31a5d95f682f -r 5a51f8ac8184 mercurial/dispatch.py
--- a/mercurial/dispatch.py	Tue Jun 21 16:56:25 2011 +0300
+++ b/mercurial/dispatch.py	Tue Jun 21 17:08:21 2011 +0300
@@ -654,7 +654,7 @@
         return runcommand(lui, repo, cmd, fullargs, ui, options, d,
                           cmdpats, cmdoptions)
     finally:
-        if repo:
+        if repo != req.repo:
             repo.close()
 
 def _runcommand(ui, options, cmd, cmdfunc):


More information about the Mercurial-devel mailing list