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


C# SvnClient.Revert方法代码示例

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


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

示例1: 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)
        {
            SvnRevertArgs args = new SvnRevertArgs();
            args.Depth = Recursive ? SvnDepth.Infinity : SvnDepth.Children;

            return client.Revert(RepositoryPath, args);
        }
开发者ID:trentcioran,项目名称:SvnMSBuildTasks,代码行数:12,代码来源:SvnRevert.cs

示例2: Rollback

        public bool Rollback(string solutionDirectoryPath, RenameContext context)
        {
            using(SvnClient svnClient = new SvnClient())
            {
                // TODO NKO Do someting with the changelist
                Collection<SvnListChangeListEventArgs> changeList;
                svnClient.GetChangeList(solutionDirectoryPath, out changeList);

                SvnRevertArgs revertArgs = new SvnRevertArgs { Depth = SvnDepth.Infinity };
                svnClient.Revert(solutionDirectoryPath, revertArgs);
            }

            // Now delete the folder that was created for the new project.
            // Note: Can not use svnclient.Delete because the folder and all containing files werent ever checked in.
            Directory.Delete(context.NewProject.ProjectDirectory, true);

            // And do an update to get a clean repository state again.
            UpdateWorkingCopy(solutionDirectoryPath);

            return true;
        }
开发者ID:manuelnelson,项目名称:VisualStudioProjectRenamer,代码行数:21,代码来源:SVNRenamer.cs

示例3: Main

        static int Main(string[] args)
        {
            try
            {
                Console.WriteLine("Svn2: {0}", Assembly.GetExecutingAssembly().GetName().Version);

                if (args.Length < 1)
                {
                    Usage();
                    return -2;
                }

                string command = args[0];
                if (command == "/?" || command == "-?" || command == "--help")
                {
                    Usage();
                    return -2;
                }

                string path = (args.Length == 2) 
                    ? Path.GetFullPath(args[1])
                    : Path.GetFullPath(Environment.CurrentDirectory);

                SvnClient client = new SvnClient();

                switch (command)
                {
                    case "sync":
                        {
                            SvnStatusArgs statusArgs = new SvnStatusArgs();
                            statusArgs.Depth = SvnDepth.Infinity;
                            statusArgs.ThrowOnError = true;
                            client.Status(path, statusArgs, new EventHandler<SvnStatusEventArgs>(delegate(object sender, SvnStatusEventArgs e)
                            {
                                switch (e.LocalContentStatus)
                                {
                                    case SvnStatus.NotVersioned:
                                        Console.WriteLine(" {0} {1}", StatusToChar(e.LocalContentStatus), e.FullPath);
                                        if (File.Exists(e.FullPath))
                                        {
                                            FileSystem.DeleteFile(e.FullPath, UIOption.OnlyErrorDialogs,
                                                RecycleOption.SendToRecycleBin);
                                        }
                                        else if (Directory.Exists(e.FullPath))
                                        {
                                            FileSystem.DeleteDirectory(e.FullPath, UIOption.OnlyErrorDialogs,
                                                RecycleOption.SendToRecycleBin);
                                        }
                                        break;
                                }
                            }));
                        }
                        break;
                    case "cleanup":
                        {
                            Console.WriteLine("Cleaning up {0}", path);
                            SvnCleanUpArgs cleanupArgs = new SvnCleanUpArgs();
                            cleanupArgs.ThrowOnError = true;
                            cleanupArgs.Notify += new EventHandler<SvnNotifyEventArgs>(delegate(object sender, SvnNotifyEventArgs e)
                                {
                                    Console.WriteLine(" L {0}", e.FullPath);
                                });
                            client.CleanUp(path, cleanupArgs);
                        }
                        break;
                    case "revert":
                        {
                            Console.WriteLine("Reverting {0}", path);
                            SvnRevertArgs revertArgs = new SvnRevertArgs();
                            revertArgs.Depth = SvnDepth.Infinity;
                            revertArgs.ThrowOnError = true;
                            revertArgs.Notify += new EventHandler<SvnNotifyEventArgs>(delegate(object sender, SvnNotifyEventArgs e)
                                {
                                    Console.WriteLine(" R {0}", e.FullPath);
                                });
                            client.Revert(path, revertArgs);
                        }
                        break;
                    case "status":
                        {
                            SvnStatusArgs statusArgs = new SvnStatusArgs();
                            statusArgs.Depth = SvnDepth.Infinity;
                            statusArgs.ThrowOnError = true;
                            client.Status(path, statusArgs, new EventHandler<SvnStatusEventArgs>(delegate(object sender, SvnStatusEventArgs e)
                                {
                                    Console.WriteLine(" {0} {1}", StatusToChar(e.LocalContentStatus), e.FullPath);
                                }));
                        }
                        break;
                    default:
                        throw new Exception(string.Format("Unsupported '{0}' command", command));
                }

                return 0;
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
#if DEBUG
                Console.Error.WriteLine(ex.StackTrace);
//.........这里部分代码省略.........
开发者ID:ainiaa,项目名称:svn2svn,代码行数:101,代码来源:Program.cs

示例4: Revert

		public void Revert(string file)
		{
			using (var svn = new SvnClient())
			{
				svn.Revert(file);
			}
		}
开发者ID:azarkevich,项目名称:VssSvnConverter,代码行数:7,代码来源:SvnDriver.cs

示例5: doSvnUpdate

        /// <summary>
        /// While the server isn't up to date
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void doSvnUpdate(object sender, DoWorkEventArgs e)
        {
            client = new SvnClient();
            client.Notify += onSvnNotify;
            client.Authentication.Clear();
            client.Authentication.DefaultCredentials = null;

            System.Console.Out.WriteLine(client.GetUriFromWorkingCopy(System.IO.Directory.GetCurrentDirectory()));

            Uri rep = client.GetUriFromWorkingCopy(System.IO.Directory.GetCurrentDirectory());
            Uri rel = new Uri("http://subversion.assembla.com/svn/skyrimonlineupdate/");

            if (rep == null || rep != rel)
            {
                SvnDelete.findSvnDirectories(System.IO.Directory.GetCurrentDirectory());
                exploreDirectory(rel);

                download.Maximum = iCount;
                updating = true;

                SvnCheckOutArgs args = new SvnCheckOutArgs();
                args.AllowObstructions = true;

                if (client.CheckOut(rel, System.IO.Directory.GetCurrentDirectory(), args, out mResult))
                {
                    updated = true;
                }

            }
            else
            {
                downloadprogress.Text = "Building update list, please be patient...";

                updating = true;
                SvnStatusArgs sa = new SvnStatusArgs();
                sa.RetrieveRemoteStatus = true;

                Collection<SvnStatusEventArgs> r;
                client.GetStatus(System.IO.Directory.GetCurrentDirectory(), sa, out r);

                foreach (SvnStatusEventArgs i in r)
                {
                    client.Revert(i.FullPath);

                    if (i.IsRemoteUpdated)
                        iCount++;
                }

                download.Maximum = iCount;
                SvnUpdateArgs args = new SvnUpdateArgs();
                args.AllowObstructions = true;

                if (client.Update(System.IO.Directory.GetCurrentDirectory(), args))
                {
                    updated = true;
                }
                else
                {
                    Application.Exit();
                }
            }
        }
开发者ID:commodoremartin,项目名称:SkyrimOnline,代码行数:67,代码来源:Panel.cs


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