0

Viewing the repository data of TortoiseSVN is done by right click on a file -> TortiseSVN -> Repo-Browser.

I would like to get this data using SharpSVN, in order to retrieve the name of lock owner.

Is it possible? How? Where does this data being saved?

I've tried to get a lock owner name using the following code, however, I get the lock infirmation just in case I'm on the machine where the lock was done from. If I'm another user, I cannot get the lock information.

using (SvnClient client = new SvnClient())
{
 client.GetInfo(@"path\to\working\copy\file.xml", out info);
 SvnLockInfo lc = info.Lock;
 if (lc != null)
    {
        MessageBox.Show("Owner: " + lc.Owner + "\n" +
                        "Creation time: " + lc.CreationTime + "\n" +
                        "Comment: " + lc.Comment + "\n" +
                        "Expiration time: " + lc.ExpirationTime);
    }
}  

Even when I set the target as the repository URI- instead of path to the local working copy I get the same result:

Uri target = client.GetUriFromWorkingCopy(@"path\to\working\copy\file.xml");

client.GetInfo(target, out info);   

The way I can see the lock owner name from another working copy is, as mentioned, by right click on file -> repo-browser.

Any ideas how to perform it programmatically?

user3165438
  • 2,631
  • 7
  • 34
  • 54

0 Answers0