Пример #1
0
        /* LOADING A PREPACKAGED REVISION */
        public override Revision GetRevision(string alias)
        {
            string _folder = "";
            string _name   = alias;

            //if alias is actually an absolute path
            if (System.IO.Directory.Exists(alias))
            {
                _folder = alias;
                _name   = _folder.TrimEnd(IO.DirSepChar).Substring(_folder.LastIndexOf(IO.DirSepChar)).Trim(IO.DirSepChar);
            }
            else if (alias.Contains("/"))
            {
                //If alias is actually a relative path
                _folder = ExecutionContext.MapPath(alias);
            }
            else
            {
                //if just an alias
                _folder = ExecutionContext.MapPath(Core.Settings.revisionsPath + "/" + alias);
            }

            RevisionStorage revstorage = new RevisionStorage();
            var             revi       = revstorage.GetFromDirectory(_name, _folder, true);

            revstorage.Dispose();

            return(revi);
        }
Пример #2
0
        public override Revision GetRevision(string alias)
        {
            string url        = Url.TrimEnd('/');
            string tempFolder = Context.Current.MapPath(Core.Settings.rootPath + "/svnRepoTemp/");

            if (System.IO.Directory.Exists(tempFolder))
            {
                System.IO.Directory.Delete(tempFolder);
            }

            using (SvnClient client = new SvnClient())
            {
                client.LoadConfiguration("path");
                client.Authentication.DefaultCredentials = new NetworkCredential(Login, Password);
                SvnTarget folderTarget = SvnTarget.FromString(url);
                client.Export(folderTarget, tempFolder);

                RevisionStorage rs = new RevisionStorage();
                var             r  = rs.GetFromDirectory(alias, tempFolder + alias);

                rs.Save(r, alias);

                rs.Dispose();

                return(r);
            }

            return(null);
        }
Пример #3
0
        public override Revision GetRevision(string alias)
        {
            string path = System.IO.Path.Combine(Path, alias);

            RevisionStorage revstorage = new RevisionStorage();
            var rev = revstorage.GetFromDirectory(alias, path);
            revstorage.Dispose();

            return rev;
        }
Пример #4
0
        public override Revision GetRevision(string alias)
        {
            string path = System.IO.Path.Combine(Path, alias);

            RevisionStorage revstorage = new RevisionStorage();
            var             rev        = revstorage.GetFromDirectory(alias, path);

            revstorage.Dispose();

            return(rev);
        }
Пример #5
0
        public List <ExceptionProxy> ValidateRevision(string directory, string username, string password)
        {
            //Auth login and IP
            AuthorizeClient(username, password);

            RevisionStorage revstorage = new RevisionStorage();
            var             rev        = revstorage.GetFromDirectory(directory, directory);

            revstorage.Dispose();

            return(new List <ExceptionProxy>());

//      return createProxy( rev.Validate() );
        }
Пример #6
0
        public override Revision GetRevision(string alias)
        {
            string url        = Url.TrimEnd('/') + "/" + alias;
            string tempFolder = TempFolderPath(alias);

            //ensure we have the latest version
            checkout(alias);

            RevisionStorage rs = new RevisionStorage();
            var             r  = rs.GetFromDirectory(alias, tempFolder);

            rs.Save(r, alias);

            rs.Dispose();

            return(r);
        }
Пример #7
0
        public override Revision GetRevision(string alias)
        {
            string _folder = "";
            string _name   = alias;

            if (System.IO.Directory.Exists(alias))
            {
                _folder = alias;
                _name   = _folder.TrimEnd(IO.DirSepChar).Substring(_folder.LastIndexOf(IO.DirSepChar)).Trim(IO.DirSepChar);
            }
            else
            {
                _folder = Context.Current.MapPath(Core.Settings.revisionsPath + "/" + alias);
            }


            RevisionStorage revstorage = new RevisionStorage();
            var             revi       = revstorage.GetFromDirectory(_name, _folder);

            revstorage.Dispose();

            return(revi);
        }
Пример #8
0
        /* LOADING A PREPACKAGED REVISION */
        public override Revision GetRevision(string alias)
        {
            string _folder = "";
            string _name = alias;

            //if alias is actually an absolute path
            if (System.IO.Directory.Exists(alias))
            {
                _folder = alias;
                _name = _folder.TrimEnd(IO.DirSepChar).Substring(_folder.LastIndexOf(IO.DirSepChar)).Trim(IO.DirSepChar);
            }
            else if(alias.Contains("/"))
            {
                //If alias is actually a relative path
                _folder = ExecutionContext.MapPath(alias);
            }else
            {
                //if just an alias
                _folder = ExecutionContext.MapPath(Core.Settings.revisionsPath + "/" + alias);
            }

            RevisionStorage revstorage = new RevisionStorage();
            var revi = revstorage.GetFromDirectory(_name, _folder, true);
            revstorage.Dispose();

            return revi;
        }
Пример #9
0
        public List<ExceptionProxy> ValidateRevision(string directory, string username, string password)
        {
            //Auth login and IP
              AuthorizeClient(username, password);

              RevisionStorage revstorage = new RevisionStorage();
              var rev = revstorage.GetFromDirectory(directory, directory);
              revstorage.Dispose();

              return new List<ExceptionProxy>();

            //      return createProxy( rev.Validate() );
        }
Пример #10
0
        public override Revision GetRevision(string alias)
        {
            string url = Url.TrimEnd('/');
            string tempFolder = Context.Current.MapPath(Core.Settings.rootPath + "/svnRepoTemp/");

            if (System.IO.Directory.Exists(tempFolder))
            System.IO.Directory.Delete(tempFolder);

            using (SvnClient client = new SvnClient())
            {
            client.LoadConfiguration("path");
            client.Authentication.DefaultCredentials = new NetworkCredential(Login, Password);
            SvnTarget folderTarget = SvnTarget.FromString(url);
            client.Export(folderTarget, tempFolder);

            RevisionStorage rs = new RevisionStorage();
            var r = rs.GetFromDirectory(alias, tempFolder + alias);

            rs.Save(r, alias);

            rs.Dispose();

            return r;
            }

            return null;
        }