Fix var scope in HgDriver

main
Jerome Tamarelle 12 years ago
parent d200481037
commit 23ef8a419a

@ -31,13 +31,12 @@ class HgDriver extends VcsDriver
*/ */
public function initialize() public function initialize()
{ {
$this->tmpDir = $this->config->get('home') . '/cache.hg/' . preg_replace('{[^a-z0-9]}i', '-', $url) . '/'; $this->tmpDir = $this->config->get('home') . '/cache.hg/' . preg_replace('{[^a-z0-9]}i', '-', $this->url) . '/';
$url = escapeshellarg($this->url);
if (is_dir($this->tmpDir)) { if (is_dir($this->tmpDir)) {
$this->process->execute(sprintf('cd %s && hg pull -u', escapeshellarg($this->tmpDir)), $output); $this->process->execute(sprintf('cd %s && hg pull -u', escapeshellarg($this->tmpDir)), $output);
} else { } else {
$this->process->execute(sprintf('cd %s && hg clone %s %s', escapeshellarg(dirname($this->tmpDir)), $url, escapeshellarg($this->tmpDir)), $output); $this->process->execute(sprintf('cd %s && hg clone %s %s', escapeshellarg(dirname($this->tmpDir)), escapeshellarg($this->url), escapeshellarg($this->tmpDir)), $output);
} }
$this->getTags(); $this->getTags();

Loading…
Cancel
Save