Get log data for a specific version number in an ad after commit using SharpSVN?

I am trying to write a post-commit hook using SharpSVN, but I cannot figure out how to get change set information using SharpSVN based on version number and repo path. Any ideas are greatly appreciated.

+5
source share
2 answers

In client clicks, you most likely want to use SvnLookClient, which directly accesses the repository. In this example (copied from another question here) I also use the SvnHookArguments class to parse the hook arguments.

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)
    {
       //
    }
  }
}
+4
source

You need a GetLog method .

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

( intellisense! # :(), , .

-2

All Articles