本文整理汇总了C#中SvnClient.GetDiffSummary方法的典型用法代码示例。如果您正苦于以下问题:C# SvnClient.GetDiffSummary方法的具体用法?C# SvnClient.GetDiffSummary怎么用?C# SvnClient.GetDiffSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SvnClient
的用法示例。
在下文中一共展示了SvnClient.GetDiffSummary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getSVNDifferFiles
public XmlDocument getSVNDifferFiles()
{
//获取最大的版本号
this.getLastVersion();
// diff xml
XmlDocument newDoc = new XmlDocument();
XmlDeclaration xmldecl = newDoc.CreateXmlDeclaration("1.0", "UTF-8", null);
newDoc.AppendChild(xmldecl);
XmlElement newRoot = newDoc.CreateElement("files");
newDoc.AppendChild(newRoot);
newRoot.SetAttribute("version", PackageSubVM.Instance.Version);
long fileSizes = 0;
int index = 0;
string[] szFilter = PackageSubVM.Instance.Filter.Split(new char[1] { ':' });
SvnClient svnClient = new SvnClient();
//List<SvnDiffSummaryEventArgs> list;
System.Collections.ObjectModel.Collection<SvnDiffSummaryEventArgs> list;
svnClient.GetDiffSummary(new SvnUriTarget(PackageSubVM.Instance.SVNPath, Int32.Parse(PackageSubVM.Instance.BeginVersion)), new SvnUriTarget(PackageSubVM.Instance.SVNPath, Int32.Parse(PackageSubVM.Instance.EndVersion)), out list);
foreach (SvnDiffSummaryEventArgs item in list)
{
if (szFilter.Contains(Path.GetExtension(item.Path)) || szFilter.Contains(Path.GetFileName(item.Path)))
{
continue;
}
string fullFileName = szResourceOutPath + "\\" + item.Path;
if (item.NodeKind == SvnNodeKind.Directory)
{
if (Directory.Exists(fullFileName) == false)
{
DirectoryInfo info = Directory.CreateDirectory(fullFileName);
}
continue;
}
string outPath = Path.GetDirectoryName(fullFileName);
if (Directory.Exists(outPath) == false)
{
DirectoryInfo info = Directory.CreateDirectory(outPath);
}
try
{
SvnClient exportSVN = new SvnClient();
SvnExportArgs ex = new SvnExportArgs();
ex.Overwrite = true;
long size = 0;
if (item.DiffKind != SvnDiffKind.Deleted)
{
exportSVN.Export(new SvnUriTarget(item.ToUri, Int32.Parse(PackageSubVM.Instance.EndVersion)), fullFileName, ex);
index = index + 1;
this.createXmlNode(newDoc, newRoot, item.Path, this.createFileMD5(fullFileName, out size), "1", index);
fileSizes += size;
}
else
{
this.createXmlNode(newDoc, newRoot, item.Path, "this is a delete file.", "0", index);
}
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
Console.WriteLine(ee.Message);
}
}
newRoot.SetAttribute("lastVersion", szLastVersion);
newRoot.SetAttribute("size", fileSizes.ToString());
return newDoc;
}