HomePhabricator

Allow monogrammed objects to be parsed from the `arc` command line in…

Description

Allow monogrammed objects to be parsed from the arc command line in "Reviewers" and similar fields

Summary:
Ref T10939. This allows the CLI to parse reviewers and subscribers like this:

Reviewers: epriestley, O123 Some Package Name

The rule goes:

  • If a reviewer or subscriber starts with a monogram (like X111), just look that up and ignore everything until the next comma.
  • Otherwise, split it on spaces and look up each part.

This means that these are valid:

alincoln htaft
alincoln, htaft
#a #b epriestley
O123 Some Package, epriestley, #b

I think the only real downside is that this:

O123 Some Package epriestley

...ignores the "epriestley" part. However, I don't expect users to be typing package monograms manually -- they just need to be representable by arc land and arc diff --edit and such. Those flows will always add commas and make the parse unambiguous.

Test Plan:

  • Added test coverage.
  • amend --show'd a revision with a package subscriber (this isn't currently possible to produce using the web UI, it came from a future change) and saw Subscribers: O123 package name, usera, userb.
  • Updated a revision with a package subscriber.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10939

Differential Revision: https://secure.phabricator.com/D15911

Details