Perforce API (.NET): File sync is not working?

809 Views Asked by At

Using 2014.1.85.4506 API version. Just trying retrieve files from within a depot to be on in the workspace.

I have an object with a local variables string localPath, string depotPath, string clientPath (which is the same as localPath), Repository repo and Connection con.

My code thus looks like:

// ...
DepotPath       depotSpec  = new DepotPath(depoPath);
ClientPath      clientSpec = new ClientPath(clientPath);
LocalPath       localSpec  = new LocalPath(localPath);

FileSpec        fileSpec   = new FileSpec(depoSpec, clientSpec, localSpec, VersionSpec.Head);

IList<FileSpec> fileSpecs  = new List<FileSpec>();
fileSpecs.Add(fileSpec);

IList<FileSpec> synced     = con.Client.SyncFiles(fileSpecs, null);
// ...

and synced always ends up being null. Any thoughts?

1

There are 1 best solutions below

0
On

Just to make sure, does SyncFiles returns null or an empty list?

If it returns an empty list, I had that happen when I already had the latest revision locally. Because there is nothing to be synced, it returns an empty list.