2009-08-07 4 views

risposta

4

In clienti gancio molto probabilmente desidera utilizzare il SvnLookClient che accede direttamente al repository. In questo esempio (copiato da un'altra domanda qui) uso anche la classe SvnHookArguments per analizzare gli argomenti gancio.

static void Main(string[] args) 
{ 
    SvnHookArguments ha; 
    if (!SvnHookArguments.ParseHookArguments(args, SvnHookType.PostCommit, false, out ha)) 
    { 
    Console.Error.WriteLine("Invalid arguments"); 
    Environment.Exit(1); 
    } 

    using (SvnLookClient cl = new SvnLookClient()) 
    { 
    SvnChangeInfoEventArgs ci; 
    cl.GetChangeInfo(ha.LookOrigin, out ci); 

    // ci contains information on the commit e.g. 
    Console.WriteLine(ci.LogMessage); // Has log message 

    foreach(SvnChangeItem i in ci.ChangedPaths) 
    { 
     // 
    } 
    } 
} 
-2

Si desidera il metodo GetLog.

SvnRevision rev(123); 
client.GetLog(uri, new SvnLogArgs(rev), out logitems); // uri is your url to the repo. 

che potrebbe non essere esatto (senza intellisense! Come sono io aspettavo di codice C# senza che :(), ma la sua più o meno ciò che si desidera.

+0

non funziona per ganci –