Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 13382:d747774ca9da
Make sure bundlerepo doesn't leak temp files (issue2491)
Add empty repository.close() and call it in dispatch.
Remove bundlerepository.__del__(), merging it into bundlerepository.close(),
which overrides repository.close().
http://docs.python.org/reference/datamodel.html says:
"It is not guaranteed that __del__() methods are called for objects that
still exist when the interpreter exits."
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sat, 12 Feb 2011 10:58:11 +0100 |
parents | a939f08fae9c |
children | 777cef34a890 |
comparison
equal
deleted
inserted
replaced
13381:d073468e3c5f | 13382:d747774ca9da |
---|---|
587 ui.warn(_("warning: --repository ignored\n")) | 587 ui.warn(_("warning: --repository ignored\n")) |
588 | 588 |
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(): |
597 try: | 601 try: |
598 return cmdfunc() | 602 return cmdfunc() |