/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Jelmer Vernooij
  • Date: 2017-02-05 17:00:29 UTC
  • mto: (6621.2.1 py3)
  • mto: This revision was merged to the branch mainline in revision 6624.
  • Revision ID: jelmer@jelmer.uk-20170205170029-s01xdro0hkixhq3r
Convert some octal numbers to new notations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
622
622
 
623
623
    def _mkdir(self, abspath, mode=None):
624
624
        if mode is None:
625
 
            local_mode = 0777
 
625
            local_mode = 0o777
626
626
        else:
627
627
            local_mode = mode
628
628
        try:
636
636
                # the sgid bit is set, report a warning to the user
637
637
                # with the umask fix.
638
638
                stat = self._get_sftp().lstat(abspath)
639
 
                mode = mode & 0777 # can't set special bits anyway
640
 
                if mode != stat.st_mode & 0777:
641
 
                    if stat.st_mode & 06000:
 
639
                mode = mode & 0o777 # can't set special bits anyway
 
640
                if mode != stat.st_mode & 0o777:
 
641
                    if stat.st_mode & 0o6000:
642
642
                        warning('About to chmod %s over sftp, which will result'
643
643
                                ' in its suid or sgid bits being cleared.  If'
644
644
                                ' you want to preserve those bits, change your '
645
645
                                ' environment on the server to use umask 0%03o.'
646
 
                                % (abspath, 0777 - mode))
 
646
                                % (abspath, 0o777 - mode))
647
647
                    self._get_sftp().chmod(abspath, mode=mode)
648
648
        except (paramiko.SSHException, IOError) as e:
649
649
            self._translate_io_exception(e, abspath, ': unable to mkdir',