本文整理汇总了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);
}
示例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;
}
示例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);
//.........这里部分代码省略.........
示例4: Revert
public void Revert(string file)
{
using (var svn = new SvnClient())
{
svn.Revert(file);
}
}
示例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();
}
}
}