Patchwork D1882: atomicupdate: add an experimental option to use atomictemp when updating

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 8:31 p.m.
Message ID <89fb36c63cbf284f509fc7b9080e33e2@localhost.localdomain>
Download mbox | patch
Permalink /patch/26933/
State Not Applicable
Headers show

Comments

phabricator - Jan. 18, 2018, 8:31 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG45b678bf3a78: atomicupdate: add an experimental option to use atomictemp when updating (authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1882?vs=4867&id=4930

REVISION DETAIL
  https://phab.mercurial-scm.org/D1882

AFFECTED FILES
  mercurial/configitems.py
  mercurial/localrepo.py
  mercurial/merge.py

CHANGE DETAILS




To: lothiraldan, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1376,7 +1376,9 @@ 
                 if repo.wvfs.lexists(absf):
                     util.rename(absf, orig)
             wctx[f].clearunknown()
-            wctx[f].write(fctx(f).data(), flags, backgroundclose=True)
+            atomictemp = ui.configbool("experimental", "update.atomic-file")
+            wctx[f].write(fctx(f).data(), flags, backgroundclose=True,
+                          atomictemp=atomictemp)
             if i == 100:
                 yield i, f
                 i = 0
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1112,6 +1112,8 @@ 
                             **kwargs)
             if 'x' in flags:
                 self.wvfs.setflags(filename, False, True)
+            else:
+                self.wvfs.setflags(filename, False, False)
         return len(data)
 
     def wwritedata(self, filename, data):
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -568,6 +568,9 @@ 
 coreconfigitem('experimental', 'treemanifest',
     default=False,
 )
+coreconfigitem('experimental', 'update.atomic-file',
+    default=False,
+)
 coreconfigitem('extensions', '.*',
     default=None,
     generic=True,