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

3 commits

Author SHA1 Message Date
epriestley
84857e4890 Implement a revision resolver for arc browse <commit>
Summary: Ref T10895. This allows `arc browse <commit name>` to resolve to a revision, if an associated open revision exists.

Test Plan: Ran `arc browse` with various arguments.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10895

Differential Revision: https://secure.phabricator.com/D16933
2016-11-23 13:27:26 -08:00
epriestley
d00de495bc Separate "browse ref -> commit" and "commit -> upstream" hardpoints from arc browse workflow
Summary:
Ref T10895. Currently, the "browse as a commit" code does these lookups, but the code can't be reused.

For T10895, I want to introduce "browse as revision", but it will need to do the same ref lookup. Separate this as a hardpoint so the code can be shared via hardpoint/ref infrastructure.

Test Plan: Ran `arc browse master` and similar commands.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10895

Differential Revision: https://secure.phabricator.com/D16929
2016-11-23 13:26:01 -08:00
epriestley
71473af895 Rebuild "arc branch" on new "hardpoint" infrastructure
Summary:
Ref T11355. Ref T10895. Ref T11518. This is heading to `experiemntal`. This may or may not be a good idea, but basically it's a more generic version of `Query` classes in Phabricator.

This starts creating generic objects ("CommitRef", "BranchRef") which have attachable properties, like many Phabricator objects do. Here, they're formalized (and theoretically extensible), as "hardpoints".

So: a hardpoint is something on an object which you can attach stuff to, but which we don't start with the data for.

All of the logic for actually figuruing out how to attach stuff to hardpoints is also modular. `Loader` classes have code for loading stuff onto objects. For example, `ArcanistMercurialBranchCommitHardpointLoader` knows how to run `hg log` to build the commit for a branch.

One issue is that `arc feature` in Mercurial is 100% bookmarks, so maybe I should actually be making `ArcanistRefRef` here. But we can probbbably deal with that later.

This moves us somewhat closer to T11355 and T11518, although the immediate thing I want to do with it is define an `ArcanistObjectNameRef` and use hardpoints to load URIs for it for T10895.

Overall, I expect this will see some revision in future changes, and perhaps most of it will go away.

Test Plan: Ran `arc branch` / `arc feature` in Git and Mercurial repositories.

Reviewers: avivey, chad

Reviewed By: chad

Maniphest Tasks: T10895, T11518, T11355

Differential Revision: https://secure.phabricator.com/D16857
2016-11-23 07:36:43 -08:00