1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-03-26 11:10:15 +01:00

Support automatic "Depends On" detection in Mercurial

Summary: Depends on D18651. Allows Mercurial to auto-detect depends-on revisions.

Test Plan: See D18652 and D18653. Didn't actually test the empty repository states but they're probably okay. The `experimental` branch is an untamed wild. ¯\_(ツ)_/¯

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18654
This commit is contained in:
epriestley 2017-09-27 10:22:00 -07:00
parent 5ddc573223
commit ba12102eb6
2 changed files with 20 additions and 1 deletions

View file

@ -1054,7 +1054,12 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
}
public function getBaseCommitRef() {
$base_commit = $this->getSourceControlBaseRevision();
$base_commit = $this->getBaseCommit();
if ($base_commit === self::GIT_MAGIC_ROOT_COMMIT) {
return null;
}
$base_message = $this->getCommitMessage($base_commit);
// TODO: We should also pull the tree hash.

View file

@ -596,6 +596,20 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
return $refs;
}
public function getBaseCommitRef() {
$base_commit = $this->getBaseCommit();
if ($base_commit === 'null') {
return null;
}
$base_message = $this->getCommitMessage($base_commit);
return $this->newCommitRef()
->setCommitHash($base_commit)
->attachMessage($base_message);
}
public function hasLocalCommit($commit) {
try {
$this->getCanonicalRevisionName($commit);