![](/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.