-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from aik099/revision-reparsing-feat
Added the "reparse" command for specific revision data reparsing
- Loading branch information
Showing
18 changed files
with
707 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
/** | ||
* This file is part of the SVN-Buddy library. | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @copyright Alexander Obuhovich <[email protected]> | ||
* @link https://github.com/console-helpers/svn-buddy | ||
*/ | ||
|
||
namespace ConsoleHelpers\SVNBuddy\Command; | ||
|
||
|
||
use ConsoleHelpers\ConsoleKit\Exception\CommandException; | ||
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RevisionLog; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class ReparseCommand extends AbstractCommand | ||
{ | ||
|
||
/** | ||
* Revision log | ||
* | ||
* @var RevisionLog | ||
*/ | ||
private $_revisionLog; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('reparse') | ||
->setDescription('Reparses given revision') | ||
->addArgument( | ||
'path', | ||
InputArgument::OPTIONAL, | ||
'Working copy path', | ||
'.' | ||
) | ||
->addOption( | ||
'revision', | ||
'r', | ||
InputOption::VALUE_REQUIRED, | ||
'Reparse specified revision' | ||
); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function initialize(InputInterface $input, OutputInterface $output) | ||
{ | ||
parent::initialize($input, $output); | ||
|
||
$this->_revisionLog = $this->getRevisionLog($this->getWorkingCopyUrl()); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* @throws CommandException When mandatory "revision" option wasn't given. | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$revision = $this->io->getOption('revision'); | ||
|
||
if ( !$revision ) { | ||
throw new CommandException('The "revision" option is mandatory.'); | ||
} | ||
|
||
$this->_revisionLog->reparse($revision); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/SVNBuddy/Repository/RevisionLog/Plugin/IOverwriteAwarePlugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* This file is part of the SVN-Buddy library. | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @copyright Alexander Obuhovich <[email protected]> | ||
* @link https://github.com/console-helpers/svn-buddy | ||
*/ | ||
|
||
namespace ConsoleHelpers\SVNBuddy\Repository\RevisionLog\Plugin; | ||
|
||
|
||
interface IOverwriteAwarePlugin | ||
{ | ||
|
||
/** | ||
* Sets overwrite mode. | ||
* | ||
* @param boolean $overwrite_mode Overwrite mode. | ||
* | ||
* @return void | ||
*/ | ||
public function setOverwriteMode($overwrite_mode); | ||
|
||
/** | ||
* Determines if overwrite mode is enabled. | ||
* | ||
* @return boolean | ||
*/ | ||
public function isOverwriteMode(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.