~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: John Arbash Meinel
  • Date: 2007-03-20 21:54:06 UTC
  • mfrom: (2365 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2366.
  • Revision ID: john@arbash-meinel.com-20070320215406-ral0r0d52fgh513i
[merge] bzr.dev 2365

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
from bzrlib.workingtree import WorkingTree, WorkingTree3, WorkingTreeFormat3
97
97
 
98
98
 
 
99
# This is the Windows equivalent of ENOTDIR
 
100
# It is defined in pywin32.winerror, but we don't want a strong dependency for
 
101
# just an error code.
 
102
ERROR_DIRECTORY = 267
 
103
 
 
104
 
99
105
class WorkingTree4(WorkingTree3):
100
106
    """This is the Format 4 working tree.
101
107
 
2065
2071
                try:
2066
2072
                    current_dir_info = dir_iterator.next()
2067
2073
                except OSError, e:
2068
 
                    if e.errno in (errno.ENOENT, errno.ENOTDIR):
2069
 
                        # there may be directories in the inventory even though
2070
 
                        # this path is not a file on disk: so mark it as end of
2071
 
                        # iterator
 
2074
                    # on win32, python2.4 has e.errno == ERROR_DIRECTORY, but
 
2075
                    # python 2.5 has e.errno == EINVAL,
 
2076
                    #            and e.winerror == ERROR_DIRECTORY
 
2077
                    e_winerror = getattr(e, 'winerror', None)
 
2078
                    # there may be directories in the inventory even though
 
2079
                    # this path is not a file on disk: so mark it as end of
 
2080
                    # iterator
 
2081
                    if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL):
 
2082
                        current_dir_info = None
 
2083
                    elif (sys.platform == 'win32'
 
2084
                          and ERROR_DIRECTORY in (e.errno, e_winerror)):
2072
2085
                        current_dir_info = None
2073
2086
                    else:
2074
2087
                        raise