svn commit - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

svn commit

michaeldunemichaeldune Posts: 103Member
hi i want to call subversion from c# i writed code but nothing happens
from command line i can comit but my code not works here is the code :

------------
confiuration file:
----------------------
<?xml version="1.0" encoding="utf-8" ?>





-----------
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Diagnostics;
using System.Windows;

namespace ConsoleApplicationSvn
{
class Program
{
static void Main(string[] args)
{

string arguments = "svn commit ";
string path = "data_files.txt";
string comment = " -m csharpcommit";
arguments = arguments + path + comment;
string stringout;
stringout = ExecuteSVN(arguments);
}



private static string ExecuteSVN(string arguments)
{
try
{

Process process = new Process();

process.StartInfo.FileName = ConfigurationManager.AppSettings["SVNLocation"];

process.StartInfo.Arguments = arguments;

process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

process.StartInfo.CreateNoWindow = true;

process.StartInfo.RedirectStandardError = true;

process.StartInfo.RedirectStandardOutput = true;

process.StartInfo.UseShellExecute = false;

process.StartInfo.WorkingDirectory = @C:defabc;
Environment.CurrentDirectory = @C:defabc;


process.Start();

process.WaitForExit();

return process.StandardOutput.ReadToEnd();
}
catch (Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
return e.ToString();
}

}

}
}
Sign In or Register to comment.