1643
1643
output. An unversioned file is defined as one with (False, False)
1644
1644
for the versioned pair.
1646
utf8_decode = cache_utf8._utf8_decode_with_None
1646
utf8_decode_or_none = cache_utf8._utf8_decode_with_None
1647
1647
_minikind_to_kind = dirstate.DirState._minikind_to_kind
1648
1648
# NB: show_status depends on being able to pass in non-versioned files
1649
1649
# and report them as unknown
1983
1983
# TODO: the pending list should be lexically sorted? the
1984
1984
# interface doesn't require it.
1985
1985
current_root = search_specific_files.pop()
1986
current_root_unicode = current_root.decode('utf8')
1986
1987
searched_specific_files.add(current_root)
1987
1988
# process the entries for this containing directory: the rest will be
1988
1989
# found by their parents recursively.
1989
1990
root_entries = _entries_for_path(current_root)
1990
root_abspath = self.target.abspath(current_root)
1991
root_abspath = self.target.abspath(current_root_unicode)
1992
1993
root_stat = os.lstat(root_abspath)
1993
1994
except OSError, e:
2025
2026
or result[6][0] != result[6][1] # kind
2026
2027
or result[7][0] != result[7][1] # executable
2028
result = (result[0],
2029
((utf8_decode(result[1][0])[0]),
2030
utf8_decode(result[1][1])[0]),) + result[2:]
2032
if want_unversioned and not path_handled:
2030
(utf8_decode_or_none(result[1][0]),
2031
utf8_decode_or_none(result[1][1])),
2035
(utf8_decode_or_none(result[5][0]),
2036
utf8_decode_or_none(result[5][1])),
2040
if want_unversioned and not path_handled and root_dir_info:
2033
2041
new_executable = bool(
2034
2042
stat.S_ISREG(root_dir_info[3].st_mode)
2035
2043
and stat.S_IEXEC & root_dir_info[3].st_mode)
2036
yield (None, (None, current_root), True, (False, False),
2038
(None, splitpath(current_root)[-1]),
2039
(None, root_dir_info[2]), (None, new_executable))
2045
(None, current_root_unicode),
2049
(None, splitpath(current_root_unicode)[-1]),
2050
(None, root_dir_info[2]),
2051
(None, new_executable)
2040
2053
initial_key = (current_root, '', '')
2041
2054
block_index, _ = state._find_block_index_from_key(initial_key)
2042
2055
if block_index == 0:
2111
2124
or result[6][0] != result[6][1] # kind
2112
2125
or result[7][0] != result[7][1] # executable
2114
result = (result[0],
2115
((utf8_decode(result[1][0])[0]),
2116
utf8_decode(result[1][1])[0]),) + result[2:]
2128
(utf8_decode_or_none(result[1][0]),
2129
utf8_decode_or_none(result[1][1])),
2133
(utf8_decode_or_none(result[5][0]),
2134
utf8_decode_or_none(result[5][1])),
2118
2138
block_index +=1
2119
2139
if (block_index < len(state._dirblocks) and
2120
2140
osutils.is_inside(current_root,
2161
2181
or result[6][0] != result[6][1] # kind
2162
2182
or result[7][0] != result[7][1] # executable
2164
result = (result[0],
2165
((utf8_decode(result[1][0])[0]),
2166
utf8_decode(result[1][1])[0]),) + result[2:]
2185
(utf8_decode_or_none(result[1][0]),
2186
utf8_decode_or_none(result[1][1])),
2190
(utf8_decode_or_none(result[5][0]),
2191
utf8_decode_or_none(result[5][1])),
2168
2195
elif current_entry[0][1] != current_path_info[1]:
2169
2196
if current_path_info[1] < current_entry[0][1]:
2170
2197
# extra file on disk: pass for now, but only
2186
2213
or result[6][0] != result[6][1] # kind
2187
2214
or result[7][0] != result[7][1] # executable
2189
result = (result[0],
2190
((utf8_decode(result[1][0])[0]),
2191
utf8_decode(result[1][1])[0]),) + result[2:]
2217
(utf8_decode_or_none(result[1][0]),
2218
utf8_decode_or_none(result[1][1])),
2222
(utf8_decode_or_none(result[5][0]),
2223
utf8_decode_or_none(result[5][1])),
2193
2227
advance_path = False
2195
2229
for result in _process_entry(current_entry, current_path_info):
2205
2239
or result[6][0] != result[6][1] # kind
2206
2240
or result[7][0] != result[7][1] # executable
2208
result = (result[0],
2209
((utf8_decode(result[1][0])[0]),
2210
utf8_decode(result[1][1])[0]),) + result[2:]
2243
(utf8_decode_or_none(result[1][0]),
2244
utf8_decode_or_none(result[1][1])),
2248
(utf8_decode_or_none(result[5][0]),
2249
utf8_decode_or_none(result[5][1])),
2212
2253
if advance_entry and current_entry is not None:
2213
2254
entry_index += 1
2214
2255
if entry_index < len(current_block[1]):
2225
2266
stat.S_ISREG(current_path_info[3].st_mode)
2226
2267
and stat.S_IEXEC & current_path_info[3].st_mode)
2227
2268
if want_unversioned:
2228
yield (None, (None, current_path_info[0]),
2270
(None, utf8_decode_or_none(current_path_info[0])),
2230
2272
(False, False),
2232
(None, current_path_info[1]),
2274
(None, utf8_decode_or_none(current_path_info[1])),
2233
2275
(None, current_path_info[2]),
2234
2276
(None, new_executable))
2235
2277
# dont descend into this unversioned path if it is