From 83798d80908a413882c1d12b8b5ddaeb5eb4f0c3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 13 Apr 2017 23:13:11 +0200 Subject: [PATCH 1/4] Avoid mixing stderr and stdout in outdated command as it mangles output --- src/Composer/Command/ShowCommand.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 358b0f28f..bdc9f703c 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -445,11 +445,10 @@ EOT if (isset($package['path'])) { $io->write(' ' . $package['path'], false); } - if (isset($package['warning'])) { - $io->writeError(''); - $io->writeError('' . $package['warning'] . '', false); - } $io->write(''); + if (isset($package['warning'])) { + $io->write('' . $package['warning'] . ''); + } } if ($showAllTypes) { From 8b0e61523246b8b29bd88157bf892523a4a2068c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 13 Apr 2017 23:23:28 +0200 Subject: [PATCH 2/4] Assume at least 80char wide terminal, fixes #6351 --- src/Composer/Command/ShowCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index bdc9f703c..c27f084a3 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -256,6 +256,8 @@ EOT } if (Platform::isWindows()) { $width--; + } else { + $width = max(80, $width); } if ($input->getOption('path') && null === $composer) { From be38f7e65d9b073d8668b4e232a45ed405821fd5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 14 Apr 2017 00:08:27 +0200 Subject: [PATCH 3/4] Ignore headless mercurial branches in bitbucket API, fixes composer/packagist#778 --- src/Composer/Repository/Vcs/BitbucketDriver.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Repository/Vcs/BitbucketDriver.php b/src/Composer/Repository/Vcs/BitbucketDriver.php index 707e8189f..7fc137c44 100644 --- a/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -321,6 +321,11 @@ abstract class BitbucketDriver extends VcsDriver ); $hasNext = true; while ($hasNext) { + // skip headless branches which seem to be deleted branches that bitbucket nevertheless returns in the API + if ($this->vcsType === 'hg' && empty($data['heads'])) { + continue; + } + $branchData = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource); foreach ($branchData['values'] as $data) { $this->branches[$data['name']] = $data['target']['hash']; From 890baa2f89979d8f7eef435857ecc06b06bf00f2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 14 Apr 2017 00:16:18 +0200 Subject: [PATCH 4/4] Force remove command to have at least one package name passed, refs #6338 --- src/Composer/Command/RemoveCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/RemoveCommand.php b/src/Composer/Command/RemoveCommand.php index 24437207e..048baace0 100644 --- a/src/Composer/Command/RemoveCommand.php +++ b/src/Composer/Command/RemoveCommand.php @@ -35,7 +35,7 @@ class RemoveCommand extends BaseCommand ->setName('remove') ->setDescription('Removes a package from the require or require-dev.') ->setDefinition(array( - new InputArgument('packages', InputArgument::IS_ARRAY, 'Packages that should be removed.'), + new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'Packages that should be removed.'), new InputOption('dev', null, InputOption::VALUE_NONE, 'Removes a package from the require-dev section.'), new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'), new InputOption('no-update', null, InputOption::VALUE_NONE, 'Disables the automatic update of the dependencies.'),