2901
2901
"""Rename a file from one path to another."""
2903
2903
osutils.rename(from_, to)
2905
2905
if e.errno in (errno.EEXIST, errno.ENOTEMPTY):
2906
2906
raise errors.FileExists(to, str(e))
2907
2907
# normal OSError doesn't include filenames so it's hard to see where
2908
2908
# the problem is, see https://bugs.launchpad.net/bzr/+bug/491763
2909
raise errors.TransformRenameFailed(from_, to, str(e), e.errno)
2912
2910
self.past_renames.append((from_, to))
2914
2912
def pre_delete(self, from_, to):