1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-12 18:02:39 +01:00
Commit graph

23 commits

Author SHA1 Message Date
epriestley
6af46f289a Support short aliases and repeatable arguments in Arcanist Workflow arguments
Summary: Ref T13546. Add support for short "-x" flags and repeatable "--say moo --say quack" flags.

Test Plan: In future changes, used "arc diff -m" and "arc land --onto ... --onto ...".

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21310
2020-06-05 12:47:43 -07:00
epriestley
bf76fa547d Make "arc <workflow> --help" work again for workflows which haven't updated yet
Summary:
See <https://discourse.phabricator-community.org/t/help-is-no-longer-present-for-arc-subcommands-in-todays-stable/3786>.

The "--help" flag ends up falling through to the old "arcanist.php", where it becomes lost. Catch it earlier so "arc diff --help" prints diff help, for instance.

Test Plan: Ran `arc help diff`, `arc diff --help`, `arc --help diff`, and similar commands for updated workflows; got help.

Differential Revision: https://secure.phabricator.com/D21168
2020-04-25 08:57:28 -07:00
epriestley
d408a80ae1 Update "arc paste" for Toolsets
Summary: Ref T13490. More-or-less straightforward upgrade to modern calls.

Test Plan: Created and viewed pastes.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21104
2020-04-13 15:01:51 -07:00
epriestley
c8dd2a3753 Crudely bridge legacy workflows into "arc help"
Summary:
Ref T13490. One of the biggest issues users are hitting in modern "arc" is that workflows don't appear in "arc help" until they're updated.

Since there's still some work to do and gluing them in isn't terribly difficult, at least get things connected for now.

Test Plan: Ran "arc help", "arc help diff".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21101
2020-04-13 11:41:05 -07:00
epriestley
0f2e277cd9 Update "arc amend" for Toolsets
Summary: Ref T13490. Moves "arc amend" to Toolsets with modern ref/hardpoint code.

Test Plan: Ran "arc amend --show", "--revision", etc. Hit all the prompts and errors, probably?

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21095
2020-04-12 13:48:26 -07:00
epriestley
088b157444 Add ref lookup for username symbols
Summary:
Ref T13490. I'm attempting to update "arc amend", but it needs to fetch revision authors to raise an "amending a revision you don't own" error.

Support user-symbol resolution.

Along the way, this introduces some infrastructure for abstracting away iteration over a multi-page Conduit result set.

Test Plan:
  - Ran "arc inspect ..." for various "user(...)" queries.
  - Set page size to 3 and issued a general query, saw the future page it away properly.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21092
2020-04-12 13:42:51 -07:00
epriestley
ccd1ebb256 Port "arc prompts" from wilds and fix a path issue in shell completion
Summary:
Ref T13490. Bring "arc prompts" from "wilds" and hook it into the prompt in "arc shell-complete".

See D21069. Fix an issue where the shell hook tested for a path other than the path it writes to.

Test Plan: Ran "arc shell-complete" with no hook and got a prompt. Shell completed things. Ran "arc prompts shell-complete".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21085
2020-04-11 10:43:05 -07:00
epriestley
387027eb3a Restore "arc alias" shell aliases
Summary:
See <https://discourse.phabricator-community.org/t/exception-when-trying-to-run-an-arc-alias-undefined-method-arcanistalias-getshellcommand/3731/>.

Shell aliases got lost in the shuffle of porting "arc alias"; restore them.

Test Plan: Bound `arc ls` to `ls -alh`, ran `arc ls`.

Differential Revision: https://secure.phabricator.com/D21084
2020-04-11 09:59:48 -07:00
epriestley
dc42f51cf7 Reroute all RefQuery callers to HardpointEngine
Summary:
Ref T11968. "arc browse", "arc branch", and "arc diff" currently may execute into the RefQuery engine. Reroute them to the HardpointEngine.

This removes older-generation "Ref" objects and renames the replacement "RefPro" objects to "Ref".

Test Plan: Ran "arc branch", "arc browse <various things>", "arc diff", searched for affected symbols.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21082
2020-04-11 06:46:23 -07:00
epriestley
adea2550f5 Introduce "arc inspect" and some of the new ref/hardpoint classes
Summary:
Ref T11968. Inches toward the new ref/hardpoint code by introducing the modern refs as "RefPro" objects and supporting an "arc inspect <object>" to load objects and hardpoints.

This doesn't impact any existing runtime behavior.

Test Plan: Ran "arc inspect [--all] commit(...)", got hardpoint queries and yield-based data fetching.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21078
2020-04-10 05:01:25 -07:00
epriestley
0b3cd39230 Update the "WorkingCopy" API and create a fallback "Filesystem" working copy
Summary:
Ref T11968.

  - Allow "WorkingCopy" objects to maintain an API object and update callers ("get...()" instead of "new...()").
  - Always generate a WorkingCopy object and a RepositoryAPI object.

Currently, code has to look like this:

```
$working_copy = ...
if ($working_copy) {
  $repository_api = ...
  if ($repository_api [instanceof ... ]) {
```

This is clunky. There's also no reason some "arc" commands can't run outside a VCS working directory without special-casing how they interact with the filesystem.

Conceptually, model the filesystem as a trivial VCS (which stores exactly one commit, always amends onto it, and discards history). Provide a trivial WorkingCopy and API for it.

(This change isn't terribly interesting on its own, but chips away at landing the new Hardpoint infrastructure.)

Test Plan: Ran `arc version`, `arc upgrade`.

Maniphest Tasks: T11968

Differential Revision: https://secure.phabricator.com/D21070
2020-04-08 09:22:43 -07:00
epriestley
d4d095dbf6 Make Windows escaping preserve "%" symbols in arguments
Summary:
Ref T13504. Ref T13209. We currently use "escapeshellarg()" under Windows, which destructively replaces "%" symbols with spaces. This is wrong, breaks general behavior with "git log --format=...", and has led to a lot of weird workarounds in `arc` code where we don't escape arguments we should be escaping to tiptoe around issues with "%".

Now that execution occurs via "bypass_shell", we can safely (probably?) escape things, although programs are still apparently free to parse the command string however they want.

Test Plan: Added unit tests, ran them under Mac and Windows, got clean results. Ran "arc version" on Mac and Windows.

Maniphest Tasks: T13504, T13209

Differential Revision: https://secure.phabricator.com/D21051
2020-04-02 13:44:13 -07:00
epriestley
5ce1d79717 Fix error behavior of "arc version" when it encounters a library which is not a working copy
Summary:
Ref T13504. The API has changed here slightly, and if you run "arc version" without "arcanist/" being a Git working copy, it currently fatals in a misleading way.

Instead, reach the error properly.

Test Plan: Ran "arc version" after moving aside ".git/", got a helpful error message instead of a confusing "call on null" exception.

Maniphest Tasks: T13504

Differential Revision: https://secure.phabricator.com/D21050
2020-04-02 08:24:22 -07:00
epriestley
9cd72baae9 Update Phage for toolsets and restore library loading behaviors
Summary: Ref T13490. This makes the "phage" toolset work properly and updates external library behavior to match the "classic" behavior, except that "--library" is now supported.

Test Plan: Ran "phage remote" workflows.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21025
2020-02-23 09:30:53 -08:00
epriestley
ee66b15bd4 Port "arc upgrade" to Toolsets
Summary: Ref T13490. Allows "arc upgrade" to run through the new Toolsets infrastructure.

Test Plan: Ran "arc upgrade", although you can't upgrade feature branches so this can't be entirely tested until it hits "master".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21006
2020-02-17 11:33:17 -08:00
epriestley
d3b77af8a5 Require "--" as an argument terminator when running noninteractively
Summary:
Depends on D21001. Ref T13490.

  - Require "--" to terminate arguments when running noninteractively.
  - Don't correct spelling when running noninteractively (we still suggest corrections).
  - Remove old "phage" wrapper script.
  - Fix an issue where "argv" could implicitly generate a parseable "--argv" flag.
  - Accept "--" as an argument terminator even when there is no argument list.
  - Update some strings to use more modern quoting style.
  - Make workflows decline to handle signals by default.
  - Allow "arc weld" to weld non-UTF8 files together.

Test Plan: Ran various commands. Welded non-UTF8 files.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21002
2020-02-16 09:16:51 -08:00
epriestley
db8419f19b Port "arc weld" and "arc anoid" to Toolsets workflows, plus minor fixes
Summary: Ref T13490. Update the "weld" workflow and the "anoid" workflow. Incorporates D20938.

Test Plan: Ran "arc weld". Ran "arc anoid".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21001
2020-02-16 09:16:24 -08:00
epriestley
8cd79d38af Port "arc shell-complete" to Toolsets
Summary: Depends on D20996. Ref T13395. Ports the updated version of this workflow from "experimental".

Test Plan: Ran `arc shell-complete` to install the hook, then shell-completed commands.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20997
2020-02-14 09:16:46 -08:00
epriestley
70c6045c7f Update "arc alias" to modern workflows
Summary: Depends on D20993. Ref T13395. Merges the more-modern "alias" out of "experimental".

Test Plan: Defined and invoked aliases. This has some rough edges: notably, no easy list/delete flow.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20996
2020-02-14 09:16:18 -08:00
epriestley
0c6ae6bbcf Port "arc version" to Toolsets
Summary: Ref T13395. Depends on D20992. Run "arc version" as a modern workflow, not a classic workflow.

Test Plan: Ran "arc version".

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20993
2020-02-14 09:15:58 -08:00
epriestley
cf9469e0d1 Port "arc liberate" to Toolsets
Summary: Ref T13395. Depends on D20991. Make "arc liberate" run as a toolset command, not a classic command.

Test Plan: Ran "arc liberate"; created this diff.

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20992
2020-02-14 09:14:56 -08:00
epriestley
0e95fcbb7f Port "arc help" to Toolsets
Summary: Ref T13395. Make "arc help" run as a toolset command, not a classic command.

Test Plan: Ran "arc help".

Maniphest Tasks: T13395

Differential Revision: https://secure.phabricator.com/D20991
2020-02-14 09:14:30 -08:00
epriestley
c471983697 Collapse Arcanist toolsets from "wilds" into "master", as an overlay layer
Summary:
Depends on D20988. Ref T13395. Ref T13098. Ref T13203.

This brings all the "toolsets" code into "master". We try to run commands as toolsets commands first, then fall back to older code.

Since the "toolsets" class tree is mostly parallel to the older class tree, this isn't completely broken. Currently, all commands fall back.

Test Plan: Created this diff, ran various other commands. But this is probably a long shot from finished.

Maniphest Tasks: T13395, T13203, T13098

Differential Revision: https://secure.phabricator.com/D20990
2020-02-13 14:10:46 -08:00