daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jul 25th, 2012 4 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. === modified file bzrlib/errors.py
  2. --- bzrlib/errors.py    2012-07-19 19:27:22 +0000
  3. +++ bzrlib/errors.py    2012-07-25 18:15:40 +0000
  4. @@ -1618,6 +1618,12 @@
  5.                  self.exc_type, self.exc_value, self.exc_tb)
  6.          self.traceback_text = ''.join(traceback_strings)
  7.  
  8. +class TransportOperationNotSupported(TransportError):
  9. +
  10. +    _fmt = "Transport operation is not supported: %(operation)s"
  11. +
  12. +    def __init__(self, operation):
  13. +        self.operation = operation
  14.  
  15.  # A set of semi-meaningful errors which can be thrown
  16.  class TransportNotPossible(TransportError):
  17.  
  18. === modified file bzrlib/transport/sftp.py
  19. --- bzrlib/transport/sftp.py    2011-12-19 13:23:58 +0000
  20. +++ bzrlib/transport/sftp.py    2012-07-25 22:26:32 +0000
  21. @@ -703,7 +703,7 @@
  22.                  or getattr(e, 'errno', None) == errno.ENOTEMPTY):
  23.                  raise errors.DirectoryNotEmpty(path, str(e))
  24.              if e.args == ('Operation unsupported',):
  25. -                raise errors.TransportNotPossible()
  26. +                raise errors.TransportNotPossible(more_info)
  27.              mutter('Raising exception with args %s', e.args)
  28.          if getattr(e, 'errno', None) is not None:
  29.              mutter('Raising exception with errno %s', e.errno)
  30. @@ -731,7 +731,10 @@
  31.              self._get_sftp().rename(self._remote_path(rel_from),
  32.                                self._remote_path(rel_to))
  33.          except (IOError, paramiko.SSHException), e:
  34. -            self._translate_io_exception(e, rel_from,
  35. +            if e != None and e.args == ('Operation unsupported',):
  36. +                raise errors.TransportOperationNotSupported("rename")
  37. +            else:
  38. +                self._translate_io_exception(e, rel_from,
  39.                      ': unable to rename to %r' % (rel_to))
  40.  
  41.      def _rename_and_overwrite(self, abs_from, abs_to):
  42. @@ -745,7 +748,10 @@
  43.                           rename_func=sftp.rename,
  44.                           unlink_func=sftp.remove)
  45.          except (IOError, paramiko.SSHException), e:
  46. -            self._translate_io_exception(e, abs_from,
  47. +            if e != None and e.args == ('Operation unsupported',):
  48. +                raise errors.TransportOperationNotSupported("rename")
  49. +            else:
  50. +                self._translate_io_exception(e, abs_from,
  51.                                           ': unable to rename to %r' % (abs_to))
  52.  
  53.      def move(self, rel_from, rel_to):
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top