[PATCH] util: set the hidden attribute on .hg/ during creation on windows (issue4178)

Mads Kiilerich mads at kiilerich.com
Sat Feb 22 09:52:12 CST 2014


On 02/21/2014 05:31 PM, Ed Morley wrote:
> # HG changeset patch
> # User Ed Morley <emorley at mozilla.com>
> # Date 1392999130 0
> #      Fri Feb 21 16:12:10 2014 +0000
> # Node ID e74d0479759cbea6edb632273345d55f96374d70
> # Parent  0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
> util: set the hidden attribute on .hg/ during creation on windows (issue4178)
>
> Windows has no concept of dotfiles/directories being hidden - instead, it
> requires that a file-is-hidden attribute be set. This patch adds an optional
> parameter to util.makedir/util.makedirs - which is used to set the hidden
> attribute when the .hg directory is created on Windows.
>
> This has the advantage that both the OS filesystem search & also editors
> grepping repositories can easily exclude the .hg directory, without needing to
> exclude it manually every time.

Mercurial is based on the unix tradition where all files starting with 
'.' are hidden. If we really want to set the 'hidden' attribute on 
windows, couldn't win32.makedir just do that if the directory starts 
with '.'?

That would also raise the question if files like .hgignore and 
directories like .hglf also should be ignored ... and if we want to set 
that flag at all.

If not, it would be easy to make an extension that wraps win32.makedir 
to set the hidden flag on dirs starting with '.'.

/Mads



More information about the Mercurial-devel mailing list