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

login
register
mail settings
Submitter Adrian Buehlmann
Date March 8, 2014, 10:55 a.m.
Message ID <531AF721.7000009@cadifra.com>
Download mbox | patch
Permalink /patch/3888/
State Deferred
Headers show

Comments

Adrian Buehlmann - March 8, 2014, 10:55 a.m.
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:

Patch

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")