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