Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/request/DiffusionMercurialRequest.php
13401 views
1
<?php
2
3
final class DiffusionMercurialRequest extends DiffusionRequest {
4
5
protected function isStableCommit($symbol) {
6
return $symbol !== null && preg_match('/^[a-f0-9]{40}\z/', $symbol);
7
}
8
9
public function getBranch() {
10
if ($this->branch) {
11
return $this->branch;
12
}
13
14
if ($this->repository) {
15
return $this->repository->getDefaultBranch();
16
}
17
18
throw new Exception(pht('Unable to determine branch!'));
19
}
20
21
}
22
23