##// END OF EJS Templates
doc: describe detail about checkambig optional argument...
FUJIWARA Katsunori -
r29367:4e6e280e default
parent child Browse files
Show More
@@ -379,6 +379,12 b' class abstractvfs(object):'
379 return util.readlock(self.join(path))
379 return util.readlock(self.join(path))
380
380
381 def rename(self, src, dst, checkambig=False):
381 def rename(self, src, dst, checkambig=False):
382 """Rename from src to dst
383
384 checkambig argument is used with util.filestat, and is useful
385 only if destination file is guarded by any lock
386 (e.g. repo.lock or repo.wlock).
387 """
382 dstpath = self.join(dst)
388 dstpath = self.join(dst)
383 oldstat = checkambig and util.filestat(dstpath)
389 oldstat = checkambig and util.filestat(dstpath)
384 if oldstat and oldstat.stat:
390 if oldstat and oldstat.stat:
@@ -533,7 +539,9 b' class vfs(abstractvfs):'
533 file were opened multiple times, there could be unflushed data
539 file were opened multiple times, there could be unflushed data
534 because the original file handle hasn't been flushed/closed yet.)
540 because the original file handle hasn't been flushed/closed yet.)
535
541
536 ``checkambig`` is passed to atomictempfile (valid only for writing).
542 ``checkambig`` argument is passed to atomictemplfile (valid
543 only for writing), and is useful only if target file is
544 guarded by any lock (e.g. repo.lock or repo.wlock).
537 '''
545 '''
538 if self._audit:
546 if self._audit:
539 r = util.checkosfilename(path)
547 r = util.checkosfilename(path)
@@ -1010,7 +1010,14 b' def checksignature(func):'
1010
1010
1011 def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False):
1011 def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False):
1012 '''copy a file, preserving mode and optionally other stat info like
1012 '''copy a file, preserving mode and optionally other stat info like
1013 atime/mtime'''
1013 atime/mtime
1014
1015 checkambig argument is used with filestat, and is useful only if
1016 destination file is guarded by any lock (e.g. repo.lock or
1017 repo.wlock).
1018
1019 copystat and checkambig should be exclusive.
1020 '''
1014 assert not (copystat and checkambig)
1021 assert not (copystat and checkambig)
1015 oldstat = None
1022 oldstat = None
1016 if os.path.lexists(dest):
1023 if os.path.lexists(dest):
@@ -1463,6 +1470,10 b' class atomictempfile(object):'
1463 the temporary copy to the original name, making the changes
1470 the temporary copy to the original name, making the changes
1464 visible. If the object is destroyed without being closed, all your
1471 visible. If the object is destroyed without being closed, all your
1465 writes are discarded.
1472 writes are discarded.
1473
1474 checkambig argument of constructor is used with filestat, and is
1475 useful only if target file is guarded by any lock (e.g. repo.lock
1476 or repo.wlock).
1466 '''
1477 '''
1467 def __init__(self, name, mode='w+b', createmode=None, checkambig=False):
1478 def __init__(self, name, mode='w+b', createmode=None, checkambig=False):
1468 self.__name = name # permanent name
1479 self.__name = name # permanent name
General Comments 0
You need to be logged in to leave comments. Login now