Esempio n. 1
0
        public void MakeBackup(ConfigSource source, HosterRepository repo, string repoFolder)
        {
            if (this.scmFactory == null)
            {
                throw new InvalidOperationException(string.Format(Resource.BackupBase_IScmfactoryIsMissing, source.Hoster));
            }

            ScmCredentials credentials = null;

            if (repo.IsPrivate)
            {
                credentials = new ScmCredentials(source.AuthName, source.Password);
            }

            this.repo = repo;

            string subdir = Path.Combine(repoFolder, this.SubDirRepo);

            this.BackupRepo(subdir, credentials);

            if (this.repo.HasWiki)
            {
                subdir = Path.Combine(repoFolder, this.SubDirWiki);
                this.BackupWiki(subdir, credentials);
            }

            if (this.repo.HasIssues)
            {
                subdir = Path.Combine(repoFolder, this.SubDirIssues);
                this.BackupIssues(subdir, credentials);
            }
        }
Esempio n. 2
0
        public void MakeBackup(ConfigSource source, HosterRepository repo, string repoFolder)
        {
            if (this.scmFactory == null)
            {
                throw new ArgumentNullException("!!");
            }

            ScmCredentials credentials = null;

            if (repo.IsPrivate)
            {
                credentials = new ScmCredentials(source.AuthName, source.Password);
            }

            this.repo = repo;

            string subdir = Path.Combine(repoFolder, this.SubDirRepo);

            this.BackupRepo(subdir, credentials);

            if (this.repo.HasWiki)
            {
                subdir = Path.Combine(repoFolder, this.SubDirWiki);
                this.BackupWiki(subdir, credentials);
            }

            if (this.repo.HasIssues)
            {
                subdir = Path.Combine(repoFolder, this.SubDirIssues);
                this.BackupIssues(subdir, credentials);
            }
        }