# HG changeset patch # User Adrian Buehlmann # Date 2011-05-24 12:08:20 # Node ID 137b03b5aea16ecc34d6ecef90460b86ce20b84a # Parent ede7cea1550f3745da21ebc462129f4d5046af8a workingctx: unlink paths while holding the wlock diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -852,15 +852,15 @@ class workingctx(changectx): yield changectx(self._repo, a) def remove(self, list, unlink=False): - if unlink: - for f in list: - try: - util.unlinkpath(self._repo.wjoin(f)) - except OSError, inst: - if inst.errno != errno.ENOENT: - raise wlock = self._repo.wlock() try: + if unlink: + for f in list: + try: + util.unlinkpath(self._repo.wjoin(f)) + except OSError, inst: + if inst.errno != errno.ENOENT: + raise for f in list: if unlink and os.path.lexists(self._repo.wjoin(f)): self._repo.ui.warn(_("%s still exists!\n") % f)