I don't have any post-commit.bat, the post-commit hook is an .exe
I'm using full paths to call svn so that couldn't be a problem (i think).
the C# code is very simple, here you have it:
String strCmd = "C:\\Program Files\\Subversion\\bin\\svn.exe";
System.Console.OutputEncoding = Encoding.ASCII;
Process svnProgram = new Process();
svnProgram.StartInfo.FileName = strCmd;
svnProgram.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
svnProgram.StartInfo.RedirectStandardInput = false;
svnProgram.StartInfo.RedirectStandardOutput = true;
svnProgram.StartInfo.UseShellExecute = false;
svnProgram.StartInfo.CreateNoWindow = true;
// Z is the mapped drive
svnProgram.StartInfo.Arguments = "update Z:\\site\\project";
try
{
svnProgram.Start();
string resultado = svnProgram.StandardOutput.ReadToEnd();
svnProgram.WaitForExit();
//System.Console.Write(resultado);
svnProgram.Close();
//System.Console.WriteLine("Anduvo todo OK");
FileStream fileStream = new
FileStream(@"O:\repositories\projects\hooks\testing.txt", FileMode.Append);
StreamWriter w = new StreamWriter(fileStream);
w.WriteLine(resultado);
w.WriteLine("-------------------");
w.Flush();
w.Close();
}
catch(SystemException e)
{
//System.Console.WriteLine(e.Message);
}
Thanks!
Gonzalo
On 6/9/06, allan@muly.dk <allan@muly.dk> wrote:
>
> Quoting Gonzalo Bourdieu <gonzalobourdieu@gmail.com>:
>
> > Everything works fine, except the post-commit hook that is written in C#
> > with .net 2.0,
> > this post-commit, basically creates a process (svn update) and after
> that
> > writes a new line
> > in something that intends to be a log.
> >
> > When i run post-commit.exe from command line, everything works fine, but
> > when it is
> > triggered by SVN, it writes the log, but doesn't make the svn update.
> > All paths are correct, and i've tried every solution found in the
> archive
> > without success
> >
> > The output generated by svn update is empty (i realize this when i write
> it
> > on the log)
> > So i really don't know what it is.
> > I've tried to move the WC to the Repository server, thinking that some
> type
> > of permissions
> > where broking everything, but the Local WC wasn't update neither.
> >
> > The only thing that i can imagine is that apache doesn't have
> permissions to
> > create a process, but i dont understand why there is no error.
>
> maybe you can post your post.commit.bat file [or its essentials] which
> presumably starts the c# hook exe file?
>
> so your 'svn update' command works in the sense that is actuallty run, or
> ?
> otherwise you might try the full path to svn.exe
>
> ./a
>
>
>
Received on Fri Jun 9 15:02:21 2006