本文整理汇总了C#中SvnClient.Export方法的典型用法代码示例。如果您正苦于以下问题:C# SvnClient.Export方法的具体用法?C# SvnClient.Export怎么用?C# SvnClient.Export使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SvnClient
的用法示例。
在下文中一共展示了SvnClient.Export方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Export
public override string Export(IPackageTree packageTree, FileSystemInfo destination)
{
SvnUpdateResult result = null;
using (var client = new SvnClient())
{
try
{
client.Export(Url, destination.FullName, new SvnExportArgs { Overwrite = true }, out result);
}
catch (SvnRepositoryIOException sre)
{
HandleExceptions(sre);
}
catch (SvnObstructedUpdateException sue)
{
HandleExceptions(sue);
}
}
return result.Revision.ToString();
}
示例2: ExecuteCommand
/// <summary>
/// Actual method to be executed for the implementing task
/// </summary>
/// <param name="client">The instance of the SVN client</param>
/// <returns></returns>
public override bool ExecuteCommand(SvnClient client)
{
SvnTarget target = GetTarget();
return client.Export(target, DestinationPath);
}
示例3: 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;
}
示例4: GetRevision
public override Revision GetRevision(string alias)
{
string url = Url.TrimEnd('/');
string tempFolder = Context.Current.MapPath(Core.Settings.rootPath + "/svnRepoTemp/");
if (System.IO.Directory.Exists(tempFolder))
System.IO.Directory.Delete(tempFolder);
using (SvnClient client = new SvnClient())
{
client.LoadConfiguration("path");
client.Authentication.DefaultCredentials = new NetworkCredential(Login, Password);
SvnTarget folderTarget = SvnTarget.FromString(url);
client.Export(folderTarget, tempFolder);
RevisionStorage rs = new RevisionStorage();
var r = rs.GetFromDirectory(alias, tempFolder + alias);
rs.Save(r, alias);
rs.Dispose();
return r;
}
return null;
}