2121
2121
# this has two possibilities:
2122
2122
# A) it is versioned but empty, so there is no block for it
2123
2123
# B) it is not versioned.
2124
# in either case it was processed by the containing directories walk:
2125
# if it is root/foo, when we walked root we emitted it,
2126
# or if we ere given root/foo to walk specifically, we
2127
# emitted it when checking the walk-root entries
2128
# advance the iterator and loop - we dont need to emit it.
2125
# if (A) then we need to recurse into it to check for
2126
# new unknown files or directories.
2127
# if (B) then we should ignore it, because we don't
2128
# recurse into unknown directories.
2129
if want_unversioned:
2131
while path_index < len(current_dir_info[1]):
2132
current_path_info = current_dir_info[1][path_index]
2133
if current_path_info[2] == 'directory':
2134
if self.target._directory_is_tree_reference(
2135
current_path_info[0].decode('utf8')):
2136
current_path_info = current_path_info[:2] + \
2137
('tree-reference',) + current_path_info[3:]
2138
new_executable = bool(
2139
stat.S_ISREG(current_path_info[3].st_mode)
2140
and stat.S_IEXEC & current_path_info[3].st_mode)
2142
(None, utf8_decode_or_none(current_path_info[0])),
2146
(None, utf8_decode_or_none(current_path_info[1])),
2147
(None, current_path_info[2]),
2148
(None, new_executable))
2149
# dont descend into this unversioned path if it is
2151
if current_path_info[2] in ('directory',
2153
del current_dir_info[1][path_index]
2157
# This dir info has been handled, go to the next
2130
2159
current_dir_info = dir_iterator.next()
2131
2160
except StopIteration:
2294
2323
new_executable = bool(
2295
2324
stat.S_ISREG(current_path_info[3].st_mode)
2296
2325
and stat.S_IEXEC & current_path_info[3].st_mode)
2297
if want_unversioned:
2299
(None, utf8_decode_or_none(current_path_info[0])),
2303
(None, utf8_decode_or_none(current_path_info[1])),
2304
(None, current_path_info[2]),
2305
(None, new_executable))
2327
(None, utf8_decode_or_none(current_path_info[0])),
2331
(None, utf8_decode_or_none(current_path_info[1])),
2332
(None, current_path_info[2]),
2333
(None, new_executable))
2306
2334
# dont descend into this unversioned path if it is
2308
2336
if current_path_info[2] in ('directory'):