commit
b947420cae
|
@ -38,7 +38,7 @@ class HgDownloader implements DownloaderInterface
|
||||||
|
|
||||||
$url = escapeshellarg($package->getSourceUrl());
|
$url = escapeshellarg($package->getSourceUrl());
|
||||||
$ref = escapeshellarg($package->getSourceReference());
|
$ref = escapeshellarg($package->getSourceReference());
|
||||||
system(sprintf('hg clone %s %s && cd %2$s && hg up %s', $url, $path, $ref));
|
system(sprintf('(hg clone %s %s 2> /dev/null) && cd %2$s && hg up %s', $url, $path, $ref));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,7 +34,7 @@ class VersionParser
|
||||||
{
|
{
|
||||||
$version = trim($version);
|
$version = trim($version);
|
||||||
|
|
||||||
if (preg_match('{^(?:master|trunk)(?:[.-]?dev)?$}i', $version)) {
|
if (preg_match('{^(?:master|trunk|default)(?:[.-]?dev)?$}i', $version)) {
|
||||||
return '9999999-dev';
|
return '9999999-dev';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class VersionParser
|
||||||
{
|
{
|
||||||
$name = trim($name);
|
$name = trim($name);
|
||||||
|
|
||||||
if (in_array($name, array('master', 'trunk'))) {
|
if (in_array($name, array('master', 'trunk', 'default'))) {
|
||||||
return $this->normalize($name);
|
return $this->normalize($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,6 @@ class HgBitbucketDriver implements VcsDriverInterface
|
||||||
foreach ($tagsData as $tag => $data) {
|
foreach ($tagsData as $tag => $data) {
|
||||||
$this->tags[$tag] = $data['raw_node'];
|
$this->tags[$tag] = $data['raw_node'];
|
||||||
}
|
}
|
||||||
unset($this->tags['tip']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->tags;
|
return $this->tags;
|
||||||
|
|
|
@ -41,7 +41,7 @@ class HgDriver implements VcsDriverInterface
|
||||||
if (is_dir($this->tmpDir)) {
|
if (is_dir($this->tmpDir)) {
|
||||||
exec(sprintf('cd %s && hg pull -u', $tmpDir), $output);
|
exec(sprintf('cd %s && hg pull -u', $tmpDir), $output);
|
||||||
} else {
|
} else {
|
||||||
exec(sprintf('hg clone %s %s', $url, $tmpDir), $output);
|
exec(sprintf('cd %s && hg clone %s %s', escapeshellarg(sys_get_temp_dir()), $url, $tmpDir), $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->getTags();
|
$this->getTags();
|
||||||
|
@ -55,7 +55,7 @@ class HgDriver implements VcsDriverInterface
|
||||||
{
|
{
|
||||||
$tmpDir = escapeshellarg($this->tmpDir);
|
$tmpDir = escapeshellarg($this->tmpDir);
|
||||||
if (null === $this->rootIdentifier) {
|
if (null === $this->rootIdentifier) {
|
||||||
exec(sprintf('cd %s && hg tip --template "{rev}:{node|short}" --color never', $tmpDir), $output);
|
exec(sprintf('cd %s && hg tip --template "{node}"', $tmpDir), $output);
|
||||||
$this->rootIdentifier = $output[0];
|
$this->rootIdentifier = $output[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class HgDriver implements VcsDriverInterface
|
||||||
public function getComposerInformation($identifier)
|
public function getComposerInformation($identifier)
|
||||||
{
|
{
|
||||||
if (!isset($this->infoCache[$identifier])) {
|
if (!isset($this->infoCache[$identifier])) {
|
||||||
exec(sprintf('cd %s && hg cat --color never -r %s composer.json', escapeshellarg($this->tmpDir), escapeshellarg($identifier)), $output);
|
exec(sprintf('cd %s && hg cat -r %s composer.json', escapeshellarg($this->tmpDir), escapeshellarg($identifier)), $output);
|
||||||
$composer = implode("\n", $output);
|
$composer = implode("\n", $output);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
|
||||||
|
@ -121,12 +121,14 @@ class HgDriver implements VcsDriverInterface
|
||||||
public function getTags()
|
public function getTags()
|
||||||
{
|
{
|
||||||
if (null === $this->tags) {
|
if (null === $this->tags) {
|
||||||
exec(sprintf('cd %s && hg tags --color never', escapeshellarg($this->tmpDir)), $output);
|
$tags = array();
|
||||||
|
|
||||||
|
exec(sprintf('cd %s && hg tags', escapeshellarg($this->tmpDir)), $output);
|
||||||
foreach ($output as $tag) {
|
foreach ($output as $tag) {
|
||||||
preg_match('(^([^\s]+)[\s]+[\d+]:(.*)$)', $tag, $match);
|
if (preg_match('(^([^\s]+)\s+\d+:(.*)$)', $tag, $match))
|
||||||
$tags[$match[1]] = $match[2];
|
$tags[$match[1]] = $match[2];
|
||||||
}
|
}
|
||||||
unset($tags['tip']);
|
|
||||||
$this->tags = $tags;
|
$this->tags = $tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,10 +143,10 @@ class HgDriver implements VcsDriverInterface
|
||||||
if (null === $this->branches) {
|
if (null === $this->branches) {
|
||||||
$branches = array();
|
$branches = array();
|
||||||
|
|
||||||
exec(sprintf('cd %s && hg branches --color never', escapeshellarg($this->tmpDir)), $output);
|
exec(sprintf('cd %s && hg branches', escapeshellarg($this->tmpDir)), $output);
|
||||||
foreach ($output as $branch) {
|
foreach ($output as $branch) {
|
||||||
preg_match('(^([^\s]+)[\s]+[\d+]:(.*)$)', $branch, $match);
|
if (preg_match('(^([^\s]+)\s+\d+:(.*)$)', $branch, $match))
|
||||||
$branches[$match[1]] = $match[2];
|
$branches[$match[1]] = $match[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->branches = $branches;
|
$this->branches = $branches;
|
||||||
|
@ -180,7 +182,7 @@ class HgDriver implements VcsDriverInterface
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
exec(sprintf('hg identify %s', escapeshellarg($url)), $ignored, $exit);
|
exec(sprintf('cd %s && hg identify %s', escapeshellarg(sys_get_temp_dir()), escapeshellarg($url)), $ignored, $exit);
|
||||||
return $exit === 0;
|
return $exit === 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ interface VcsDriverInterface
|
||||||
function getComposerInformation($identifier);
|
function getComposerInformation($identifier);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the root identifier (trunk, master, ..)
|
* Return the root identifier (trunk, master, default/tip ..)
|
||||||
*
|
*
|
||||||
* @return string Identifier
|
* @return string Identifier
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue