/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: John Arbash Meinel
  • Date: 2006-09-06 21:45:49 UTC
  • mto: (1946.2.15 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1989.
  • Revision ID: john@arbash-meinel.com-20060906214549-1ac6815d44926e1a
Restore mode bit tests for sftp, and track down bugs

Show diffs side-by-side

added added

removed removed

Lines of Context:
512
512
            else:
513
513
                yield relpath
514
514
 
 
515
    def _mkdir(self, abspath, mode=None):
 
516
        if mode is None:
 
517
            local_mode = 0777
 
518
        else:
 
519
            local_mode = mode
 
520
        try:
 
521
            self._sftp.mkdir(abspath, local_mode)
 
522
            if mode is not None:
 
523
                self._sftp.chmod(abspath, mode=mode)
 
524
        except (paramiko.SSHException, IOError), e:
 
525
            self._translate_io_exception(e, abspath, ': unable to mkdir',
 
526
                failure_exc=FileExists)
 
527
 
515
528
    def mkdir(self, relpath, mode=None):
516
529
        """Create a directory at the given path."""
517
 
        path = self._remote_path(relpath)
518
 
        try:
519
 
            self._sftp.mkdir(path)
520
 
            if mode is not None:
521
 
                self._sftp.chmod(path, mode=mode)
522
 
        except (paramiko.SSHException, IOError), e:
523
 
            self._translate_io_exception(e, path, ': unable to mkdir',
524
 
                failure_exc=FileExists)
 
530
        self._mkdir(self._remote_path(relpath), mode=mode)
525
531
 
526
532
    def _translate_io_exception(self, e, path, more_info='', 
527
533
                                failure_exc=PathError):
745
751
            self._translate_io_exception(e, abspath, ': unable to open',
746
752
                failure_exc=FileExists)
747
753
 
 
754
    def _can_roundtrip_unix_modebits(self):
 
755
        if sys.platform == 'win32':
 
756
            # anyone else?
 
757
            return False
 
758
        else:
 
759
            return True
748
760
 
749
761
# ------------- server test implementation --------------
750
762
import threading