~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-06 19:54:45 UTC
  • mfrom: (5050.3.21 2.2-final)
  • mto: This revision was merged to the branch mainline in revision 5371.
  • Revision ID: john@arbash-meinel.com-20100806195445-7vsjls3uf8o6t7kt
Merge the 2.2-final branch into trunk, in preparation for release.

Had to fix up one NEWS entry that accidentally got merged into the 2.2 section.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1182
1182
            if trans_id not in self._new_contents:
1183
1183
                continue
1184
1184
            new_path = self._limbo_name(trans_id)
1185
 
            osutils.rename(old_path, new_path)
 
1185
            os.rename(old_path, new_path)
1186
1186
            for descendant in self._limbo_descendants(trans_id):
1187
1187
                desc_path = self._limbo_files[descendant]
1188
1188
                desc_path = new_path + desc_path[len(old_path):]
2919
2919
    def rename(self, from_, to):
2920
2920
        """Rename a file from one path to another."""
2921
2921
        try:
2922
 
            osutils.rename(from_, to)
2923
 
        except (IOError, OSError), e:
 
2922
            os.rename(from_, to)
 
2923
        except OSError, e:
2924
2924
            if e.errno in (errno.EEXIST, errno.ENOTEMPTY):
2925
2925
                raise errors.FileExists(to, str(e))
2926
2926
            # normal OSError doesn't include filenames so it's hard to see where
2942
2942
        """Reverse all renames that have been performed"""
2943
2943
        for from_, to in reversed(self.past_renames):
2944
2944
            try:
2945
 
                osutils.rename(to, from_)
2946
 
            except (OSError, IOError), e:
 
2945
                os.rename(to, from_)
 
2946
            except OSError, e:
2947
2947
                raise errors.TransformRenameFailed(to, from_, str(e), e.errno)                
2948
2948
        # after rollback, don't reuse _FileMover
2949
2949
        past_renames = None