[PATCH 3 of 3 STABLE] localrepo.wwrite: use unlinkopened instead of os.unlink

Greg Ward greg-hg at gerg.ca
Thu Dec 2 20:56:51 CST 2010


On Wed, Dec 1, 2010 at 7:53 AM, Adrian Buehlmann <adrian at cadifra.com> wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1291199708 -3600
> # Branch stable
> # Node ID 18d06beed4a794331427e89f3828cb9408012b6a
> # Parent  52f97fe43a6be964691d78a0147f6650855fc303
> localrepo.wwrite: use unlinkopened instead of os.unlink
>
> Windows delays deleting open files, preventing recreation under
> the same name until the file is closed.
>
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -618,7 +618,7 @@ class localrepository(repo.repository):
>     def wwrite(self, filename, data, flags):
>         data = self._filter(self._decodefilterpats, filename, data)
>         try:
> -            os.unlink(self.wjoin(filename))
> +            util.unlinkopened(self.wjoin(filename))

Does this fix a bug? Or is just a "nice to have"?

Greg


More information about the Mercurial-devel mailing list