# HG changeset patch # User Ian Moody # Date 2020-07-30 15:58:38 # Node ID b1f2659c1c34577b7532ef3d4fa92bbfcc108d98 # Parent b4887d0680a4ddde0266507ccadab7bd4ea10698 phabricator: unconditionally pop `test_vcr` to fix debugcallconduit 11592ce6a711 / D8525 accidentally broke debugcallconduit in non-test scenarios because it stopped popping `test_vcr` from `kwargs` unconditionally, so when `--test-vcr` isn't set the empty string still gets passed down as the value of `test_vcr` in `kwargs`. However unlike all the other commands debugcallconduit doesn't have an `**opts` argument to receive it, so it aborts because of invalid arguments. Differential Revision: https://phab.mercurial-scm.org/D8852 diff --git a/hgext/phabricator.py b/hgext/phabricator.py --- a/hgext/phabricator.py +++ b/hgext/phabricator.py @@ -238,8 +238,9 @@ def vcrcommand(name, flags, spec, helpca def decorate(fn): def inner(*args, **kwargs): - if kwargs.get('test_vcr'): - cassette = pycompat.fsdecode(kwargs.pop('test_vcr')) + vcr = kwargs.pop('test_vcr') + if vcr: + cassette = pycompat.fsdecode(vcr) import hgdemandimport with hgdemandimport.deactivated(): diff --git a/tests/test-phabricator.t b/tests/test-phabricator.t --- a/tests/test-phabricator.t +++ b/tests/test-phabricator.t @@ -24,16 +24,9 @@ > EOF $ VCR="$TESTDIR/phabricator" -BROKEN: debugcallconduit fails without --test-vcr: +debugcallconduit doesn't claim invalid arguments without --test-vcr: $ echo '{}' | HGRCSKIPREPO= hg debugcallconduit 'conduit.ping' - hg debugcallconduit: invalid arguments - hg debugcallconduit METHOD - - call Conduit API - - options: - - (use 'hg debugcallconduit -h' to show more help) + abort: config phabricator.url is required [255] Error is handled reasonably. We override the phabtoken here so that