1
0
Fork 0

Added support for hg bookmarks

pull/1174/head
Zsolt Szeberenyi 2012-10-02 13:41:03 +02:00
parent b474a9fa86
commit 5201564c0f
1 changed files with 10 additions and 1 deletions

View File

@ -162,6 +162,7 @@ class HgDriver extends VcsDriver
{
if (null === $this->branches) {
$branches = array();
$bookmarks = array();
$this->process->execute('hg branches', $output, $this->repoDir);
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;