Pergunta

I have to following directory structure on the local machine before the inital checkout:

base_dir/somefolder/someotherfolder/file.txt

After the checkout I want the following:

base_dir/somefolder/someotherfolder/file.txt
base_dir/somefolder/checked_out_folder/new_file.txt

So basically the checkout adding new files into the already existing directory. I can't get that to work with SharpSvn however. When checking out, it downloads all not locally existing files, the files or folders that already exist locally are not touched.

TortoiseSvn seems to be able to do that. I've read here that it should work somehow, but like the guy asking points out, setting the option AllowObstructions to true does nothing.

My checkout code ( I'm using SharpSVN 1.7 ):

using (SvnClient client = new SvnClient()) {
   client.Progress += new EventHandler<SvnProgressEventArgs>(cl_Progress);
   SvnCheckOutArgs sco = new SvnCheckOutArgs();
   sco.Depth = SvnDepth.Infinity;
   sco.AllowObstructions = true;
   client.CheckOut(from, to, out result);
}

I don't know what to do, the documentation on SharpSvn is very thin. I hope somebody here can maybe help me out.

Foi útil?

Solução

Even with .AllowObstructions it is still possible to get into conflicts.

E.g. With AllowObstructions a local file that already exists is left in place as a modified version of the new file. But if you add a directory in its place then you get a tree conflict.

(I would really recommend not using .AllowObstructions as that makes it easy to commit a new file over another file without noticing that you accidentally did this)

There are more than a few cases where you can get obstructions or skips, so you should really look at the Notifications (.Notify event on the client or the args object) or the Status after update.

Even checkout to an empty directory (or a not existing location) might cause conflicts... E.g. in cases where there are problems in the svn:externals definitions.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top