Example #1
0
        internal bool CreateProject(string projectName)
        {
            try
            {
                using (SvnClient client = new SvnClient())
                {
                    // Bind the SharpSvn UI to our client for SSL certificate and credentials
                    SvnUIBindArgs bindArgs = new SvnUIBindArgs();
                    SvnUI.Bind(client, bindArgs);

                    List <Uri> folderList = new List <Uri>();

                    if (string.IsNullOrWhiteSpace(projectName) == false)
                    {
                        SvnUriTarget projectUrl = new SvnUriTarget(this.projectsUri + "/" + projectName);

                        if (this.CheckUrlValide(client, projectUrl) == false)
                        {
                            folderList.AddRange(new Uri[]
                            {
                                projectUrl.Uri,
                                new Uri(string.Format("{0}/documentation/", projectUrl.ToString())),
                                new Uri(string.Format("{0}/nbproject/", projectUrl.ToString())),
                                new Uri(string.Format("{0}/release/", projectUrl.ToString())),
                                new Uri(string.Format("{0}/tags/", projectUrl.ToString())),
                                new Uri(string.Format("{0}/workspace/", projectUrl.ToString()))
                            });
                        }

                        SvnCreateDirectoryArgs arg = new SvnCreateDirectoryArgs();
                        arg.CreateParents = true;
                        arg.LogMessage    = "ADMIN-0: Component structure created.";

                        return(client.RemoteCreateDirectories(folderList, arg));
                    }
                }
                return(false);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        internal bool CreateComponents(List <string> componentNameList)
        {
            try
            {
                using (SvnClient client = new SvnClient())
                {
                    // Bind the SharpSvn UI to our client for SSL certificate and credentials
                    SvnUIBindArgs bindArgs = new SvnUIBindArgs();
                    SvnUI.Bind(client, bindArgs);

                    List <Uri> folderList = new List <Uri>();

                    if (componentNameList.Count > 0)
                    {
                        foreach (string componentName in componentNameList)
                        {
                            SvnUriTarget componentUrl = new SvnUriTarget(this.componentsUri + "/" + componentName);

                            if (this.CheckUrlValide(client, componentUrl) == false)
                            {
                                folderList.AddRange(new Uri[]
                                {
                                    componentUrl.Uri,
                                    new Uri(string.Format("{0}/branches/", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/archive", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/core", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/core/ifsapp-8.0", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/core/ifsapp-8.0/main", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/core/ifsapp-9.0", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/core/ifsapp-9.0/main", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/branches/project", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/tags/", componentUrl.ToString())),
                                    new Uri(string.Format("{0}/trunk/", componentUrl.ToString()))
                                });
                            }
                        }

                        SvnCreateDirectoryArgs arg = new SvnCreateDirectoryArgs();
                        arg.CreateParents = true;
                        arg.LogMessage    = "ADMIN-0: Component structure created.";

                        return(client.RemoteCreateDirectories(folderList, arg));
                    }
                }
                return(false);
            }
            catch (Exception)
            {
                throw;
            }
        }