From 57daa71514b0c9be86f6a119f09c7d9691e38709 Mon Sep 17 00:00:00 2001 From: Ryan McElroy Date: Wed, 7 Feb 2018 01:53:50 -0800 Subject: [PATCH] phabstatus: remove bad early exit Summary: This would cause us to return data outside of our contract, which crashes in a worse, less useful way that if we catch things ourselves and print useful debug information. Reviewed By: quark-zju Differential Revision: D6826454 fbshipit-source-id: 9cdb2987f762c98c6167ffcea03545bc46eb2119 --- hgext/extlib/phabricator/graphql.py | 4 ---- tests/test-fb-hgext-phabstatus.t | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hgext/extlib/phabricator/graphql.py b/hgext/extlib/phabricator/graphql.py index dc25fc65df..7c5b8e6fd5 100644 --- a/hgext/extlib/phabricator/graphql.py +++ b/hgext/extlib/phabricator/graphql.py @@ -134,10 +134,6 @@ class Client(object): except (KeyError, TypeError): pass - revisions = ret['data']['query'][0]['results']['nodes'] - if revisions is None: - return None - infos = {} for revision in rev_numbers: info = {} diff --git a/tests/test-fb-hgext-phabstatus.t b/tests/test-fb-hgext-phabstatus.t index 4baee35aab..e278d12143 100644 --- a/tests/test-fb-hgext-phabstatus.t +++ b/tests/test-fb-hgext-phabstatus.t @@ -43,7 +43,9 @@ And now with bad responses: > [{"data": {"query": [{"results": {"nodes": null}}]}}] > EOF $ HG_ARC_CONDUIT_MOCK=$TESTTMP/mockduit hg log -T '{phabstatus}\n' -r . 2>&1 | grep Error - AttributeError: 'NoneType' object has no attribute 'get' + Error talking to phabricator. No diff information can be provided. + Error info: 'NoneType' object is not iterable + Error $ cat > $TESTTMP/mockduit << EOF > [{"data": {"query": [{"results": null}]}}]