Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.