代码之家  ›  专栏  ›  技术社区  ›  Allen Rice 0x6A75616E

如何在命令行预提交挂钩应用程序中将错误写入客户端?

  •  1
  • Allen Rice 0x6A75616E  · 技术社区  · 14 年前

    我在C中编写一个预提交钩子,我知道失败时必须返回1,成功时必须返回0,但我无法让它向客户机写出任何消息。目前我正在使用

    static int Main(string[] args)
    {
        var repository = args[0];
        var transaction = args[1];       
    
        // TODO: do stuff and return 1 or 0 appropriately 
    
        Console.WriteLine("This message should go to the client");
    
        return 1;
    }
    

    乌龟只是给出反馈:

    错误:提交失败(详细信息如下): 错误:提交被预提交阻止 钩子(退出代码1)没有输出。

    如何使我的命令行应用程序向SVN客户机(在本例中是Tortoise)提供反馈?

    1 回复  |  直到 14 年前
        1
  •  2
  •   Allen Rice 0x6A75616E    14 年前

    变化 Console.WriteLine Console.Error.WriteLine