Rev 2428: (bialix) some fixes for win32 in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 19 10:53:02 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2428
revision-id: pqm at pqm.ubuntu.com-20070419095256-nq0n6puj11zm7n7r
parent: pqm at pqm.ubuntu.com-20070419082117-znciscush3qbaky1
parent: bialix at ukr.net-20070418194650-d7p4etnr0oaki6h2
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-04-19 10:52:56 +0100
message:
  (bialix) some fixes for win32
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 2423.2.3
    merged: bialix at ukr.net-20070418194650-d7p4etnr0oaki6h2
    parent: bialix at ukr.net-20070418140646-jtfgh5592o6au3zn
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: selftest.win32
    timestamp: Wed 2007-04-18 22:46:50 +0300
    message:
      shutil no more needed in clean_selftest_output()
    ------------------------------------------------------------
    revno: 2423.2.2
    merged: bialix at ukr.net-20070418140646-jtfgh5592o6au3zn
    parent: bialix at ukr.net-20070417122024-276go12kd3yt8o4c
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: selftest.win32
    timestamp: Wed 2007-04-18 17:06:46 +0300
    message:
      Explicit error messages for test FTP server (Python 2.5 @ win32 compatibility)
    ------------------------------------------------------------
    revno: 2423.2.1
    merged: bialix at ukr.net-20070417122024-276go12kd3yt8o4c
    parent: pqm at pqm.ubuntu.com-20070417005930-rofskshyjsfzrahh
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: selftest.win32
    timestamp: Tue 2007-04-17 15:20:24 +0300
    message:
      Fix for walkdirs in missing dir with Py2.4 @ win32
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2007-04-19 04:54:08 +0000
+++ b/bzrlib/tests/__init__.py	2007-04-19 09:52:56 +0000
@@ -2314,8 +2314,6 @@
     :param  quiet:  suppress report about deleting directories
     """
     import re
-    import shutil
-
     re_dir = re.compile(r'''test\d\d\d\d\.tmp''')
     if root is None:
         root = u'.'

=== modified file 'bzrlib/transport/ftp.py'
--- a/bzrlib/transport/ftp.py	2007-04-17 00:59:30 +0000
+++ b/bzrlib/transport/ftp.py	2007-04-18 14:06:46 +0000
@@ -701,7 +701,10 @@
             except (IOError, OSError), e:
                 # TODO: jam 20060516 return custom responses based on
                 #       why the command failed
-                self.respond('550 RNTO failed: %s' % (e,))
+                # (bialix 20070418) str(e) on Python 2.5 @ Windows
+                # sometimes don't provide expected error message;
+                # so we obtain such message via os.strerror()
+                self.respond('550 RNTO failed: %s' % os.strerror(e.errno))
             except:
                 self.respond('550 RNTO failed')
                 # For a test server, we will go ahead and just die
@@ -739,7 +742,11 @@
                     self.filesystem.mkdir (path)
                     self.respond ('257 MKD command successful.')
                 except (IOError, OSError), e:
-                    self.respond ('550 error creating directory: %s' % (e,))
+                    # (bialix 20070418) str(e) on Python 2.5 @ Windows
+                    # sometimes don't provide expected error message;
+                    # so we obtain such message via os.strerror()
+                    self.respond ('550 error creating directory: %s' %
+                                  os.strerror(e.errno))
                 except:
                     self.respond ('550 error creating directory.')
 

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2007-04-13 15:51:14 +0000
+++ b/bzrlib/workingtree.py	2007-04-17 12:20:24 +0000
@@ -38,6 +38,7 @@
 
 from cStringIO import StringIO
 import os
+import sys
 
 from bzrlib.lazy_import import lazy_import
 lazy_import(globals(), """
@@ -119,6 +120,8 @@
 MERGE_MODIFIED_HEADER_1 = "BZR merge-modified list format 1"
 CONFLICT_HEADER_1 = "BZR conflict list format 1"
 
+ERROR_PATH_NOT_FOUND = 3    # WindowsError errno code, equivalent to ENOENT
+
 
 @deprecated_function(zero_thirteen)
 def gen_file_id(name):
@@ -2119,7 +2122,8 @@
             current_disk = disk_iterator.next()
             disk_finished = False
         except OSError, e:
-            if e.errno != errno.ENOENT:
+            if not (e.errno == errno.ENOENT or
+                (sys.platform == 'win32' and e.errno == ERROR_PATH_NOT_FOUND)):
                 raise
             current_disk = None
             disk_finished = True




More information about the bazaar-commits mailing list