tfs - Equivalent to `p4 -c <wksp_name> sync` -
as part of process of transiting p4 tfs, need translate automated scripts calling p4
command tfs equivalents.
one of scripts executes couple of commands:
p4 <server-and-login-options> -c <wksp_name> client -i < <definition> p4 <server-and-login-options> -c <wksp_name> sync [-f]
in perforce, enough (optionally) alter , synchronize specific workspace. works seamlessly on both windows , linux.
after wandering around msdn documentation few weeks, seems i've failed discover equivalent in tfs.
i tried use tfs java sdk job:
... workingfolder[] workingfolders = ...; workspace wksp = null; try { wksp = vcs.getworkspace(workspacename, versioncontrolconstants.authenticated_user); wksp.update(null, workspace_comment, workingfolders, true); } catch (workspacenotfoundexception ex) { wksp = vcs.createworkspace( workingfolders, workspacename, workspace_comment, workspacelocation.server, workspaceoptions.none); } final versionspec versionspec = latestversionspec.instance; getoptions getoptions = getoptions.none; if (force) getoptions = getoptions.combine(getoptions.get_all); final getstatus getstatus = wksp.get(versionspec, getoptions); ...
this works me on windows.
but not on linux. getworkspace
/createworkspace
part works right, effect can verified tf workfold
. however, inside workspace.get
program crashes following message:
exception in thread "main" java.lang.nosuchmethoderror: <init> @ com.microsoft.tfs.jni.internal.filesystem.nativefilesystem.nativegetattributes(native method) @ com.microsoft.tfs.jni.internal.filesystem.nativefilesystem.getattributes(nativefilesystem.java:74) @ com.microsoft.tfs.jni.filesystemutils.getattributes(filesystemutils.java:39) @ com.microsoft.tfs.core.clients.versioncontrol.engines.internal.getengine.processoperation(getengine.java:1800) @ com.microsoft.tfs.core.clients.versioncontrol.engines.internal.getengine.processoperationsinternal(getengine.java:1163) @ com.microsoft.tfs.core.clients.versioncontrol.engines.internal.getengine.processoperations(getengine.java:957) @ com.microsoft.tfs.core.clients.versioncontrol.engines.internal.getengine.processgetoperations(getengine.java:782) @ com.microsoft.tfs.core.clients.versioncontrol.soapextensions.workspace.get(workspace.java:2429) @ com.microsoft.tfs.core.clients.versioncontrol.soapextensions.workspace.get(workspace.java:2307) @ com.microsoft.tfs.core.clients.versioncontrol.soapextensions.workspace.get(workspace.java:2295) @ com.microsoft.tfs.core.clients.versioncontrol.soapextensions.workspace.get(workspace.java:2271) @ tfsget.main(tfsget.java:181)
well, not unix boy , don't know how diagnose , fix it. tried leave getworkspace
/createworkspace
part in java , call tf get
. seems need specify particular directories , files want update.
i feel job must quite common , cannot believe nobody ever got done.
thanks everyone, error in workspace.get
turned out result of own inattention. versions of com.microsoft.tfs.sdk-11.0.0.jar
, libnative_*.so
files did not match. i've made sure files match each other, problem solved.
Comments
Post a Comment