当前位置: 首页>>代码示例>>C#>>正文


C# SvnClient.Info方法代码示例

本文整理汇总了C#中SvnClient.Info方法的典型用法代码示例。如果您正苦于以下问题:C# SvnClient.Info方法的具体用法?C# SvnClient.Info怎么用?C# SvnClient.Info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SvnClient的用法示例。


在下文中一共展示了SvnClient.Info方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Authentication_ASFCertSafe

        public void Authentication_ASFCertSafe()
        {
            using (SvnClient client = new SvnClient())
            {
                client.Authentication.Clear();

                bool arrived = false;
                SvnInfoArgs ia = new SvnInfoArgs();
                ia.AddExpectedError(SvnErrorCode.SVN_ERR_AUTHN_NO_PROVIDER);
                ia.AddExpectedError(SvnErrorCode.SVN_ERR_RA_CANNOT_CREATE_SESSION);
                Assert.That(client.Info(new Uri("https://svn.apache.org/repos/asf/"), ia,
                    delegate(object sender, SvnInfoEventArgs e)
                    {
                        arrived = true;
                    }), Is.False);

                Assert.That(arrived, Is.False);
                Assert.That(ia.LastException, Is.Not.Null, "Has exception");
                Assert.That(ia.LastException.ContainsError(SvnErrorCode.SVN_ERR_AUTHN_NO_PROVIDER), "Right error code in chain");
            }

            using (SvnClient client = new SvnClient())
            {
                client.Authentication.Clear();
                client.Authentication.SslAuthorityTrustHandlers += SvnAuthentication.SubversionWindowsSslAuthorityTrustHandler;
                client.Authentication.SslServerTrustHandlers += SvnAuthentication.SubversionWindowsSslServerTrustHandler;

                bool arrived = false;
                Assert.That(client.Info(new Uri("https://svn.apache.org/repos/asf/"),
                    delegate(object sender, SvnInfoEventArgs e)
                    {
                        arrived = true;
                    }));

                Assert.That(arrived);
            }
        }
开发者ID:riiiqpl,项目名称:sharpsvn,代码行数:37,代码来源:AuthenticationTests.cs

示例2: Authentication_SimpleSslCert

        public void Authentication_SimpleSslCert()
        {
            using (SvnClient client = new SvnClient())
            {
                client.Authentication.Clear();
                client.Authentication.SslServerTrustHandlers += Authenticator_SslServerTrustHandlers;
                client.Authentication.UserNamePasswordHandlers += Authenticator_UserNamePasswordHandlers;
                bool arrived = false;
                SvnInfoArgs a = new SvnInfoArgs();
                a.ThrowOnCancel = false;
                a.ThrowOnError = false;

                Assert.That(client.Info(new Uri("https://svn.apache.org/repos/private/committers"), a,
                    delegate(object sender, SvnInfoEventArgs e)
                    {
                        arrived = true;
                    }), Is.False);

                Assert.That(a.LastException, Is.Not.Null);
                Assert.That(a.LastException, Is.InstanceOf(typeof(SvnException)));
                Assert.That(arrived, Is.False);
                Assert.That(_serverTrustTicked);
                Assert.That(_userNamePasswordTicked);

                Assert.That(_userArgs, Is.Not.Null);
                Assert.That(_userArgs.InitialUserName, Is.Not.Null);
                Assert.That(_userArgs.Realm, Is.EqualTo("<https://svn.apache.org:443> ASF Members"));
                Assert.That(_userArgs.RealmUri, Is.EqualTo(new Uri("https://svn.apache.org/")));
            }
        }
开发者ID:riiiqpl,项目名称:sharpsvn,代码行数:30,代码来源:AuthenticationTests.cs

示例3: GatherSvnInformation

		private void GatherSvnInformation( SvnInformation svn )
		{
			using ( var client = new SvnClient() )
			{
				var arg = new SvnStatusArgs()
				{
					Revision = new SvnRevision( SvnRevisionType.Working ),
					Depth = SvnDepth.Empty
				};
				client.Info( WorkingCopy, ( sender, e ) =>
				{
					svn.Now = DateTime.Now;
					if ( String.IsNullOrEmpty( svn.Url ) )
						svn.Url = e.Uri.AbsoluteUri;
					svn.CommitRevision = e.Revision;
				} );
				Collection<SvnStatusEventArgs> statuses;
				arg.Depth = SvnDepth.Infinity;
				arg.RetrieveAllEntries = true;
				client.GetStatus( WorkingCopy, arg, out statuses );
				foreach ( var item in statuses )
				{
					if ( string.IsNullOrEmpty( svn.RootUrl ) )
						svn.RootUrl = item.RepositoryRoot.AbsoluteUri;
					svn.MinRevision = item.Revision > 0 && ( item.Revision < svn.MinRevision || svn.MinRevision == 0 ) ? item.Revision : svn.MinRevision;
					svn.MaxRevision = item.Revision > 0 && ( item.Revision > svn.MaxRevision || svn.MaxRevision == 0 ) ? item.Revision : svn.MaxRevision;
					svn.IsSvnItem = false;
					switch ( item.LocalNodeStatus )
					{
						case SvnStatus.None:
						case SvnStatus.NotVersioned:
						case SvnStatus.Ignored:
							break;
						case SvnStatus.External:
						case SvnStatus.Incomplete:
						case SvnStatus.Normal:
							svn.IsSvnItem = true;
							break;
						default:
							svn.IsSvnItem = true;
							svn.HasModifications = true;
							break;
					}
					switch ( item.LocalPropertyStatus )
					{
						case SvnStatus.None:
						case SvnStatus.NotVersioned:
						case SvnStatus.Ignored:
							break;
						case SvnStatus.External:
						case SvnStatus.Incomplete:
						case SvnStatus.Normal:
							svn.IsSvnItem = true;
							break;
						default:
							svn.IsSvnItem = true;
							svn.HasModifications = true;
							break;
					}
				}

				svn.MixedRevisions = svn.MinRevision != svn.MaxRevision;
				svn.RevisionRange = String.Format( "{0}:{1}", svn.MinRevision, svn.MaxRevision );
			}
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:65,代码来源:SvnInfo.cs

示例4: ResolveFiles

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override bool ResolveFiles()
        {
            SvnClient client = new SvnClient();
            SvnInfoArgs infoArgs = new SvnInfoArgs();

            infoArgs.ThrowOnError = false;
            infoArgs.Depth = SvnDepth.Files;

            foreach (SourceFile file in State.SourceFiles.Values)
            {
                if (file.IsResolved)
                    continue;

                string dirName = SvnTools.GetTruePath(SvnTools.GetNormalizedDirectoryName(file.FullName), true);

                client.Info(dirName, infoArgs,
                    delegate(object sender, SvnInfoEventArgs e)
                    {
                        SourceFile infoFile;

                        string path = e.FullPath;

                        if (State.SourceFiles.TryGetValue(path, out infoFile)
                            && !infoFile.IsResolved)
                        {
                            infoFile.SourceReference = new SubversionSourceReference(this, infoFile, e.RepositoryRoot,
                                                                                      e.RepositoryRoot.MakeRelativeUri(e.Uri), e.LastChangeRevision, e.Revision);
                        }
                    });
            }

            return true;
        }
开发者ID:riiiqpl,项目名称:sharpsvn,代码行数:37,代码来源:SubversionResolver.cs

示例5: GetNotFoundError

        Exception GetNotFoundError()
        {
            SvnClient client = new SvnClient();
            SvnInfoArgs a = new SvnInfoArgs();
            a.ThrowOnError = false;

            Assert.That(client.Info("c:/does/not/ever/exist/on/windows", a,
                delegate(object sender, SvnInfoEventArgs e)
                {
                }), Is.False, "Should fail");

            return a.LastException;
        }
开发者ID:riiiqpl,项目名称:sharpsvn,代码行数:13,代码来源:LocalizationTests.cs

示例6: TestSshConnectError

        public void TestSshConnectError()
        {
            SvnClient cl = new SvnClient();
            SvnRepositoryIOException rio = null;
            try
            {
                cl.Info(new Uri("svn+builtin-ssh://sharpsvn.open.collab.net:80"),
                    delegate(object Sender, SvnInfoEventArgs e)
                    { });
            }
            catch (SvnRepositoryIOException e)
            {
                rio = e;
            }

            Assert.That(rio, Is.Not.Null);

            SvnSshException sshEx = rio.GetCause<SvnSshException>();

            Assert.That(sshEx, Is.Not.Null);
            Assert.That(sshEx.SshErrorCode, Is.EqualTo(SvnSshErrorCode.LIBSSH2_ERROR_SOCKET_DISCONNECT));
        }
开发者ID:riiiqpl,项目名称:sharpsvn,代码行数:22,代码来源:SvnRemoteTests.cs


注:本文中的SvnClient.Info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。