![](/img/trans.png)
[英]how to detect if the order of two lists changed and if changed then show newly added or deleted members in c#
[英]How to get Line numbers where content added, deleted or modified in svnlook ? (hooking)
我已经使用 c# for windows 为visualSVN 创建了预提交钩子和后提交钩子,但在预提交钩子中,我还需要获取每个更新文件的行号,其中内容已更改(添加、删除或修改。)。 例如
output.cs 的内容(最新版本):
private static string GetSvnLookOutput(string repos, string txn, string subcommand)
{
var processStartInfo = new ProcessStartInfo
{
FileName = "svnlook.exe",
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
Arguments = String.Format("{0} -t \"{1}\" \"{2}\"", subcommand, txn, repos)
};
var process = Process.Start(processStartInfo);
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
return output;
}
output.cs 的内容(最新版本):
private static string GetSvnLookOutput(string repos, string txn, string subcommand)
{
var processStartInfo = new ProcessStartInfo
{
FileName = "svnlook.exe",
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = false, // modified the value
RedirectStandardError = false,// modified the value
Arguments = String.Format("{0} -t \"{1}\" \"{2}\"", subcommand, txn, repos)
};
var process = Process.Start(processStartInfo);// deleted one line after this line
process.WaitForExit();
return output;
}
我需要知道行号 (8,9,14) 作为预提交挂钩中的输出。 对于通过 c# 进行的预提交挂钩,我遵循了此链接。
注意:我的最终要求是找出修改了哪个函数(在 .cs 文件中 - 只有一个类)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.