##// END OF EJS Templates
vfs: create copy at renaming to avoid file stat ambiguity if needed...
FUJIWARA Katsunori -
r32748:ed66ec39 default
parent child Browse files
Show More
@@ -174,6 +174,7 b' class abstractvfs(object):'
174 174 only if destination file is guarded by any lock
175 175 (e.g. repo.lock or repo.wlock).
176 176 """
177 srcpath = self.join(src)
177 178 dstpath = self.join(dst)
178 179 oldstat = checkambig and util.filestat(dstpath)
179 180 if oldstat and oldstat.stat:
@@ -184,9 +185,13 b' class abstractvfs(object):'
184 185 # stat of renamed file is ambiguous to original one
185 186 return ret, newstat.avoidambig(dpath, oldstat)
186 187 return ret, True
187 ret, avoided = dorename(self.join(src), dstpath)
188 ret, avoided = dorename(srcpath, dstpath)
189 if not avoided:
190 # simply copy to change owner of srcpath (see issue5418)
191 util.copyfile(dstpath, srcpath)
192 ret, avoided = dorename(srcpath, dstpath)
188 193 return ret
189 return util.rename(self.join(src), dstpath)
194 return util.rename(srcpath, dstpath)
190 195
191 196 def readlink(self, path):
192 197 return os.readlink(self.join(path))
General Comments 0
You need to be logged in to leave comments. Login now