public XXX ()
{
var _svnFolder = "xxx"; //查询的svn本地路径(主干路径)
string curDir = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(_svnFolder);//
var tempLogFile = "一个临时存放svn记录的路径";
var _lastSvnVersion = 1; //起始svn的版本号
ProcessStartInfo info = new ProcessStartInfo();
if(File.Exists(tempLogFile))
{
File.Delete(tempLogFile);
}
info.FileName = "cmd.exe";
info.Arguments = "/c svn log -r " + _lastSvnVersion + ":HEAD > " + tempLogFile;
info.WindowStyle = ProcessWindowStyle.Normal;
info.UseSgekkExecute = false;
info.ErrorDialog = true;
info.RedirectStandardError = true;
info.StandardErrorEncoding = Encoding.GetEncoding("GBK");
var pro = Process.Start(info);
pro.WaitForExit();
using (var sr = pro.StandardError)
{
string str = sr.ReadToEnd();
if(!string.IsNullOrEmpty(str))
{
EditorUtility.DisplayDialog("错误",str,"确定");
}
}
pro.Dispose()
}
C# 查询svn提交记录
最新推荐文章于 2023-04-09 14:18:38 发布