Ejemplo n.º 1
0
 public override void AfterApplyCommand(RepositoryInfo repository, Command command)
 {
     if (command.CommandName == CommandName.CreateGherkinLink)
     {
         GitGherkinLinkProvider.CreateGherkinLink(repository, command);
     }
 }
Ejemplo n.º 2
0
        public VsPackageManagerFactory(ISolutionManager solutionManager,
            IPackageRepositoryFactory repositoryFactory,
            IFileSystemProvider fileSystemProvider,
            IRepositorySettings repositorySettings,
            IRecentPackageRepository recentPackagesRepository)
        {
            if (solutionManager == null) {
                throw new ArgumentNullException("solutionManager");
            }
            if (repositoryFactory == null) {
                throw new ArgumentNullException("repositoryFactory");
            }
            if (fileSystemProvider == null) {
                throw new ArgumentNullException("fileSystemProvider");
            }
            if (repositorySettings == null) {
                throw new ArgumentNullException("repositorySettings");
            }

            _fileSystemProvider = fileSystemProvider;
            _repositorySettings = repositorySettings;
            _solutionManager = solutionManager;
            _repositoryFactory = repositoryFactory;
            _recentPackageRepository = recentPackagesRepository;

            _solutionManager.SolutionClosing += (sender, e) => {
                _repositoryInfo = null;
            };
        }
Ejemplo n.º 3
0
        public virtual void Fetch(RepositoryInfo repositoryInfo, string targetBranch)
        {
            // Sync with dropbox
            DropboxInfo info = (DropboxInfo)repositoryInfo;

            _helper.Sync(info.DeployInfo, targetBranch);
        }
Ejemplo n.º 4
0
        public bool TryGetRepositoryInfo(HttpRequest request, JObject payload, out RepositoryInfo repositoryInfo)
        {
            repositoryInfo = null;
            if (!String.IsNullOrEmpty(payload.Value<string>("NewCursor")))
            {
                repositoryInfo = new DropboxInfo(payload);
            }

            return repositoryInfo != null;
        }
Ejemplo n.º 5
0
 public override void Create()
 {
     base.Create();
     var repositoryManager = Container.Get<RepositoryManager>();
     this.FakeSecurityContext.UserName = "******";
     RepoPath = repositoryManager.GetPathFor(REPO_NAME);
     var repositoryInfo = new RepositoryInfo(RepoPath, REPO_NAME);
     RepositoryRoot = Path.Combine(AppRoot, repositoryInfo.Path);
     DirectoryHelper.DeleteSubdirectories(RepositoryRoot.ParentDirectory());
     if (!Directory.Exists(RepositoryRoot))
         Directory.CreateDirectory(RepositoryRoot);
 }
        public VsPackageManagerFactory(ISolutionManager solutionManager,
                                       IPackageRepositoryFactory repositoryFactory,
                                       IVsPackageSourceProvider packageSourceProvider,
                                       IFileSystemProvider fileSystemProvider,
                                       IRepositorySettings repositorySettings,
                                       IRecentPackageRepository recentPackagesRepository,
                                       VsPackageInstallerEvents packageEvents,
                                       IPackageRepository cacheRepository)
        {
            if (solutionManager == null)
            {
                throw new ArgumentNullException("solutionManager");
            }
            if (repositoryFactory == null)
            {
                throw new ArgumentNullException("repositoryFactory");
            }
            if (packageSourceProvider == null)
            {
                throw new ArgumentNullException("packageSourceProvider");
            }
            if (fileSystemProvider == null)
            {
                throw new ArgumentNullException("fileSystemProvider");
            }
            if (repositorySettings == null)
            {
                throw new ArgumentNullException("repositorySettings");
            }
            if (cacheRepository == null)
            {
                throw new ArgumentNullException("cacheRepository");
            }

            if (packageEvents == null)
            {
                throw new ArgumentNullException("packageEvents");
            }

            _fileSystemProvider = fileSystemProvider;
            _repositorySettings = repositorySettings;
            _solutionManager = solutionManager;
            _repositoryFactory = repositoryFactory;
            _recentPackageRepository = recentPackagesRepository;
            _packageSourceProvider = packageSourceProvider;
            _packageEvents = packageEvents;
            _cacheRepository = cacheRepository;

            _solutionManager.SolutionClosing += (sender, e) =>
            {
                _repositoryInfo = null;
            };
        }
Ejemplo n.º 7
0
        private RepositoryInfo GetRepositoryInfo()
        {
            // Update the path if it needs updating
            string path = _repositorySettings.RepositoryPath;

            if (_repositoryInfo == null || !_repositoryInfo.Path.Equals(path)) {
                IFileSystem fileSystem = _fileSystemProvider.GetFileSystem(path);
                ISharedPackageRepository repository = new SharedPackageRepository(new DefaultPackagePathResolver(fileSystem), fileSystem);

                _repositoryInfo = new RepositoryInfo(path, fileSystem, repository);
            }

            return _repositoryInfo;
        }
Ejemplo n.º 8
0
 public EmailManager()
 {
     try
     {
         ConfigHelper config = new ConfigHelper();
         _repository = config.GetRepository("RestrictedSymbolList");
         string serverName = ConfigurationManager.AppSettings["SMTPServer"];
         _client = new SmtpClient(serverName);
     }
     catch (Exception ex)
     {
         throw new ApplicationException("SMTP Client Init Error: " + ex.Message);
     }
 }
Ejemplo n.º 9
0
        static List <MountPendingMergeLink> BuildMountPendingMergeLinks(
            MountPoint mount, IList <PendingMergeLink> links)
        {
            List <MountPendingMergeLink> result = new List <MountPendingMergeLink>();

            RepositoryInfo repInfo = RepositorySpecResolverProvider.Get().
                                     GetRepInfo(mount.RepSpec);

            foreach (PendingMergeLink link in links)
            {
                result.Add(new MountPendingMergeLink(repInfo.GetRepSpec(), link));
            }

            return(result);
        }
Ejemplo n.º 10
0
        public void SetUp()
        {
            this.telemetryClient = TelemetryMock.InitializeMockTelemetryClient();
            MongoClient client = new MongoClient(Settings.ConnectionString);

            client.DropDatabase(Settings.DatabaseName);

            RepositoryDatabase database = new RepositoryDatabase(Settings);
            RepositoryInfo     result   = database.Create(this.testRepoOne);

            Assert.IsNotNull(result);
            RepositoryInfo result2 = database.Create(this.testRepoTwo);

            Assert.IsNotNull(result2);
        }
Ejemplo n.º 11
0
        public void on_a_non_tagged_repository_all_commits_can_be_a_first_possible_version()
        {
            var repoTest = TestHelper.TestGitRepository;

            foreach (SimpleCommit c in repoTest.Commits)
            {
                RepositoryInfo i = repoTest.GetRepositoryInfo(c.Sha);
                Assert.That(i.RepositoryError, Is.Null);
                Assert.That(i.ReleaseTagErrorLines, Is.Null);
                Assert.That(i.ValidReleaseTag, Is.Null);
                Assert.That(i.PreviousRelease, Is.Null);
                Assert.That(i.PreviousMaxRelease, Is.Null);
                CollectionAssert.AreEqual(ReleaseTagVersion.FirstPossibleVersions, i.PossibleVersions);
            }
        }
Ejemplo n.º 12
0
        private void PerformDeployment(RepositoryInfo repositoryInfo, string targetBranch)
        {
            if (repositoryInfo.UseSSH)
            {
                using (_tracer.Step("Prepare SSH environment"))
                {
                    _gitServer.SetSSHEnv(repositoryInfo.Host, _environment.ApplicationRootPath);
                }
            }

            bool hasPendingDeployment;

            do
            {
                hasPendingDeployment = false;

                using (_tracer.Step("Performing fetch based deployment"))
                {
                    // Configure the repository
                    _gitServer.Initialize(_configuration);

                    // Setup the receive info (this is important to know if branches were deleted etc)
                    _gitServer.SetReceiveInfo(repositoryInfo.OldRef, repositoryInfo.NewRef, targetBranch);

                    // Fetch from url
                    _gitServer.FetchWithoutConflict(repositoryInfo.RepositoryUrl, "external", targetBranch);

                    // Perform the actual deployment
                    _deploymentManager.Deploy(repositoryInfo.Deployer);

                    if (MarkerFileExists())
                    {
                        _tracer.Trace("Pending deployment marker file exists");

                        hasPendingDeployment = DeleteMarkerFile();

                        if (hasPendingDeployment)
                        {
                            _tracer.Trace("Deleted marker file");
                        }
                        else
                        {
                            _tracer.TraceError("Failed to delete marker file");
                        }
                    }
                }
            } while (hasPendingDeployment);
        }
Ejemplo n.º 13
0
        public void RepositoryAssign()
        {
            RepositoryInfo ri = new RepositoryInfo
            {
                Proprietary = "Guionardo"
            };

            Console.WriteLine(ri);

            RepositoryInfo r2 = new RepositoryInfo();

            Console.WriteLine(r2);
            Console.WriteLine("Assign");
            r2.Assign(ri);
            Console.WriteLine(r2);
        }
Ejemplo n.º 14
0
    internal async Task <bool> CanSynchronize(RepositoryInfo targetRepository, SyncOutput expectedOutput)
    {
        if (expectedOutput == SyncOutput.CreatePullRequest ||
            expectedOutput == SyncOutput.MergePullRequest)
        {
            var hasOpenPullRequests = await gateway.HasOpenPullRequests(targetRepository.Owner, targetRepository.Repository, PullRequestTitle);

            if (hasOpenPullRequests)
            {
                log("Cannot create pull request, there is an existing open pull request, close or merge that first");
                return(false);
            }
        }

        return(true);
    }
Ejemplo n.º 15
0
        private bool TryGetRepositoryInfo(IExecutionContext executionContext, out RepositoryInfo repoInfo)
        {
            // Return the matching repository resource and its source provider.
            Trace.Entering();
            var primaryRepo    = RepositoryUtil.GetPrimaryRepository(executionContext.Repositories);
            var triggeringRepo = RepositoryUtil.GetTriggeringRepository(executionContext.Repositories);

            repoInfo = new RepositoryInfo
            {
                PrimaryRepository    = primaryRepo,
                TriggeringRepository = triggeringRepo,
                SourceProvider       = GetSourceProvider(executionContext, primaryRepo),
            };

            return(repoInfo.SourceProvider != null);
        }
Ejemplo n.º 16
0
        public void SetUp()
        {
            MongoClient client = new MongoClient(Settings.ConnectionString);

            client.DropDatabase(Settings.DatabaseName);

            RepositoryDatabase database = new RepositoryDatabase(Settings);
            RepositoryInfo     result   = database.Create(this.snapshotRepoOne);

            Assert.IsNotNull(result);
            RepositoryInfo result2 = database.Create(this.snapshotRepoTwo);

            Assert.IsNotNull(result2);
            RepositoryInfo result3 = database.Create(this.defaultRepoOne);

            Assert.IsNotNull(result3);
        }
Ejemplo n.º 17
0
        private RepositoryInfo CreateRepositoryInfo(string repoName, string repoStoragePath)
        {
            var currentHeadRevision   = _svnLookProvider.GetHeadRevision(repoStoragePath);
            var latestChangeTimestamp = _svnLookProvider.GetRevisionTimestamp(repoStoragePath, currentHeadRevision);

            var repoInfo = new RepositoryInfo
            {
                Name                  = repoName,
                LatestRevision        = currentHeadRevision,
                LatestChangeTimestamp = latestChangeTimestamp,
                LatestChangeUsername  = _svnLookProvider.GetRevisionUsername(repoStoragePath, currentHeadRevision),
                SizeInBytes           = GetRepoSizeInBytes(repoStoragePath),
                Url = _serverInfoProvider.BaseRepoUrl + repoName,
            };

            return(repoInfo);
        }
        public void UpdatesExistingDynamicRepository()
        {
            var repoName = Guid.NewGuid().ToString();
            var tempPath = Path.GetTempPath();
            var tempDir  = Path.Combine(tempPath, repoName);

            Directory.CreateDirectory(tempDir);
            string dynamicRepositoryPath = null;

            try
            {
                using (var mainRepositoryFixture = new EmptyRepositoryFixture())
                {
                    mainRepositoryFixture.Repository.MakeCommits(1);

                    var repositoryInfo = new RepositoryInfo
                    {
                        Url    = mainRepositoryFixture.RepositoryPath,
                        Branch = "master"
                    };

                    using (var gitRepository = GitRepositoryFactory.CreateRepository(repositoryInfo))
                    {
                        dynamicRepositoryPath = gitRepository.DotGitDirectory;
                    }

                    var newCommit = mainRepositoryFixture.Repository.MakeACommit();

                    using (var gitRepository = GitRepositoryFactory.CreateRepository(repositoryInfo))
                    {
                        mainRepositoryFixture.Repository.DumpGraph();
                        gitRepository.Repository.DumpGraph();
                        gitRepository.Repository.Commits.ShouldContain(c => c.Sha == newCommit.Sha);
                    }
                }
            }
            finally
            {
                Directory.Delete(tempDir, true);

                if (dynamicRepositoryPath != null)
                {
                    DeleteHelper.DeleteGitRepository(dynamicRepositoryPath);
                }
            }
        }
Ejemplo n.º 19
0
        public void NetCoreProject_Load()
        {
            var path = TestUtils.GetSampleProject(@"RepoCat.TestApps.NetCore.csproj");

            var repo = new RepositoryInfo()
            {
                RepositoryName   = "Test",
                OrganizationName = "TestOrg"
            };
            var provider = ProjectInfoBuilderFactory.Get(new TransmitterArguments()
            {
                TransmissionMode = TransmissionMode.LocalDotNetProjects, RepositoryName = repo.RepositoryName, OrganizationName = repo.OrganizationName
            }, new Mock <ILogger>().Object);

            var info = (provider as ProjectInfoBuilderBase).GetInfo(path.FullName);

            info.Should().NotBeNull();
            info.RepositoryInfo.Should().BeEquivalentTo(repo);
            info.Owner.Should().BeEquivalentTo("Jim The Beam");
            info.ProjectDescription.Should().BeEquivalentTo("Description is optional");
            info.ProjectName.Should().BeEquivalentTo("RepoCat.TestApps.NetCore");
            info.RepositoryStamp.Should().NotBeNullOrEmpty();
            info.AssemblyName.Should().Be("RepoCat.TestApps.NetCore");
            info.Tags.Should().BeEquivalentTo(new[] { "These", "Tags", "Are", "Optional" });
            info.Properties.Should().ContainEquivalentOf(new Property("EntireProjectProperties", "AreAlsoOptional"));
            info.Properties.Should()
            .ContainEquivalentOf(new Property("CodeFiles", new List <string>()
            {
                "Program.cs"
            }));
            info.Properties.Should()
            .ContainEquivalentOf(new Property("ManualCollection", new List <string>()
            {
                "Value 1", "Val2", "V3"
            }));

            info.Components.Single().Name.Should().Be("SampleNetCoreConsoleApp");
            info.Components.Single().Tags.Count.Should().Be(3);


            info.Components.First().Properties.Should()
            .ContainEquivalentOf(new Property("ComponentManualCollection", new List <string>()
            {
                "Value 1", "Val2", "V3"
            }));
        }
Ejemplo n.º 20
0
        public VsPackageManagerFactory(ISolutionManager solutionManager,
                                       IPackageRepositoryFactory repositoryFactory,
                                       IVsPackageSourceProvider packageSourceProvider,
                                       IFileSystemProvider fileSystemProvider,
                                       IRepositorySettings repositorySettings,
                                       IRecentPackageRepository recentPackagesRepository,
                                       VsPackageInstallerEvents packageEvents)
        {
            if (solutionManager == null)
            {
                throw new ArgumentNullException("solutionManager");
            }
            if (repositoryFactory == null)
            {
                throw new ArgumentNullException("repositoryFactory");
            }
            if (packageSourceProvider == null)
            {
                throw new ArgumentNullException("packageSourceProvider");
            }
            if (fileSystemProvider == null)
            {
                throw new ArgumentNullException("fileSystemProvider");
            }
            if (repositorySettings == null)
            {
                throw new ArgumentNullException("repositorySettings");
            }
            if (packageEvents == null)
            {
                throw new ArgumentNullException("packageEvents");
            }

            _fileSystemProvider      = fileSystemProvider;
            _repositorySettings      = repositorySettings;
            _solutionManager         = solutionManager;
            _repositoryFactory       = repositoryFactory;
            _recentPackageRepository = recentPackagesRepository;
            _packageSourceProvider   = packageSourceProvider;
            _packageEvents           = packageEvents;

            _solutionManager.SolutionClosing += (sender, e) =>
            {
                _repositoryInfo = null;
            };
        }
Ejemplo n.º 21
0
        public RepositoryInfo GetRepositoryInfo(string basePath, string repositoryName)
        {
            var uri            = this.GetUrl(basePath, repositoryName);
            var latestLog      = SvnLogInfo.GetLatestLog($"{uri}");
            var firstLog       = SvnLogInfo.GetFirstLog($"{uri}");
            var repositoryInfo = new RepositoryInfo()
            {
                ID               = GuidUtility.FromName(repositoryName + firstLog.Revision),
                Name             = repositoryName,
                Comment          = firstLog.Comment,
                Revision         = latestLog.Revision,
                CreationInfo     = new SignatureDate(firstLog.Author, firstLog.DateTime),
                ModificationInfo = new SignatureDate(latestLog.Author, latestLog.DateTime),
            };

            return(repositoryInfo);
        }
Ejemplo n.º 22
0
        public async Task SnapshotModeSetFromStart()
        {
            RepositoryDatabase service         = new RepositoryDatabase(Settings);
            string             organizationOne = MethodBase.GetCurrentMethod().Name;
            string             repoOne         = Guid.NewGuid().ToString();

            //add a new repository with snapshot mode
            RepositoryInfo repo = await service.UpsertUpdate(
                new RepositoryInfo()
            {
                OrganizationName = organizationOne,
                RepositoryName   = repoOne,
                RepositoryMode   = RepositoryMode.Snapshot
            }).ConfigureAwait(false);

            repo.RepositoryMode.Should().Be(RepositoryMode.Snapshot);
        }
        internal void CreateGherkinLink(RepositoryInfo repositoryInfo, Command command)
        {
            var args = (AppendToCollectionCommandArgs)command.CommandArgs;
            var gherkinFile = (GherkinFile)entityRepository.Load(repositoryInfo, args.CollectionMember);
            if (gherkinFile.FileProviderType != ProviderType)
                return; // this is not for us

            var updateBoundary = new Boundary(Context.Current);
            try
            {
                GherkinFilePoller.TriggerUpdate(gherkinFile, updateBoundary);
            }
            catch (Exception ex)
            {
                logger.Log(TraceEventType.Error, "An exception has occurred during updating a gherkin file link: {0}", ex);
            }
        }
Ejemplo n.º 24
0
        public Task <bool> TryDetectRepositoryInformationAsync(
            string repositoryFolder,
            string repositoryUri,
            CancellationToken cancellationToken,
            out RepositoryInfo?repositoryInfo)
        {
            if (!TryParseGitUri(repositoryUri, out IDictionary <string, string>?properties) ||
                properties == null)
            {
                repositoryInfo = null;
                return(Task.FromResult(false));
            }

            cancellationToken.ThrowIfCancellationRequested();
            repositoryInfo = new RepositoryInfo(repositoryUri, properties, this);
            return(Task.FromResult(true));
        }
Ejemplo n.º 25
0
        static IList <Guid> GetCandidatesGuids(
            WorkspaceInfo wkInfo,
            RepositorySpec repSpec,
            List <WorkspaceTreeNode> candidates)
        {
            RepositoryInfo repInfo = RepositorySpecResolverProvider.
                                     Get().GetRepInfo(repSpec);

            IList <long> ids = new List <long>(candidates.Count);

            foreach (WorkspaceTreeNode candidate in candidates)
            {
                ids.Add(candidate.RevInfo.ItemId);
            }

            return(GuidResolver.Get().GetObjectGuids(repInfo, wkInfo, ids));
        }
Ejemplo n.º 26
0
        public IVsPackageManager CreatePackageManager(IPackageRepository repository, bool useFallbackForDependencies)
        {
            RepositoryInfo info           = GetRepositoryInfo();
            var            packageManager = new VsPackageManager(_solutionManager,
                                                                 repository,
                                                                 _fileSystemProvider,
                                                                 info.FileSystem,
                                                                 info.Repository,
                                                                 // We ensure DeleteOnRestartManager is initialized with a PhysicalFileSystem so the
                                                                 // .deleteme marker files that get created don't get checked into version control
                                                                 new DeleteOnRestartManager(() => new PhysicalFileSystem(info.FileSystem.Root)),
                                                                 _packageEvents,
                                                                 _frameworkMultiTargeting);

            packageManager.DependencyVersion = GetDependencyVersion();
            return(packageManager);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Gets the simple git version <see cref="RepositoryInfo"/> from a branch.
        /// Returns null if an error occurred or if RepositoryInfo.xml has not been successfully read.
        /// </summary>
        /// <param name="m">The monitor to use.</param>
        /// <param name="branchName">Defaults to <see cref="CurrentBranchName"/>.</param>
        /// <returns>The RepositoryInfo or null if it it cannot be obtained.</returns>
        public RepositoryInfo ReadRepositoryVersionInfo(IActivityMonitor m, string branchName = null)
        {
            if (branchName == null)
            {
                branchName = CurrentBranchName;
            }
            try
            {
                Branch b = Git.Branches[branchName];
                if (b == null)
                {
                    m.Error($"Unknown branch {branchName}.");
                    return(null);
                }
                var pathOpt = b.IsRemote
                                ? SubPath.AppendPart("remotes").Combine(b.FriendlyName)
                                : SubPath.AppendPart("branches").AppendPart(branchName);

                pathOpt = pathOpt.AppendPart("RepositoryInfo.xml");
                var fOpt = FileSystem.GetFileInfo(pathOpt);
                if (!fOpt.Exists)
                {
                    m.Error($"Missing required {pathOpt} file.");
                    return(null);
                }
                var opt = RepositoryInfoOptions.Read(fOpt.ReadAsXDocument().Root);
                opt.StartingBranchName = branchName;
                var result = new RepositoryInfo(Git, opt);
                if (result.RepositoryError != null)
                {
                    m.Error($"Unable to read RepositoryInfo. RepositoryError: {result.RepositoryError}.");
                    return(null);
                }
                if (result.Error != null)
                {
                    m.Error(result.ReleaseTagError);
                    return(null);
                }
                return(result);
            }
            catch (Exception ex)
            {
                m.Fatal($"While reading version info for branch '{branchName}'.", ex);
                return(null);
            }
        }
        public void PicksAnotherDirectoryNameWhenDynamicRepoFolderTaken()
        {
            var repoName = Guid.NewGuid().ToString();
            var tempPath = Path.GetTempPath();
            var tempDir  = Path.Combine(tempPath, repoName);

            Directory.CreateDirectory(tempDir);
            string expectedDynamicRepoLocation = null;

            try
            {
                using (var fixture = new EmptyRepositoryFixture())
                {
                    fixture.Repository.CreateFileAndCommit("TestFile.txt");
                    File.Copy(Path.Combine(fixture.RepositoryPath, "TestFile.txt"), Path.Combine(tempDir, "TestFile.txt"));
                    expectedDynamicRepoLocation = Path.Combine(tempPath, fixture.RepositoryPath.Split(Path.DirectorySeparatorChar).Last());
                    Directory.CreateDirectory(expectedDynamicRepoLocation);

                    var repositoryInfo = new RepositoryInfo
                    {
                        Url    = fixture.RepositoryPath,
                        Branch = "master"
                    };

                    using (var gitRepository = GitRepositoryFactory.CreateRepository(repositoryInfo))
                    {
                        gitRepository.IsDynamic.ShouldBe(true);
                        gitRepository.DotGitDirectory.ShouldBe(Path.Combine(expectedDynamicRepoLocation + "_1", ".git"));
                    }
                }
            }
            finally
            {
                DeleteHelper.DeleteDirectory(tempDir, true);
                if (expectedDynamicRepoLocation != null)
                {
                    DeleteHelper.DeleteDirectory(expectedDynamicRepoLocation, true);
                }

                if (expectedDynamicRepoLocation != null)
                {
                    DeleteHelper.DeleteGitRepository(expectedDynamicRepoLocation + "_1");
                }
            }
        }
Ejemplo n.º 29
0
        public RepositoryInfo RepositoryInfoDemo()
        {
            OperationOptions operationOptions = new OperationOptions();
            RepositoryInfo repositoryInfo = schemaService.GetRepositoryInfo(DefaultRepository, 
                                                                            operationOptions);
 
            Console.WriteLine(repositoryInfo.Name);
            Console.WriteLine("Default schema name: " + repositoryInfo.DefaultSchemaName);
            Console.WriteLine("Label: " + repositoryInfo.Label);
            Console.WriteLine("Description: " + repositoryInfo.Description);
            Console.WriteLine("Schema names:");
            List<String> schemaList = repositoryInfo.SchemaNames;
            foreach (String schemaName in schemaList)
            {
                Console.WriteLine(schemaName);
            }
            return repositoryInfo;
        }
Ejemplo n.º 30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="repository"></param>
        /// <returns></returns>
        public async Task <DownloadStatistics> GetDownloadStatistics(RepositoryInfo repository)
        {
            void CheckParams()
            {
                if (repository == null)
                {
                    throw new ArgumentNullException(nameof(repository));
                }
            }

            CheckParams();


            FilterDefinition <DownloadStatistics> repositoryFilter =
                RepoCatFilterBuilder.BuildStatisticsRepositoryFilter(repository.Id);

            return(await this.FindOneOrCreateNewAsync(repository.Id, repositoryFilter));
        }
Ejemplo n.º 31
0
        public override ValidationResult Validate(RepositoryInfo repositoryInfo, Action <ValidationResult> notify = null)
        {
            var    result = new ValidationResult(this);
            var    exist  = FileSystemHelper.GetFolders(repositoryInfo.RepositoryRootPath, RelativePath).Any();
            string message;

            if (!exist && CheckType == CheckType.MustExist || exist && CheckType == CheckType.MustNotExist)
            {
                message = string.Format("Folder '{0}' {1}.", RelativePath, exist ? Resources.FolderRule_Validate_exists_This_folder_should_not_exist
                                        : Resources.FolderRule_Validate_does_not_exist_This_folder_must_exist);
                result.AddResult(ResultLevel.NotPassed, message);
                return(result);
            }
            message = string.Format("Folder '{0}' {1}.", RelativePath, exist ? Resources.FolderRule_Validate_exists : Resources.FolderRule_Validate_does_not_exist);
            result.AddResult(ResultLevel.Passed, message);

            return(result);
        }
        /// <summary>
        /// Gets the coollection of stamps for a given repository
        /// </summary>
        /// <param name="repository"></param>
        /// <returns></returns>
        public async Task <List <string> > GetStamps(RepositoryInfo repository)
        {
            void CheckParams()
            {
                if (repository == null)
                {
                    throw new ArgumentNullException(nameof(repository));
                }
            }

            CheckParams();

            FilterDefinition <ProjectInfo> filter = Builders <ProjectInfo> .Filter.Eq(p => p.RepositoryId, repository.Id);

            List <string> stamps = await(await this.projects.DistinctAsync(x => x.RepositoryStamp, filter).ConfigureAwait(false)).ToListAsync().ConfigureAwait(false);

            return(stamps);
        }
Ejemplo n.º 33
0
        public IVsPackageManager CreatePackageManager(IPackageRepository repository, bool useFallbackForDependencies)
        {
            if (useFallbackForDependencies)
            {
                repository = CreateFallbackRepository(repository);
            }
            RepositoryInfo info = GetRepositoryInfo();

            return(new VsPackageManager(_solutionManager,
                                        repository,
                                        _fileSystemProvider,
                                        info.FileSystem,
                                        info.Repository,
                                        // We ensure DeleteOnRestartManager is initialized with a PhysicalFileSystem so the
                                        // .deleteme marker files that get created don't get checked into version control
                                        new DeleteOnRestartManager(() => new PhysicalFileSystem(info.FileSystem.Root)),
                                        _packageEvents));
        }
        public void UpdatesExistingDynamicRepository()
        {
            var repoName = Guid.NewGuid().ToString();
            var tempPath = Path.GetTempPath();
            var tempDir  = Path.Combine(tempPath, repoName);

            Directory.CreateDirectory(tempDir);
            string dynamicRepositoryPath = null;

            try
            {
                using (var mainRepositoryFixture = new EmptyRepositoryFixture())
                {
                    var commit = mainRepositoryFixture.Repository.MakeACommit();

                    var repositoryInfo = new RepositoryInfo
                    {
                        Url = mainRepositoryFixture.RepositoryPath
                    };

                    using (var dynamicRepository = DynamicRepositories.CreateOrOpen(repositoryInfo, tempPath, "master", commit.Sha))
                    {
                        dynamicRepositoryPath = dynamicRepository.Repository.Info.Path;
                    }

                    var newCommit = mainRepositoryFixture.Repository.MakeACommit();

                    using (var dynamicRepository = DynamicRepositories.CreateOrOpen(repositoryInfo, tempPath, "master", newCommit.Sha))
                    {
                        dynamicRepository.Repository.Info.Path.ShouldBe(dynamicRepositoryPath);
                        dynamicRepository.Repository.Commits.ShouldContain(c => c.Sha == newCommit.Sha);
                    }
                }
            }
            finally
            {
                Directory.Delete(tempDir, true);

                if (dynamicRepositoryPath != null)
                {
                    DeleteHelper.DeleteGitRepository(dynamicRepositoryPath);
                }
            }
        }
Ejemplo n.º 35
0
        public IVsPackageManager CreatePackageManager(IPackageRepository repository, bool useFallbackForDependencies, bool addToRecent)
        {
            if (useFallbackForDependencies)
            {
                repository = CreateFallbackRepository(repository);
            }
            RepositoryInfo info = GetRepositoryInfo();

            return(new VsPackageManager(_solutionManager,
                                        repository,
                                        _fileSystemProvider,
                                        info.FileSystem,
                                        info.Repository,
                                        _recentPackageRepository,
                                        _packageEvents)
            {
                AddToRecent = addToRecent
            });
        }
Ejemplo n.º 36
0
        public void id_should_return_false_when_compared_with_null_and_empty_strings()
        {
            // Arrange
            var            info     = new RepositoryInfo("", "");
            RepositoryInfo nullInfo = null;

            // Act + Assert
            Assert.True(nullInfo == null);

            Assert.False(info == null);
            Assert.False(null == info);
            Assert.False(info == "");
            Assert.False("" == info);

            Assert.True(info != null);
            Assert.True(null != info);
            Assert.True(info != "");
            Assert.True("" != info);
        }
Ejemplo n.º 37
0
        public async Task <RepositoryStats> GetByRepositoryPathAsync(string path, string branch = "master")
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path), $"The {nameof(path)} parameter can not be null.");
            }
            if (branch == null)
            {
                throw new ArgumentNullException(nameof(branch), $"The {nameof(branch)} parameter can not be null.");
            }

            var cacheKey = $"{MethodBase.GetCurrentMethod().ReflectedType.GUID}_{path}";

            RepositoryInfo repositoryInfoGH = _memoryCache.Get <RepositoryInfo>(cacheKey);

            if (repositoryInfoGH != null)
            {
                _httpClient.DefaultRequestHeaders.IfNoneMatch.Add(repositoryInfoGH.ETag);
            }

            HttpResponseMessage httpResponseMessage = await _httpClient.GetAsync(string.Format(_gitHubRepositoryZipFileUriPattern, path, branch));

            if (httpResponseMessage.StatusCode.Equals(HttpStatusCode.OK))
            {
                var filesInfoGH = await GetAsync(httpResponseMessage);

                RepositoryStats repositoryStats = MapTo(filesInfoGH);

                repositoryInfoGH = new RepositoryInfo
                {
                    ETag            = httpResponseMessage.Headers.ETag,
                    RepositoryStats = repositoryStats
                };

                _memoryCache.Set(cacheKey, repositoryInfoGH);
            }
            else if (!httpResponseMessage.StatusCode.Equals(HttpStatusCode.NotModified))
            {
                throw new RepositoryException("GitHub Repository not found.");
            }

            return(repositoryInfoGH.RepositoryStats);
        }
Ejemplo n.º 38
0
        // Custom Whitebox sorry...
        //public dynamic UnitTestPeek
        //{
        //	get
        //	{
        //		dynamic result = new ExpandoObject();
        //		return result;
        //	}
        //}
        public override ValidationResult Validate(RepositoryInfo repositoryInfo, Action <ValidationResult> notify = null)
        {
            var result           = new ValidationResult(this);
            var projectFilePaths = _projectFileHelper.GetAllProjectFilePath(repositoryInfo.RepositoryRootPath);

            foreach (var projectFilePath in projectFilePaths)
            {
                try
                {
                    _projectFileHelper.LoadProject(projectFilePath);
                    DoValidation(result, repositoryInfo, notify);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
            }
            return(result);
        }
Ejemplo n.º 39
0
        public async Task <RepositoryInfo> UpsertUpdate(RepositoryInfo repositoryInfo)
        {
            void CheckArgs()
            {
                if (repositoryInfo == null)
                {
                    throw new ArgumentNullException(nameof(repositoryInfo));
                }
            }

            CheckArgs();

            FilterDefinition <RepositoryInfo> repoNameFilter =
                Builders <RepositoryInfo> .Filter.Where(x =>
                                                        x.RepositoryName.ToUpperInvariant() == repositoryInfo.RepositoryName.ToUpperInvariant() &&
                                                        x.OrganizationName.ToUpperInvariant() == repositoryInfo.OrganizationName.ToUpperInvariant()
                                                        );

            FindOneAndUpdateOptions <RepositoryInfo, RepositoryInfo> options = new FindOneAndUpdateOptions <RepositoryInfo, RepositoryInfo>()
            {
                IsUpsert       = true,
                ReturnDocument = ReturnDocument.After
            };
            UpdateDefinition <RepositoryInfo> updateDef = new UpdateDefinitionBuilder <RepositoryInfo>()
                                                          .SetOnInsert(x => x.OrganizationName, repositoryInfo.OrganizationName)
                                                          .SetOnInsert(x => x.RepositoryName, repositoryInfo.RepositoryName)
                                                          .SetOnInsert(x => x.RepositoryMode, repositoryInfo.RepositoryMode)
            ;

            try
            {
                return(await this.repositories.FindOneAndUpdateAsync(repoNameFilter, updateDef, options)
                       .ConfigureAwait(false));
            }
            catch (MongoException)
            {
                //upsert might require a retry
                //https://docs.mongodb.com/manual/reference/method/db.collection.findAndModify/#upsert-and-unique-index
                //https://stackoverflow.com/questions/42752646/async-update-or-insert-mongodb-documents-using-net-driver
                return(await this.repositories.FindOneAndUpdateAsync(repoNameFilter, updateDef, options)
                       .ConfigureAwait(false));
            }
        }
Ejemplo n.º 40
0
        private RepositoryInfo GetRepositoryInfo()
        {
            // Update the path if it needs updating
            string path = _repositorySettings.RepositoryPath;
            string configFolderPath = _repositorySettings.ConfigFolderPath;

            if (_repositoryInfo == null || 
                !_repositoryInfo.Path.Equals(path, StringComparison.OrdinalIgnoreCase) ||
                !_repositoryInfo.ConfigFolderPath.Equals(configFolderPath, StringComparison.OrdinalIgnoreCase) ||
                _solutionManager.IsSourceControlBound != _repositoryInfo.IsSourceControlBound)
            {
                IFileSystem fileSystem = _fileSystemProvider.GetFileSystem(path);
                IFileSystem configSettingsFileSystem = GetConfigSettingsFileSystem(configFolderPath);
                // this file system is used to access the repositories.config file. We want to use Source Control-bound 
                // file system to access it even if the 'disableSourceControlIntegration' setting is set.
                IFileSystem storeFileSystem = _fileSystemProvider.GetFileSystem(path, ignoreSourceControlSetting: true);
                
                ISharedPackageRepository repository = new SharedPackageRepository(
                    new DefaultPackagePathResolver(fileSystem), 
                    fileSystem, 
                    storeFileSystem, 
                    configSettingsFileSystem);

                var settings = Settings.LoadDefaultSettings(
					configSettingsFileSystem, 
					configFileName: null, 
					machineWideSettings: _machineWideSettings);
                repository.PackageSaveMode = CalculatePackageSaveMode(settings);
                _repositoryInfo = new RepositoryInfo(path, configFolderPath, fileSystem, repository);
            }

            return _repositoryInfo;
        }
Ejemplo n.º 41
0
 public override void AfterUndoCommand(RepositoryInfo repository, Command command) { /* SKIP */ }
Ejemplo n.º 42
0
        private void Update(string referenceBranchName)
        {
            using (var repository = new Repository(RepositoryPath))
            {
                Branch referenceBranch = repository.Branches[referenceBranchName];
                Branch currentBranch = repository.Branches.Current();

                Commit latestMergeCommit = currentBranch.LatestMergeCommit(referenceBranch);

                IEnumerable<TreeEntryChanges> changes = null;
                if (latestMergeCommit != null)
                {
                    changes = repository.Diff.Compare<TreeChanges>(latestMergeCommit.Tree, currentBranch.Tip.Tree)
                        .OrderBy(tc => tc.Path);
                }

                var repositoryInfo = new RepositoryInfo(
                    RepositoryPath,
                    repository.Branches.Select(b => b.Name).ToList(),
                    currentBranch.Name,
                    referenceBranch.Name,
                    latestMergeCommit == null ? null : latestMergeCommit.Sha,
                    changes);

                DataContext = repositoryInfo;
            }
        }
Ejemplo n.º 43
0
        private RepositoryInfo GetRepositoryInfo(HttpRequest request, string json)
        {
            JObject payload = null;
            try
            {
                payload = JObject.Parse(json);
            }
            catch (Exception ex)
            {
                throw new FormatException(Resources.Error_UnsupportedFormat, ex);
            }

            var info = new RepositoryInfo();

            // If it has a repository, then try to get information from that
            var repository = payload.Value<JObject>("repository");

            if (repository != null)
            {
                // Try to assume the github format
                // { repository: { url: "" }, ref: "", before: "", after: "" }
                info.RepositoryUrl = repository.Value<string>("url");

                // The format of ref is refs/something/something else
                // For master it's normally refs/head/master
                string @ref = payload.Value<string>("ref");

                if (String.IsNullOrEmpty(@ref))
                {
                    throw new FormatException(Resources.Error_UnsupportedFormat);
                }

                // Just get the last token
                info.Branch = @ref.Split('/').Last();
                info.Deployer = GetDeployer(request);
                info.OldRef = payload.Value<string>("before");
                info.NewRef = payload.Value<string>("after");
            }
            else
            {
                // Look for the generic format
                // { url: "", branch: "", deployer: "", oldRef: "", newRef: "" }
                info.RepositoryUrl = payload.Value<string>("url");
                info.Branch = payload.Value<string>("branch");
                info.Deployer = payload.Value<string>("deployer");
                info.OldRef = payload.Value<string>("oldRef");
                info.NewRef = payload.Value<string>("newRef");
            }

            // If there's no specified branch assume master
            if (String.IsNullOrEmpty(info.Branch))
            {
                info.Branch = "master";
            }

            if (String.IsNullOrEmpty(info.RepositoryUrl))
            {
                throw new FormatException(Resources.Error_MissingRepositoryUrl);
            }

            return info;
        }
Ejemplo n.º 44
0
		private void PrependRecentProjectsMenuItem(RepositoryInfo projectInfo) {
			ToolStripItem item = new ToolStripMenuItem(projectInfo.projectName);
			item.Tag = projectInfo;
			item.ToolTipText = string.Format("Project: {0}{3}Location: {1}{3}Repository Type: {2}", projectInfo.projectName, projectInfo.location, projectInfo.typeName, Environment.NewLine);
			item.Click += openRecentProjectMenuItem_Click;
			recentProjectsMenuItem.DropDownItems.Insert(0, item);
			if (!recentProjectsMenuItem.Visible) recentProjectsMenuItem.Visible = true;
		}
Ejemplo n.º 45
0
 public override void BeforeApplyCommand(RepositoryInfo repository, Command command) { /* SKIP */ }
Ejemplo n.º 46
0
        private void PerformDeployment(RepositoryInfo repositoryInfo, string targetBranch)
        {
            if (repositoryInfo.UseSSH)
            {
                using (_tracer.Step("Prepare SSH environment"))
                {
                    _gitServer.SetSSHEnv(repositoryInfo.Host, _environment.ApplicationRootPath);
                }
            }

            bool hasPendingDeployment;

            do
            {
                hasPendingDeployment = false;

                using (_tracer.Step("Performing fetch based deployment"))
                {
                    // Configure the repository
                    _gitServer.Initialize(_configuration);

                    // Setup the receive info (this is important to know if branches were deleted etc)
                    _gitServer.SetReceiveInfo(repositoryInfo.OldRef, repositoryInfo.NewRef, targetBranch);

                    // Fetch from url
                    _gitServer.FetchWithoutConflict(repositoryInfo.RepositoryUrl, "external", targetBranch);

                    // Perform the actual deployment
                    _deploymentManager.Deploy(repositoryInfo.Deployer);

                    if (MarkerFileExists())
                    {
                        _tracer.Trace("Pending deployment marker file exists");

                        hasPendingDeployment = DeleteMarkerFile();

                        if (hasPendingDeployment)
                        {
                            _tracer.Trace("Deleted marker file");
                        }
                        else
                        {
                            _tracer.TraceError("Failed to delete marker file");
                        }
                    }
                }

            } while (hasPendingDeployment);
        }
Ejemplo n.º 47
0
		private bool AddToRecentProjects(RepositoryInfo projectInfo) {
			// Check if the project already exists in the recent projects list
			for (int i = recentProjects.Count - 1; i >= 0; --i)
				if (recentProjects[i] == projectInfo) return false;
			// If it does not, add it and create a new menu item
			if (recentProjects.Count == recentProjectsItemCount)
				recentProjects.RemoveAt(0);
			recentProjects.Add(projectInfo);
			PrependRecentProjectsMenuItem(projectInfo);
			SaveConfigFile();
			return true;
		}
Ejemplo n.º 48
0
        private RepositoryInfo GetRepositoryInfo(HttpRequest request, string json)
        {
            JObject payload = null;
            try
            {
                payload = JObject.Parse(json);
            }
            catch (Exception ex)
            {
                throw new FormatException(Resources.Error_UnsupportedFormat, ex);
            }

            var info = new RepositoryInfo();

            // If it has a repository, then try to get information from that
            var repository = payload.Value<JObject>("repository");

            if (repository != null)
            {
                if (request.UserAgent != null && request.UserAgent.StartsWith("Bitbucket", StringComparison.OrdinalIgnoreCase))
                {
                    // bitbucket format
                    // { repository: { absolute_url: "/a/b", is_private: true }, canon_url: "https//..." }
                    string server = payload.Value<string>("canon_url");     // e.g. https://bitbucket.org
                    string path = repository.Value<string>("absolute_url"); // e.g. /davidebbo/testrepo/

                    // Combine them to get the full URL
                    info.RepositoryUrl = server + path;

                    info.IsPrivate = repository.Value<bool>("is_private");

                    info.Deployer = "Bitbucket";

                    // We don't get any refs from bitbucket, so write dummy string (we ignore it later anyway)
                    info.OldRef = "dummy";

                    // When there are no commits, set the new ref to an all-zero string to cause the logic in
                    // GitDeploymentRepository.GetReceiveInfo ignore the push
                    var commits = payload.Value<JArray>("commits");
                    info.NewRef = commits.Count == 0 ? "000" : "dummy";
                }
                else
                {
                    // github format
                    // { repository: { url: "https//...", private: False }, ref: "", before: "", after: "" }
                    info.RepositoryUrl = repository.Value<string>("url");

                    info.IsPrivate = repository.Value<bool>("private");

                    // The format of ref is refs/something/something else
                    // For master it's normally refs/head/master
                    string @ref = payload.Value<string>("ref");

                    if (String.IsNullOrEmpty(@ref))
                    {
                        throw new FormatException(Resources.Error_UnsupportedFormat);
                    }

                    // Just get the last token
                    info.Branch = @ref.Split('/').Last();
                    info.Deployer = GetDeployer(request);
                    info.OldRef = payload.Value<string>("before");
                    info.NewRef = payload.Value<string>("after");
                }

                // private repo, use SSH
                if (info.IsPrivate)
                {
                    Uri uri = new Uri(info.RepositoryUrl);
                    if (uri.Scheme.StartsWith("http", StringComparison.OrdinalIgnoreCase))
                    {
                        info.Host = "git@" + uri.Host;
                        info.RepositoryUrl = info.Host + ":" + uri.AbsolutePath.TrimStart('/');
                        info.UseSSH = true;
                    }
                }
            }
            else
            {
                // Look for the generic format
                // { url: "", branch: "", deployer: "", oldRef: "", newRef: "" }
                info.RepositoryUrl = payload.Value<string>("url");
                info.Branch = payload.Value<string>("branch");
                info.Deployer = payload.Value<string>("deployer");
                info.OldRef = payload.Value<string>("oldRef");
                info.NewRef = payload.Value<string>("newRef");
            }

            // If there's no specified branch assume master
            if (String.IsNullOrEmpty(info.Branch))
            {
                // REVIEW: Is this correct
                info.Branch = "master";
            }

            if (String.IsNullOrEmpty(info.RepositoryUrl))
            {
                throw new FormatException(Resources.Error_MissingRepositoryUrl);
            }

            return info;
        }
Ejemplo n.º 49
0
        public VsPackageManagerFactory(ISolutionManager solutionManager,
                                       IPackageRepositoryFactory repositoryFactory,
                                       IVsPackageSourceProvider packageSourceProvider,
                                       IFileSystemProvider fileSystemProvider,
                                       IRepositorySettings repositorySettings,
                                       VsPackageInstallerEvents packageEvents,
                                       IPackageRepository activePackageSourceRepository,
                                       IVsFrameworkMultiTargeting frameworkMultiTargeting,
									   IMachineWideSettings machineWideSettings)
        {
            if (solutionManager == null)
            {
                throw new ArgumentNullException("solutionManager");
            }
            if (repositoryFactory == null)
            {
                throw new ArgumentNullException("repositoryFactory");
            }
            if (packageSourceProvider == null)
            {
                throw new ArgumentNullException("packageSourceProvider");
            }
            if (fileSystemProvider == null)
            {
                throw new ArgumentNullException("fileSystemProvider");
            }
            if (repositorySettings == null)
            {
                throw new ArgumentNullException("repositorySettings");
            }
            if (packageEvents == null)
            {
                throw new ArgumentNullException("packageEvents");
            }
            if (activePackageSourceRepository == null)
            {
                throw new ArgumentNullException("activePackageSourceRepository");
            }

            _fileSystemProvider = fileSystemProvider;
            _repositorySettings = repositorySettings;
            _solutionManager = solutionManager;
            _repositoryFactory = repositoryFactory;
            _packageSourceProvider = packageSourceProvider;
            _packageEvents = packageEvents;
            _activePackageSourceRepository = activePackageSourceRepository;
            _frameworkMultiTargeting = frameworkMultiTargeting;
			_machineWideSettings = machineWideSettings;

            _solutionManager.SolutionClosing += (sender, e) =>
            {
                _repositoryInfo = null;
            };
        }
Ejemplo n.º 50
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Github"/> class.
 /// </summary>
 /// <param name="repositoryInfo">The repository information.</param>
 public Github(RepositoryInfo repositoryInfo)
 {
     _RepoInfo = repositoryInfo;
     _LocalRepo = string.Format("Projects\\{0}", _RepoInfo.Name);
 }
Ejemplo n.º 51
0
			public static Store CreateStore(RepositoryInfo repositoryInfo) {
				Store store = null;
				if (repositoryInfo.typeName == RepositoryInfo.XmlStoreTypeName) {
					store = new XmlStore(Path.GetDirectoryName(repositoryInfo.location), Path.GetExtension(repositoryInfo.location));
				} else if (repositoryInfo.typeName == RepositoryInfo.SqlServerStoreTypeName) {
					store = new SqlStore();
					((SqlStore)store).DatabaseName = repositoryInfo.location;
					((SqlStore)store).ServerName = repositoryInfo.computerName;
				} else {
					Debug.Fail(string.Format("Unsupported {0} value '{1}'", typeof(RepositoryInfo).Name, repositoryInfo));
				}
				return store;
			}
Ejemplo n.º 52
0
        private RepositoryInfo GetRepositoryInfo()
        {
            // Update the path if it needs updating
            string path = _repositorySettings.RepositoryPath;
            string configFolderPath = _repositorySettings.ConfigFolderPath;

            if (_repositoryInfo == null || 
                !_repositoryInfo.Path.Equals(path, StringComparison.OrdinalIgnoreCase) ||
                !_repositoryInfo.ConfigFolderPath.Equals(configFolderPath, StringComparison.OrdinalIgnoreCase) ||
                _solutionManager.IsSourceControlBound != _repositoryInfo.IsSourceControlBound)
            {
                IFileSystem fileSystem = _fileSystemProvider.GetFileSystem(path);
                IFileSystem configSettingsFileSystem = GetConfigSettingsFileSystem(configFolderPath);
                ISharedPackageRepository repository = new SharedPackageRepository(
                    new DefaultPackagePathResolver(fileSystem), fileSystem, configSettingsFileSystem);

                _repositoryInfo = new RepositoryInfo(path, configFolderPath, fileSystem, repository);
            }

            return _repositoryInfo;
        }
Ejemplo n.º 53
0
		private bool RemoveFromRecentProjects(RepositoryInfo projectInfo) {
			return recentProjects.Remove(projectInfo);
		}