D517: journal: do not use atomictemp

quark (Jun Wu) phabricator at mercurial-scm.org
Fri Aug 25 04:42:57 UTC 2017


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Writing journal files using `atomictemp` leads to quadratic performance.
  Other logs like blackbox does not use atomictemp, and journal logs are not
  critical for repo correctness. So let's make them non-atomictemp.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/journal.py

CHANGE DETAILS

diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ b/hgext/journal.py
@@ -342,7 +342,7 @@
         with self.jlock(vfs):
             version = None
             # open file in amend mode to ensure it is created if missing
-            with vfs('namejournal', mode='a+b', atomictemp=True) as f:
+            with vfs('namejournal', mode='a+b') as f:
                 f.seek(0, os.SEEK_SET)
                 # Read just enough bytes to get a version number (up to 2
                 # digits plus separator)



To: quark, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list