private void BindGrid()
{
DataSet ds = new DataSet();
string filePath = Request.PhysicalApplicationPath + "log.xml";
if(Cache["refresh"] == null || !File.Exists(filePath))
{
Cache.Insert("refresh", true, null, DateTime.Now.AddMinutes(1), TimeSpan.Zero);
if (File.Exists(filePath))
{
File.Delete(filePath);
}
string command = Server.MapPath("svn.exe");
string args = @"log --xml http://subsonicproject.googlecode.com/svn/trunk/";
ProcessStartInfo psi = new ProcessStartInfo(command, args);
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
Process proc = Process.Start(psi);
proc.Start();
string content = proc.StandardOutput.ReadToEnd();
File.WriteAllText(filePath, content);
proc.StandardOutput.Close();
proc.Close();
}
ds.ReadXml(filePath);
grid.DataSource = ds;
grid.DataBind();
}
It's a total hack, with just enough dumb caching to keep the server from getting pounded, but it gets the job done. However, now that StatSVN is running, I doubt I'll be putting much more effort into embellishing the code...