diff --git a/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs b/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs index 34fecb10..0adfd4b8 100644 --- a/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs +++ b/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs @@ -265,13 +265,21 @@ private void OnDownloadClick(object sender, EventArgs e) StartClone(); } - public void StartClone(string username, string password, Uri targetUri) + + /// + /// Starts a clone operation with the supplied information. + /// Username for Mercurial authentication + /// Password for Mercurial authentication + /// Host name (with scheme), e.g. https://www.google.com + /// Name of the project to clone (will be combined with the host Uri) + /// + public void StartClone(string username, string password, Uri host, string projectName) { _model.Username = username; _model.Password = password; - _model.CustomUrl = targetUri.ToString(); + _model.CustomUrl = new Uri(host, projectName).ToString(); _model.IsCustomUrl = true; - _model.LocalFolderName = GetProjectName(targetUri); + _model.LocalFolderName = projectName; StartClone(); } @@ -291,11 +299,6 @@ private void StartClone() } } - private string GetProjectName(Uri uri) - { - return uri.Segments[1].ToString(); - } - public string ThreadSafeUrl { get;