##// END OF EJS Templates
vfs: make rename avoid ambiguity of file stat if needed...
FUJIWARA Katsunori -
r29203:731ced08 default
parent child Browse files
Show More
@@ -377,8 +377,18 b' class abstractvfs(object):'
377 def readlock(self, path):
377 def readlock(self, path):
378 return util.readlock(self.join(path))
378 return util.readlock(self.join(path))
379
379
380 def rename(self, src, dst):
380 def rename(self, src, dst, checkambig=False):
381 return util.rename(self.join(src), self.join(dst))
381 dstpath = self.join(dst)
382 oldstat = checkambig and util.filestat(dstpath)
383 if oldstat and oldstat.stat:
384 ret = util.rename(self.join(src), dstpath)
385 newstat = util.filestat(dstpath)
386 if newstat.isambig(oldstat):
387 # stat of renamed file is ambiguous to original one
388 advanced = (oldstat.stat.st_mtime + 1) & 0x7fffffff
389 os.utime(dstpath, (advanced, advanced))
390 return ret
391 return util.rename(self.join(src), dstpath)
382
392
383 def readlink(self, path):
393 def readlink(self, path):
384 return os.readlink(self.join(path))
394 return os.readlink(self.join(path))
General Comments 0
You need to be logged in to leave comments. Login now