How do I check if a file is already in a repository (or NOT in the repository) so I can determine whether I need to 'add' it first before doing the check in? (For the record, I have check-in working, but I get an exception when I try to check in a file that has not yet been added to the repository.)
+1
A:
I believe you can use SvnClient.GetRepositoryIdFromUri to verify that a specific file exists. If that method returns false, then you'll need to Add the file to the repository.
Reed Copsey
2010-03-31 01:21:51
I took a look at that. However, when I pass the URL as a local string path (C:\Path\To\File.txt), the URI that is created seems incorrect. Maybe I am just formatting the URI incorrectly?
JasCav
2010-03-31 01:58:11
You can use .TryGetRepositoryId(Uri, out Guid) for urls and .TryGetRepositoryId(string, out Guid) for local paths.If you pass a local path to SharpSvn via a Uri, you pass a file:/// style url.
Bert Huijben
2010-04-01 08:35:19
@Bert - Unfortunately, I am still getting back the System.Guid.Empty value as a response, even though the file is already in the repository.
JasCav
2010-04-03 15:34:24
A:
While SvnClient.GetRepositoryIdFromUri may work (I wasn't able to get it working), I did find an answer elsewhere on SO which did work (this didn't come up in my original search, so sorry about the duplicate question).
JasCav
2010-04-03 17:13:44