Rev 2368: [merge] bzr.dev 2365 in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/dirstate_93681

John Arbash Meinel john at arbash-meinel.com
Tue Mar 20 21:54:22 GMT 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/dirstate_93681

------------------------------------------------------------
revno: 2368
revision-id: john at arbash-meinel.com-20070320215406-ral0r0d52fgh513i
parent: john at arbash-meinel.com-20070320010014-d4qj0b1lyd6mi9ak
parent: pqm at pqm.ubuntu.com-20070320202100-be028df627bf5697
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate_93681
timestamp: Tue 2007-03-20 16:54:06 -0500
message:
  [merge] bzr.dev 2365
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
    ------------------------------------------------------------
    revno: 2363.1.2
    merged: pqm at pqm.ubuntu.com-20070320202100-be028df627bf5697
    parent: pqm at pqm.ubuntu.com-20070319072606-0b45228c7ad6e0ae
    parent: john at arbash-meinel.com-20070320191916-0qxauqd00dehfrxl
    committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Tue 2007-03-20 20:21:00 +0000
    message:
      (John Arbash Meinel, Wouter van Heyst) Handle ERROR_DIRECTORY on win32 when doing 'bzr status filename'
        ------------------------------------------------------------
        revno: 2363.2.4
        merged: john at arbash-meinel.com-20070320191916-0qxauqd00dehfrxl
        parent: john at arbash-meinel.com-20070319232736-qsk1w9068h5sm1as
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: win32_notdir
        timestamp: Tue 2007-03-20 14:19:16 -0500
        message:
          Handle ERROR_DIRECTORY for python 2.5
        ------------------------------------------------------------
        revno: 2363.2.3
        merged: john at arbash-meinel.com-20070319232736-qsk1w9068h5sm1as
        parent: john at arbash-meinel.com-20070319232456-oal04x9alxvsbuqu
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: win32_notdir
        timestamp: Mon 2007-03-19 18:27:36 -0500
        message:
          NEWS entry for fixing bug #90819
        ------------------------------------------------------------
        revno: 2363.2.2
        merged: john at arbash-meinel.com-20070319232456-oal04x9alxvsbuqu
        parent: john at arbash-meinel.com-20070319231030-blqw1ylij3g290gg
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: win32_notdir
        timestamp: Mon 2007-03-19 18:24:56 -0500
        message:
          Clean up the error.
        ------------------------------------------------------------
        revno: 2363.2.1
        merged: john at arbash-meinel.com-20070319231030-blqw1ylij3g290gg
        parent: pqm at pqm.ubuntu.com-20070317015305-7b7562331da9f786
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: win32_notdir
        timestamp: Mon 2007-03-19 18:10:30 -0500
        message:
          Catch Windows ERROR_DIRECTORY when doing os.listdir('file')
    ------------------------------------------------------------
    revno: 2363.1.1
    merged: pqm at pqm.ubuntu.com-20070319072606-0b45228c7ad6e0ae
    parent: pqm at pqm.ubuntu.com-20070317015305-7b7562331da9f786
    parent: aaron.bentley at utoronto.ca-20070319070804-om44daawwxu6vi5c
    committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Mon 2007-03-19 07:26:06 +0000
    message:
      Remove the merge-revert alias
    ------------------------------------------------------------
    revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.3
    merged: aaron.bentley at utoronto.ca-20070319070804-om44daawwxu6vi5c
    parent: aaron.bentley at utoronto.ca-20070314044345-gdpib8w2b9l3lnt2
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Mon 2007-03-19 03:08:04 -0400
    message:
      Remove the merge-revert alias
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-03-20 01:00:14 +0000
+++ b/NEWS	2007-03-20 21:54:06 +0000
@@ -54,6 +54,10 @@
 
     * Don't fail during ``bzr commit`` if a file is marked removed, and
       the containing directory is auto-removed.  (John Arbash Meinel, #93681)
+
+    * ``bzr status FILENAME`` failed on Windows because of an uncommon
+      errno. (``ERROR_DIRECTORY == 267 != ENOTDIR``).
+      (Wouter van Heyst, John Arbash Meinel, #90819)
  
 bzr 0.15rc1  2007-03-07
 

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-03-14 10:37:18 +0000
+++ b/bzrlib/builtins.py	2007-03-19 07:26:06 +0000
@@ -2728,7 +2728,6 @@
     """
     takes_options = ['revision', 'no-backup']
     takes_args = ['file*']
-    aliases = ['merge-revert']
 
     def run(self, revision=None, no_backup=False, file_list=None):
         if file_list is not None:

=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2007-03-20 00:55:43 +0000
+++ b/bzrlib/workingtree_4.py	2007-03-20 21:54:06 +0000
@@ -96,6 +96,12 @@
 from bzrlib.workingtree import WorkingTree, WorkingTree3, WorkingTreeFormat3
 
 
+# This is the Windows equivalent of ENOTDIR
+# It is defined in pywin32.winerror, but we don't want a strong dependency for
+# just an error code.
+ERROR_DIRECTORY = 267
+
+
 class WorkingTree4(WorkingTree3):
     """This is the Format 4 working tree.
 
@@ -2065,10 +2071,17 @@
                 try:
                     current_dir_info = dir_iterator.next()
                 except OSError, e:
-                    if e.errno in (errno.ENOENT, errno.ENOTDIR):
-                        # there may be directories in the inventory even though
-                        # this path is not a file on disk: so mark it as end of
-                        # iterator
+                    # on win32, python2.4 has e.errno == ERROR_DIRECTORY, but
+                    # python 2.5 has e.errno == EINVAL,
+                    #            and e.winerror == ERROR_DIRECTORY
+                    e_winerror = getattr(e, 'winerror', None)
+                    # there may be directories in the inventory even though
+                    # this path is not a file on disk: so mark it as end of
+                    # iterator
+                    if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL):
+                        current_dir_info = None
+                    elif (sys.platform == 'win32'
+                          and ERROR_DIRECTORY in (e.errno, e_winerror)):
                         current_dir_info = None
                     else:
                         raise



More information about the bazaar-commits mailing list