[PATCH 6 of 6 V2] vfs: add explanation about cost of checkambig=True in corner case

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Tue Jul 4 10:29:04 EDT 2017


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1499177627 -32400
#      Tue Jul 04 23:13:47 2017 +0900
# Node ID b56f614b168deabd6ee32ba9b6b2f652efaa5b64
# Parent  afad00f764b6ea14a6c5b6f16d55e403ed44026a
vfs: add explanation about cost of checkambig=True in corner case

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)


More information about the Mercurial-devel mailing list