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


C# SvnClient.Export方法代码示例

本文整理汇总了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();
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:22,代码来源:SvnSourceControl.cs

示例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);
 }
开发者ID:trentcioran,项目名称:SvnMSBuildTasks,代码行数:10,代码来源:SvnExport.cs

示例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;
        }
开发者ID:daz2yy,项目名称:MyTools,代码行数:70,代码来源:FileFilter.cs

示例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;
        }
开发者ID:jayvin,项目名称:Courier,代码行数:27,代码来源:SubversionRepository.cs


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