summaryrefslogtreecommitdiff
path: root/buildscripts/phing/classes/phing/tasks/ext/git
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/phing/classes/phing/tasks/ext/git')
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitBaseTask.php134
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitBranchTask.php296
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitCheckoutTask.php256
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitCloneTask.php128
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitCommitTask.php179
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitFetchTask.php284
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitGcTask.php158
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitInitTask.php81
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitLogTask.php270
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitMergeTask.php258
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitPullTask.php373
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitPushTask.php255
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/git/GitTagTask.php406
13 files changed, 0 insertions, 3078 deletions
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitBaseTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitBaseTask.php
deleted file mode 100644
index 8381cc64..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitBaseTask.php
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-/*
- * $Id: 5ffc8c9c51dfa9bd0d691a88db670cdeb5f985c1 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/BuildException.php';
-
-/**
- * Base class for Git tasks
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 5ffc8c9c51dfa9bd0d691a88db670cdeb5f985c1 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-abstract class GitBaseTask extends Task
-{
- /**
- * Bath to git binary
- * @var string
- */
- private $gitPath = '/usr/bin/git';
-
- /**
- * @var VersionControl_Git
- */
- private $gitClient = null;
-
- /**
- * Current repository directory
- * @var string
- */
- private $repository;
-
- /**
- * Initialize Task.
- * Check and include necessary libraries.
- */
- public function init()
- {
- @include_once 'VersionControl/Git.php';
- if (false == class_exists('VersionControl_Git')) {
- throw new BuildException("The Git tasks depend on PEAR\'s "
- . "VersionControl_Git package.", $this->getLocation());
- }
- }
-
- /**
- * Set repository directory
- *
- * @param string $repository Repo directory
- * @return GitBaseTask
- */
- public function setRepository($repository)
- {
- $this->repository = $repository;
- return $this;
- }
-
- /**
- * Get repository directory
- *
- * @return string
- */
- public function getRepository()
- {
- return $this->repository;
- }
-
- /**
- * Set path to git executable
- *
- * @param string $gitPath New path to git repository
- * @return GitBaseTask
- */
- public function setGitPath($gitPath)
- {
- $this->gitPath = $gitPath;
- return $this;
- }
-
- /**
- * Get path to git executable
- *
- * @return string
- */
- public function getGitPath()
- {
- return $this->gitPath;
- }
-
- protected function getGitClient($reset = false, $repository = null)
- {
- $this->gitClient = ($reset === true) ? null : $this->gitClient;
- $repository = (null === $repository)
- ? $this->getRepository()
- : $repository;
-
- if(null === $this->gitClient) {
- try {
- $this->gitClient = new VersionControl_Git($repository);
- } catch (VersionControl_Git_Exception $e) {
- // re-package
- throw new BuildException(
- 'You must specify readable directory as repository.');
-
- }
- }
- $this->gitClient->setGitCommandPath($this->getGitPath());
-
- return $this->gitClient;
- }
-}
-
-
-
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitBranchTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitBranchTask.php
deleted file mode 100644
index 54a0eb20..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitBranchTask.php
+++ /dev/null
@@ -1,296 +0,0 @@
-<?php
-/*
- * $Id: 88a8737d783614bcd5acb103738fafc23c509225 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper aroung git-branch
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 88a8737d783614bcd5acb103738fafc23c509225 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitBranchTask extends GitBaseTask
-{
- /**
- * Branch name
- * @var string
- */
- private $branchname;
-
- /**
- * New Branch name for git-branch -m | -M
- * @var string
- */
- private $newbranch;
-
- /**
- * If not HEAD, specify starting point
- * @var string
- */
- private $startPoint;
-
- /**
- * --set-upstream key to git-branch
- * @var boolean
- */
- private $setUpstream = false;
-
- /**
- * --track key to git-branch
- * @var boolean
- */
- private $track = false;
-
- /**
- * --no-track key to git-branch
- * @var boolean
- */
- private $noTrack = false;
-
- /**
- * --force, -f key to git-branch
- * @var boolean
- */
- private $force = false;
-
- /**
- * -d, -D, -m, -M options to git-branch
- * Respective task options:
- * delete, forceDelete, move, forceMove
- * @var array
- */
- private $extraOptions = array(
- 'd' => false,
- 'D' => false,
- 'm' => false,
- 'M' => false,
- );
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
- if (null === $this->getBranchname()) {
- throw new BuildException('"branchname" is required parameter');
- }
-
- // if we are moving branch, we need to know new name
- if ($this->isMove() || $this->isForceMove()) {
- if (null === $this->getNewbranch()) {
- throw new BuildException('"newbranch" is required parameter');
- }
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('branch');
- $command
- ->setOption('set-upstream', $this->isSetUpstream())
- ->setOption('no-track', $this->isNoTrack())
- ->setOption('force', $this->isForce());
- if ($this->isNoTrack() == false) {
- $command->setOption('track', $this->getTrack());
- }
-
- // check extra options (delete, move)
- foreach ($this->extraOptions as $option => $flag) {
- if ($flag) {
- $command->setOption($option, true);
- }
- }
-
- $command->addArgument($this->getBranchname());
-
- if (null !== $this->getStartPoint()) {
- $command->addArgument($this->getStartPoint());
- }
-
- if (null !== $this->getNewbranch()) {
- $command->addArgument($this->getNewbranch());
- }
-
- $this->log('git-branch command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed.');
- }
-
- $this->log(
- sprintf('git-branch: branch "%s" repository', $this->getRepository()),
- Project::MSG_INFO);
- $this->log('git-branch output: ' . trim($output), Project::MSG_INFO);
- }
-
- public function setSetUpstream($flag)
- {
- $this->setUpstream = $flag;
- }
-
- public function getSetUpstream()
- {
- return $this->setUpstream;
- }
-
- public function isSetUpstream()
- {
- return $this->getSetUpstream();
- }
-
- public function setTrack($flag)
- {
- $this->track = $flag;
- }
-
- public function getTrack()
- {
- return $this->track;
- }
-
- public function isTrack()
- {
- return $this->getTrack();
- }
-
- public function setNoTrack($flag)
- {
- $this->noTrack = $flag;
- }
-
- public function getNoTrack()
- {
- return $this->noTrack;
- }
-
- public function isNoTrack()
- {
- return $this->getNoTrack();
- }
-
- public function setForce($flag)
- {
- $this->force = $flag;
- }
-
- public function getForce()
- {
- return $this->force;
- }
-
- public function isForce()
- {
- return $this->getForce();
- }
-
- public function setBranchname($branchname)
- {
- $this->branchname = $branchname;
- }
-
- public function getBranchname()
- {
- return $this->branchname;
- }
-
- public function setStartPoint($startPoint)
- {
- $this->startPoint = $startPoint;
- }
-
- public function getStartPoint()
- {
- return $this->startPoint;
- }
-
- public function setDelete($flag)
- {
- $this->extraOptions['d'] = $flag;
- }
-
- public function getDelete()
- {
- return $this->extraOptions['d'];
- }
-
- public function isDelete()
- {
- return $this->getDelete();
- }
-
- public function setForceDelete($flag)
- {
- $this->extraOptions['D'] = $flag;
- }
-
- public function getForceDelete()
- {
- return $this->extraOptions['D'];
- }
-
- public function setMove($flag)
- {
- $this->extraOptions['m'] = $flag;
- }
-
- public function getMove()
- {
- return $this->extraOptions['m'];
- }
-
- public function isMove()
- {
- return $this->getMove();
- }
-
- public function setForceMove($flag)
- {
- $this->extraOptions['M'] = $flag;
- }
-
- public function getForceMove()
- {
- return $this->extraOptions['M'];
- }
-
- public function isForceMove()
- {
- return $this->getForceMove();
- }
-
- public function setNewBranch($name)
- {
- $this->newbranch = $name;
- }
-
- public function getNewBranch()
- {
- return $this->newbranch;
- }
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitCheckoutTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitCheckoutTask.php
deleted file mode 100644
index 16a2bd9f..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitCheckoutTask.php
+++ /dev/null
@@ -1,256 +0,0 @@
-<?php
-/*
- * $Id: a1dcb809b44bfd34c3af154683dd2200c814e5f0 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-/**
- * Wrapper around git-checkout
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: a1dcb809b44bfd34c3af154683dd2200c814e5f0 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitCheckoutTask extends GitBaseTask
-{
- /**
- * Branch name
- * @var string
- */
- private $branchname;
-
- /**
- * If not HEAD, specify starting point
- * @var string
- */
- private $startPoint;
-
- /**
- * --force, -f key to git-checkout
- * @var boolean
- */
- private $force = false;
-
- /**
- * --quiet, -q key to git-checkout
- * @var boolean
- */
- private $quiet = false;
-
- /**
- * When creating a new branch, set up "upstream" configuration.
- * --track key to git-checkout
- * @var boolean
- */
- private $track = false;
-
- /**
- * Do not set up "upstream" configuration
- * --no-track key to git-checkout
- * @var boolean
- */
- private $noTrack = false;
-
- /**
- * -b, -B, -m options to git-checkout
- * Respective task options:
- * create, forceCreate, merge
- * @var array
- */
- private $extraOptions = array(
- 'b' => false,
- 'B' => false,
- 'm' => false,
- );
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
- if (null === $this->getBranchname()) {
- throw new BuildException('"branchname" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('checkout');
- $command
- ->setOption('no-track', $this->isNoTrack())
- ->setOption('q', $this->isQuiet())
- ->setOption('force', $this->isForce())
- ->setOption('b', $this->isCreate())
- ->setOption('B', $this->isForceCreate())
- ->setOption('m', $this->isMerge());
- if ($this->isNoTrack()) {
- $command->setOption('track', $this->isTrack());
- }
-
- $command->addArgument($this->getBranchname());
-
- if (null !== $this->getStartPoint()) {
- $command->addArgument($this->getStartPoint());
- }
-
- $this->log('git-checkout command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed.');
- }
-
- $this->log(
- sprintf('git-checkout: checkout "%s" repository', $this->getRepository()),
- Project::MSG_INFO);
- $this->log('git-checkout output: ' . trim($output), Project::MSG_INFO);
- }
-
- public function setBranchname($branchname)
- {
- $this->branchname = $branchname;
- }
-
- public function getBranchname()
- {
- return $this->branchname;
- }
-
- public function setStartPoint($startPoint)
- {
- $this->startPoint = $startPoint;
- }
-
- public function getStartPoint()
- {
- return $this->startPoint;
- }
-
- public function setForce($flag)
- {
- $this->force = $flag;
- }
-
- public function getForce()
- {
- return $this->force;
- }
-
- public function isForce()
- {
- return $this->getForce();
- }
-
- public function setQuiet($flag)
- {
- $this->quiet = $flag;
- }
-
- public function getQuiet()
- {
- return $this->quiet;
- }
-
- public function isQuiet()
- {
- return $this->getQuiet();
- }
-
- public function setTrack($flag)
- {
- $this->track = $flag;
- }
-
- public function getTrack()
- {
- return $this->track;
- }
-
- public function isTrack()
- {
- return $this->getTrack();
- }
-
- public function setNoTrack($flag)
- {
- $this->noTrack = $flag;
- }
-
- public function getNoTrack()
- {
- return $this->noTrack;
- }
-
- public function isNoTrack()
- {
- return $this->getNoTrack();
- }
-
- public function setCreate($flag)
- {
- $this->extraOptions['b'] = $flag;
- }
-
- public function getCreate()
- {
- return $this->extraOptions['b'];
- }
-
- public function isCreate()
- {
- return $this->getCreate();
- }
-
- // -B flag is not found in all versions of git
- // --force is present everywhere
- public function setForceCreate($flag)
- {
- $this->setForce($flag);
- }
-
- public function getForceCreate()
- {
- return $this->extraOptions['B'];
- }
-
- public function isForceCreate()
- {
- return $this->getForceCreate();
- }
-
- public function setMerge($flag)
- {
- $this->extraOptions['m'] = $flag;
- }
-
- public function getMerge()
- {
- return $this->extraOptions['m'];
- }
-
- public function isMerge()
- {
- return $this->getMerge();
- }
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitCloneTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitCloneTask.php
deleted file mode 100644
index 3d1eb76f..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitCloneTask.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-/*
- * $Id: 0d9ce448c11e505885b9c5362f5c2d399e205f90 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-/**
- * Wrapper around git-clone
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 0d9ce448c11e505885b9c5362f5c2d399e205f90 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitCloneTask extends GitBaseTask
-{
- /**
- * Whether --bare key should be set for git-init
- * @var string
- */
- private $isBare = false;
-
- /**
- * Path to target directory
- * @var string
- */
- private $targetPath;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- if (null === $this->getTargetPath()) {
- throw new BuildException('"targetPath" is required parameter');
- }
-
- $files = @scandir($this->getTargetPath());
- if (isset($files) && is_array($files) && (count($files) > 2)) {
- throw new BuildException(
- sprintf(
- '"%s" target directory is not empty',
- $this->getTargetPath())
- );
- }
-
- $client = $this->getGitClient(false, getcwd());
-
- try {
- $client->createClone(
- $this->getRepository(),
- $this->isBare(),
- $this->getTargetPath());
- } catch (Exception $e) {
- throw new BuildException('The remote end hung up unexpectedly');
- }
-
- $msg = 'git-clone: cloning '
- . ($this->isBare() ? '(bare) ' : '')
- . '"' . $this->getRepository() .'" repository'
- . ' to "' . $this->getTargetPath() .'" directory';
- $this->log($msg, Project::MSG_INFO);
- }
-
- /**
- * Get path to target direcotry repo
- *
- * @return string
- */
- public function getTargetPath()
- {
- return $this->targetPath;
- }
-
- /**
- * Set path to source repo
- *
- * @param string $targetPath Path to repository used as source
- * @return void
- */
- public function setTargetPath($targetPath)
- {
- $this->targetPath = $targetPath;
- }
-
- /**
- * Alias @see getBare()
- *
- * @return string
- */
- public function isBare()
- {
- return $this->getBare();
- }
-
- public function getBare()
- {
- return $this->isBare;
- }
-
- public function setBare($flag)
- {
- $this->isBare = (bool)$flag;
- }
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitCommitTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitCommitTask.php
deleted file mode 100644
index 71b26ab9..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitCommitTask.php
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-/*
- * $Id: 355a6d3cf8e182652b4acf3af0a6cd3eaa58fd02 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-/**
- * Wrapper around git-commit
- *
- * @package Phing.tasks.ext.git
- * @author Jonathan Creasy <jonathan.creasy@gmail.com>
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitCommitTask extends GitBaseTask
-{
- /**
- * Path to target directory
- * @var string
- */
- private $targetPath;
-
- private $allFiles;
-
- private $message;
-
- private $files;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- if (null === $this->getTargetPath()) {
- throw new BuildException('"targetPath" is required parameter');
- }
-
- if ($this->allFiles !== true && empty($this->files))
- {
- throw new BuildException('"allFiles" cannot be false if no files are specified.');
- }
-
- $client = $this->getGitClient(false, $this->getTargetPath());
-
- $options = Array();
-
- if ($this->allFiles === true)
- {
- $options['all'] = true;
- }
-
- $arguments = Array();
- if ($this->allFiles !== true && is_array($this->files))
- {
- foreach($files as $file)
- {
- $arguments[] = $file;
- }
- }
-
- if (!empty($this->message))
- {
- $arguments[] = $this->message;
- } else {
- $options['allow-empty-message'] = true;
- }
-
- try {
- $command = $git->Command('commit');
- $command->setArguments($arguments);
- $command->setOptions($options);
- $command->execute();
- } catch (Exception $e) {
- throw new BuildException('The remote end hung up unexpectedly');
- }
-
- $msg = 'git-commit: Executed git commit ';
- foreach ($options as $option=>$value)
- {
-
- $msg .= ' --' . $options . '=' . $value;
- }
-
- foreach ($arguments as $argument)
- {
- $msg .= ' ' . $argument;
- }
-
- $this->log($msg, Project::MSG_INFO);
- }
-
- /**
- * Get path to target direcotry repo
- *
- * @return string
- */
- public function getTargetPath()
- {
- return $this->targetPath;
- }
-
- /**
- * Set path to source repo
- *
- * @param string $targetPath Path to repository used as source
- * @return void
- */
- public function setTargetPath($targetPath)
- {
- $this->targetPath = $targetPath;
- }
-
- /**
- * Alias @see getAllFiles()
- *
- * @return string
- */
- public function isallFiles()
- {
- return $this->getallFiles();
- }
-
- public function getallFiles()
- {
- return $this->allFiles;
- }
-
- public function setallFiles($flag)
- {
- $this->allFiles = (bool)$flag;
- }
-
- public function getMessage()
- {
- return $this->message;
- }
-
- public function setMessage($message)
- {
- $this->message = $message;
- }
-
- public function getFiles()
- {
- return $this->files;
- }
-
- public function setFiles($files)
- {
- if (!$empty($files) && is_array($files))
- {
- $this->setallfiles(false);
- $this->Files = $files;
- } else {
- $this->Files = null;
- }
- }
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitFetchTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitFetchTask.php
deleted file mode 100644
index 4b3e8a3d..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitFetchTask.php
+++ /dev/null
@@ -1,284 +0,0 @@
-<?php
-/*
- * $Id: bcddbc1cd2e77003746b048568da8111b48da2fb $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper aroung git-fetch
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: bcddbc1cd2e77003746b048568da8111b48da2fb $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitFetchTask extends GitBaseTask
-{
- /**
- * --force, -f key to git-fetch
- * @var boolean
- */
- private $force = false;
-
- /**
- * --quiet, -q key to git-fetch
- * @var boolean
- */
- private $quiet = false;
-
- /**
- * Fetch all remotes
- * --all key to git-fetch
- * @var boolean
- */
- private $allRemotes = false;
-
- /**
- * Keep downloaded pack
- * --keep key to git-fetch
- * @var boolean
- */
- private $keepFiles = false;
-
- /**
- * After fetching, remove any remote tracking branches which no longer
- * exist on the remote.
- * --prune key to git fetch
- * @var boolean
- */
- private $prune = false;
-
- /**
- * Disable/enable automatic tag following
- * --no-tags key to git-fetch
- * @var boolean
- */
- private $noTags = false;
-
- /**
- * Fetch all tags (even not reachable from branch heads)
- * --tags key to git-fetch
- * @var boolean
- */
- private $tags = false;
-
- /**
- * <group> argument to git-fetch
- * @var string
- */
- private $group;
-
- /**
- * <repository> argument to git-fetch
- * @var string
- */
- private $source = 'origin';
-
- /**
- * <refspec> argument to git-fetch
- * @var string
- */
- private $refspec;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('fetch');
- $command
- ->setOption('tags', $this->isTags())
- ->setOption('no-tags', $this->isNoTags())
- ->setOption('prune', $this->isPrune())
- ->setOption('keep', $this->isKeepFiles())
- ->setOption('q', $this->isQuiet())
- ->setOption('force', $this->isForce());
-
- // set operation target
- if ($this->isAllRemotes()) { // --all
- $command->setOption('all', true);
- } elseif ($this->getGroup()) { // <group>
- $command->addArgument($this->getGroup());
- } elseif ($this->getSource()) { // <repository> [<refspec>]
- $command->addArgument($this->getSource());
- if ($this->getRefspec()) {
- $command->addArgument($this->getRefspec());
- }
- } else {
- throw new BuildException('No remote repository specified');
- }
-
- $this->log('git-fetch command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed.');
- }
-
- $this->log(
- sprintf('git-fetch: branch "%s" repository', $this->getRepository()),
- Project::MSG_INFO);
- $this->log('git-fetch output: ' . trim($output), Project::MSG_INFO);
- }
-
- public function setForce($flag)
- {
- $this->force = $flag;
- }
-
- public function getForce()
- {
- return $this->force;
- }
-
- public function isForce()
- {
- return $this->getForce();
- }
-
- public function setQuiet($flag)
- {
- $this->quiet = $flag;
- }
-
- public function getQuiet()
- {
- return $this->quiet;
- }
-
- public function isQuiet()
- {
- return $this->getQuiet();
- }
-
- public function setAll($flag)
- {
- $this->allRemotes = $flag;
- }
-
- public function getAll()
- {
- return $this->allRemotes;
- }
-
- public function isAllRemotes()
- {
- return $this->getAll();
- }
-
- public function setKeep($flag)
- {
- $this->keepFiles = $flag;
- }
-
- public function getKeep()
- {
- return $this->keepFiles;
- }
-
- public function isKeepFiles()
- {
- return $this->getKeep();
- }
-
- public function setPrune($flag)
- {
- $this->prune = $flag;
- }
-
- public function getPrune()
- {
- return $this->prune;
- }
-
- public function isPrune()
- {
- return $this->getPrune();
- }
-
- public function setNoTags($flag)
- {
- $this->noTags = $flag;
- }
-
- public function getNoTags()
- {
- return $this->noTags;
- }
-
- public function isNoTags()
- {
- return $this->getNoTags();
- }
-
- public function setTags($flag)
- {
- $this->tags = $flag;
- }
-
- public function getTags()
- {
- return $this->tags;
- }
-
- public function isTags()
- {
- return $this->getTags();
- }
-
- public function setSource($source)
- {
- $this->source = $source;
- }
-
- public function getSource()
- {
- return $this->source;
- }
-
- public function setRefspec($spec)
- {
- $this->refspec = $spec;
- }
-
- public function getRefspec()
- {
- return $this->refspec;
- }
-
- public function setGroup($group)
- {
- $this->group = $group;
- }
-
- public function getGroup()
- {
- return $this->group;
- }
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitGcTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitGcTask.php
deleted file mode 100644
index 12de4119..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitGcTask.php
+++ /dev/null
@@ -1,158 +0,0 @@
-<?php
-/*
- * $Id: 13487520850c3a7ad71d85f02afbddfd408bfbba $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-/**
- * Wrapper around git-gc
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 13487520850c3a7ad71d85f02afbddfd408bfbba $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitGcTask extends GitBaseTask
-{
- /**
- * --aggressive key to git-gc
- * @var boolean
- */
- private $isAggressive = false;
-
- /**
- * --auto key to git-gc
- * @var boolean
- */
- private $isAuto = false;
-
- /**
- * --no-prune key to git-gc
- * @var boolean
- */
- private $noPrune = false;
-
- /**
- * --prune=<date>option of git-gc
- * @var string
- */
- private $prune = '2.weeks.ago';
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('gc');
- $command
- ->setOption('aggressive', $this->isAggressive())
- ->setOption('auto', $this->isAuto())
- ->setOption('no-prune', $this->isNoPrune());
- if ($this->isNoPrune() == false) {
- $command->setOption('prune', $this->getPrune());
- }
-
- // suppress output
- $command->setOption('q');
-
- $this->log('git-gc command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed');
- }
-
- $this->log(
- sprintf('git-gc: cleaning up "%s" repository', $this->getRepository()),
- Project::MSG_INFO);
- }
-
- /**
- * @see getAggressive()
- */
- public function isAggressive()
- {
- return $this->getAggressive();
- }
-
- public function getAggressive()
- {
- return $this->isAggressive;
- }
-
- public function setAggressive($flag)
- {
- $this->isAggressive = (bool)$flag;
- }
-
- /**
- * @see getAuto()
- */
- public function isAuto()
- {
- return $this->getAuto();
- }
-
- public function getAuto()
- {
- return $this->isAuto;
- }
-
- public function setAuto($flag)
- {
- $this->isAuto = (bool)$flag;
- }
-
- /**
- * @see NoPrune()
- */
- public function isNoPrune()
- {
- return $this->getNoPrune();
- }
-
- public function getNoPrune()
- {
- return $this->noPrune;
- }
-
- public function setNoPrune($flag)
- {
- $this->noPrune = (bool)$flag;
- }
-
- public function getPrune()
- {
- return $this->prune;
- }
-
- public function setPrune($date)
- {
- $this->prune = $date;
- }
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitInitTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitInitTask.php
deleted file mode 100644
index b4654cae..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitInitTask.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-/*
- * $Id: 5e66bb51f299c733e4410258f40dcf61f6e96e2f $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/BuildException.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Repository initialization task
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 5e66bb51f299c733e4410258f40dcf61f6e96e2f $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitInitTask extends GitBaseTask
-{
-
- /**
- * Whether --bare key should be set for git-init
- * @var string
- */
- private $isBare = false;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient();
- $client->initRepository($this->isBare());
-
- $msg = 'git-init: initializing '
- . ($this->isBare() ? '(bare) ' : '')
- . '"' . $this->getRepository() .'" repository';
- $this->log($msg, Project::MSG_INFO);
- }
-
- /**
- * Alias @see getBare()
- *
- * @return string
- */
- public function isBare()
- {
- return $this->getBare();
- }
-
- public function getBare()
- {
- return $this->isBare;
- }
-
- public function setBare($flag)
- {
- $this->isBare = (bool)$flag;
- }
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitLogTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitLogTask.php
deleted file mode 100644
index c1d8058a..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitLogTask.php
+++ /dev/null
@@ -1,270 +0,0 @@
-<?php
-/*
- * $Id: 27b94c44aa26823164ce02628de06ff8b44717f7 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper aroung git-log
- *
- * @author Evan Kaufman <evan@digitalflophouse.com>
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 27b94c44aa26823164ce02628de06ff8b44717f7 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.5
- */
-class GitLogTask extends GitBaseTask
-{
- /**
- * Generate a diffstat. See --stat of git-log
- * @var string|boolean
- */
- private $stat = false;
-
- /**
- * Names + status of changed files. See --name-status of git-log
- * @var boolean
- */
- private $nameStatus = false;
-
- /**
- * Number of commits to show. See -<n>|-n|--max-count of git-log
- * @var integer
- */
- private $maxCount;
-
- /**
- * Don't show commits with more than one parent. See --no-merges of git-log
- * @var boolean
- */
- private $noMerges = false;
-
- /**
- * Commit format. See --format of git-log
- * @var string
- */
- private $format = 'medium';
-
- /**
- * Date format. See --date of git-log
- * @var string
- */
- private $date;
-
- /**
- * <since> argument to git-log
- * @var string
- */
- private $sinceCommit;
-
- /**
- * <until> argument to git-log
- * @var string
- */
- private $untilCommit = 'HEAD';
-
- /**
- * <path> arguments to git-log
- * Accepts one or more paths delimited by PATH_SEPARATOR
- * @var string
- */
- private $paths;
-
- /**
- * Property name to set with output value from git-log
- * @var string
- */
- private $outputProperty;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('log');
- $command
- ->setOption('stat', $this->getStat())
- ->setOption('name-status', $this->isNameStatus())
- ->setOption('no-merges', $this->isNoMerges())
- ->setOption('format', $this->getFormat());
-
- if (null !== $this->getMaxCount()) {
- $command->setOption('max-count', $this->getMaxCount());
- }
-
- if (null !== $this->getDate()) {
- $command->setOption('date', $this->getDate());
- }
-
- if (null !== $this->getSince()) {
- $command->setOption('since', $this->getSince());
- }
- $command->setOption('until', $this->getUntil());
-
- $command->addDoubleDash(true);
- if (null !== $this->getPaths()) {
- $command->addDoubleDash(false);
- $paths = explode(PATH_SEPARATOR, $this->getPaths());
- foreach ($paths as $path) {
- $command->addArgument($path);
- }
- }
-
- $this->log('git-log command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed');
- }
-
- if (null !== $this->outputProperty) {
- $this->project->setProperty($this->outputProperty, $output);
- }
-
- $this->log(
- sprintf('git-log: commit log for "%s" repository', $this->getRepository()),
- Project::MSG_INFO);
- $this->log('git-log output: ' . trim($output), Project::MSG_INFO);
- }
-
- public function setStat($stat)
- {
- $this->stat = $stat;
- }
-
- public function getStat()
- {
- return $this->stat;
- }
-
- public function setNameStatus($flag)
- {
- $this->nameStatus = (boolean)$flag;
- }
-
- public function getNameStatus()
- {
- return $this->nameStatus;
- }
-
- public function isNameStatus()
- {
- return $this->getNameStatus();
- }
-
- public function setMaxCount($count)
- {
- $this->maxCount = (int)$count;
- }
-
- public function getMaxCount()
- {
- return $this->maxCount;
- }
-
- public function setNoMerges($flag)
- {
- $this->noMerges = (bool)$flag;
- }
-
- public function getNoMerges()
- {
- return $this->noMerges;
- }
-
- public function isNoMerges()
- {
- return $this->getNoMerges();
- }
-
- public function setFormat($format)
- {
- $this->format = $format;
- }
-
- public function getFormat()
- {
- return $this->format;
- }
-
- public function setDate($date)
- {
- $this->date = $date;
- }
-
- public function getDate()
- {
- return $this->date;
- }
-
- public function setSince($since)
- {
- $this->sinceCommit = $since;
- }
-
- public function getSince()
- {
- return $this->sinceCommit;
- }
-
- public function setAfter($after)
- {
- $this->setSince($after);
- }
-
- public function setUntil($until)
- {
- $this->untilCommit = $until;
- }
-
- public function getUntil()
- {
- return $this->untilCommit;
- }
-
- public function setBefore($before)
- {
- $this->setUntil($before);
- }
-
- public function setPaths($paths)
- {
- $this->paths = $paths;
- }
-
- public function getPaths()
- {
- return $this->paths;
- }
-
- public function setOutputProperty($prop)
- {
- $this->outputProperty = $prop;
- }
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitMergeTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitMergeTask.php
deleted file mode 100644
index 7a3e17fb..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitMergeTask.php
+++ /dev/null
@@ -1,258 +0,0 @@
-<?php
-/*
- * $Id: 82fabd65e9247cb37fa3fe16c122d525db4fc697 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper aroung git-merge
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 82fabd65e9247cb37fa3fe16c122d525db4fc697 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- * @link http://www.kernel.org/pub/software/scm/git/docs/git-merge.html
- */
-class GitMergeTask extends GitBaseTask
-{
- /**
- * <commit> of git-merge
- * @var string
- */
- private $remote;
-
- /**
- * Commit message
- * @var string
- */
- private $message;
-
- /**
- * Merge strategy. See -s <strategy> of git-merge
- * Available strategies are: octopus ours recursive resolve subtree
- * @var string
- */
- private $strategy;
-
- /**
- * -X or --strategy-option of git-merge
- * @var string
- */
- private $strategyOption;
-
- /**
- * --commit key of git-merge
- * @var boolean
- */
- private $commit = false;
-
- /**
- * --no-commit key of git-merge
- * @var boolean
- */
- private $noCommit = false;
-
- /**
- * --ff --no-ff keys to git-merge
- * @var boolean
- */
- private $fastForwardCommit = false;
-
- /**
- * --quiet, -q key to git-merge
- * @var boolean
- */
- private $quiet = false;
-
- /**
- * Valid merge strategies
- * @var array
- */
- private $validStrategies = array(
- 'octopus', 'ours', 'recursive', 'resolve', 'subtree');
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
- $remotes = trim($this->getRemote());
- if (null === $remotes || '' === $remotes) {
- throw new BuildException('"remote" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('merge');
- $command
- ->setOption('commit', $this->isCommit())
- ->setOption('q', $this->isQuiet());
-
- if ($this->getMessage()) {
- $command->setOption('message', $this->getMessage());
- }
-
- if (!$this->isCommit()) {
- $command->setOption('no-commit', $this->isNoCommit());
- }
-
- if ($this->isFastForwardCommit()) {
- $command->setOption('no-ff', true);
- }
-
- $strategy = $this->getStrategy();
- if ($strategy) {
- // check if strategy is valid
- if (false === in_array($strategy, $this->validStrategies)) {
- throw new BuildException(
- "Could not find merge strategy '" . $strategy . "'\n".
- "Available strategies are: " . implode(', ', $this->validStrategies));
- }
- $command->setOption('strategy', $strategy);
- if ($this->getStrategyOption()) {
- $command->setOption(
- 'strategy-option', $this->getStrategyOption());
- }
- }
-
- $remotes = explode(' ', $this->getRemote());
- foreach ($remotes as $remote) {
- $command->addArgument($remote);
- }
-
- $this->log('git-merge command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed.');
- }
-
- $this->log(
- sprintf('git-merge: replaying "%s" commits', $this->getRemote()),
- Project::MSG_INFO);
- $this->log('git-merge output: ' . trim($output), Project::MSG_INFO);
-
- }
-
- public function setRemote($remote)
- {
- $this->remote = $remote;
- }
-
- public function getRemote()
- {
- return $this->remote;
- }
-
- public function setMessage($message)
- {
- $this->message = $message;
- }
-
- public function getMessage()
- {
- return $this->message;
- }
-
- public function setStrategy($strategy)
- {
- $this->strategy = $strategy;
- }
-
- public function getStrategy()
- {
- return $this->strategy;
- }
-
- public function setStrategyOption($strategyOption)
- {
- $this->strategyOption = $strategyOption;
- }
-
- public function getStrategyOption()
- {
- return $this->strategyOption;
- }
-
- public function setQuiet($flag)
- {
- $this->quiet = $flag;
- }
-
- public function getQuiet()
- {
- return $this->quiet;
- }
-
- public function isQuiet()
- {
- return $this->getQuiet();
- }
-
- public function setCommit($flag)
- {
- $this->commit = (boolean)$flag;
- }
-
- public function getCommit()
- {
- return $this->commit;
- }
-
- public function isCommit()
- {
- return $this->getCommit();
- }
-
- public function setNoCommit($flag)
- {
- $this->noCommit = (boolean)$flag;
- }
-
- public function getNoCommit()
- {
- return $this->noCommit;
- }
-
- public function isNoCommit()
- {
- return $this->getNoCommit();
- }
-
- public function setFastForwardCommit($flag)
- {
- $this->fastForwardCommit = $flag;
- }
-
- public function getFastForwardCommit()
- {
- return $this->fastForwardCommit;
- }
-
- public function isFastForwardCommit()
- {
- return $this->getFastForwardCommit();
- }
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitPullTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitPullTask.php
deleted file mode 100644
index 1f7cfcc1..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitPullTask.php
+++ /dev/null
@@ -1,373 +0,0 @@
-<?php
-/*
- * $Id: f96a4faad59ab1b29abccd59d04269fe0c409084 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper aroung git-pull
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: f96a4faad59ab1b29abccd59d04269fe0c409084 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- */
-class GitPullTask extends GitBaseTask
-{
- /**
- * <repository> argument to git-pull
- * @var string
- */
- private $source = 'origin';
-
- /**
- * <refspec> argument to git-pull
- * @var string
- */
- private $refspec;
-
- /**
- * --rebase key to git-pull
- * @var boolean
- */
- private $rebase = false;
-
- /**
- * --no-rebase key to git-pull
- * Allow to override --rebase (if set to default true in configuration)
- * @var boolean
- */
- private $noRebase = false;
-
- /**
- * Merge strategy. See -s <strategy> of git-pull
- * @var string
- */
- private $strategy;
-
- /**
- * -X or --strategy-option of git-pull
- * @var string
- */
- private $strategyOption;
-
- /**
- * Fetch all remotes
- * --all key to git-pull
- * @var boolean
- */
- private $allRemotes = false;
-
- /**
- * --append key to git-pull
- * @var boolean
- */
- private $append = false;
-
- /**
- * Keep downloaded pack
- * --keep key to git-pull
- * @var boolean
- */
- private $keepFiles = false;
-
- /**
- * Disable/enable automatic tag following
- * --no-tags key to git-pull
- * @var boolean
- */
- private $noTags = false;
-
- /**
- * Fetch all tags (even not reachable from branch heads)
- * --tags key to git-pull
- * @var boolean
- */
- private $tags = false;
-
- /**
- * --quiet, -q key to git-pull
- * @var boolean
- */
- private $quiet = true;
-
- /**
- * --force, -f key to git-pull
- * @var boolean
- */
- private $force = false;
-
- /**
- * Valid merge strategies
- * @var array
- */
- private $validStrategies = array(
- 'octopus', 'ours', 'recursive', 'resolve', 'subtree');
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('pull');
- $command
- ->setOption('rebase', $this->isRebase());
-
- if (!$this->isRebase()) {
- $command->setOption('no-rebase', $this->isNoRebase());
- }
-
- $strategy = $this->getStrategy();
- if ($strategy) {
- // check if strategy is valid
- if (false === in_array($strategy, $this->validStrategies)) {
- throw new BuildException(
- "Could not find merge strategy '" . $strategy . "'\n".
- "Available strategies are: " . implode(', ', $this->validStrategies));
- }
- $command->setOption('strategy', $strategy);
- if ($this->getStrategyOption()) {
- $command->setOption(
- 'strategy-option', $this->getStrategyOption());
- }
- }
-
- // order of arguments is important
- $command
- ->setOption('tags', $this->isTags())
- ->setOption('no-tags', $this->isNoTags())
- ->setOption('keep', $this->isKeepFiles())
- ->setOption('append', $this->isAppend())
- ->setOption('q', $this->isQuiet())
- ->setOption('force', $this->isForce());
-
- // set operation target
- if ($this->isAllRemotes()) { // --all
- $command->setOption('all', true);
- $this->log('git-pull: fetching from all remotes', Project::MSG_INFO);
- } elseif ($this->getSource()) { // <repository> [<refspec>]
- $command->addArgument($this->getSource());
- if ($this->getRefspec()) {
- $command->addArgument($this->getRefspec());
- }
- $this->log(
- sprintf('git-pull: pulling from %s %s',
- $this->getSource(), $this->getRefspec()),
- Project::MSG_INFO);
- } else {
- throw new BuildException('No source repository specified');
- }
-
- $this->log('git-pull command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed.');
- }
-
- $this->log('git-pull: complete', Project::MSG_INFO);
- $this->log('git-pull output: ' . trim($output), Project::MSG_INFO);
-
- }
-
- public function setStrategy($strategy)
- {
- $this->strategy = $strategy;
- }
-
- public function getStrategy()
- {
- return $this->strategy;
- }
-
- public function setStrategyOption($strategyOption)
- {
- $this->strategyOption = $strategyOption;
- }
-
- public function getStrategyOption()
- {
- return $this->strategyOption;
- }
-
- public function setSource($source)
- {
- $this->source = $source;
- }
-
- public function getSource()
- {
- return $this->source;
- }
-
- public function setRefspec($spec)
- {
- $this->refspec = $spec;
- }
-
- public function getRefspec()
- {
- return $this->refspec;
- }
-
- public function setAll($flag)
- {
- $this->allRemotes = $flag;
- }
-
- public function getAll()
- {
- return $this->allRemotes;
- }
-
- public function isAllRemotes()
- {
- return $this->getAll();
- }
-
- public function setAppend($flag)
- {
- $this->append = (boolean)$flag;
- }
-
- public function getAppend()
- {
- return $this->append;
- }
-
- public function isAppend()
- {
- return $this->getAppend();
- }
-
- public function setKeep($flag)
- {
- $this->keepFiles = $flag;
- }
-
- public function getKeep()
- {
- return $this->keepFiles;
- }
-
- public function isKeepFiles()
- {
- return $this->getKeep();
- }
-
- public function setNoTags($flag)
- {
- $this->noTags = $flag;
- }
-
- public function getNoTags()
- {
- return $this->noTags;
- }
-
- public function isNoTags()
- {
- return $this->getNoTags();
- }
-
- public function setTags($flag)
- {
- $this->tags = $flag;
- }
-
- public function getTags()
- {
- return $this->tags;
- }
-
- public function isTags()
- {
- return $this->getTags();
- }
-
- public function setQuiet($flag)
- {
- $this->quiet = $flag;
- }
-
- public function getQuiet()
- {
- return $this->quiet;
- }
-
- public function isQuiet()
- {
- return $this->getQuiet();
- }
-
- public function setRebase($flag)
- {
- $this->rebase = (boolean)$flag;
- }
-
- public function getRebase()
- {
- return $this->rebase;
- }
-
- public function isRebase()
- {
- return $this->getRebase();
- }
-
- public function setNoRebase($flag)
- {
- $this->noRebase = (boolean)$flag;
- }
-
- public function getNoRebase()
- {
- return $this->noRebase;
- }
-
- public function isNoRebase()
- {
- return $this->getNoRebase();
- }
-
- public function setForce($flag)
- {
- $this->force = $flag;
- }
-
- public function getForce()
- {
- return $this->force;
- }
-
- public function isForce()
- {
- return $this->getForce();
- }
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitPushTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitPushTask.php
deleted file mode 100644
index 996fa57f..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitPushTask.php
+++ /dev/null
@@ -1,255 +0,0 @@
-<?php
-/*
- * $Id: a01e7e9f6cc92e419e82b4e99e4a45de6a61eba8 $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper aroung git-push
- *
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: a01e7e9f6cc92e419e82b4e99e4a45de6a61eba8 $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.3
- * @link http://www.kernel.org/pub/software/scm/git/docs/git-push.html
- */
-class GitPushTask extends GitBaseTask
-{
- /**
- * Instead of naming each ref to push, specifies that all refs
- * --all key to git-push
- * @var boolean
- */
- private $allRemotes = false;
-
- /**
- * Mirror to remote repository
- * --mirror key to git-push
- * @var boolean
- */
- private $mirror = false;
-
- /**
- * Same as prefixing repos with colon
- * --delete argument to git-push
- * @var string
- */
- private $delete = false;
-
- /**
- * Push all refs under refs/tags
- * --tags key to git-fetch
- * @var boolean
- */
- private $tags = false;
-
- /**
- * <repository> argument to git-push
- * @var string
- */
- private $destination = 'origin';
-
- /**
- * <refspec> argument to git-push
- * @var string
- */
- private $refspec;
-
- /**
- * --force, -f key to git-push
- * @var boolean
- */
- private $force = false;
-
- /**
- * --quiet, -q key to git-push
- * @var boolean
- */
- private $quiet = true;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('push');
- $command
- ->setOption('tags', $this->isTags())
- ->setOption('mirror', $this->isMirror())
- ->setOption('delete', $this->isDelete())
- ->setOption('q', $this->isQuiet())
- ->setOption('force', $this->isForce());
-
- // set operation target
- if ($this->isAllRemotes()) { // --all
- $command->setOption('all', true);
- $this->log('git-push: push to all refs', Project::MSG_INFO);
- } elseif ($this->isMirror()) { // <repository> [<refspec>]
- $command->setOption('mirror', true);
- $this->log('git-push: mirror all refs', Project::MSG_INFO);
- } elseif ($this->getDestination()) { // <repository> [<refspec>]
- $command->addArgument($this->getDestination());
- if ($this->getRefspec()) {
- $command->addArgument($this->getRefspec());
- }
- $this->log(
- sprintf('git-push: pushing to %s %s',
- $this->getDestination(), $this->getRefspec()),
- Project::MSG_INFO);
- } else {
- throw new BuildException('At least one destination must be provided');
- }
-
- $this->log('git-push command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- throw new BuildException('Task execution failed.');
- }
-
- $this->log('git-push: complete', Project::MSG_INFO);
- if ($this->isDelete()) {
- $this->log('git-push: branch delete requested', Project::MSG_INFO);
- }
- $this->log('git-push output: ' . trim($output), Project::MSG_INFO);
- }
-
- public function setAll($flag)
- {
- $this->allRemotes = $flag;
- }
-
- public function getAll()
- {
- return $this->allRemotes;
- }
-
- public function isAllRemotes()
- {
- return $this->getAll();
- }
-
- public function setMirror($flag)
- {
- $this->mirror = (boolean)$flag;
- }
-
- public function getMirror()
- {
- return $this->mirror;
- }
-
- public function isMirror()
- {
- return $this->getMirror();
- }
-
- public function setDelete($flag)
- {
- $this->delete = (boolean)$flag;
- }
-
- public function getDelete()
- {
- return $this->delete;
- }
-
- public function isDelete()
- {
- return $this->getDelete();
- }
-
- public function setTags($flag)
- {
- $this->tags = $flag;
- }
-
- public function getTags()
- {
- return $this->tags;
- }
-
- public function isTags()
- {
- return $this->getTags();
- }
-
- public function setDestination($destination)
- {
- $this->destination = $destination;
- }
-
- public function getDestination()
- {
- return $this->destination;
- }
-
- public function setRefspec($spec)
- {
- $this->refspec = $spec;
- }
-
- public function getRefspec()
- {
- return $this->refspec;
- }
-
- public function setForce($flag)
- {
- $this->force = $flag;
- }
-
- public function getForce()
- {
- return $this->force;
- }
-
- public function isForce()
- {
- return $this->getForce();
- }
-
- public function setQuiet($flag)
- {
- $this->quiet = $flag;
- }
-
- public function getQuiet()
- {
- return $this->quiet;
- }
-
- public function isQuiet()
- {
- return $this->getQuiet();
- }
-
-
-
-
-}
diff --git a/buildscripts/phing/classes/phing/tasks/ext/git/GitTagTask.php b/buildscripts/phing/classes/phing/tasks/ext/git/GitTagTask.php
deleted file mode 100644
index 864e71ba..00000000
--- a/buildscripts/phing/classes/phing/tasks/ext/git/GitTagTask.php
+++ /dev/null
@@ -1,406 +0,0 @@
-<?php
-/*
- * $Id: 127d4af12e159083935466773d1af788e46acd4e $
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This software consists of voluntary contributions made by many individuals
- * and is licensed under the LGPL. For more information please see
- * <http://phing.info>.
- */
-
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/git/GitBaseTask.php';
-
-/**
- * Wrapper around git-tag
- *
- * @author Evan Kaufman <evan@digitalflophouse.com>
- * @author Victor Farazdagi <simple.square@gmail.com>
- * @version $Id: 127d4af12e159083935466773d1af788e46acd4e $
- * @package phing.tasks.ext.git
- * @see VersionControl_Git
- * @since 2.4.5
- */
-class GitTagTask extends GitBaseTask
-{
- /**
- * Make unsigned, annotated tag object. See -a of git-tag
- * @var boolean
- */
- private $annotate = false;
-
- /**
- * Make GPG-signed tag. See -s of git-tag
- * @var boolean
- */
- private $sign = false;
-
- /**
- * Make GPG-signed tag, using given key. See -u of git-tag
- * @var string
- */
- private $keySign;
-
- /**
- * Replace existing tag with given name. See -f of git-tag
- * @var boolean
- */
- private $replace = false;
-
- /**
- * Delete existing tags with given names. See -d of git-tag
- * @var boolean
- */
- private $delete = false;
-
- /**
- * Verify gpg signature of given tag names. See -v of git-tag
- * @var boolean
- */
- private $verify = false;
-
- /**
- * List tags with names matching given pattern. See -l of git-tag
- * @var boolean
- */
- private $list = false;
-
- /**
- * <num> specifies how many lines from the annotation, if any, are printed
- * when using -l. See -n of git-tag
- * @var int
- */
- private $num;
-
- /**
- * Only list tags containing specified commit. See --contains of git-tag
- * @var string
- */
- private $contains;
-
- /**
- * Use given tag message. See -m of git-tag
- * @var string
- */
- private $message;
-
- /**
- * Take tag message from given file. See -F of git-tag
- * @var string
- */
- private $file;
-
- /**
- * <tagname> argument to git-tag
- * @var string
- */
- private $name;
-
- /**
- * <commit> argument to git-tag
- * @var string
- */
- private $commit;
-
- /**
- * <object> argument to git-tag
- * @var string
- */
- private $object;
-
- /**
- * <pattern> argument to git-tag
- * @var string
- */
- private $pattern;
-
- /**
- * Property name to set with output value from git-tag
- * @var string
- */
- private $outputProperty;
-
- /**
- * The main entry point for the task
- */
- public function main()
- {
- if (null === $this->getRepository()) {
- throw new BuildException('"repository" is required parameter');
- }
-
- $client = $this->getGitClient(false, $this->getRepository());
- $command = $client->getCommand('tag');
- $command
- ->setOption('a', $this->isAnnotate())
- ->setOption('s', $this->isSign())
- ->setOption('f', $this->isReplace())
- ->setOption('d', $this->isDelete())
- ->setOption('v', $this->isVerify())
- ->setOption('l', $this->isList());
-
- if (null !== $this->getKeySign()) {
- $command->setOption('u', $this->getKeySign());
- }
-
- if (null !== $this->getMessage()) {
- $command->setOption('m', $this->getMessage());
- }
-
- if (null !== $this->getFile()) {
- $command->setOption('F', $this->getFile());
- }
-
- // Use 'name' arg, if relevant
- if (null != $this->getName() && false == $this->isList()) {
- $command->addArgument($this->getName());
- }
-
- if (null !== $this->getKeySign() || $this->isAnnotate() || $this->isSign()) {
- // Require a tag message or file
- if (null === $this->getMessage() && null === $this->getFile()) {
- throw new BuildException('"message" or "file" required to make a tag');
- }
- }
-
- // Use 'commit' or 'object' args, if relevant
- if (null !== $this->getCommit()) {
- $command->addArgument($this->getCommit());
- } else if (null !== $this->getObject()) {
- $command->addArgument($this->getObject());
- }
-
- // Customize list (-l) options
- if ($this->isList()) {
- if (null !== $this->getContains()) {
- $command->setOption('contains', $this->getContains());
- }
- if (null !== $this->getPattern()) {
- $command->addArgument($this->getPattern());
- }
- if (null != $this->getNum()) {
- $command->setOption('n', $this->getNum());
- }
- }
-
- $this->log('git-tag command: ' . $command->createCommandString(), Project::MSG_INFO);
-
- try {
- $output = $command->execute();
- } catch (Exception $e) {
- $this->log($e->getMessage(), Project::MSG_ERR);
- throw new BuildException('Task execution failed. ' . $e->getMessage());
- }
-
- if (null !== $this->outputProperty) {
- $this->project->setProperty($this->outputProperty, $output);
- }
-
- $this->log(
- sprintf('git-tag: tags for "%s" repository', $this->getRepository()),
- Project::MSG_INFO);
- $this->log('git-tag output: ' . trim($output), Project::MSG_INFO);
- }
-
- public function setAnnotate($flag)
- {
- $this->annotate = (bool)$flag;
- }
-
- public function getAnnotate()
- {
- return $this->annotate;
- }
-
- public function isAnnotate()
- {
- return $this->getAnnotate();
- }
-
- public function setSign($flag)
- {
- $this->sign = (bool)$flag;
- }
-
- public function getSign()
- {
- return $this->sign;
- }
-
- public function isSign()
- {
- return $this->getSign();
- }
-
- public function setKeySign($keyId)
- {
- $this->keySign = $keyId;
- }
-
- public function getKeySign()
- {
- return $this->keySign;
- }
-
- public function setReplace($flag)
- {
- $this->replace = (bool)$flag;
- }
-
- public function getReplace()
- {
- return $this->replace;
- }
-
- public function isReplace()
- {
- return $this->getReplace();
- }
-
- public function setForce($flag)
- {
- return $this->setReplace($flag);
- }
-
- public function setDelete($flag)
- {
- $this->delete = (bool)$flag;
- }
-
- public function getDelete()
- {
- return $this->delete;
- }
-
- public function isDelete()
- {
- return $this->getDelete();
- }
-
- public function setVerify($flag)
- {
- $this->verify = (bool)$flag;
- }
-
- public function getVerify()
- {
- return $this->verify;
- }
-
- public function isVerify()
- {
- return $this->getVerify();
- }
-
- public function setList($flag)
- {
- $this->list = (bool)$flag;
- }
-
- public function getList()
- {
- return $this->list;
- }
-
- public function isList()
- {
- return $this->getList();
- }
-
- public function setNum($num)
- {
- $this->num = (int)$num;
- }
-
- public function getNum()
- {
- return $this->num;
- }
-
- public function setContains($commit)
- {
- $this->contains = $commit;
- }
-
- public function getContains()
- {
- return $this->contains;
- }
-
- public function setMessage($msg)
- {
- $this->message = $msg;
- }
-
- public function getMessage()
- {
- return $this->message;
- }
-
- public function setFile($file)
- {
- $this->file = $file;
- }
-
- public function getFile()
- {
- return $this->file;
- }
-
- public function setName($name)
- {
- $this->name = $name;
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- public function setCommit($commit)
- {
- $this->commit = $commit;
- }
-
- public function getCommit()
- {
- return $this->commit;
- }
-
- public function setObject($object)
- {
- $this->object = $object;
- }
-
- public function getObject()
- {
- return $this->object;
- }
-
- public function setPattern($pattern)
- {
- $this->pattern = $pattern;
- }
-
- public function getPattern()
- {
- return $this->pattern;
- }
-
- public function setOutputProperty($prop)
- {
- $this->outputProperty = $prop;
- }
-}
-