Fix limit calculation for largeish Mercurial repsositories
Summary: Fixes T10304. In Mercurial, we must enumerate the whole file tree. Currently, we incorrectly count files within directories (which won't be shown) toward the "100 file" limit at top level, so directories with more than 100 subpaths are truncated improperly. This is approxiately the same as @richardvanvelzen's fix. Test Plan: Viewed a large Mercurial repository, saw a complete directory listing. Reviewers: chad Reviewed By: chad Subscribers: richardvanvelzen Maniphest Tasks: T10304 Differential Revision: https://secure.phabricator.com/D15282
This commit is contained in:
@@ -246,7 +246,16 @@ final class DiffusionBrowseQueryConduitAPIMethod
|
||||
DiffusionBrowseResultSet::REASON_IS_FILE);
|
||||
return $result;
|
||||
}
|
||||
|
||||
$parts = explode('/', $remainder);
|
||||
$name = reset($parts);
|
||||
|
||||
// If we've already seen this path component, we're looking at a file
|
||||
// inside a directory we already processed. Just move on.
|
||||
if (isset($results[$name])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (count($parts) == 1) {
|
||||
$type = DifferentialChangeType::FILE_NORMAL;
|
||||
} else {
|
||||
@@ -254,7 +263,7 @@ final class DiffusionBrowseQueryConduitAPIMethod
|
||||
}
|
||||
|
||||
if ($count >= $offset) {
|
||||
$results[reset($parts)] = $type;
|
||||
$results[$name] = $type;
|
||||
}
|
||||
|
||||
$count++;
|
||||
|
||||
Reference in New Issue
Block a user