From bd2b557b426af8271f6a6cddf3de729138efbcc6 Mon Sep 17 00:00:00 2001 From: Nicholas Harper Date: Mon, 22 Aug 2011 13:33:48 -0700 Subject: [PATCH] Mark diffusion browse result as empty directory when appropriate Summary: When selecting children of a directory, it is possible that none of its children exist anymore even though the directory still exists. After fetching the children but before returning them, we should check whether there are any, and if there are no children, set the reason as empty directory. Test Plan: In sandbox, browsed in diffusion to a directory that exists but has no files and saw that it has a useful message instead of a vague exception. Reviewers: epriestley, tuomaspelkonen, jungejason Reviewed By: tuomaspelkonen CC: aran, tuomaspelkonen Differential Revision: 846 --- .../diffusion/query/browse/svn/DiffusionSvnBrowseQuery.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/diffusion/query/browse/svn/DiffusionSvnBrowseQuery.php b/src/applications/diffusion/query/browse/svn/DiffusionSvnBrowseQuery.php index 7356093598..c47952118a 100644 --- a/src/applications/diffusion/query/browse/svn/DiffusionSvnBrowseQuery.php +++ b/src/applications/diffusion/query/browse/svn/DiffusionSvnBrowseQuery.php @@ -179,6 +179,10 @@ final class DiffusionSvnBrowseQuery extends DiffusionBrowseQuery { $results[] = $result; } + if (empty($results)) { + $this->reason = self::REASON_IS_EMPTY; + } + return $results; }