Exemple #1
0
        public virtual void SyncRemoteFromLocal()
        {
            var address = new HttpRepositoryPath("localrepo", Local.Repository.PathToRepo, false);

            Remote.Repository.Pull(address, Local.Repository.PathToRepo);
            Remote.Repository.Update();
        }
Exemple #2
0
        public void CloneRemoteFromLocal()
        {
            //Remote.Repository.Init();
            var address = new HttpRepositoryPath("localrepo", Local.Repository.PathToRepo, false);

            Remote.Repository.Pull(address, Local.Repository.PathToRepo);
            Remote.Repository.Update();
        }
Exemple #3
0
        public void RepositoryURIForLog_ChorusHubWithVariable_DoesNotThrow()
        {
            const string uri     = "http://[email protected]:5913/" + RepositoryAddress.ProjectNameVariable;
            var          address = new HttpRepositoryPath("whatever", uri, false);

            // SUT
            var result = new HgRepository("ssh://nowhere", _progress).RepositoryURIForLog(address);

            Assert.AreEqual(uri, result);
        }
Exemple #4
0
        public void RepositoryURIForLog_ContainsNoPassword()
        {
            const string uri     = "https://hg-public.languageforge.org/project/tpi-flex";
            var          address = new HttpRepositoryPath("whatever", uri, false);

            // SUT
            var result = new HgRepository("ssh://nowhere", _progress).RepositoryURIForLog(address);

            Assert.AreEqual(uri, result);
        }
Exemple #5
0
 public void Pull_Test()
 {
     //RobustNetworkOperation.ClearCredentialSettings();
     using (var f = new TemporaryFolder("pulltest"))
     {
         var repo    = HgRepository.CreateOrUseExisting(f.Path, _progress);
         var address = new HttpRepositoryPath("default", _cloneableTestProjectUrl, false);
         repo.Pull(address, _cloneableTestProjectUrl);
         Assert.IsTrue(Directory.Exists(f.Combine(f.Path, ".hg")));
     }
 }
Exemple #6
0
        public void PullThenPush_Test()
        {
            //  RobustNetworkOperation.ClearCredentialSettings();
            using (var f = new TemporaryFolder("pulltest"))
            {
                var repo    = HgRepository.CreateOrUseExisting(f.Path, _progress);
                var address = new HttpRepositoryPath("default", _cloneableTestProjectUrl, false);
                repo.Pull(address, _cloneableTestProjectUrl);
                Assert.IsTrue(Directory.Exists(f.Combine(f.Path, ".hg")));

                //nb: this is safe to do over an over, because it will just say "no changes found", never actually add a changeset

                repo.Push(address, _cloneableTestProjectUrl);
            }
        }
Exemple #7
0
        public void GetPotentialRepoUri_LeavesExistingUserInfo()
        {
            var source = new HttpRepositoryPath("test", UrlWithCredentials, false);

            Assert.AreEqual(UrlWithCredentials, source.GetPotentialRepoUri("testing", null, null));
        }
Exemple #8
0
        public void GetPotentialRepoUri_ToleratesNullProjectName()
        {
            var source = new HttpRepositoryPath("test", UrlSansCredentials, true);

            Assert.AreEqual(UrlSansCredentials, source.GetPotentialRepoUri("testing", null, null));
        }
Exemple #9
0
        public void GetPotentialRepoUri_ReplacesProjectNameVariable()
        {
            var source = new HttpRepositoryPath("test", UrlTemplate, true);

            Assert.AreEqual(UrlSansCredentials, source.GetPotentialRepoUri("testing", ProjectName, null));
        }