##// END OF EJS Templates
vfs: factor out "rename and avoid ambiguity" to reuse...
FUJIWARA Katsunori -
r32747:1a79de47 default
parent child Browse files
Show More
@@ -177,11 +177,14 b' class abstractvfs(object):'
177 dstpath = self.join(dst)
177 dstpath = self.join(dst)
178 oldstat = checkambig and util.filestat(dstpath)
178 oldstat = checkambig and util.filestat(dstpath)
179 if oldstat and oldstat.stat:
179 if oldstat and oldstat.stat:
180 ret = util.rename(self.join(src), dstpath)
180 def dorename(spath, dpath):
181 newstat = util.filestat(dstpath)
181 ret = util.rename(spath, dpath)
182 if newstat.isambig(oldstat):
182 newstat = util.filestat(dpath)
183 # stat of renamed file is ambiguous to original one
183 if newstat.isambig(oldstat):
184 newstat.avoidambig(dstpath, oldstat)
184 # stat of renamed file is ambiguous to original one
185 return ret, newstat.avoidambig(dpath, oldstat)
186 return ret, True
187 ret, avoided = dorename(self.join(src), dstpath)
185 return ret
188 return ret
186 return util.rename(self.join(src), dstpath)
189 return util.rename(self.join(src), dstpath)
187
190
General Comments 0
You need to be logged in to leave comments. Login now