175 (e.g. repo.lock or repo.wlock). |
175 (e.g. repo.lock or repo.wlock). |
176 """ |
176 """ |
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 |
188 def readlink(self, path): |
191 def readlink(self, path): |
189 return os.readlink(self.join(path)) |
192 return os.readlink(self.join(path)) |