<commit_before><?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 <NAME> <<EMAIL>>
 * @link      https://github.com/console-helpers/svn-buddy
 */

namespace ConsoleHelpers\SVNBuddy\Command;


use ConsoleHelpers\SVNBuddy\Config\AbstractConfigSetting;
use ConsoleHelpers\SVNBuddy\Config\IntegerConfigSetting;
use ConsoleHelpers\SVNBuddy\Config\RegExpsConfigSetting;
use ConsoleHelpers\ConsoleKit\Exception\CommandException;
use ConsoleHelpers\SVNBuddy\Repository\Parser\RevisionListParser;
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RevisionLog;
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RevisionPrinter;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
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 LogCommand extends AbstractCommand implements IAggregatorAwareCommand, IConfigAwareCommand
{

	const SETTING_LOG_LIMIT = 'log.limit';

	const SETTING_LOG_MESSAGE_LIMIT = 'log.message-limit';

	const SETTING_LOG_MERGE_CONFLICT_REGEXPS = 'log.merge-conflict-regexps';

	/**
	 * Revision list parser.
	 *
	 * @var RevisionListParser
	 */
	private $_revisionListParser;

	/**
	 * Revision log
	 *
	 * @var RevisionLog
	 */
	private $_revisionLog;

	/**
	 * Revision printer.
	 *
	 * @var RevisionPrinter
	 */
	private $_revisionPrinter;

	/**
	 * Prepare dependencies.
	 *
	 * @return void
	 */
	protected function prepareDependencies()
	{
		parent::prepareDependencies();

		$container = $this->getContainer();

		$this->_revisionListParser = $container['revision_list_parser'];
		$this->_revisionPrinter = $container['revision_printer'];
	}

	/**
	 * {@inheritdoc}
	 */
	protected function configure()
	{
		$this->pathAcceptsUrl = true;

		$this
			->setName('log')
			->setDescription(
				'Show the log messages for a set of revisions, bugs, paths, refs, etc.'
			)
			->addArgument(
				'path',
				InputArgument::OPTIONAL,
				'Working copy path or URL',
				'.'
			)
			->addOption(
				'revisions',
				'r',
				InputOption::VALUE_REQUIRED,
				'List of revision(-s) and/or revision range(-s), e.g. <comment>53324</comment>, <comment>1224-4433</comment>'
			)
			->addOption(
				'bugs',
				'b',
				InputOption::VALUE_REQUIRED,
				'List of bug(-s), e.g. <comment>JRA-1234</comment>, <comment>43644</comment>'
			)
			->addOption(
				'refs',
				null,
				InputOption::VALUE_REQUIRED,
				'List of refs, e.g. <comment>trunk</comment>, <comment>branches/branch-name</comment>, <comment>tags/tag-name</comment>'
			)
			->addOption(
				'merges',
				null,
				InputOption::VALUE_NONE,
				'Show merge revisions only'
			)
			->addOption(
				'no-merges',
				null,
				InputOption::VALUE_NONE,
				'Hide merge revisions'
			)
			->addOption(
				'merged',
				null,
				InputOption::VALUE_NONE,
				'Shows only revisions, that were merged at least once'
			)
			->addOption(
				'not-merged',
				null,
				InputOption::VALUE_NONE,
				'Shows only revisions, that were not merged'
			)
			->addOption(
				'merged-by',
				null,
				InputOption::VALUE_REQUIRED,
				'Show revisions merged by list of revision(-s) and/or revision range(-s)'
			)
			->addOption(
				'action',
				null,
				InputOption::VALUE_REQUIRED,
				'Show revisions, whose paths were affected by specified action, e.g. <info>A</info>, <info>M</info>, <info>R</info>, <info>D</info>'
			)
			->addOption(
				'kind',
				null,
				InputOption::VALUE_REQUIRED,
				'Show revisions, whose paths match specified kind, e.g. <info>dir</info> or <info>file</info>'
			)
			->addOption(
				'with-details',
				'd',
				InputOption::VALUE_NONE,
				'Shows detailed revision information, e.g. paths affected'
			)
			->addOption(
				'with-summary',<commit_msg>Wrong example color was used in "log" command argument description<commit_after><?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 <NAME> <<EMAIL>>
 * @link      https://github.com/console-helpers/svn-buddy
 */

namespace ConsoleHelpers\SVNBuddy\Command;


use ConsoleHelpers\SVNBuddy\Config\AbstractConfigSetting;
use ConsoleHelpers\SVNBuddy\Config\IntegerConfigSetting;
use ConsoleHelpers\SVNBuddy\Config\RegExpsConfigSetting;
use ConsoleHelpers\ConsoleKit\Exception\CommandException;
use ConsoleHelpers\SVNBuddy\Repository\Parser\RevisionListParser;
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RevisionLog;
use ConsoleHelpers\SVNBuddy\Repository\RevisionLog\RevisionPrinter;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
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 LogCommand extends AbstractCommand implements IAggregatorAwareCommand, IConfigAwareCommand
{

	const SETTING_LOG_LIMIT = 'log.limit';

	const SETTING_LOG_MESSAGE_LIMIT = 'log.message-limit';

	const SETTING_LOG_MERGE_CONFLICT_REGEXPS = 'log.merge-conflict-regexps';

	/**
	 * Revision list parser.
	 *
	 * @var RevisionListParser
	 */
	private $_revisionListParser;

	/**
	 * Revision log
	 *
	 * @var RevisionLog
	 */
	private $_revisionLog;

	/**
	 * Revision printer.
	 *
	 * @var RevisionPrinter
	 */
	private $_revisionPrinter;

	/**
	 * Prepare dependencies.
	 *
	 * @return void
	 */
	protected function prepareDependencies()
	{
		parent::prepareDependencies();

		$container = $this->getContainer();

		$this->_revisionListParser = $container['revision_list_parser'];
		$this->_revisionPrinter = $container['revision_printer'];
	}

	/**
	 * {@inheritdoc}
	 */
	protected function configure()
	{
		$this->pathAcceptsUrl = true;

		$this
			->setName('log')
			->setDescription(
				'Show the log messages for a set of revisions, bugs, paths, refs, etc.'
			)
			->addArgument(
				'path',
				InputArgument::OPTIONAL,
				'Working copy path or URL',
				'.'
			)
			->addOption(
				'revisions',
				'r',
				InputOption::VALUE_REQUIRED,
				'List of revision(-s) and/or revision range(-s), e.g. <comment>53324</comment>, <comment>1224-4433</comment>'
			)
			->addOption(
				'bugs',
				'b',
				InputOption::VALUE_REQUIRED,
				'List of bug(-s), e.g. <comment>JRA-1234</comment>, <comment>43644</comment>'
			)
			->addOption(
				'refs',
				null,
				InputOption::VALUE_REQUIRED,
				'List of refs, e.g. <comment>trunk</comment>, <comment>branches/branch-name</comment>, <comment>tags/tag-name</comment>'
			)
			->addOption(
				'merges',
				null,
				InputOption::VALUE_NONE,
				'Show merge revisions only'
			)
			->addOption(
				'no-merges',
				null,
				InputOption::VALUE_NONE,
				'Hide merge revisions'
			)
			->addOption(
				'merged',
				null,
				InputOption::VALUE_NONE,
				'Shows only revisions, that were merged at least once'
			)
			->addOption(
				'not-merged',
				null,
				InputOption::VALUE_NONE,
				'Shows only revisions, that were not merged'
			)
			->addOption(
				'merged-by',
				null,
				InputOption::VALUE_REQUIRED,
				'Show revisions merged by list of revision(-s) and/or revision range(-s)'
			)
			->addOption(
				'action',
				null,
				InputOption::VALUE_REQUIRED,
				'Show revisions, whose paths were affected by specified action, e.g. <comment>A</comment>, <comment>M</comment>, <comment>R</comment>, <comment>D</comment>'
			)
			->addOption(
				'kind',
				null,
				InputOption::VALUE_REQUIRED,
				'Show revisions, whose paths match specified kind, e.g. <comment>dir</comment> or <comment>file</comment>'
			)
			->addOption(
				'with-details',
				'd',
				InputOption::VALUE_NONE,
				'Shows detailed revision information, e.g. paths affected'
			)
			->addOption(
				'with-summary',
{'fraction_non_alphanumeric': 0.1307854572527609, 'fraction_numerical': 0.005459734458369525, 'mean_word_length': 3.7523584905660377, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 99, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3611553', 'n_tokens_mistral': 3137, 'n_tokens_neox': 2590, 'n_words': 550}