private void CreatePaths() { List <string> paths; paths = new List <string>(); using (SvnClient client = SvnUtilities.CreateClient(this.SvnConnectionSettings)) { this.OnProgressChanged(new ProgressEventArgs("Creating new directories...")); foreach (string str_rel_path in this.VssRelativeProjPaths) { if (!string.IsNullOrEmpty(str_rel_path)) { string path = Path.Combine(this.SvnFullRepositoryPath, str_rel_path); if (!Directory.Exists(path)) { paths.Add(path); } } } client.CreateDirectories(paths, new SvnCreateDirectoryArgs() { CreateParents = true }); string commitMessage = string.Format("VSS Porting from project: {0}. Initial directory creation.", this.VssDatabase.SrcSafeIni); client.Commit(this.SvnFullRepositoryPath, new SvnCommitArgs() { LogMessage = commitMessage }); } }
private void CommitChangesets() { this.OnProgressChanged(new ProgressEventArgs("Committing Changesets...")); using (SvnClient client = SvnUtilities.CreateClient(this.SvnConnectionSettings)) { foreach (Changeset changeset in Changesets.Values) { // commit the changeset this.CommitChangeset(client, changeset); // send a progress message Int32 i = this.Changesets.Values.IndexOf(changeset); double progress = (double)((i + 1) * 100) / (double)(this.Changesets.Count); this.OnProgressChanged(new ProgressEventArgs( string.Format("Commited {0} of {1}", i + 1, this.Changesets.Count), progress)); } } }
public string CreateSVNfolder() //throws exception { string str_uri = this.SvnConnectionSettings.RepositoryUri; if (!str_uri.EndsWith("/")) { str_uri += "/"; } Uri uri = new Uri(str_uri + this.RootSubversionProject); using (SvnClient client = SvnUtilities.CreateClient(this.SvnConnectionSettings)) { client.RemoteCreateDirectory(uri, new SvnCreateDirectoryArgs() { CreateParents = true, LogMessage = "Created Root Project Folder" }); return(uri.ToString()); } }
private void InitializeRepository() { if (this.IsPreview) { throw new InvalidOperationException("Not supported in preview mode."); } using (SvnClient client = SvnUtilities.CreateClient(this.SvnConnectionSettings)) { { this.OnProgressChanged(new ProgressEventArgs("Checking out working copy...")); try { client.CheckOut(this.SvnFullRepositoryUri, this.SvnFullRepositoryPath); } catch (Exception ex) { this.LogMessage("Couldn't checkout project!\n\n" + ex.ToString()); } } } }