系统相关
首页 > 系统相关> > windows – 如何将perforce工作区指向跨两台计算机同步的项目?

windows – 如何将perforce工作区指向跨两台计算机同步的项目?

作者:互联网

我有一个eclipse同步项目,我在我的Windows机器上工作,然后在linux构建服务器上同步和编译它.但是,Windows工作区连接到perforce,而linux工作区则没有.问题是当Eclipse同步这两者时,权限会在linux端搞砸,这样我就无法执行通常在构建期间执行的某些shell脚本.我有的解决方法是在执行构建之前以某种方式c​​hmod所有* .sh文件,但我宁愿让perforce知道这两个地方(这样我也可以从linux端或windows端提交).出于性能原因,我无法在远程构建服务器上运行eclipse,因此这是我找到的唯一解决方案.此外,当我尝试为linux端设置第二个工作区时,它给了我错误说“无法破坏X”.我认为主要的问题是我在这里处理某种权限问题.

解决方法:

我可能找到了答案.根据perforce documentation

By default, you can only use a workspace on the machine that is specified by the Host: field. If you want to use the same client workspace on multiple machines with different platforms, delete the Host: entry and set the AltRoots: field in the client specification. You can specify a maximum of two alternate client workspace roots. The locations must be visible from all machines that will be using them, for example through NFS or Samba mounts.
Perforce compares the current working directory against the main Root: first, and then against the two AltRoots: if specified. The first root to match the current working directory is used. If no roots match, the main root is used.
Note
If you are using a Windows directory in any of your client roots, specify the Windows directory as your main client Root: and specify your other workspace root directories in the AltRoots: field.
In the following example, if user bruno’s current working directory is located under /usr/bruno, Perforce uses the UNIX path as his client workspace root, rather than c:\bruno_ws. This approach allows bruno to use the same client workspace specification for both UNIX and Windows development.
Client: bruno_ws
Owner: bruno
Description:
Created by bruno.
Root: c:\bruno_ws
AltRoots:
/usr/bruno/
To find out which workspace root is in effect, issue the p4 info command and check the Client root: field.
If you edit text files in the same workspace from different platforms, ensure that the editors and settings you use preserve the line endings. For details about line-endings in cross-platform settings, refer to the Perforce System Administrator’s Guide.

标签:linux,windows,perforce,workspace
来源: https://codeday.me/bug/20190726/1539916.html