~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Alexander Belchenko
  • Date: 2007-12-01 21:59:46 UTC
  • mto: This revision was merged to the branch mainline in revision 3064.
  • Revision ID: bialix@ukr.net-20071201215946-cv7sc7jdv2czuisf
Catch OSError 17 (file exists) in final phase of tree transform and show filename to user (#111758).

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 == errno.EEXIST:
 
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):