Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/05/2012, 06:17
pedamarcos
 
Fecha de Ingreso: mayo-2009
Mensajes: 114
Antigüedad: 15 años
Puntos: 1
No puedo hacer commit con un servicio

Buenas,

Estoy desarrollando el código de un servicio y en un punto necesito hacer un add y después un commit de un fichero con subversion.

El código, a grandes rasgos, es:

Dim p As New Process
Dim sAnswer As String = ""
Dim nPosvbCrLf As Integer = 0

p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.Arguments = "add " & sRuta & sFichero
p.StartInfo.FileName = "svn"
p.StartInfo.CreateNoWindow = True
p.Start()
sAnswer = p.StandardOutput.ReadToEnd()
p.WaitForExit()
nPosvbCrLf = InStr(sAnswer, vbCrLf)
sAnswer = UCase(IIf((nPosvbCrLf > 0), Mid(sAnswer, 1, Len(sAnswer) - (Len(sAnswer) - nPosvbCrLf + 1)), sAnswer))
If (InStr(sAnswer, UCase("A (bin) " & sRuta & sFichero)) > 0) Or (InStr(sAnswer, UCase("A " & sRuta & sFichero)) > 0) Then
Debug.Print("Operación add realizada con éxito: " & sRuta & sFichero)
p.StartInfo.Arguments = "commit " & sRuta & " -m ""Subido fichero" & sFichero & " de la ruta " & sRuta & "."" --username xxxxxx --password xxxxxxxx"
p.StartInfo.FileName = "svn"
p.StartInfo.CreateNoWindow = True
p.Start()
sAnswer = p.StandardOutput.ReadToEnd()
p.WaitForExit(5000)
.......

La primera parte, el add, lo hace perfectamente; la segunda, el commit, siempre da como resultado la variable sAnswer vacía, y el commit no se realiza.
Este mismo código, también en VB. NET, pero para una aplicación en lugar de un servicio, funciona correctamente.

¿Alguna idea? Las necesito.

Gracias a todos.