From 6615d76c3489a3977549d2133374b60b5ce98e42 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 11 May 2016 07:22:07 -0700 Subject: [PATCH] In Subversion, show "svn checkout " in Diffusion Summary: Ref T10923. The old behavior was to show a full command in SVN, Mercurial, and Git, like this: - `git clone ` - `hg clone ` - `svn checkout ` In Git and Mercurial, the `` ends in something like `/nice-repository-name.git` so the default directory it creates is called `nice-repository-name/`. In Subversion, we don't (and can't easily) do that for various reasons so we provide an explicit `` with the nice name. In the update, I've changed things to just show the URI. I often found that I wanted the URI alone, not the whole clone command (for example, to `fetch`, `remote-add`, etc). This is also consistent with GitHub. Because we have nice URIs for Git and Mercurial, `git clone ` has good behavior. In Subversion, `svn checkout ` has bad beahvior (you get a directory named `47/` or whatever). So continue showing the whole command there. We can possibly tailor this after T4245 finishes up and we get access to `/source/nice-repository-name/` URIs. Test Plan: - Viewed a Subversion repository, saw a full command. - Viewed a Git repository, saw only a clone URI. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10923 Differential Revision: https://secure.phabricator.com/D15888 --- .../controller/DiffusionRepositoryController.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index 9aad7f1c5b..45fbf5c717 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -671,7 +671,16 @@ final class DiffusionRepositoryController extends DiffusionController { require_celerity_resource('diffusion-icons-css'); - $display = (string)csprintf('%R', (string)$uri->getDisplayURI()); + if ($repository->isSVN()) { + $display = csprintf( + 'svn checkout %R %R', + (string)$uri->getDisplayURI(), + $repository->getCloneName()); + } else { + $display = csprintf('%R', (string)$uri->getDisplayURI()); + } + + $display = (string)$display; $input = javelin_tag( 'input',