Update ArcanistMercurialAPI to support getting the current commit ref
Summary:
Mercurial does not have an implementation for querying commit symbol hardpoints, which is what the "arc amend" workflow uses.
This provides an implementation for Mercurial as well as updating ArcanistMercurialAPI to specify the current working directory symbol as ..
Additionally removed an erroneous early return in ArcanistAmendWorkflow which prevents a check against uncommitted changes.
Fixes T13665
Test Plan:
- I created a diff on a Mercurial revision.
- I updated the revisions summary in phabricator.
- I ran arc amend and it successfully amended the local commit with the updated commit message.
- I modified a file in the repository and left the change uncommitted.
- I ran arc amend and verified that it reported an error due to uncommited commits.
I ran the following commands to verify that they resolved to the correct commits
- arc inspect --explore -- 'commit(674492bb460)' properly matched the right commit as a commit hash prefix
- arc inspect --explore -- 'commit(674492bb4606666d5321feb38d2a467a8733c786)' properly matched the right commit as a full commit hash
- arc inspect --explore -- 'commit(master)' properly matched the right commit as a bookmark
- arc inspect --explore -- 'commit(tip)' properly matched the right commit as a tag
- arc inspect --explore -- 'commit(.)' properly matched the right commit as the working directory
- arc inspect --explore -- 'commit(cafe)' properly matched the right commit as a commit hash prefix
- I created a 'cafe' bookmark on a changeset
- arc inspect --explore -- 'commit(cafe)' properly matched the right commit as a bookmark
- arc inspect --explore -- 'commit(67449)' properly matched the right commit as a revision number
- arc inspect --explore -- 'commit(2147483648)' properly did not match any revision (no python exception)
- arc inspect --explore -- 'commit(0)' properly matched the first commit
Reviewers: Blessed Reviewers, epriestley
Reviewed By: Blessed Reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T13665
Differential Revision: https://secure.phabricator.com/D21716