Question

I`m using SharpSVN. How can I split Checkout method logic into two steps:

  1. Create an empty svn folder
  2. Update to HEAD revision

Here is how do I do the first step with SvnDepth.Empty argument

var args = new SvnCheckOutArgs() {Depth = SvnDepth.Empty};
result = svnClient.CheckOut(new SvnUriTarget(syncConnectionData.Url), syncConnectionData.RootPath, args);

But then if I try to Update like this:

var updateArgs = new SvnUpdateArgs() { Depth = SvnDepth.Infinity};
svnClient.Update(syncConnectionData.RootPath, updateArgs);

I get no updates. The repository on svn server is not empty.

So the question is: how do I correctly update to the latest revision after making Checkout with Empty depth.

Was it helpful?

Solution

Okay, found the solution =) Needed to use KeepDepth property of SvnUpdateArgs

Here is the working code for Update after Sparse-Checkout

    var updateArgs = new SvnUpdateArgs() { Depth = SvnDepth.Infinity, KeepDepth = true };
    svnClient.Update(syncConnectionData.RootPath, updateArgs);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top