Handle case of no empty files
Review Request #7683 — Created Oct. 9, 2015 and submitted
Mercurial's locate command will exit with status 1 when no files are
found. We usehg locate -r <REV> set:size(0)
to locate empty files.
However, when there are no empty files, we will getNone
instead of
empty output because of Mercurial's status code. We now only try to
parse the list of files when there is output to avoid this issue.
Ran unit tests.
rbt post
worked with this patch and didn't without it.
- Description:
-
~ Mercrial's locate command will return 1 if it finds no files for the sepcified query. This causes issues when looking for empty files because it is not guaranteed there are any. This patch will return an empty set of files instead of raising an exception.
~ Mercurial's locate command will exit with status 1 when no files are
+ found. We use hg locate -r <REV> set:size(0)
to locate empty files.+ However, when there are no empty files, we will get None
instead of+ empty output because of Mercurial's status code. We now only try to + parse the list of files when there is output to avoid this issue. - Testing Done:
-
~ Ran
hg locate -r <REV> set:size(n)
forn = 0
and `~ Ran unit tests.
+ + rbt post
worked with this patch and didn't without it.