本文整理汇总了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 });
}
}
示例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;
}