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


C# SvnClient.Add方法代码示例

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


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

示例1: AddFiles

		public void AddFiles(params string[] files)
		{
			using (var svn = new SvnClient())
			{
				foreach (var file in files)
				{
					svn.Add(file);
				}
			}
		}
开发者ID:azarkevich,项目名称:VssSvnConverter,代码行数:10,代码来源:SvnDriver.cs

示例2: ExecuteSVNTask

        protected override void ExecuteSVNTask(SvnClient client)
        {
            if (Dir == null)
            {
                Dir = new DirectoryInfo(Project.BaseDirectory);
            }

            if (!Dir.Exists)
            {
                throw new BuildException(string.Format(Resources.MissingDirectory, Dir.FullName), Location);
            }

            string sourcesFolder = string.Concat(Dir.FullName, @"\Sources");

            if (Directory.Exists(sourcesFolder))
            {
                Log(Level.Info, Resources.SVNAdding, Dir.FullName);
                SvnAddArgs addArgs = new SvnAddArgs();
                addArgs.Depth = SvnDepth.Infinity;
                addArgs.Force = true;
                client.Add(sourcesFolder, addArgs);
            }
            else
            {
                Log(Level.Info, Resources.SVNSourcesFolderNotFound, sourcesFolder);
            }

            Log(Level.Info, Resources.SVNCommitCommitting, Dir.FullName, Message);
            SvnCommitArgs args = new SvnCommitArgs();
            args.LogMessage = Message;
            args.ThrowOnError = true;
            SvnCommitResult result;
            client.Commit(Dir.FullName, args, out result);
            if (result != null)
            {
                Log(Level.Info, Resources.SVNCommitResult, Dir.FullName, result.Revision, result.Author);
            }
        }
开发者ID:julienblin,项目名称:NAntConsole,代码行数:38,代码来源:SVNCommitTask.cs

示例3: AddAll

        /*
         * This adds, modifies, and removes index entries to match the working tree.
         */
        public bool AddAll()
        {
            /*
            var startInfo = GetStartInfo("add -A");

            // add fails if there are no files (directories don't count)
            return ExecuteUnless(startInfo, "did not match any files");
            */
            var overallStatus = true;

            using (var client = new SvnClient())
            {
                SvnUI.Bind(client, parentWindow);

                var statusList = (Collection<SvnStatusEventArgs>)null;
                var svnStatusArgs = new SvnStatusArgs { Depth = SvnDepth.Infinity, IgnoreExternals = false, KeepDepth = false, RetrieveIgnoredEntries = false };

                if (client.GetStatus(useSvnStandardDirStructure ? trunkPath : workingCopyPath, svnStatusArgs, out statusList))
                {
                    overallStatus = statusList.Select(svnStatusEventArg =>
                    {
                        switch (svnStatusEventArg.LocalNodeStatus)
                        {
                            case SvnStatus.Missing:
                                logger.WriteLine("Commit: Deleting file {0} due to status = {1}", svnStatusEventArg.FullPath, svnStatusEventArg.LocalNodeStatus);
                                return client.Delete(svnStatusEventArg.FullPath, new SvnDeleteArgs { KeepLocal = false, Force = false });
                            case SvnStatus.NotVersioned:
                                logger.WriteLine("Commit: Adding file {0} due to status = {1}", svnStatusEventArg.FullPath, svnStatusEventArg.LocalNodeStatus);
                                return client.Add(svnStatusEventArg.FullPath, new SvnAddArgs { AddParents = false, Depth = SvnDepth.Infinity, Force = false });
                            default:
                                return true;
                        }
                    })
                    .Aggregate(true, (state, val) => state &= val);
                }
                else
                    overallStatus = false;
            }

            return overallStatus;
        }
开发者ID:mathewng,项目名称:vss2svn,代码行数:44,代码来源:SvnWrapper.cs

示例4: Checkout

		public static void Checkout(string repoDir, string wcDir)
		{
			if (Directory.Exists(wcDir))
			{
				Directory.Delete(wcDir, true);
			}

			using (var svn = new SvnClient())
			{
				var repoUri = new Uri("file:///" + repoDir.Replace('\\', '/'));

				svn.CheckOut(new SvnUriTarget(repoUri), wcDir);

				foreach (var fse in Directory.EnumerateFileSystemEntries(wcDir))
				{
					if (Path.GetFileName(fse).ToLowerInvariant() == ".svn")
						continue;

					svn.Add(fse, SvnDepth.Infinity);
				}

				svn.Commit(wcDir, new SvnCommitArgs { LogMessage = "PreCreate revision" });
			}
		}
开发者ID:azarkevich,项目名称:VssSvnConverter,代码行数:24,代码来源:SvnDriver.cs

示例5: Add

        public bool Add(string path)
        {
            /*
            var startInfo = GetStartInfo("add -- " + Quote(path));

            // add fails if there are no files (directories don't count)
            return ExecuteUnless(startInfo, "did not match any files");
            */

            using (var client = new SvnClient())
            {
                SvnUI.Bind(client, parentWindow);
                return client.Add(path, new SvnAddArgs { AddParents = false, Depth = SvnDepth.Infinity, Force = true });
            }

            return false;
        }
开发者ID:mathewng,项目名称:vss2svn,代码行数:17,代码来源:SvnWrapper.cs


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