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

Yuya Nishihara yuya at tcha.org
Fri May 21 07:06:36 CDT 2010


Mads Kiilerich wrote:
> 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?

Hmm, I added _ because it didn't copy everything what we would treat
as file attributes.
Maybe I should name it as "copyextrafileattrs" or something. Thanks.

Yuya,


More information about the Mercurial-devel mailing list