Esempio n. 1
0
        public void Backup(ConfigSource source, IEnumerable <HosterRepository> repos)
        {
            this.logger.Log(ErrorLevel.Info, Resource.BackupMaker_Source, source.Title);

            string sourceFolder = this.fileHelper.CreateSubDirectory(context.Config.LocalFolder, source.Title);

            var url = new UrlHelper();

            foreach (var repo in repos)
            {
                string repoFolder = this.fileHelper.CreateSubDirectory(sourceFolder, repo.FullName);

                this.logger.Log(ErrorLevel.Info, Resource.BackupMaker_Repo, repo.Scm.ToString(), url.RemoveCredentialsFromUrl(repo.CloneUrl));

                this.backupMaker.MakeBackup(source, repo, repoFolder);
            }
        }
Esempio n. 2
0
        public List <HosterRepository> GetRepositoryList(ConfigSource source)
        {
            this.logger.Log(ErrorLevel.Info, Resource.ApiGettingRepos, source.Title, source.Hoster);
            var repos = this.caller.GetRepositoryList(source);

            // #40: Bitbucket will remove all Mercurial repos on Jun 01 2020 -> show warning when the list contains at least one
            if (source.Hoster == "bitbucket")
            {
                var hgrepos = repos.Where(r => r.Scm == ScmType.Mercurial).Count();

                if (hgrepos > 0)
                {
                    this.logger.Log(ErrorLevel.Warn, Resource.BitbucketMercurialWarning, hgrepos);
                }
            }

            return(repos);
        }
Esempio n. 3
0
 public IEnumerable <HosterRepository> GetReposForSource(ConfigSource config)
 {
     return(this.Dic[config].OrderBy(r => r.FullName));
 }
Esempio n. 4
0
 public void AddItem(ConfigSource config, List <HosterRepository> repos)
 {
     this.Dic.Add(config, repos);
 }
 public List <HosterRepository> GetRepositoryList(ConfigSource source)
 {
     this.logger.Log(ErrorLevel.Info, Resource.ApiGettingRepos, source.Title, source.Hoster);
     return(this.caller.GetRepositoryList(source));
 }
Esempio n. 6
0
 public ValidationResult(ConfigSource configSource)
 {
     this.Messages = new List <ValidationMessage>();
     this.source   = configSource;
 }