changeset 45246:b1f2659c1c34

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
author Ian Moody <moz-ian@perix.co.uk>
date Thu, 30 Jul 2020 16:58:38 +0100
parents b4887d0680a4
children e15416c95b25
files hgext/phabricator.py tests/test-phabricator.t
diffstat 2 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/phabricator.py	Thu Jul 30 16:52:12 2020 +0100
+++ b/hgext/phabricator.py	Thu Jul 30 16:58:38 2020 +0100
@@ -238,8 +238,9 @@
 
     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():
--- a/tests/test-phabricator.t	Thu Jul 30 16:52:12 2020 +0100
+++ b/tests/test-phabricator.t	Thu Jul 30 16:58:38 2020 +0100
@@ -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