/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/_walkdirs_win32.pyx

  • Committer: John Arbash Meinel
  • Date: 2009-06-12 18:05:15 UTC
  • mto: (4371.4.5 vila-better-heads)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090612180515-t0cwbjsnve094oik
Add a failing test for handling nodes that are in the same linear chain.

It fails because the ancestry skipping causes us to miss the fact that the two nodes
are actually directly related. We could check at the beginning, as the 
code used to do, but I think that will be incomplete for the more-than-two
heads cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
109
109
                                 wcslen(data.cFileName))
110
110
 
111
111
 
112
 
cdef int _get_mode_bits(WIN32_FIND_DATAW *data): # cannot_raise
 
112
cdef int _get_mode_bits(WIN32_FIND_DATAW *data):
113
113
    cdef int mode_bits
114
114
 
115
115
    mode_bits = 0100666 # writeable file, the most common
121
121
    return mode_bits
122
122
 
123
123
 
124
 
cdef __int64 _get_size(WIN32_FIND_DATAW *data): # cannot_raise
 
124
cdef __int64 _get_size(WIN32_FIND_DATAW *data):
125
125
    # Pyrex casts a DWORD into a PyLong anyway, so it is safe to do << 32
126
126
    # on a DWORD
127
127
    return ((<__int64>data.nFileSizeHigh) << 32) + data.nFileSizeLow
128
128
 
129
129
 
130
 
cdef double _ftime_to_timestamp(FILETIME *ft): # cannot_raise
 
130
cdef double _ftime_to_timestamp(FILETIME *ft):
131
131
    """Convert from a FILETIME struct into a floating point timestamp.
132
132
 
133
133
    The fields of a FILETIME structure are the hi and lo part
147
147
    return (val * 1.0e-7) - 11644473600.0
148
148
 
149
149
 
150
 
cdef int _should_skip(WIN32_FIND_DATAW *data): # cannot_raise
 
150
cdef int _should_skip(WIN32_FIND_DATAW *data):
151
151
    """Is this '.' or '..' so we should skip it?"""
152
152
    if (data.cFileName[0] != c'.'):
153
153
        return 0