[PATCH 2 of 2] util: make atomictempfile keep win32-specific file attrs

Mads Kiilerich mads at kiilerich.com
Fri May 21 06:29:17 CDT 2010


On 05/21/2010 01:17 PM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara<yuya at tcha.org>
> # Date 1274372380 -32400
> # Node ID 2b069d5e7a082512c7192458de4fc15a08fabc3c
> # Parent  c6a03ac45bd3028e8f72a24eac118d49b0559374
> util: make atomictempfile keep win32-specific file attrs
>
> Main intention of this change is to preserve "hidden" attribute.
>
> It copies file attributes at end, not first, because some attributes are
> troublesome when editing. For example, hidden files are not truncatable
> on NTFS, thus we cannot open('hidden-file', 'w') if set "hidden" before
> opening.
>
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -553,6 +553,10 @@ def hidewindow():
>       """
>       pass
>
> +def copyfileattrs_(src, dest):

Why use a _ suffix?

/Mads


More information about the Mercurial-devel mailing list