簡體   English   中英

如何獲取在 svnlook 中添加、刪除或修改內容的行號? (鈎)

[英]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 文件中 - 只有一個類)。

你真的需要一個鈎子腳本嗎? 在我看來,VisualSVN Server 的 Web 界面具有您需要的功能。

修訂日志查看器顯示更改的行號,您還可以共享指向特定行的鏈接。 這是演示服務器上的示例

在此處輸入圖片說明

您還可以使用高級責備查看器。 這是演示服務器上的示例

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM