switch dircleanup in mercurial.hg.clone from gc based to explicit
authorRonny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
Wed, 22 Apr 2009 02:01:22 +0200
changeset 8110 b616f328af9f
parent 8109 496ae1ea4698
child 8111 dbf20df40eb1
switch dircleanup in mercurial.hg.clone from gc based to explicit
mercurial/hg.py
--- a/mercurial/hg.py	Wed Apr 22 02:01:22 2009 +0200
+++ b/mercurial/hg.py	Wed Apr 22 02:01:22 2009 +0200
@@ -143,7 +143,7 @@
             self.dir_ = dir_
         def close(self):
             self.dir_ = None
-        def __del__(self):
+        def cleanup(self):
             if self.dir_:
                 self.rmtree(self.dir_, True)
 
@@ -251,7 +251,8 @@
         return src_repo, dest_repo
     finally:
         release(src_lock, dest_lock)
-        del dir_cleanup
+        if dir_cleanup is not None:
+            dir_cleanup.cleanup()
 
 def _showstats(repo, stats):
     stats = ((stats[0], _("updated")),