Page MenuHomePhabricator

Allow "arc browse <symbol>" to resolve symbolic commits

Authored by epriestley on Aug 4 2014, 6:06 PM.



Ref T5781. This makes things like arc browse master work (but they open the commit, not a revision).

Test Plan

Ran arc browse master.

Diff Detail

rARC Arcanist
Lint Skipped
Unit Tests Skipped

Event Timeline

epriestley updated this revision to Diff 24392.Aug 4 2014, 6:06 PM
epriestley retitled this revision from to Allow "arc browse <symbol>" to resolve symbolic commits.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: btrahan, csilvers.
csilvers edited edge metadata.Aug 4 2014, 6:17 PM

I'm not sure I understand when you use plural arguments -- does that mean you can do arc browse D1234 T5678? If so, am I reading the current review right that it will either interpret all arguments as commits, or all arguments as objects, or all arguments as files? I'm probably not.

You can specify multiple objects, yes. We try to resolve them in this order:

  • object names (like T123).
  • if you're in a working copy:
    • symbolic commits.
    • paths which exist in the working copy.
    • (with --force: force everything that's left to resolve as a path).

They fall through if they fail an earlier resolution:

$ arc browse T234 master README
Opening T234 as an object.
Opening master as a commit.
Opening README as a repository path.

(There's no way to force T123 to resolve as a symbolic commit or a path, nor to force master to resolve as a path, but I suspect no one will ever care, and we could introduce some --path flag if they do.)

Oh, I think i was just misundersatnding how the php works. I see the unset commands now, and the logic makes more sense to me. But clearly I am not the best person to be reviewing this...

epriestley updated this revision to Diff 24394.Aug 4 2014, 6:52 PM
epriestley edited edge metadata.
  • Rebase to pick up $paths handling fix.
btrahan accepted this revision.Aug 4 2014, 6:57 PM
btrahan edited edge metadata.
This revision is now accepted and ready to land.Aug 4 2014, 6:57 PM
epriestley closed this revision.Aug 4 2014, 7:03 PM
epriestley updated this revision to Diff 24398.

Closed by commit rARC26b71baf0919 (authored by @epriestley).