1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Use new "%R" escape for csprintf() to produce slightly nicer clone/checkout commands

Summary: Fixes T4175. In cases where the arguments have only always-safe characters, we can produce a more human-readable URI.

Test Plan: Looked at some repositories.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T4175

Differential Revision: https://secure.phabricator.com/D8100
This commit is contained in:
epriestley 2014-01-30 11:42:33 -08:00
parent c41b4cfac0
commit 3bfa54819e

View file

@ -551,17 +551,17 @@ final class DiffusionRepositoryController extends DiffusionController {
switch ($repository->getVersionControlSystem()) { switch ($repository->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
$command = csprintf( $command = csprintf(
'git clone %s', 'git clone %R',
$uri); $uri);
break; break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
$command = csprintf( $command = csprintf(
'hg clone %s', 'hg clone %R',
$uri); $uri);
break; break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
$command = csprintf( $command = csprintf(
'svn checkout %s %s', 'svn checkout %R %R',
$uri, $uri,
$repository->getCloneName()); $repository->getCloneName());
break; break;