1
0
Fork 0

Merge pull request #1174 from szeber/master

Mercurial bookmarks support
pull/1176/head
Jordi Boggiano 2012-10-02 06:06:24 -07:00
commit a5eaba805c
1 changed files with 10 additions and 1 deletions

View File

@ -162,6 +162,7 @@ class HgDriver extends VcsDriver
{ {
if (null === $this->branches) { if (null === $this->branches) {
$branches = array(); $branches = array();
$bookmarks = array();
$this->process->execute('hg branches', $output, $this->repoDir); $this->process->execute('hg branches', $output, $this->repoDir);
foreach ($this->process->splitLines($output) as $branch) { foreach ($this->process->splitLines($output) as $branch) {
@ -170,7 +171,15 @@ class HgDriver extends VcsDriver
} }
} }
$this->branches = $branches; $this->process->execute('hg bookmarks', $output, $this->repoDir);
foreach ($this->process->splitLines($output) as $branch) {
if ($branch && preg_match('(^(?:[\s*]*)([^\s]+)\s+\d+:(.*)$)', $branch, $match)) {
$bookmarks[$match[1]] = $match[2];
}
}
// Branches will have preference over bookmarks
$this->branches = array_merge($bookmarks, $branches);
} }
return $this->branches; return $this->branches;