@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+10 -1
+10 -1
src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
··· 246 246 DiffusionBrowseResultSet::REASON_IS_FILE); 247 247 return $result; 248 248 } 249 + 249 250 $parts = explode('/', $remainder); 251 + $name = reset($parts); 252 + 253 + // If we've already seen this path component, we're looking at a file 254 + // inside a directory we already processed. Just move on. 255 + if (isset($results[$name])) { 256 + continue; 257 + } 258 + 250 259 if (count($parts) == 1) { 251 260 $type = DifferentialChangeType::FILE_NORMAL; 252 261 } else { ··· 254 263 } 255 264 256 265 if ($count >= $offset) { 257 - $results[reset($parts)] = $type; 266 + $results[$name] = $type; 258 267 } 259 268 260 269 $count++;