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


C# SvnClient.Delete方法代码示例

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


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

示例1: Remove

 public void Remove(string path, bool recursive)
 {
     /*
     SvnExec("rm " + (recursive ? "-r " : "") + "-- " + Quote(path));
     */
     using (var client = new SvnClient())
     {
         SvnUI.Bind(client, parentWindow);
         var result = client.Delete(path, new SvnDeleteArgs { Force = true, KeepLocal = false });
     }
 }
开发者ID:mathewng,项目名称:vss2svn,代码行数:11,代码来源:SvnWrapper.cs

示例2: 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


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