Page MenuHomePhabricator

arc patch with invalid revision number fails with an exception
Closed, DuplicatePublic

Description

Current Result:
Running arc patch --revision with an invalid revision number ends in an exception.

Expected Result:
Arcanist should now a message "This revision does not exist" or something like that.

$ arc --version
arcanist 8f69a5c378c317f0a85b33151ee769626c0ecf00 (12 Jul 2016)
libphutil ff84abc7d8575799b9a5323bb5b549925c6f6185 (12 Jul 2016)
$ arc patch --revision 893
[2016-07-20 09:42:26] ERROR 2: Invalid argument supplied for foreach() at [/opt/arcanist/arcanist/src/workflow/ArcanistWorkflow.php:1201]
arcanist(head=master, ref.master=8f69a5c378c3), phutil(head=master, ref.master=ff84abc7d857)
  #0 ArcanistWorkflow::loadBundleFromConduit(ConduitClient, array) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1189]
  #1 ArcanistWorkflow::loadRevisionBundleFromConduit(ConduitClient, string) called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:383]
  #2 ArcanistPatchWorkflow::run() called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:397]
  #3 ArcanistPatchWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]
[2016-07-20 09:42:26] EXCEPTION: (TypeError) Argument 1 passed to idx() must be of the type array, boolean given, called in /opt/arcanist/arcanist/src/workflow/ArcanistWorkflow.php on line 1208 at [<phutil>/src/utils/utils.php:36]
arcanist(head=master, ref.master=8f69a5c378c3), phutil(head=master, ref.master=ff84abc7d857)
  #0 idx(boolean, string) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1208]
  #1 ArcanistWorkflow::loadBundleFromConduit(ConduitClient, array) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1189]
  #2 ArcanistWorkflow::loadRevisionBundleFromConduit(ConduitClient, string) called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:383]
  #3 ArcanistPatchWorkflow::run() called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:397]
  #4 ArcanistPatchWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]

Event Timeline

sascha-egerer renamed this task from arc patch with revision number fails with an exception to arc patch with invalid revision number fails with an exception.Jul 20 2016, 10:29 AM
sascha-egerer updated the task description. (Show Details)
sascha-egerer edited projects, added Feature Request; removed Bug Report.