/** * Finishes the current git flow hotfix without tagging. * * @return Version * @throws Exception */ public function finishHotfix() { $detector = new GitFlowBranch($this, GitFlowBranch::HOTFIX); $version = $detector->getCurrentVersion(); $command = 'flow hotfix finish -m "' . $version . '" ' . $version . ' 1>/dev/null 2>&1'; $this->executeGitCommand($command); return $version; }
protected function execute(InputInterface $input, OutputInterface $output) { $detector = new GitFlowBranch($this->getContext()->getVCS(), GitFlowBranch::HOTFIX); if ($detector->isInTheFlow()) { throw new Exception("Detected a git flow branch. Finish it first."); } // Generate and save the new version number $generator = new SemanticGenerator(); $newVersion = $generator->generateNextVersion($this->getContext()->getParam('current-version'), Version::TYPE_PATCH); $this->getContext()->setNewVersion($newVersion); $action = new GitFlowStartHotfixAction(); $action->setContext($this->getContext()); $action->execute(); }
protected function execute(InputInterface $input, OutputInterface $output) { $detector = new GitFlowBranch($this->getContext()->getVCS(), GitFlowBranch::RELEASE); if ($detector->isInTheFlow()) { throw new Exception("Detected a git flow branch. Finish it first."); } // Generate and save the new version number $increment = $this->getContext()->getInformationCollector()->getValueFor('type'); $generator = new \Liip\RMT\Version\Generator\SemanticGenerator(); $newVersion = $generator->generateNextVersion($this->getContext()->getParam('current-version'), $increment); $this->getContext()->setNewVersion($newVersion); $action = new GitFlowStartReleaseAction(); $action->setContext($this->getContext()); $action->execute(); }
protected function execute(InputInterface $input, OutputInterface $output) { $detector = new GitFlowBranch($this->getContext()->getVCS()); $newVersion = $detector->getCurrentVersion(); $this->getContext()->setNewVersion($newVersion); $currentVersion = $this->getContext()->getVersionDetector()->getCurrentVersion(); $type = $currentVersion->getDifferenceType($newVersion); if ($type === null) { throw new Exception('Could not detect a version difference.', 404); } $this->getContext()->setParameter('type', $type); //in case the type information is needed... $this->getContext()->getInformationCollector()->registerStandardRequest('type'); $this->getContext()->getInformationCollector()->setValueFor('type', $type); //push a git flow finish action to the post release list $action = new GitFlowFinishAction($detector->getBranchType()); $action->setContext($this->getContext()); $this->getContext()->getList(Context::POSTRELEASE_LIST)->push($action); parent::execute($input, $output); }
public function testIsNotInTheFlow() { system("git flow init -fd 1>/dev/null 2>&1"); $this->assertFalse($this->detector->isInTheFlow()); }