I have created pre-commit hook and post-commit hook for visualSVN using c# for windows, but in pre-commit hook I also required to get the line numbers for each updated file where content got changed (added, deleted or modified.).
e.g.
content of output.cs (in last revision):
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;
}
content of output.cs (in last revision):
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;
}
I need know the line number (8,9,14) as output in the pre-commit hook. For the pre-commit hooking through c# I followed this link .
NOTE : My end requirement is to find out the which function (in .cs file - with one class only) get modified.