Patchwork [8,of,8] vfs: add explanation about cost of checkambig=True in corner case

login
register
mail settings
Submitter Katsunori FUJIWARA
Date June 29, 2017, 4:53 p.m.
Message ID <edd9fe8c3417d81e1c5f.1498755195@speaknoevil>
Download mbox | patch
Permalink /patch/21831/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - June 29, 2017, 4:53 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1498754870 -32400
#      Fri Jun 30 01:47:50 2017 +0900
# Node ID edd9fe8c3417d81e1c5fe2542dbac2682a37230c
# Parent  5bdabaa7c404da6074733e593516b460a1629483
vfs: add explanation about cost of checkambig=True in corner case

Patch

diff --git a/mercurial/vfs.py b/mercurial/vfs.py
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -190,6 +190,11 @@  class abstractvfs(object):
         checkambig argument is used with util.filestat, and is useful
         only if destination file is guarded by any lock
         (e.g. repo.lock or repo.wlock).
+
+        To avoid file stat ambiguity forcibly, checkambig=True involves
+        copying ``src`` file, if it is owned by another. Therefore, use
+        checkambig=True only in limited cases (see also issue5418 and
+        issue5584 for detail).
         """
         srcpath = self.join(src)
         dstpath = self.join(dst)
@@ -350,6 +355,12 @@  class vfs(abstractvfs):
         ``checkambig`` argument is passed to atomictemplfile (valid
         only for writing), and is useful only if target file is
         guarded by any lock (e.g. repo.lock or repo.wlock).
+
+        To avoid file stat ambiguity forcibly, checkambig=True involves
+        copying ``path`` file opened in "append" mode (e.g. for
+        truncation), if it is owned by another. Therefore, use
+        combination of append mode and checkambig=True only in limited
+        cases (see also issue5418 and issue5584 for detail).
         '''
         if self._audit:
             r = util.checkosfilename(path)