~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-02 13:49:39 UTC
  • mfrom: (3063.1.3 bzr.ab.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20071202134939-jvspioo8sh18aok3
TreeTransform.apply gives better errors when OSErrors occur (Belchenko)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1878
1878
 
1879
1879
    def rename(self, from_, to):
1880
1880
        """Rename a file from one path to another.  Functions like os.rename"""
1881
 
        os.rename(from_, to)
 
1881
        try:
 
1882
            os.rename(from_, to)
 
1883
        except OSError, e:
 
1884
            if e.errno in (errno.EEXIST, errno.ENOTEMPTY):
 
1885
                raise errors.FileExists(to, str(e))
 
1886
            raise
1882
1887
        self.past_renames.append((from_, to))
1883
1888
 
1884
1889
    def pre_delete(self, from_, to):