comparison mercurial/hg.py @ 8110:b616f328af9f

switch dircleanup in mercurial.hg.clone from gc based to explicit
author Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
date Wed, 22 Apr 2009 02:01:22 +0200
parents 496ae1ea4698
children 29bc5d18714a
comparison
equal deleted inserted replaced
8109:496ae1ea4698 8110:b616f328af9f
141 def __init__(self, dir_): 141 def __init__(self, dir_):
142 self.rmtree = shutil.rmtree 142 self.rmtree = shutil.rmtree
143 self.dir_ = dir_ 143 self.dir_ = dir_
144 def close(self): 144 def close(self):
145 self.dir_ = None 145 self.dir_ = None
146 def __del__(self): 146 def cleanup(self):
147 if self.dir_: 147 if self.dir_:
148 self.rmtree(self.dir_, True) 148 self.rmtree(self.dir_, True)
149 149
150 src_lock = dest_lock = dir_cleanup = None 150 src_lock = dest_lock = dir_cleanup = None
151 try: 151 try:
249 _update(dest_repo, uprev) 249 _update(dest_repo, uprev)
250 250
251 return src_repo, dest_repo 251 return src_repo, dest_repo
252 finally: 252 finally:
253 release(src_lock, dest_lock) 253 release(src_lock, dest_lock)
254 del dir_cleanup 254 if dir_cleanup is not None:
255 dir_cleanup.cleanup()
255 256
256 def _showstats(repo, stats): 257 def _showstats(repo, stats):
257 stats = ((stats[0], _("updated")), 258 stats = ((stats[0], _("updated")),
258 (stats[1], _("merged")), 259 (stats[1], _("merged")),
259 (stats[2], _("removed")), 260 (stats[2], _("removed")),