Liip\RMT\VCS\Hg::executeHgCommand PHP Method

executeHgCommand() protected method

protected executeHgCommand ( $cmd )
    protected function executeHgCommand($cmd)
    {
        if ($this->dryRun) {
            $binary = 'hg --dry-run ';
        } else {
            $binary = 'hg ';
        }
        // Execute
        $cmd = $binary . $cmd;
        exec($cmd, $result, $exitCode);
        if ($exitCode !== 0) {
            throw new \Liip\RMT\Exception('Error while executing hg command: ' . $cmd);
        }
        return $result;
    }