diff tests/test-phabricator.t @ 44579:a7f8c657a3f0

phabricator: allow multiple DREVSPEC args to phabread|phabimport|phabupdate Per Augie's request. Like regular revsets, the result is the union of all given specs. Unlike regular revsets, these don't resolve in parent -> child order, and should be specified as such on the command line. This change invalidated a previous test using an empty `hg phabread`, so it has been switched to `hg debugcallconduit` to preserve that coverage. Differential Revision: https://phab.mercurial-scm.org/D8233
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Mar 2020 11:02:07 -0500
parents 2ec6160449aa
children 38f7b2f02f6d
line wrap: on
line diff
--- a/tests/test-phabricator.t	Thu Mar 05 11:00:00 2020 -0500
+++ b/tests/test-phabricator.t	Thu Mar 05 11:02:07 2020 -0500
@@ -29,19 +29,20 @@
   >  --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head
   abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long.
 
-Missing arguments print the command help
+Missing arguments don't crash, and may print the command help
 
-  $ hg phabread
-  hg phabread: invalid arguments
-  hg phabread DREVSPEC [OPTIONS]
+  $ hg debugcallconduit
+  hg debugcallconduit: invalid arguments
+  hg debugcallconduit METHOD
   
-  print patches from Phabricator suitable for importing
+  call Conduit API
   
   options:
   
-    --stack read dependencies
-  
-  (use 'hg phabread -h' to show more help)
+  (use 'hg debugcallconduit -h' to show more help)
+  [255]
+  $ hg phabread
+  abort: empty DREVSPEC set
   [255]
 
 Basic phabread:
@@ -57,6 +58,22 @@
   
   This commit establishes a new exchangev2 module for holding
 
+Phabread with multiple DREVSPEC
+
+TODO: attempt to order related revisions like --stack?
+  $ hg phabread --test-vcr "$VCR/phabread-multi-drev.json" D8205 8206 D8207 \
+  >             | grep '^Differential Revision'
+  Differential Revision: https://phab.mercurial-scm.org/D8205
+  Differential Revision: https://phab.mercurial-scm.org/D8206
+  Differential Revision: https://phab.mercurial-scm.org/D8207
+
+Empty DREVSPECs don't crash
+
+  $ hg phabread --test-vcr "$VCR/phabread-empty-drev.json" D7917-D7917
+  abort: empty DREVSPEC set
+  [255]
+
+
 phabupdate with an accept:
   $ hg phabupdate --accept D4564 \
   > -m 'I think I like where this is headed. Will read rest of series later.'\
@@ -370,5 +387,12 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     create beta for phabricator test
   
+Phabimport accepts multiple DREVSPECs
+
+  $ hg rollback --config ui.rollback=True
+  repository tip rolled back to revision 1 (undo phabimport)
+  $ hg phabimport --no-stack D7917 D7918 --test-vcr "$VCR/phabimport-multi-drev.json"
+  applying patch from D7917
+  applying patch from D7918
 
   $ cd ..