Show More
@@ -379,6 +379,12 b' class abstractvfs(object):' | |||
|
379 | 379 | return util.readlock(self.join(path)) |
|
380 | 380 | |
|
381 | 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 | 388 | dstpath = self.join(dst) |
|
383 | 389 | oldstat = checkambig and util.filestat(dstpath) |
|
384 | 390 | if oldstat and oldstat.stat: |
@@ -533,7 +539,9 b' class vfs(abstractvfs):' | |||
|
533 | 539 | file were opened multiple times, there could be unflushed data |
|
534 | 540 | because the original file handle hasn't been flushed/closed yet.) |
|
535 | 541 | |
|
536 |
``checkambig`` is passed to atomictempfile (valid |
|
|
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 | 546 | if self._audit: |
|
539 | 547 | r = util.checkosfilename(path) |
@@ -1010,7 +1010,14 b' def checksignature(func):' | |||
|
1010 | 1010 | |
|
1011 | 1011 | def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False): |
|
1012 | 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 | 1021 | assert not (copystat and checkambig) |
|
1015 | 1022 | oldstat = None |
|
1016 | 1023 | if os.path.lexists(dest): |
@@ -1463,6 +1470,10 b' class atomictempfile(object):' | |||
|
1463 | 1470 | the temporary copy to the original name, making the changes |
|
1464 | 1471 | visible. If the object is destroyed without being closed, all your |
|
1465 | 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 | 1478 | def __init__(self, name, mode='w+b', createmode=None, checkambig=False): |
|
1468 | 1479 | self.__name = name # permanent name |
General Comments 0
You need to be logged in to leave comments.
Login now