5

In SharpSvn's documentation I found (here), the return value of SvnClient.getinfo (boolean type) is missing. Can anyone help with that? Thanks.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
asherbret
  • 5,439
  • 4
  • 38
  • 58
  • 2
    Try to send a mail at the bottom of page which `Send comments on this topic to SharpSvn Users` part. You might get a faster answer.. – Soner Gönül Apr 10 '13 at 05:37

2 Answers2

9

Here's the answer I got:

Usually all SvnClient methods return true on success and throw an error on failures. But if you change .ThrowOnError to false or cancel a command in its eventhandler then it will return false on an error/cancel. So if you are just using a simple call to .GetInfo without an SvnInfoArgs object with specific settings (or very specific handling on the SvnClient instance itself where you can also override the error handling) you can ignore the return value as it will always be true.

The credit goes to a helpful guy named Bert who sent me this email. Thanks.

bahrep
  • 29,961
  • 12
  • 103
  • 150
asherbret
  • 5,439
  • 4
  • 38
  • 58
1

It takes an out param of SvnInfoEventArgs which gets populated of the call was a success. For example, I might use the GetInfo call to get the most recent revision number from a directory:

private long GetLatestRevisionNumber(Uri myUri)
{
    using (SvnClient client = GetClient())
    {
        SvnInfoEventArgs info;
        client.GetInfo(myUri, out info);
        return info.LastChangeRevision;
    }
}
Community
  • 1
  • 1
  • 1
    The question is about the bool return value, not the out parameter. And it's answered already – edc65 Jan 10 '20 at 15:20