##// END OF EJS Templates
Make sure bundlerepo doesn't leak temp files (issue2491)...
Adrian Buehlmann -
r13382:d747774c default
parent child Browse files
Show More
@@ -251,11 +251,6 b' class bundlerepository(localrepo.localre'
251 self.bundle.close()
251 self.bundle.close()
252 if self.tempfile is not None:
252 if self.tempfile is not None:
253 os.unlink(self.tempfile)
253 os.unlink(self.tempfile)
254
255 def __del__(self):
256 del self.bundle
257 if self.tempfile is not None:
258 os.unlink(self.tempfile)
259 if self._tempparent:
254 if self._tempparent:
260 shutil.rmtree(self._tempparent, True)
255 shutil.rmtree(self._tempparent, True)
261
256
@@ -589,8 +589,12 b' def _dispatch(ui, args):'
589 msg = ' '.join(' ' in a and repr(a) or a for a in fullargs)
589 msg = ' '.join(' ' in a and repr(a) or a for a in fullargs)
590 ui.log("command", msg + "\n")
590 ui.log("command", msg + "\n")
591 d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
591 d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
592 return runcommand(lui, repo, cmd, fullargs, ui, options, d,
592 try:
593 cmdpats, cmdoptions)
593 return runcommand(lui, repo, cmd, fullargs, ui, options, d,
594 cmdpats, cmdoptions)
595 finally:
596 if repo:
597 repo.close()
594
598
595 def _runcommand(ui, options, cmd, cmdfunc):
599 def _runcommand(ui, options, cmd, cmdfunc):
596 def checkargs():
600 def checkargs():
@@ -35,3 +35,6 b' class repository(object):'
35
35
36 def cancopy(self):
36 def cancopy(self):
37 return self.local()
37 return self.local()
38
39 def close(self):
40 pass
@@ -188,6 +188,13 b' Log -R full.hg in fresh empty'
188 date: Thu Jan 01 00:00:00 1970 +0000
188 date: Thu Jan 01 00:00:00 1970 +0000
189 summary: 0.0
189 summary: 0.0
190
190
191 Make sure bundlerepo doesn't leak tempfiles (issue2491)
192
193 $ ls .hg
194 00changelog.i
195 cache
196 requires
197 store
191
198
192 Pull ../full.hg into empty (with hook)
199 Pull ../full.hg into empty (with hook)
193
200
General Comments 0
You need to be logged in to leave comments. Login now