Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 29367:4e6e280e238f
doc: describe detail about checkambig optional argument
This is followup for patches below, which add checkambig argument to
existing function.
- 731ced087a4b
- 76f1ea360c7e
- ce2d81aafbae
- a109bf7e0dc2
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 13 Jun 2016 05:11:56 +0900 |
parents | c27dc3c31222 |
children | 50269a4dce61 |
line wrap: on
line diff
--- a/mercurial/util.py Sun Jun 12 14:07:26 2016 +0900 +++ b/mercurial/util.py Mon Jun 13 05:11:56 2016 +0900 @@ -1010,7 +1010,14 @@ def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False): '''copy a file, preserving mode and optionally other stat info like - atime/mtime''' + atime/mtime + + checkambig argument is used with filestat, and is useful only if + destination file is guarded by any lock (e.g. repo.lock or + repo.wlock). + + copystat and checkambig should be exclusive. + ''' assert not (copystat and checkambig) oldstat = None if os.path.lexists(dest): @@ -1463,6 +1470,10 @@ the temporary copy to the original name, making the changes visible. If the object is destroyed without being closed, all your writes are discarded. + + checkambig argument of constructor is used with filestat, and is + useful only if target file is guarded by any lock (e.g. repo.lock + or repo.wlock). ''' def __init__(self, name, mode='w+b', createmode=None, checkambig=False): self.__name = name # permanent name