~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Gary van der Merwe
  • Date: 2010-08-02 19:56:52 UTC
  • mfrom: (5050.3.18 2.2)
  • mto: (5050.3.19 2.2)
  • mto: This revision was merged to the branch mainline in revision 5371.
  • Revision ID: garyvdm@gmail.com-20100802195652-o1ppjemhwrr98i61
MergeĀ lp:bzr/2.2.

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):]
2935
2935
    def rename(self, from_, to):
2936
2936
        """Rename a file from one path to another."""
2937
2937
        try:
2938
 
            osutils.rename(from_, to)
2939
 
        except (IOError, OSError), e:
 
2938
            os.rename(from_, to)
 
2939
        except OSError, e:
2940
2940
            if e.errno in (errno.EEXIST, errno.ENOTEMPTY):
2941
2941
                raise errors.FileExists(to, str(e))
2942
2942
            # normal OSError doesn't include filenames so it's hard to see where
2958
2958
        """Reverse all renames that have been performed"""
2959
2959
        for from_, to in reversed(self.past_renames):
2960
2960
            try:
2961
 
                osutils.rename(to, from_)
2962
 
            except (OSError, IOError), e:
 
2961
                os.rename(to, from_)
 
2962
            except OSError, e:
2963
2963
                raise errors.TransformRenameFailed(to, from_, str(e), e.errno)                
2964
2964
        # after rollback, don't reuse _FileMover
2965
2965
        past_renames = None