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

Adrian Buehlmann adrian at cadifra.com
Sat Mar 8 04:55:29 CST 2014


On 2014-03-08 01:15, Adrian Buehlmann wrote:
> Perhaps a compromise could be made by setting the hidden flag on
> .hg/store on new repositories...

Incomplete sketch:

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -210,7 +210,7 @@
                 continue
             dstbase = os.path.dirname(f)
             if dstbase and not dstvfs.exists(dstbase):
-                dstvfs.mkdir(dstbase)
+                dstvfs.mkdir(dstbase, hidden=f.endswith('store'))
             if srcvfs.exists(f):
                 if f.endswith('data'):
                     # lock to avoid premature writing to the target
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -200,7 +200,7 @@
                 self.vfs.makedir(notindexed=True)
                 requirements = self._baserequirements(create)
                 if self.ui.configbool('format', 'usestore', True):
-                    self.vfs.mkdir("store")
+                    self.vfs.mkdir("store", hidden=True)
                     requirements.append("store")
                     if self.ui.configbool('format', 'usefncache', True):
                         requirements.append("fncache")


More information about the Mercurial-devel mailing list