~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-05 14:53:57 UTC
  • mfrom: (6344.1.1 dev_2.4_integration)
  • Revision ID: pqm@pqm.ubuntu.com-20111205145357-aesrpb6b49pxzym8
(gz) Merge 2.4 into bzr.dev (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
776
776
                    to_mode |= 0010 & ~umask
777
777
            else:
778
778
                to_mode = current_mode & ~0111
779
 
            os.chmod(abspath, to_mode)
 
779
            osutils.chmod_if_possible(abspath, to_mode)
780
780
 
781
781
    def _new_entry(self, name, parent_id, file_id):
782
782
        """Helper function to create a new filesystem entry."""
1555
1555
        try:
1556
1556
            limbodir = urlutils.local_path_from_url(
1557
1557
                tree._transport.abspath('limbo'))
1558
 
            try:
1559
 
                os.mkdir(limbodir)
1560
 
            except OSError, e:
1561
 
                if e.errno == errno.EEXIST:
1562
 
                    raise ExistingLimbo(limbodir)
 
1558
            osutils.ensure_empty_directory_exists(
 
1559
                limbodir,
 
1560
                errors.ExistingLimbo)
1563
1561
            deletiondir = urlutils.local_path_from_url(
1564
1562
                tree._transport.abspath('pending-deletion'))
1565
 
            try:
1566
 
                os.mkdir(deletiondir)
1567
 
            except OSError, e:
1568
 
                if e.errno == errno.EEXIST:
1569
 
                    raise errors.ExistingPendingDeletion(deletiondir)
 
1563
            osutils.ensure_empty_directory_exists(
 
1564
                deletiondir,
 
1565
                errors.ExistingPendingDeletion)
1570
1566
        except:
1571
1567
            tree.unlock()
1572
1568
            raise
1635
1631
            else:
1636
1632
                raise
1637
1633
        if typefunc(mode):
1638
 
            os.chmod(self._limbo_name(trans_id), mode)
 
1634
            osutils.chmod_if_possible(self._limbo_name(trans_id), mode)
1639
1635
 
1640
1636
    def iter_tree_children(self, parent_id):
1641
1637
        """Iterate through the entry's tree children, if any"""