mercurial/vfs.py
changeset 33282 d1db7af81548
parent 33281 6af0f023d014
child 33412 a42369e04aee
equal deleted inserted replaced
33281:6af0f023d014 33282:d1db7af81548
   188         """Rename from src to dst
   188         """Rename from src to dst
   189 
   189 
   190         checkambig argument is used with util.filestat, and is useful
   190         checkambig argument is used with util.filestat, and is useful
   191         only if destination file is guarded by any lock
   191         only if destination file is guarded by any lock
   192         (e.g. repo.lock or repo.wlock).
   192         (e.g. repo.lock or repo.wlock).
       
   193 
       
   194         To avoid file stat ambiguity forcibly, checkambig=True involves
       
   195         copying ``src`` file, if it is owned by another. Therefore, use
       
   196         checkambig=True only in limited cases (see also issue5418 and
       
   197         issue5584 for detail).
   193         """
   198         """
   194         srcpath = self.join(src)
   199         srcpath = self.join(src)
   195         dstpath = self.join(dst)
   200         dstpath = self.join(dst)
   196         oldstat = checkambig and util.filestat.frompath(dstpath)
   201         oldstat = checkambig and util.filestat.frompath(dstpath)
   197         if oldstat and oldstat.stat:
   202         if oldstat and oldstat.stat:
   341            because the original file handle hasn't been flushed/closed yet.)
   346            because the original file handle hasn't been flushed/closed yet.)
   342 
   347 
   343         ``checkambig`` argument is passed to atomictemplfile (valid
   348         ``checkambig`` argument is passed to atomictemplfile (valid
   344         only for writing), and is useful only if target file is
   349         only for writing), and is useful only if target file is
   345         guarded by any lock (e.g. repo.lock or repo.wlock).
   350         guarded by any lock (e.g. repo.lock or repo.wlock).
       
   351 
       
   352         To avoid file stat ambiguity forcibly, checkambig=True involves
       
   353         copying ``path`` file opened in "append" mode (e.g. for
       
   354         truncation), if it is owned by another. Therefore, use
       
   355         combination of append mode and checkambig=True only in limited
       
   356         cases (see also issue5418 and issue5584 for detail).
   346         '''
   357         '''
   347         if auditpath:
   358         if auditpath:
   348             if self._audit:
   359             if self._audit:
   349                 r = util.checkosfilename(path)
   360                 r = util.checkosfilename(path)
   350                 if r:
   361                 if r: