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:
		@@ -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;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user