Esempio n. 1
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")));
     }
 }
Esempio n. 2
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);
            }
        }
Esempio n. 3
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();
 }
Esempio n. 4
0
 public virtual void SyncRemoteFromLocal()
 {
     var address = new HttpRepositoryPath("localrepo", Local.Repository.PathToRepo, false);
     Remote.Repository.Pull(address, Local.Repository.PathToRepo);
     Remote.Repository.Update();
 }
Esempio n. 5
0
        private void _useSharedFolderButton_Click(object sender, EventArgs e)
        {
            if (RepositoryChosen != null)
            {
                RepositoryAddress address;

                if (_lanMode == LANMode.Folder)
                {
                    address = _repository.GetDefaultNetworkAddress<DirectoryRepositorySource>();
                }
                else
                {
                    string directoryName = Path.GetFileName(_repository.PathToRepo);
                    var doWait  = _chorusHubClient.PrepareHubToSync(directoryName);
                    if(doWait)
                    {
                        //enhance: sorry, I regret that this is all kludgy, ux-wise.
                        MessageBox.Show("After you press OK, we will give the ChorusHub 10 seconds to get ready to receive this repository.");
                        Cursor.Current = Cursors.WaitCursor;
                        Thread.Sleep(10*1000);
                        Cursor.Current = Cursors.Default;
                    }
                    address = new HttpRepositoryPath(_chorusHubInfo.HostName, _chorusHubInfo.GetHgHttpUri(directoryName), false);
                }
                RepositoryChosen.Invoke(this, new SyncStartArgs(address, _commitMessageText.Text));
            }
        }